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')
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] + "."
#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)
+ # 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)
+ # 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
#print "nimDiseqcD set to " + str(val)
pass
-
def InitNimManager(nimmgr):
config.Nims = []
for x in range(nimmgr.nimCount):
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)
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.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)]));
+ 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))
nim.diseqcMode.addNotifier(boundFunction(nimDiseqcModeChanged,x))
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"]: