Support fast channel change.
[vuplus_dvbapp] / lib / python / Components / NimManager.py
index ce063b4..b92ad92 100755 (executable)
@@ -59,10 +59,10 @@ class SecConfigure:
                sec.setLNBLOFL(9750000)
                sec.setLNBLOFH(10600000)
                sec.setLNBThreshold(11700000)
-               sec.setLNBIncreasedVoltage(lnbParam.OFF)
+               sec.setLNBIncreasedVoltage(False)
                sec.setRepeats(0)
                sec.setFastDiSEqC(fastDiSEqC)
-               sec.setSeqRepeat(0)
+               sec.setSeqRepeat(False)
                sec.setCommandOrder(0)
 
                #user values
@@ -369,9 +369,9 @@ class SecConfigure:
 #                                      pass # nyi in drivers
 
                                if currLnb.increased_voltage.value:
-                                       sec.setLNBIncreasedVoltage(lnbParam.ON)
+                                       sec.setLNBIncreasedVoltage(True)
                                else:
-                                       sec.setLNBIncreasedVoltage(lnbParam.OFF)
+                                       sec.setLNBIncreasedVoltage(False)
 
                                dm = currLnb.diseqcMode.value
                                if dm == "none":
@@ -876,6 +876,10 @@ class NimManager:
                        for slot in self.getNimListOfType(type, exception = slotid):
                                if self.hasOutputs(slot):
                                        slots.append(slot)
+
+               # remove duplicates from list
+               slots = list(set(slots))
+
                # remove nims, that have a conntectedTo reference on
                for testnim in slots[:]:
                        for nim in self.getNimListOfType("DVB-S", slotid):
@@ -883,6 +887,17 @@ class NimManager:
                                if nimConfig.content.items.has_key("configMode") and nimConfig.configMode.value == "loopthrough" and int(nimConfig.connectedTo.value) == testnim:
                                        slots.remove(testnim)
                                        break 
+
+                               if nimConfig.content.items.has_key("configMode") and nimConfig.configMode.value == "advanced":
+                                       try:
+                                               if (nimConfig.advanced.unicableconnected is not None) and (nimConfig.advanced.unicableconnected.value == True):
+                                                       if int(nimConfig.advanced.unicableconnectedTo.value) == testnim:
+                                                               slots.remove(testnim)
+                                                               break
+                                       except:
+                                               pass
+
+
                slots.sort()
                
                return slots
@@ -1116,7 +1131,7 @@ def InitSecParams():
 # the C(++) part should can handle this
 # the configElement should be only visible when diseqc 1.2 is disabled
 
-def InitNimManager(nimmgr):
+def InitNimManager(nimmgr, update_slots = []):
        hw = HardwareInfo()
        addNimConfig = False
        try:
@@ -1646,6 +1661,9 @@ def InitNimManager(nimmgr):
                x = slot.slot
                nim = config.Nims[x]
 
+               if update_slots and (x not in update_slots):
+                       continue
+
                if slot.isCompatible("DVB-S"):
                        createSatConfig(nim, x, empty_slots)
                        config_mode_choices = [ ("nothing", _("nothing connected")),