diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2008-06-26 18:55:11 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2008-06-26 18:55:11 +0000 |
| commit | 96e58d2b58fa6b5712857ed01dfbeb770fe6c6d3 (patch) | |
| tree | acca2c62f22a5b24348620fd1874d5fdcb72e813 /lib/python/Components/NimManager.py | |
| parent | 04f4636324ab06c5a3a4f618100048e159eaf6f9 (diff) | |
| download | enigma2-96e58d2b58fa6b5712857ed01dfbeb770fe6c6d3.tar.gz enigma2-96e58d2b58fa6b5712857ed01dfbeb770fe6c6d3.zip | |
some restrictions for the sat setup
we don't allow
- DVB-S tuner ==loopthrough==> DVB-S2 tuner
- tuner A ==equals to==> tuner B set to loopthrough
- tuner A ==equals to==> tuner B set to 2nd cable on positioner LNB
- tuner A ==2nd cable==> tuner B, if tuner B is already referenced in another tuner's config as 2nd cable on this positioner
Diffstat (limited to 'lib/python/Components/NimManager.py')
| -rw-r--r-- | lib/python/Components/NimManager.py | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index f2f7c57f..794cd80d 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -563,6 +563,9 @@ class NimManager: return True return False + def getNimType(self, slotid): + return self.nim_slots[slotid].type + def getNimDescription(self, slotid): return self.nim_slots[slotid].friendly_full_description @@ -595,18 +598,50 @@ class NimManager: def hasOutputs(self, slotid): return self.nim_slots[slotid].hasOutputs() - def connectableTo(self, slotid): + def canConnectTo(self, slotid): slots = [] if self.nim_slots[slotid].internallyConnectableTo() is not None: slots.append(self.nim_slots[slotid].internallyConnectableTo()) for type in self.nim_slots[slotid].connectableTo(): for slot in self.getNimListOfType(type, exception = slotid): - if self.hasOutputs(slot): - slots.append(slot) + # FIXME we restrict loopthrough from dvb-s2 to dvb-s, because the c++ part can't handle it + if not (type == "DVB-S" and self.getNimType(slot)): + if self.hasOutputs(slot): + slots.append(slot) slots.sort() return slots + def canEqualTo(self, slotid): + type = self.getNimType(slotid) + if self.getNimConfig(slotid) == "DVB-S2": + type = "DVB-S" + nimList = self.getNimListOfType(type, slotid) + for nim in nimList[:]: + mode = self.getNimConfig(nim) + if mode.configMode.value == "loopthrough" or mode.configMode.value == "satposdepends": + nimList.remove(nim) + return nimList + + def canDependOn(self, slotid): + type = self.getNimType(slotid) + if self.getNimConfig(slotid) == "DVB-S2": + type = "DVB-S" + nimList = self.getNimListOfType(type, slotid) + positionerList = [] + for nim in nimList[:]: + mode = self.getNimConfig(nim) + if mode.configMode.value == "simple" and mode.diseqcMode.value == "positioner": + alreadyConnected = False + for testnim in nimList: + testmode = self.getNimConfig(testnim) + if testmode.configMode.value == "satposdepends" and int(testmode.connectedTo.value) == int(nim): + alreadyConnected = True + break + if not alreadyConnected: + positionerList.append(nim) + return positionerList + def getNimConfig(self, slotid): return config.Nims[slotid] @@ -743,8 +778,6 @@ def InitNimManager(nimmgr): x = slot.slot nim = config.Nims[x] - # HACK: currently, we can only looptrough to socket A - if slot.isCompatible("DVB-S"): choices = { "nothing": _("nothing connected"), "simple": _("simple"), @@ -752,7 +785,7 @@ def InitNimManager(nimmgr): if len(nimmgr.getNimListOfType(slot.type, exception = x)) > 0: choices["equal"] = _("equal to") choices["satposdepends"] = _("second cable of motorized LNB") - if len(nimmgr.connectableTo(x)) > 0: + if len(nimmgr.canConnectTo(x)) > 0: choices["loopthrough"] = _("loopthrough to") nim.configMode = ConfigSelection(choices = choices, default = "simple") |
