1 from config import config #global config instance
3 from config import configElement
4 from config import ConfigSubsection
5 from config import ConfigSlider
6 from config import configSelection
7 from config import currentConfigSelectionElement
8 from config import getConfigSelectionElement
9 from config import configSequence
10 from config import configsequencearg
11 from config import configSatlist
15 import xml.dom.minidom
16 from xml.dom import EMPTY_NAMESPACE
17 from skin import elementsWithTag
18 from Tools import XMLTools
20 from xml.sax import make_parser
21 from xml.sax.handler import ContentHandler
23 from Tools.BoundFunction import boundFunction
25 def tryOpen(filename):
27 procFile = open(filename)
33 def addLNBSimple(self, slotid, diseqcmode, toneburstmode = 0, diseqcpos = 0, orbpos = 0, longitude = 0, latitude = 0, loDirection = 0, laDirection = 0):
35 sec = eDVBSatelliteEquipmentControl.getInstance()
37 sec.setLNBTunerMask(1 << slotid)
38 sec.setLNBLOFL(9750000)
39 sec.setLNBLOFH(10600000)
40 sec.setLNBThreshold(11750000)
44 sec.setVoltageMode(0) #HV
45 sec.setToneMode(0) #HILO
46 sec.setCommandOrder(0)
48 sec.setDiSEqCMode(diseqcmode)
49 sec.setToneburst(toneburstmode)
50 sec.setCommittedCommand(diseqcpos)
51 #print "set orbpos to:" + str(orbpos)
53 if (0 <= diseqcmode < 3):
54 sec.addSatellite(orbpos)
55 self.satList.append(orbpos)
56 elif (diseqcmode == 3): # diseqc 1.2
57 sec.setLatitude(latitude)
58 sec.setLaDirection(laDirection)
59 sec.setLongitude(longitude)
60 sec.setLoDirection(loDirection)
61 sec.setUseInputpower(True)
62 sec.setInputpowerDelta(50)
64 for x in self.NimManager.satList:
65 print "Add sat " + str(x[1])
66 sec.addSatellite(int(x[1]))
69 self.satList.append(int(x[1]))
72 def linkNIMs(self, nim1, nim2):
73 eDVBSatelliteEquipmentControl.getInstance().setTunerLinked(nim1, nim2)
79 eDVBSatelliteEquipmentControl.getInstance().clear()
83 for slot in self.NimManager.nimslots:
86 if slot.nimType == self.NimManager.nimType["DVB-S"]:
87 print "slot: " + str(x) + " configmode: " + str(nim.configMode.value)
88 if currentConfigSelectionElement(nim.configMode) == "loopthrough":
89 self.linkNIMs(x, nim.linkedTo.value)
90 nim = config.Nims[nim.linkedTo.value]
91 elif currentConfigSelectionElement(nim.configMode) == "simple": #simple config
92 if currentConfigSelectionElement(nim.diseqcMode) == "single": #single
93 self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcA.vals[nim.diseqcA.value][1]), toneburstmode = 0, diseqcmode = 0, diseqcpos = 4)
94 elif currentConfigSelectionElement(nim.diseqcMode) == "toneburst_a_b": #Toneburst A/B
95 self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcA.vals[nim.diseqcA.value][1]), toneburstmode = 1, diseqcmode = 0, diseqcpos = 4)
96 self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcB.vals[nim.diseqcB.value][1]), toneburstmode = 1, diseqcmode = 0, diseqcpos = 4)
97 elif currentConfigSelectionElement(nim.diseqcMode) == "diseqc_a_b": #DiSEqC A/B
98 self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcA.vals[nim.diseqcA.value][1]), toneburstmode = 0, diseqcmode = 1, diseqcpos = 0)
99 self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcB.vals[nim.diseqcB.value][1]), toneburstmode = 0, diseqcmode = 1, diseqcpos = 1)
100 elif currentConfigSelectionElement(nim.diseqcMode) == "diseqc_a_b_c_d": #DiSEqC A/B/C/D
101 self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcA.vals[nim.diseqcA.value][1]), toneburstmode = 0, diseqcmode = 1, diseqcpos = 0)
102 self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcB.vals[nim.diseqcB.value][1]), toneburstmode = 0, diseqcmode = 1, diseqcpos = 1)
103 self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcC.vals[nim.diseqcC.value][1]), toneburstmode = 0, diseqcmode = 1, diseqcpos = 2)
104 self.addLNBSimple(slotid = x, orbpos = int(nim.diseqcD.vals[nim.diseqcD.value][1]), toneburstmode = 0, diseqcmode = 1, diseqcpos = 3)
105 elif currentConfigSelectionElement(nim.diseqcMode) == "positioner": #Positioner
106 self.addLNBSimple(slotid = x, diseqcmode = 3, longitude = float(str(nim.longitude.value[0]) + "." + str(nim.longitude.value[1])), loDirection = nim.longitudeOrientation.value - 2, latitude = float(str(nim.latitude.value[0]) + "." + str(nim.latitude.value[1])), laDirection = nim.latitudeOrientation.value)
108 elif currentConfigSelectionElement(nim.configMode) == "nothing":
110 else: #advanced config
111 self.updateAdvanced(x)
113 def updateAdvanced(self, slotid):
114 sec = eDVBSatelliteEquipmentControl.getInstance()
116 for x in range(1,33):
118 for x in self.NimManager.satList:
119 lnb = config.Nims[slotid].advanced.sat[x[1]].lnb.value
121 lnbSat[lnb].append(x[1])
122 for x in range(1,33):
123 if len(lnbSat[x]) > 0:
124 currLnb = config.Nims[slotid].advanced.lnb[x]
126 sec.setLNBTunerMask(1 << slotid)
127 if currentConfigSelectionElement(currLnb.lof) == "universal_lnb":
128 sec.setLNBLOFL(9750000)
129 sec.setLNBLOFH(10600000)
130 sec.setLNBThreshold(11750000)
131 elif currentConfigSelectionElement(currLnb.lof) == "c_band":
132 sec.setLNBLOFL(5150000)
133 sec.setLNBLOFH(5150000)
134 sec.setLNBThreshold(5150000)
135 elif currentConfigSelectionElement(currLnb.lof) == "user_defined":
136 sec.setLNBLOFL(currLnb.lofl.value * 1000)
137 sec.setLNBLOFH(currLnb.lofh.value * 1000)
138 sec.setLNBThreshold(currLnb.threshold.value * 1000)
140 if currentConfigSelectionElement(currLnb.output_12v) == "0V":
142 elif currentConfigSelectionElement(currLnb.output_12v) == "12V":
145 if currentConfigSelectionElement(currLnb.increased_voltage) == "yes":
150 if currentConfigSelectionElement(currLnb.diseqcMode) == "none":
152 elif currentConfigSelectionElement(currLnb.diseqcMode) == "1_0":
154 elif currentConfigSelectionElement(currLnb.diseqcMode) == "1_1":
156 elif currentConfigSelectionElement(currLnb.diseqcMode) == "1_2":
159 if currentConfigSelectionElement(currLnb.diseqcMode) != "none":
160 if currentConfigSelectionElement(currLnb.toneburst) == "none":
162 elif currentConfigSelectionElement(currLnb.toneburst) == "A":
164 elif currentConfigSelectionElement(currLnb.toneburst) == "B":
168 if currentConfigSelectionElement(currLnb.commitedDiseqcCommand) == "none":
170 elif currentConfigSelectionElement(currLnb.commitedDiseqcCommand) == "AA":
172 elif currentConfigSelectionElement(currLnb.commitedDiseqcCommand) == "AB":
174 elif currentConfigSelectionElement(currLnb.commitedDiseqcCommand) == "BA":
176 elif currentConfigSelectionElement(currLnb.commitedDiseqcCommand) == "BB":
179 if currentConfigSelectionElement(currLnb.fastDiseqc) == "yes":
184 if currentConfigSelectionElement(currLnb.sequenceRepeat) == "yes":
189 if currentConfigSelectionElement(currLnb.diseqcMode) == "1_0":
190 currCO = currLnb.commandOrder1_0.value
192 currCO = currLnb.commandOrder.value
194 pass # do something with currLnb.uncommittedDiseqcCommand.value... holds 0 for none, 1 for input 1, 2 for input 2 etc.
196 if currentConfigSelectionElement(currLnb.diseqcRepeats) == "none":
198 elif currentConfigSelectionElement(currLnb.diseqcRepeats) == "One":
200 elif currentConfigSelectionElement(currLnb.diseqcRepeats) == "Two":
202 elif currentConfigSelectionElement(currLnb.diseqcRepeats) == "Three":
205 if currCO == 0: # committed, toneburst
207 elif currCO == 1: # toneburst, committed
209 elif currCO == 2: # committed, uncommitted, toneburst
211 elif currCO == 3: # toneburst, committed, uncommitted
213 elif currCO == 4: # uncommitted, committed, toneburst
215 elif currCO == 5: # toneburst, uncommitted, commmitted
218 if currentConfigSelectionElement(currLnb.diseqcMode) == "1_2":
219 sec.setLatitude(float(str(currLnb.latitude.value[0]) + "." + str(currLnb.latitude.value[1])))
220 sec.setLaDirection(nim.latitudeOrientation.value)
221 sec.setLongitude(float(str(currLnb.longitude.value[0]) + "." + str(currLnb.longitude.value[1])))
222 sec.setLoDirection(nim.longitudeOrientation.value - 2)
224 if currentConfigSelectionElement(currLnb.powerMeasurement) == "yes":
225 pass # set to currLnb.powerThreshold.value, which is an integer holding the mA value
227 # finally add the orbital positions
231 def __init__(self, nimmgr):
232 self.NimManager = nimmgr
236 def __init__(self, slotid, nimtype, name):
238 self.nimType = nimtype
242 class parseSats(ContentHandler):
243 def __init__(self, satList, satellites, transponders):
244 self.isPointsElement, self.isReboundsElement = 0, 0
245 self.satList = satList
246 self.satellites = satellites
247 self.transponders = transponders
249 def startElement(self, name, attrs):
251 #print "found sat " + attrs.get('name',"") + " " + str(attrs.get('position',""))
252 tpos = int(attrs.get('position',""))
255 tname = attrs.get('name',"")
256 self.satellites[tpos] = tname
257 self.satList.append( (tname, tpos) )
258 self.parsedSat = int(tpos)
259 elif (name == "transponder"):
260 freq = int(attrs.get('frequency',""))
261 sr = int(attrs.get('symbol_rate',""))
262 pol = int(attrs.get('polarization',""))
263 fec = int(attrs.get('fec_inner',""))
264 if self.parsedSat in self.transponders:
267 self.transponders[self.parsedSat] = [ ]
269 self.transponders[self.parsedSat].append((0, freq, sr, pol, fec))
271 class parseCables(ContentHandler):
272 def __init__(self, cablesList, transponders):
273 self.isPointsElement, self.isReboundsElement = 0, 0
274 self.cablesList = cablesList
275 self.transponders = transponders
277 def startElement(self, name, attrs):
278 if (name == "cable"):
279 #print "found sat " + attrs.get('name',"") + " " + str(attrs.get('position',""))
280 tname = attrs.get('name',"")
281 self.cablesList.append(str(tname))
282 self.parsedCab = str(tname)
283 elif (name == "transponder"):
284 freq = int(attrs.get('frequency',""))
285 sr = int(attrs.get('symbol_rate',""))
286 mod = int(attrs.get('modulation',""))
287 fec = int(attrs.get('fec_inner',""))
288 if self.parsedCab in self.transponders:
291 self.transponders[self.parsedCab] = [ ]
293 self.transponders[self.parsedCab].append((1, freq, sr, mod, fec))
295 class parseTerrestrials(ContentHandler):
296 def __init__(self, terrestrialsList, transponders):
297 self.isPointsElement, self.isReboundsElement = 0, 0
298 self.terrestrialsList = terrestrialsList
299 self.transponders = transponders
301 def startElement(self, name, attrs):
302 if (name == "terrestrial"):
303 #print "found sat " + attrs.get('name',"") + " " + str(attrs.get('position',""))
304 tname = attrs.get('name',"")
305 tflags = attrs.get('flags',"")
306 self.terrestrialsList.append((tname, tflags))
307 self.parsedTer = str(tname)
308 elif (name == "transponder"):
310 freq = int(attrs.get('centre_frequency',""))
311 bw = int(attrs.get('bandwidth',""))
312 const = int(attrs.get('constellation',""))
313 crh = int(attrs.get('code_rate_hp',""))
314 crl = int(attrs.get('code_rate_lp',""))
315 guard = int(attrs.get('guard_interval',""))
316 transm = int(attrs.get('transmission_mode',""))
317 hierarchy = int(attrs.get('hierarchy_information',""))
318 inv = int(attrs.get('inversion',""))
319 if self.parsedTer in self.transponders:
322 self.transponders[self.parsedTer] = [ ]
324 self.transponders[self.parsedTer].append((2, freq, bw, const, crh, crl, guard, transm, hierarchy, inv))
326 def getTransponders(self, pos):
327 return self.transponders[pos]
329 def getConfiguredSats(self):
330 return self.sec.getSatList()
332 def getSatDescription(self, pos):
333 return self.satellites[pos]
335 def readSatsfromFile(self):
336 self.satellites = { }
337 self.transponders = { }
338 self.transponderscable = { }
339 self.transpondersterrestrial = { }
341 parser = make_parser()
342 if (self.hasNimType(self.nimType["DVB-S"])):
343 print "Reading satellites.xml"
344 satHandler = self.parseSats(self.satList, self.satellites, self.transponders)
345 parser.setContentHandler(satHandler)
346 parser.parse('/etc/tuxbox/satellites.xml')
347 if (self.hasNimType(self.nimType["DVB-C"])):
348 print "Reading cables.xml"
349 cabHandler = self.parseCables(self.cablesList, self.transponderscable)
350 parser.setContentHandler(cabHandler)
351 parser.parse('/etc/tuxbox/cables.xml')
353 if (self.hasNimType(self.nimType["DVB-T"])):
354 print "Reading terrestrial.xml"
355 terHandler = self.parseTerrestrials(self.terrestrialsList, self.transpondersterrestrial)
356 parser.setContentHandler(terHandler)
357 parser.parse('/etc/tuxbox/terrestrial.xml')
362 self.nimSocketCount = 0
363 nimfile = tryOpen("/proc/bus/nim_sockets")
366 return self.nimType["empty/unknown"]
371 line = nimfile.readline()
374 if line.strip().startswith("NIM Socket"):
375 parts = line.strip().split(" ")
376 id = int(parts[2][:1])
378 self.nimSocketCount += 1
379 elif line.strip().startswith("Type:"):
380 self.nimTypes[lastsocket] = str(line.strip()[6:])
381 elif line.strip().startswith("Name:"):
382 self.nimNames[lastsocket] = str(line.strip()[6:])
383 elif line.strip().startswith("empty"):
384 self.nimNames[lastsocket] = _("N/A")
385 self.nimTypes[lastsocket] = "empty/unknown"
389 def getNimType(self, slotID):
390 if slotID >= self.nimCount:
391 return "empty/unknown"
393 return self.nimType[self.nimTypes[slotID]]
395 def getNimName(self, slotID):
396 return self.nimNames[slotID]
398 def getNimSocketCount(self):
399 return self.nimSocketCount
401 def hasNimType(self, chktype):
402 for id, type in self.nimTypes.items():
403 if (chktype == self.nimType[str(type)]):
407 def getNimListOfType(self, type, exception = -1):
409 for x in self.nimslots:
410 if ((x.nimType == type) and (x.slotid != exception)):
411 list.append(x.slotid)
414 def getConfigPrefix(self, slotid):
415 return "config.Nim" + ("A","B","C","D")[slotid] + "."
419 self.nimType = { "empty/unknown": -1,
425 self.terrestrialsList = []
429 self.readSatsfromFile()
431 self.nimCount = self.getNimSocketCount()
435 while x < self.nimCount:
436 tType = self.getNimType(x)
437 tName = self.getNimName(x)
438 tNim = nimSlot(x, tType, tName)
439 self.nimslots.append(tNim)
442 InitNimManager(self) #init config stuff
446 for slot in self.nimslots:
447 nimText = _("Socket ") + ("A", "B", "C", "D")[slot.slotid] + ": "
448 if slot.nimType == -1:
449 nimText += _("empty/unknown")
451 nimText += slot.name + " ("
452 nimText += ("DVB-S", "DVB-C", "DVB-T")[slot.nimType] + ")"
453 list.append((nimText, slot))
456 def getSatListForNim(self, slotid):
458 if (self.getNimType(slotid) != self.nimType["empty/unknown"]):
459 #print "slotid:", slotid
461 #print "self.satellites:", self.satList[config.Nims[slotid].diseqcA.value]
462 #print "diseqcA:", config.Nims[slotid].diseqcA.value
463 if (config.Nims[slotid].diseqcMode.value <= 3):
464 list.append(self.satList[config.Nims[slotid].diseqcA.value])
465 if (0 < config.Nims[slotid].diseqcMode.value <= 3):
466 list.append(self.satList[config.Nims[slotid].diseqcB.value])
467 if (config.Nims[slotid].diseqcMode.value == 3):
468 list.append(self.satList[config.Nims[slotid].diseqcC.value])
469 list.append(self.satList[config.Nims[slotid].diseqcD.value])
470 if (config.Nims[slotid].diseqcMode.value == 4):
471 for x in self.satList:
475 #callbacks for c++ config
476 def nimConfigModeChanged(self, slotid, mode):
477 if (mode != 2): # not linked
478 print "Unlinking slot " + str(slotid)
479 # TODO call c++ to unlink nim in slot slotid
480 if (mode == 2): # linked
483 #if (len(self.getNimListOfType(self.nimType["DVB-S"], slotid)) > 0):
484 # print "Linking slot " + str(slotid) + " to " + str(nimmgr.getConfigPrefix(slotid).value)
485 # TODO call c++ to link nim in slot slotid with nim in slot nimmgr.getConfigPrefix(slotid).value
486 def nimLinkedToChanged(self, slotid, val):
487 print "Linking slot " + str(slotid) + " to " + str(val)
489 def nimDiseqcModeChanged(self, slotid, mode):
490 #print "nimDiseqcModeChanged set to " + str(mode)
492 def nimPortAChanged(self, slotid, val):
493 #print "nimDiseqcA set to " + str(slotid) + " val:" + str(val)
495 def nimPortBChanged(self, slotid, val):
496 #print "nimDiseqcA set to " + str(slotid) + " val:" + str(val)
497 #print "nimDiseqcB set to " + str(val)
499 def nimPortCChanged(self, slotid, val):
500 #print "nimDiseqcC set to " + str(val)
502 def nimPortDChanged(self, slotid, val):
503 #print "nimDiseqcD set to " + str(val)
506 def InitNimManager(nimmgr):
508 for x in range(nimmgr.nimCount):
509 config.Nims.append(ConfigSubsection())
511 def nimConfigModeChanged(slotid, configElement):
512 nimmgr.nimConfigModeChanged(slotid, configElement.value)
513 def nimLinkedToChanged(slotid, configElement):
514 nimmgr.nimLinkedToChanged(slotid, configElement.value)
515 def nimDiseqcModeChanged(slotid, configElement):
516 nimmgr.nimDiseqcModeChanged(slotid, configElement.value)
518 def nimPortAChanged(slotid, configElement):
519 nimmgr.nimPortAChanged(slotid, configElement.vals[configElement.value][1])
520 def nimPortBChanged(slotid, configElement):
521 nimmgr.nimPortBChanged(slotid, configElement.vals[configElement.value][1])
522 def nimPortCChanged(slotid, configElement):
523 nimmgr.nimPortCChanged(slotid, configElement.vals[configElement.value][1])
524 def nimPortDChanged(slotid, configElement):
525 nimmgr.nimPortDChanged(slotid, configElement.vals[configElement.value][1])
527 for slot in nimmgr.nimslots:
529 cname = nimmgr.getConfigPrefix(x)
532 if slot.nimType == nimmgr.nimType["DVB-S"]:
534 nim.configMode = configElement(cname + "configMode", configSelection, 0, (("simple", _("Simple")), ("advanced", _("Advanced"))))
536 nim.configMode = configElement(cname + "configMode", configSelection, 0, (("simple", _("Simple")), ("nothing", _("Nothing connected")), ("loopthrough", _("Loopthrough to Socket A")), ("advanced", _("Advanced"))))
538 #important - check if just the 2nd one is LT only and the first one is DVB-S
539 if currentConfigSelectionElement(nim.configMode) == "loopthrough": #linked
540 if x == 0: #first one can never be linked to anything
541 nim.configMode.value = getConfigSelectionElement(nim.configMode, "simple") #reset to simple
542 nim.configMode.save()
544 #FIXME: make it better
545 for y in nimmgr.nimslots:
547 if y.nimType != nimmgr.nimType["DVB-S"]:
548 nim.configMode.value = getConfigSelectionElement(nim.configMode, "simple") #reset to simple
549 nim.configMode.save()
551 nim.diseqcMode = configElement(cname + "diseqcMode", configSelection, 2, (("single", _("Single")), ("toneburst_a_b", _("Toneburst A/B")), ("diseqc_a_b", _("DiSEqC A/B")), ("diseqc_a_b_c_d", _("DiSEqC A/B/C/D")), ("positioner", _("Positioner"))));
552 nim.diseqcA = configElement(cname + "diseqcA", configSatlist, 192, nimmgr.satList);
553 nim.diseqcB = configElement(cname + "diseqcB", configSatlist, 130, nimmgr.satList);
554 nim.diseqcC = configElement(cname + "diseqcC", configSatlist, 0, nimmgr.satList);
555 nim.diseqcD = configElement(cname + "diseqcD", configSatlist, 0, nimmgr.satList);
556 nim.positionerMode = configElement(cname + "positionerMode", configSelection, 0, (("usals", _("USALS")), ("manual", _("manual"))));
557 nim.longitude = configElement(cname + "longitude", configSequence, [5,100], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
558 nim.longitudeOrientation = configElement(cname + "longitudeOrientation", configSelection, 0, (_("East"), _("West")))
559 nim.latitude = configElement(cname + "latitude", configSequence, [50,767], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
560 nim.latitudeOrientation = configElement(cname + "latitudeOrientation", configSelection, 0, (("north", _("North")), ("south", _("South"))))
561 satNimList = nimmgr.getNimListOfType(nimmgr.nimType["DVB-S"], slot.slotid)
564 satNimListNames.append((("Slot_" + ("A", "B", "C", "D")[x] + "_" + nimmgr.getNimName(x)), _("Slot ") + ("A", "B", "C", "D")[x] + ": " + nimmgr.getNimName(x)))
565 nim.linkedTo = configElement(cname + "linkedTo", configSelection, 0, satNimListNames);
567 #perhaps the instance of the slot is more useful?
568 nim.configMode.addNotifier(boundFunction(nimConfigModeChanged,x))
569 nim.diseqcMode.addNotifier(boundFunction(nimDiseqcModeChanged,x))
570 nim.diseqcA.addNotifier(boundFunction(nimPortAChanged,int(x)))
571 nim.diseqcB.addNotifier(boundFunction(nimPortBChanged,x))
572 nim.diseqcC.addNotifier(boundFunction(nimPortCChanged,x))
573 nim.diseqcD.addNotifier(boundFunction(nimPortDChanged,x))
574 nim.linkedTo.addNotifier(boundFunction(nimLinkedToChanged,x))
577 nim.advanced = ConfigSubsection()
578 nim.advanced.sats = configElement(cname + "advanced.sats", configSatlist, 192, nimmgr.satList);
579 nim.advanced.sat = {}
580 lnbs = ["not available"]
581 for y in range(1, 33):
582 lnbs.append("LNB " + str(y))
583 for x in nimmgr.satList:
584 nim.advanced.sat[x[1]] = ConfigSubsection()
585 nim.advanced.sat[x[1]].voltage = configElement(cname + "advanced.sat" + str(x[1]) + ".voltage", configSelection, 0, (("polarization", _("Polarization")), ("13V", _("13 V")), ("18V", _("18 V"))))
586 nim.advanced.sat[x[1]].tonemode = configElement(cname + "advanced.sat" + str(x[1]) + ".tonemode", configSelection, 0, (("band", _("Band")), ("on", _("On")), ("off", _("Off"))))
587 nim.advanced.sat[x[1]].usals = configElement(cname + "advanced.sat" + str(x[1]) + ".usals", configSelection, 0, (("yes", _("Yes")), ("no", _("No"))))
588 nim.advanced.sat[x[1]].rotorposition = configElement(cname + "advanced.sat" + str(x[1]) + ".rotorposition", configSequence, [1], configsequencearg.get("INTEGER", (1, 255)))
589 nim.advanced.sat[x[1]].lnb = configElement(cname + "advanced.sat" + str(x[1]) + ".lnb", configSelection, 0, lnbs)
591 nim.advanced.lnb = [0]
592 for x in range(1, 33):
593 nim.advanced.lnb.append(ConfigSubsection())
594 nim.advanced.lnb[x].lof = configElement(cname + "advanced.lnb" + str(x) + ".lof", configSelection, 0, (("universal_lnb", _("Universal LNB")), ("c_band", _("C-Band")), ("user_defined", _("User defined"))))
595 nim.advanced.lnb[x].lofl = configElement(cname + "advanced.lnb" + str(x) + ".lofl", configSequence, [9750], configsequencearg.get("INTEGER", (0, 99999)))
596 nim.advanced.lnb[x].lofh = configElement(cname + "advanced.lnb" + str(x) + ".lofh", configSequence, [10600], configsequencearg.get("INTEGER", (0, 99999)))
597 nim.advanced.lnb[x].threshold = configElement(cname + "advanced.lnb" + str(x) + ".threshold", configSequence, [11750], configsequencearg.get("INTEGER", (0, 99999)))
598 nim.advanced.lnb[x].output_12v = configElement(cname + "advanced.lnb" + str(x) + ".output_12v", configSelection, 0, (("0V", _("0 V")), ("12V", _("12 V"))))
599 nim.advanced.lnb[x].increased_voltage = configElement(cname + "advanced.lnb" + str(x) + ".increased_voltage", configSelection, 0, (("no", _("No")), ("yes", _("Yes"))))
600 nim.advanced.lnb[x].toneburst = configElement(cname + "advanced.lnb" + str(x) + ".toneburst", configSelection, 0, (("none", _("None")), ("A", _("A")), ("B", _("B"))))
601 nim.advanced.lnb[x].diseqcMode = configElement(cname + "advanced.lnb" + str(x) + ".diseqcMode", configSelection, 0, (("none", _("None")), ("1_0", _("1.0")), ("1_1", _("1.1")), ("1_2", _("1.2"))))
602 nim.advanced.lnb[x].commitedDiseqcCommand = configElement(cname + "advanced.lnb" + str(x) + ".commitedDiseqcCommand", configSelection, 0, (("none", _("None")), ("AA", _("AA")), ("AB", _("AB")), ("BA", _("BA")), ("BB", _("BB"))))
603 nim.advanced.lnb[x].fastDiseqc = configElement(cname + "advanced.lnb" + str(x) + ".fastDiseqc", configSelection, 0, (("no", _("No")), ("yes", _("Yes"))))
604 nim.advanced.lnb[x].sequenceRepeat = configElement(cname + "advanced.lnb" + str(x) + ".sequenceRepeat", configSelection, 0, (("no", _("No")), ("yes", _("Yes"))))
605 nim.advanced.lnb[x].commandOrder1_0 = configElement(cname + "advanced.lnb" + str(x) + ".commandOrder1_0", configSelection, 0, ("committed, toneburst", "toneburst, committed"))
606 nim.advanced.lnb[x].commandOrder = configElement(cname + "advanced.lnb" + str(x) + ".commandOrder", configSelection, 0, ("committed, toneburst", "toneburst, committed", "committed, uncommitted, toneburst", "toneburst, committed, uncommitted", "uncommitted, committed, toneburst", "toneburst, uncommitted, commmitted"))
608 for y in range(1, 17):
609 disCmd.append("Input " + str(y))
610 nim.advanced.lnb[x].uncommittedDiseqcCommand = configElement(cname + "advanced.lnb" + str(x) + ".uncommittedDiseqcCommand", configSelection, 0, disCmd)
611 nim.advanced.lnb[x].diseqcRepeats = configElement(cname + "advanced.lnb" + str(x) + ".diseqcRepeats", configSelection, 0, (("none", _("None")), ("one", _("One")), ("two", _("Two")), ("three", _("Three"))))
612 nim.advanced.lnb[x].longitude = configElement(cname + "advanced.lnb" + str(x) + ".longitude", configSequence, [5,100], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
613 nim.advanced.lnb[x].longitudeOrientation = configElement(cname + "advanced.lnb" + str(x) + ".longitudeOrientation", configSelection, 0, (_("East"), _("West")))
614 nim.advanced.lnb[x].latitude = configElement(cname + "advanced.lnb" + str(x) + ".latitude", configSequence, [50,767], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
615 nim.advanced.lnb[x].latitudeOrientation = configElement(cname + "advanced.lnb" + str(x) + ".latitudeOrientation", configSelection, 0, (("north", _("North")), ("south", _("South"))))
616 nim.advanced.lnb[x].powerMeasurement = configElement(cname + "advanced.lnb" + str(x) + ".powerMeasurement", configSelection, 0, (("yes", _("Yes")), ("no", _("No"))))
617 nim.advanced.lnb[x].powerThreshold = configElement(cname + "advanced.lnb" + str(x) + ".powerThreshold", configSequence, [50], configsequencearg.get("INTEGER", (0, 100)))
618 elif slot.nimType == nimmgr.nimType["DVB-C"]:
619 nim.cable = configElement(cname + "cable", configSelection, 0, nimmgr.cablesList);
620 elif slot.nimType == nimmgr.nimType["DVB-T"]:
621 nim.cable = configElement(cname + "terrestrial", configSelection, 0, nimmgr.terrestrialsList);
623 print "pls add support for this frontend type!"
625 nimmgr.sec = SecConfigure(nimmgr)
627 nimmanager = NimManager()