X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FNimManager.py;h=017e57b820b107d34e53b03f029bb901a1f324e3;hb=a9984df92fc78bd4955b24502724b74b935dcc3f;hp=ce063b498ad2315068e0630d6239d4462cfef626;hpb=7b7a80a1f979b0bd9c68aa33af968db25bf63f81;p=vuplus_dvbapp diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py old mode 100755 new mode 100644 index ce063b4..017e57b --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -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 @@ -153,7 +153,7 @@ class SecConfigure: for slot in nim_slots: if slot.type is not None: - used_nim_slots.append((slot.slot, slot.description, slot.config.configMode.value != "nothing" and True or False, slot.isCompatible("DVB-S2"), slot.isCompatible("DVB-T2"), slot.frontend_id is None and -1 or slot.frontend_id)) + used_nim_slots.append((slot.slot, slot.description, slot.config.configMode.value != "nothing" and True or False, slot.isCompatible("DVB-S2"), slot.isCompatible("DVB-T2"), slot.isCompatible("DVB-S2X"), slot.frontend_id is None and -1 or slot.frontend_id)) eDVBResourceManager.getInstance().setFrontendSlotInformations(used_nim_slots) for slot in nim_slots: @@ -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": @@ -510,7 +510,7 @@ class NIM(object): def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}, frontend_id = None, i2c = None, is_empty = False): self.slot = slot - if type not in ("DVB-S", "DVB-C", "DVB-T", "DVB-S2", "DVB-T2", None): + if type not in ("DVB-S", "DVB-C", "DVB-T", "DVB-S2", "DVB-T2", "DVB-S2X", None): print "warning: unknown NIM type %s, not using." % type type = None @@ -528,7 +528,8 @@ class NIM(object): "DVB-C": ("DVB-C", None), "DVB-T": ("DVB-T", None), "DVB-S2": ("DVB-S", "DVB-S2", None), - "DVB-T2": ("DVB-T", "DVB-T2", None) + "DVB-T2": ("DVB-T", "DVB-T2", None), + "DVB-S2X": ("DVB-S", "DVB-S2", "DVB-S2X", None), } def getType(self): @@ -558,7 +559,8 @@ class NIM(object): "DVB-C": ("DVB-C",), "DVB-T": ("DVB-T",), "DVB-S2": ("DVB-S", "DVB-S2"), - "DVB-T2": ("DVB-T", "DVB-T2",) + "DVB-T2": ("DVB-T", "DVB-T2",), + "DVB-S2X": ("DVB-S", "DVB-S2", "DVB-S2X"), } return connectable[self.getType()] @@ -601,7 +603,16 @@ class NIM(object): # empty tuners are supported! def isSupported(self): return (self.frontend_id is not None) or self.__is_empty - + + def isMultistream(self): + multistream = self.frontend_id is not None and eDVBResourceManager.getInstance().frontendIsMultistream(self.frontend_id) or False + # HACK due to poor support for VTUNER_SET_FE_INFO + # When vtuner does not accept fe_info we have to fallback to detection using tuner name + # More tuner names will be added when confirmed as multistream (FE_CAN_MULTISTREAM) + if not multistream and "TBS" in self.description: + multistream = True + return multistream + # returns dict {: } def getMultiTypeList(self): return self.multi_type @@ -615,6 +626,7 @@ class NIM(object): "DVB-C": "DVB-C", "DVB-S2": "DVB-S2", "DVB-T2": "DVB-T2", + "DVB-S2X": "DVB-S2X", None: _("empty") }[self.getType()] @@ -798,13 +810,20 @@ class NimManager: # get MultiType from DTV_ENUM_DELSYS if entry["frontend_device"] is not None: - types = [type for type in ["DVB-C", "DVB-T2", "DVB-T", "DVB-S2", "DVB-S", "ATSC"] if eDVBResourceManager.getInstance().frontendIsCompatible(entry["frontend_device"], type)] + types = [type for type in ["DVB-C", "DVB-T2", "DVB-T", "DVB-S2", "DVB-S", "ATSC", "DVB-S2X"] if eDVBResourceManager.getInstance().frontendIsCompatible(entry["frontend_device"], type)] if "DVB-T2" in types and "DVB-T" in types: # DVB-T2 implies DVB-T support types.remove("DVB-T") if "DVB-S2" in types and "DVB-S" in types: # DVB-S2 implies DVB-S support types.remove("DVB-S") + if "DVB-S2X" in types: + if "DVB-S" in types: + # DVB-S2X implies DVB-S support + types.remove("DVB-S") + if "DVB-S2" in types: + # DVB-S2X implies DVB-S2 support + types.remove("DVB-S2") if len(types) > 1: entry["multi_type"] = {} for type in types: @@ -841,6 +860,9 @@ class NimManager: list.append(x.slot) return list + def isSupportMultistream(self, slotid): + return self.getNim(slotid).isMultistream() + def __init__(self): self.satList = [ ] self.cablesList = [] @@ -876,6 +898,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 +909,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 @@ -893,6 +930,8 @@ class NimManager: type = "DVB-S" elif type == "DVB-T2": type = "DVB-T" + elif type == "DVB-S2X": + type = "DVB-S" nimList = self.getNimListOfType(type, slotid) for nim in nimList[:]: mode = self.getNimConfig(nim) @@ -906,6 +945,8 @@ class NimManager: type = "DVB-S" elif type == "DVB-T2": type = "DVB-T" + elif type == "DVB-S2X": + type = "DVB-S" nimList = self.getNimListOfType(type, slotid) positionerList = [] for nim in nimList[:]: @@ -1116,7 +1157,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 +1687,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")),