X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/f3b1a20b183c612caf5122ebc4540a8fe4fff486..cbe7b975e72bb5ab4708396eb648fc8e6bc2548b:/lib/python/Components/NimManager.py diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 14517d75..061e4fb8 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -189,10 +189,10 @@ class NimManager: self.transponders = { } self.transponderscable = { } self.transpondersterrestrial = { } - + + parser = make_parser() if (self.hasNimType(self.nimType["DVB-S"])): print "Reading satellites.xml" - parser = make_parser() satHandler = self.parseSats(self.satList, self.satellites, self.transponders) parser.setContentHandler(satHandler) parser.parse('/etc/tuxbox/satellites.xml') @@ -253,6 +253,13 @@ class NimManager: if (chktype == self.nimType[str(type)]): return True return False + + def getNimListOfType(self, type, exception = -1): + list = [] + for x in self.nimslots: + if ((x.nimType == type) and (x.slotid != exception)): + list.append(x.slotid) + return list def getConfigPrefix(self, slotid): return "config.Nim" + ("A","B","C","D")[slotid] + "." @@ -314,8 +321,18 @@ class NimManager: #callbacks for c++ config def nimConfigModeChanged(self, slotid, mode): - #print "nimConfigModeChanged set to " + str(mode) - pass + if (mode != 1): # not linked + print "Unlinking slot " + str(slotid) + # TODO call c++ to unlink nim in slot slotid + if (mode == 1): # linked + if (len(self.getNimListOfType(self.nimType["DVB-S"], slotid)) > 0): + print "Linking slot " + str(slotid) + " to " + str(nimmgr.getConfigPrefix(slotid).value) + self.sec.setTunerLinked(slotid, nimmgr.getConfigPrefix(slotid).value) + # TODO call c++ to link nim in slot slotid with nim in slot nimmgr.getConfigPrefix(slotid).value + def nimLinkedToChanged(self, slotid, val): + print "Linking slot " + str(slotid) + " to " + str(val) + self.sec.setTunerLinked(slotid, val) + # TODO call c++ to link nim in slot slotid with nim in slot val def nimDiseqcModeChanged(self, slotid, mode): #print "nimDiseqcModeChanged set to " + str(mode) pass @@ -333,7 +350,6 @@ class NimManager: #print "nimDiseqcD set to " + str(val) pass - def InitNimManager(nimmgr): config.Nims = [] for x in range(nimmgr.nimCount): @@ -341,6 +357,8 @@ def InitNimManager(nimmgr): def nimConfigModeChanged(slotid, configElement): nimmgr.nimConfigModeChanged(slotid, configElement.value) + def nimLinkedToChanged(slotid, configElement): + nimmgr.nimLinkedToChanged(slotid, configElement.value) def nimDiseqcModeChanged(slotid, configElement): nimmgr.nimDiseqcModeChanged(slotid, configElement.value) @@ -359,14 +377,22 @@ def InitNimManager(nimmgr): nim = config.Nims[x] if slot.nimType == nimmgr.nimType["DVB-S"]: - nim.configMode = configElement(cname + "configMode", configSelection, 0, (_("Simple"), _("Advanced"))); + nim.configMode = configElement(cname + "configMode", configSelection, 0, (_("Simple"), _("Linked tuner"))) # "Advanced")); nim.diseqcMode = configElement(cname + "diseqcMode", configSelection, 2, (_("Single"), _("Toneburst A/B"), _("DiSEqC A/B"), _("DiSEqC A/B/C/D"), _("Positioner"))); nim.diseqcA = configElement(cname + "diseqcA", configSatlist, 192, nimmgr.satList); nim.diseqcB = configElement(cname + "diseqcB", configSatlist, 130, nimmgr.satList); nim.diseqcC = configElement(cname + "diseqcC", configSatlist, 0, nimmgr.satList); nim.diseqcD = configElement(cname + "diseqcD", configSatlist, 0, nimmgr.satList); - nim.longitude = configElement(cname + "longitude", configSequence, [0,0], configsequencearg.get("FLOAT", [(0,90),(0,999)])); - nim.latitude = configElement(cname + "latitude", configSequence, [0,0], configsequencearg.get("FLOAT", [(0,90),(0,999)])); + nim.positionerMode = configElement(cname + "positionerMode", configSelection, 0, (_("USALS"), _("manual"))); + nim.longitude = configElement(cname + "longitude", configSequence, [5,100], configsequencearg.get("FLOAT", [(0,90),(0,999)])); + nim.longitudeOrientation = configElement(cname + "longitudeOrientation", configSelection, 0, (_("East"), _("West"))) + nim.latitude = configElement(cname + "latitude", configSequence, [50,767], configsequencearg.get("FLOAT", [(0,90),(0,999)])); + nim.latitudeOrientation = configElement(cname + "latitudeOrientation", configSelection, 0, (_("North"), _("South"))) + satNimList = nimmgr.getNimListOfType(nimmgr.nimType["DVB-S"], slot.slotid) + satNimListNames = [] + for x in satNimList: + satNimListNames.append(_("Slot ") + ("A", "B", "C", "D")[x] + ": " + nimmgr.getNimName(x)) + nim.linkedTo = configElement(cname + "linkedTo", configSelection, 0, satNimListNames); #perhaps the instance of the slot is more useful? nim.configMode.addNotifier(boundFunction(nimConfigModeChanged,x)) @@ -375,6 +401,7 @@ def InitNimManager(nimmgr): nim.diseqcB.addNotifier(boundFunction(nimPortBChanged,x)) nim.diseqcC.addNotifier(boundFunction(nimPortCChanged,x)) nim.diseqcD.addNotifier(boundFunction(nimPortDChanged,x)) + nim.linkedTo.addNotifier(boundFunction(nimLinkedToChanged,x)) elif slot.nimType == nimmgr.nimType["DVB-C"]: nim.cable = configElement(cname + "cable", configSelection, 0, nimmgr.cablesList); elif slot.nimType == nimmgr.nimType["DVB-T"]: