X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FNimManager.py;h=31e59a6f3990b4701d2a84e0c2dfd35bf254fd7a;hb=ee75b9b5a61fb4363008bc701e1ba9a42c0b922c;hp=4b7ef8eab4d1df3ecbd7e6f271a133b96075180d;hpb=c97ce12d8d2cff90adefbea0864df38e370d875a;p=vuplus_dvbapp diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 4b7ef8e..31e59a6 100755 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -500,11 +500,7 @@ class NIM(object): self.i2c = i2c self.frontend_id = frontend_id self.__is_empty = is_empty - - def isCompatible(self, what): - if not self.isSupported(): - return False - compatible = { + self.compatible = { None: (None,), "DVB-S": ("DVB-S", None), "DVB-C": ("DVB-C", None), @@ -512,7 +508,19 @@ class NIM(object): "DVB-S2": ("DVB-S", "DVB-S2", None), "DVB-T2": ("DVB-T", "DVB-T2", None) } - return what in compatible[self.type] + + def isCompatible(self, what): + if not self.isSupported(): + return False + return what in self.compatible[self.type] + + def canBeCompatible(self, what): + if self.isCompatible(what): + return True + for type in self.getMultiTypeList().values(): + if what in self.compatible[type]: + return True + return False def getType(self): return self.type @@ -764,11 +772,8 @@ class NimManager: def hasNimType(self, chktype): for slot in self.nim_slots: - if slot.isCompatible(chktype): + if slot.canBeCompatible(chktype): return True - for type in slot.getMultiTypeList().values(): - if chktype == type: - return True return False def getNimType(self, slotid): @@ -913,7 +918,7 @@ class NimManager: nim = config.Nims[slotid] configMode = nim.configMode.value - if self.nim_slots[slotid].isCompatible("DVB-S") or self.nim_slots[slotid].isCompatible("DVB-T") or self.nim_slots[slotid].isCompatible("DVB-C") or self.nim_slots[slotid].isCompatible("DVB-T2"): + if self.nim_slots[slotid].isCompatible("DVB-S") or self.nim_slots[slotid].isCompatible("DVB-T") or self.nim_slots[slotid].isCompatible("DVB-C"): return not (configMode == "nothing") def getSatListForNim(self, slotid): @@ -1514,20 +1519,6 @@ def InitNimManager(nimmgr): n += 1 nim.terrestrial = ConfigSelection(choices = list) nim.terrestrial_5V = ConfigOnOff() - elif slot.isCompatible("DVB-T2"): - nim.configMode = ConfigSelection( - choices = { - "enabled": _("enabled"), - "nothing": _("nothing connected"), - }, - default = "enabled") - list = [] - n = 0 - for x in nimmgr.terrestrialsList: - list.append((str(n), x[0])) - n += 1 - nim.terrestrial = ConfigSelection(choices = list) - nim.terrestrial_5V = ConfigOnOff() else: empty_slots += 1 nim.configMode = ConfigSelection(choices = { "nothing": _("disabled") }, default="nothing");