add a "nothing connected" option to the sat setup for nim b
[enigma2.git] / lib / python / Components / NimManager.py
index 38f58ce3fa66a71ec10bfff7534494cfb1b05c6c..38047cbdd96efa28749a0193cbb6b583a33197c9 100644 (file)
@@ -83,7 +83,7 @@ class SecConfigure:
                        nim = config.Nims[x]
                        if slot.nimType == self.NimManager.nimType["DVB-S"]:
                                print "slot: " + str(x) + " configmode: " + str(nim.configMode.value)
-                               if nim.configMode.value == 1:
+                               if nim.configMode.value == 2:
                                        self.linkNIMs(x, nim.linkedTo.value)
                                        nim = config.Nims[nim.linkedTo.value]
                                if nim.configMode.value == 0:           #simple config
@@ -101,7 +101,7 @@ class SecConfigure:
                                                self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcC.vals[nim.diseqcC.value][1]), toneburstmode = 0, diseqcmode = 1, diseqcpos = 2)
                                                self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcD.vals[nim.diseqcD.value][1]), toneburstmode = 0, diseqcmode = 1, diseqcpos = 3)
                                        elif nim.diseqcMode.value == 4:         #Positioner
-                                               self.addLNBSimple(slotid = x, diseqcmode = 3, longitude = 0, loDirection = 0, latitude = 0, laDirection = 0)
+                                               self.addLNBSimple(slotid = x, diseqcmode = 3, longitude = float(str(nim.longitude.value[0]) + "." + str(nim.longitude.value[1])), loDirection = nim.longitudeOrientation.value - 2, latitude = float(str(nim.latitude.value[0]) + "." + str(nim.latitude.value[1])), laDirection = nim.latitudeOrientation.value)
                                        pass
                                else:                                                                                                                                   #advanced config
                                        print "FIXME add support for advanced config"
@@ -343,14 +343,17 @@ class NimManager:
                        if (config.Nims[slotid].diseqcMode.value == 3):
                                list.append(self.satList[config.Nims[slotid].diseqcC.value])
                                list.append(self.satList[config.Nims[slotid].diseqcD.value])
+                       if (config.Nims[slotid].diseqcMode.value == 4):
+                               for x in self.satList:
+                                       list.append(x)
                return list
 
        #callbacks for c++ config
        def nimConfigModeChanged(self, slotid, mode):
-               if (mode != 1): # not linked
+               if (mode != 2): # not linked
                        print "Unlinking slot " + str(slotid)
                        # TODO call c++ to unlink nim in slot slotid
-               if (mode == 1): # linked
+               if (mode == 2): # linked
                        pass
                        #FIXME!!!
                        #if (len(self.getNimListOfType(self.nimType["DVB-S"], slotid)) > 0):
@@ -403,10 +406,10 @@ def InitNimManager(nimmgr):
                nim = config.Nims[x]
                
                if slot.nimType == nimmgr.nimType["DVB-S"]:
-                       nim.configMode = configElement(cname + "configMode", configSelection, 0, (_("Simple"), _("Loopthrough to Socket A"))) # "Advanced"));
+                       nim.configMode = configElement(cname + "configMode", configSelection, 0, (_("Simple"), _("Nothing connected"), _("Loopthrough to Socket A"))) # "Advanced"));
                        
                        #important - check if just the 2nd one is LT only and the first one is DVB-S
-                       if nim.configMode.value == 1: #linked
+                       if nim.configMode.value == 2: #linked
                                if x == 0:                                                                              #first one can never be linked to anything
                                        nim.configMode.value = 0                #reset to simple
                                        nim.configMode.save()