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
230 currSat = config.Nims[slotid].advanced.sat[y]
231 if currentConfigSelectionElement(currSat.voltage) == "polarization":
233 elif currentConfigSelectionElement(currSat.voltage) == "13V":
235 elif currentConfigSelectionElement(currSat.voltage) == "18V":
238 if currentConfigSelectionElement(currSat.tonemode) == "band":
240 elif currentConfigSelectionElement(currSat.tonemode) == "on":
242 elif currentConfigSelectionElement(currSat.tonemode) == "off":
245 if currentConfigSelectionElement(currSat.usals) == "no":
246 pass # use currSat.rotorposition.value to set the stored rotor position
248 pass # use usals for this sat!
251 def __init__(self, nimmgr):
252 self.NimManager = nimmgr
256 def __init__(self, slotid, nimtype, name):
258 self.nimType = nimtype
262 class parseSats(ContentHandler):
263 def __init__(self, satList, satellites, transponders):
264 self.isPointsElement, self.isReboundsElement = 0, 0
265 self.satList = satList
266 self.satellites = satellites
267 self.transponders = transponders
269 def startElement(self, name, attrs):
271 #print "found sat " + attrs.get('name',"") + " " + str(attrs.get('position',""))
272 tpos = int(attrs.get('position',""))
275 tname = attrs.get('name',"")
276 self.satellites[tpos] = tname
277 self.satList.append( (tname, tpos) )
278 self.parsedSat = int(tpos)
279 elif (name == "transponder"):
280 freq = int(attrs.get('frequency',""))
281 sr = int(attrs.get('symbol_rate',""))
282 pol = int(attrs.get('polarization',""))
283 fec = int(attrs.get('fec_inner',""))
284 if self.parsedSat in self.transponders:
287 self.transponders[self.parsedSat] = [ ]
289 self.transponders[self.parsedSat].append((0, freq, sr, pol, fec))
291 class parseCables(ContentHandler):
292 def __init__(self, cablesList, transponders):
293 self.isPointsElement, self.isReboundsElement = 0, 0
294 self.cablesList = cablesList
295 self.transponders = transponders
297 def startElement(self, name, attrs):
298 if (name == "cable"):
299 #print "found sat " + attrs.get('name',"") + " " + str(attrs.get('position',""))
300 tname = attrs.get('name',"")
301 self.cablesList.append(str(tname))
302 self.parsedCab = str(tname)
303 elif (name == "transponder"):
304 freq = int(attrs.get('frequency',""))
305 sr = int(attrs.get('symbol_rate',""))
306 mod = int(attrs.get('modulation',""))
307 fec = int(attrs.get('fec_inner',""))
308 if self.parsedCab in self.transponders:
311 self.transponders[self.parsedCab] = [ ]
313 self.transponders[self.parsedCab].append((1, freq, sr, mod, fec))
315 class parseTerrestrials(ContentHandler):
316 def __init__(self, terrestrialsList, transponders):
317 self.isPointsElement, self.isReboundsElement = 0, 0
318 self.terrestrialsList = terrestrialsList
319 self.transponders = transponders
321 def startElement(self, name, attrs):
322 if (name == "terrestrial"):
323 #print "found sat " + attrs.get('name',"") + " " + str(attrs.get('position',""))
324 tname = attrs.get('name',"")
325 tflags = attrs.get('flags',"")
326 self.terrestrialsList.append((tname, tflags))
327 self.parsedTer = str(tname)
328 elif (name == "transponder"):
330 freq = int(attrs.get('centre_frequency',""))
331 bw = int(attrs.get('bandwidth',""))
332 const = int(attrs.get('constellation',""))
333 crh = int(attrs.get('code_rate_hp',""))
334 crl = int(attrs.get('code_rate_lp',""))
335 guard = int(attrs.get('guard_interval',""))
336 transm = int(attrs.get('transmission_mode',""))
337 hierarchy = int(attrs.get('hierarchy_information',""))
338 inv = int(attrs.get('inversion',""))
339 if self.parsedTer in self.transponders:
342 self.transponders[self.parsedTer] = [ ]
344 self.transponders[self.parsedTer].append((2, freq, bw, const, crh, crl, guard, transm, hierarchy, inv))
346 def getTransponders(self, pos):
347 return self.transponders[pos]
349 def getConfiguredSats(self):
350 return self.sec.getSatList()
352 def getSatDescription(self, pos):
353 return self.satellites[pos]
355 def readSatsfromFile(self):
356 self.satellites = { }
357 self.transponders = { }
358 self.transponderscable = { }
359 self.transpondersterrestrial = { }
361 parser = make_parser()
362 if (self.hasNimType(self.nimType["DVB-S"])):
363 print "Reading satellites.xml"
364 satHandler = self.parseSats(self.satList, self.satellites, self.transponders)
365 parser.setContentHandler(satHandler)
366 parser.parse('/etc/tuxbox/satellites.xml')
367 if (self.hasNimType(self.nimType["DVB-C"])):
368 print "Reading cables.xml"
369 cabHandler = self.parseCables(self.cablesList, self.transponderscable)
370 parser.setContentHandler(cabHandler)
371 parser.parse('/etc/tuxbox/cables.xml')
373 if (self.hasNimType(self.nimType["DVB-T"])):
374 print "Reading terrestrial.xml"
375 terHandler = self.parseTerrestrials(self.terrestrialsList, self.transpondersterrestrial)
376 parser.setContentHandler(terHandler)
377 parser.parse('/etc/tuxbox/terrestrial.xml')
382 self.nimSocketCount = 0
383 nimfile = tryOpen("/proc/bus/nim_sockets")
386 return self.nimType["empty/unknown"]
391 line = nimfile.readline()
394 if line.strip().startswith("NIM Socket"):
395 parts = line.strip().split(" ")
396 id = int(parts[2][:1])
398 self.nimSocketCount += 1
399 elif line.strip().startswith("Type:"):
400 self.nimTypes[lastsocket] = str(line.strip()[6:])
401 elif line.strip().startswith("Name:"):
402 self.nimNames[lastsocket] = str(line.strip()[6:])
403 elif line.strip().startswith("empty"):
404 self.nimNames[lastsocket] = _("N/A")
405 self.nimTypes[lastsocket] = "empty/unknown"
409 def getNimType(self, slotID):
410 if slotID >= self.nimCount:
411 return "empty/unknown"
413 return self.nimType[self.nimTypes[slotID]]
415 def getNimName(self, slotID):
416 return self.nimNames[slotID]
418 def getNimSocketCount(self):
419 return self.nimSocketCount
421 def hasNimType(self, chktype):
422 for id, type in self.nimTypes.items():
423 if (chktype == self.nimType[str(type)]):
427 def getNimListOfType(self, type, exception = -1):
429 for x in self.nimslots:
430 if ((x.nimType == type) and (x.slotid != exception)):
431 list.append(x.slotid)
434 def getConfigPrefix(self, slotid):
435 return "config.Nim" + ("A","B","C","D")[slotid] + "."
439 self.nimType = { "empty/unknown": -1,
445 self.terrestrialsList = []
449 self.readSatsfromFile()
451 self.nimCount = self.getNimSocketCount()
455 while x < self.nimCount:
456 tType = self.getNimType(x)
457 tName = self.getNimName(x)
458 tNim = nimSlot(x, tType, tName)
459 self.nimslots.append(tNim)
462 InitNimManager(self) #init config stuff
466 for slot in self.nimslots:
467 nimText = _("Socket ") + ("A", "B", "C", "D")[slot.slotid] + ": "
468 if slot.nimType == -1:
469 nimText += _("empty/unknown")
471 nimText += slot.name + " ("
472 nimText += ("DVB-S", "DVB-C", "DVB-T")[slot.nimType] + ")"
473 list.append((nimText, slot))
476 def getSatListForNim(self, slotid):
478 if (self.getNimType(slotid) != self.nimType["empty/unknown"]):
479 #print "slotid:", slotid
481 #print "self.satellites:", self.satList[config.Nims[slotid].diseqcA.value]
482 #print "diseqcA:", config.Nims[slotid].diseqcA.value
483 if (config.Nims[slotid].diseqcMode.value <= 3):
484 list.append(self.satList[config.Nims[slotid].diseqcA.value])
485 if (0 < config.Nims[slotid].diseqcMode.value <= 3):
486 list.append(self.satList[config.Nims[slotid].diseqcB.value])
487 if (config.Nims[slotid].diseqcMode.value == 3):
488 list.append(self.satList[config.Nims[slotid].diseqcC.value])
489 list.append(self.satList[config.Nims[slotid].diseqcD.value])
490 if (config.Nims[slotid].diseqcMode.value == 4):
491 for x in self.satList:
495 #callbacks for c++ config
496 def nimConfigModeChanged(self, slotid, mode):
497 if (mode != 2): # not linked
498 print "Unlinking slot " + str(slotid)
499 # TODO call c++ to unlink nim in slot slotid
500 if (mode == 2): # linked
503 #if (len(self.getNimListOfType(self.nimType["DVB-S"], slotid)) > 0):
504 # print "Linking slot " + str(slotid) + " to " + str(nimmgr.getConfigPrefix(slotid).value)
505 # TODO call c++ to link nim in slot slotid with nim in slot nimmgr.getConfigPrefix(slotid).value
506 def nimLinkedToChanged(self, slotid, val):
507 print "Linking slot " + str(slotid) + " to " + str(val)
509 def nimDiseqcModeChanged(self, slotid, mode):
510 #print "nimDiseqcModeChanged set to " + str(mode)
512 def nimPortAChanged(self, slotid, val):
513 #print "nimDiseqcA set to " + str(slotid) + " val:" + str(val)
515 def nimPortBChanged(self, slotid, val):
516 #print "nimDiseqcA set to " + str(slotid) + " val:" + str(val)
517 #print "nimDiseqcB set to " + str(val)
519 def nimPortCChanged(self, slotid, val):
520 #print "nimDiseqcC set to " + str(val)
522 def nimPortDChanged(self, slotid, val):
523 #print "nimDiseqcD set to " + str(val)
526 def InitNimManager(nimmgr):
528 for x in range(nimmgr.nimCount):
529 config.Nims.append(ConfigSubsection())
531 def nimConfigModeChanged(slotid, configElement):
532 nimmgr.nimConfigModeChanged(slotid, configElement.value)
533 def nimLinkedToChanged(slotid, configElement):
534 nimmgr.nimLinkedToChanged(slotid, configElement.value)
535 def nimDiseqcModeChanged(slotid, configElement):
536 nimmgr.nimDiseqcModeChanged(slotid, configElement.value)
538 def nimPortAChanged(slotid, configElement):
539 nimmgr.nimPortAChanged(slotid, configElement.vals[configElement.value][1])
540 def nimPortBChanged(slotid, configElement):
541 nimmgr.nimPortBChanged(slotid, configElement.vals[configElement.value][1])
542 def nimPortCChanged(slotid, configElement):
543 nimmgr.nimPortCChanged(slotid, configElement.vals[configElement.value][1])
544 def nimPortDChanged(slotid, configElement):
545 nimmgr.nimPortDChanged(slotid, configElement.vals[configElement.value][1])
547 for slot in nimmgr.nimslots:
549 cname = nimmgr.getConfigPrefix(x)
552 if slot.nimType == nimmgr.nimType["DVB-S"]:
554 nim.configMode = configElement(cname + "configMode", configSelection, 0, (("simple", _("Simple")), ("advanced", _("Advanced"))))
556 nim.configMode = configElement(cname + "configMode", configSelection, 0, (("simple", _("Simple")), ("nothing", _("Nothing connected")), ("loopthrough", _("Loopthrough to Socket A")), ("advanced", _("Advanced"))))
558 #important - check if just the 2nd one is LT only and the first one is DVB-S
559 if currentConfigSelectionElement(nim.configMode) == "loopthrough": #linked
560 if x == 0: #first one can never be linked to anything
561 nim.configMode.value = getConfigSelectionElement(nim.configMode, "simple") #reset to simple
562 nim.configMode.save()
564 #FIXME: make it better
565 for y in nimmgr.nimslots:
567 if y.nimType != nimmgr.nimType["DVB-S"]:
568 nim.configMode.value = getConfigSelectionElement(nim.configMode, "simple") #reset to simple
569 nim.configMode.save()
571 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"))));
572 nim.diseqcA = configElement(cname + "diseqcA", configSatlist, 192, nimmgr.satList);
573 nim.diseqcB = configElement(cname + "diseqcB", configSatlist, 130, nimmgr.satList);
574 nim.diseqcC = configElement(cname + "diseqcC", configSatlist, 0, nimmgr.satList);
575 nim.diseqcD = configElement(cname + "diseqcD", configSatlist, 0, nimmgr.satList);
576 nim.positionerMode = configElement(cname + "positionerMode", configSelection, 0, (("usals", _("USALS")), ("manual", _("manual"))));
577 nim.longitude = configElement(cname + "longitude", configSequence, [5,100], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
578 nim.longitudeOrientation = configElement(cname + "longitudeOrientation", configSelection, 0, (_("East"), _("West")))
579 nim.latitude = configElement(cname + "latitude", configSequence, [50,767], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
580 nim.latitudeOrientation = configElement(cname + "latitudeOrientation", configSelection, 0, (("north", _("North")), ("south", _("South"))))
581 satNimList = nimmgr.getNimListOfType(nimmgr.nimType["DVB-S"], slot.slotid)
584 satNimListNames.append((("Slot_" + ("A", "B", "C", "D")[x] + "_" + nimmgr.getNimName(x)), _("Slot ") + ("A", "B", "C", "D")[x] + ": " + nimmgr.getNimName(x)))
585 nim.linkedTo = configElement(cname + "linkedTo", configSelection, 0, satNimListNames);
587 #perhaps the instance of the slot is more useful?
588 nim.configMode.addNotifier(boundFunction(nimConfigModeChanged,x))
589 nim.diseqcMode.addNotifier(boundFunction(nimDiseqcModeChanged,x))
590 nim.diseqcA.addNotifier(boundFunction(nimPortAChanged,int(x)))
591 nim.diseqcB.addNotifier(boundFunction(nimPortBChanged,x))
592 nim.diseqcC.addNotifier(boundFunction(nimPortCChanged,x))
593 nim.diseqcD.addNotifier(boundFunction(nimPortDChanged,x))
594 nim.linkedTo.addNotifier(boundFunction(nimLinkedToChanged,x))
597 nim.advanced = ConfigSubsection()
598 nim.advanced.sats = configElement(cname + "advanced.sats", configSatlist, 192, nimmgr.satList);
599 nim.advanced.sat = {}
600 lnbs = ["not available"]
601 for y in range(1, 33):
602 lnbs.append("LNB " + str(y))
603 for x in nimmgr.satList:
604 nim.advanced.sat[x[1]] = ConfigSubsection()
605 nim.advanced.sat[x[1]].voltage = configElement(cname + "advanced.sat" + str(x[1]) + ".voltage", configSelection, 0, (("polarization", _("Polarization")), ("13V", _("13 V")), ("18V", _("18 V"))))
606 nim.advanced.sat[x[1]].tonemode = configElement(cname + "advanced.sat" + str(x[1]) + ".tonemode", configSelection, 0, (("band", _("Band")), ("on", _("On")), ("off", _("Off"))))
607 nim.advanced.sat[x[1]].usals = configElement(cname + "advanced.sat" + str(x[1]) + ".usals", configSelection, 0, (("yes", _("Yes")), ("no", _("No"))))
608 nim.advanced.sat[x[1]].rotorposition = configElement(cname + "advanced.sat" + str(x[1]) + ".rotorposition", configSequence, [1], configsequencearg.get("INTEGER", (1, 255)))
609 nim.advanced.sat[x[1]].lnb = configElement(cname + "advanced.sat" + str(x[1]) + ".lnb", configSelection, 0, lnbs)
611 nim.advanced.lnb = [0]
612 for x in range(1, 33):
613 nim.advanced.lnb.append(ConfigSubsection())
614 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"))))
615 nim.advanced.lnb[x].lofl = configElement(cname + "advanced.lnb" + str(x) + ".lofl", configSequence, [9750], configsequencearg.get("INTEGER", (0, 99999)))
616 nim.advanced.lnb[x].lofh = configElement(cname + "advanced.lnb" + str(x) + ".lofh", configSequence, [10600], configsequencearg.get("INTEGER", (0, 99999)))
617 nim.advanced.lnb[x].threshold = configElement(cname + "advanced.lnb" + str(x) + ".threshold", configSequence, [11750], configsequencearg.get("INTEGER", (0, 99999)))
618 nim.advanced.lnb[x].output_12v = configElement(cname + "advanced.lnb" + str(x) + ".output_12v", configSelection, 0, (("0V", _("0 V")), ("12V", _("12 V"))))
619 nim.advanced.lnb[x].increased_voltage = configElement(cname + "advanced.lnb" + str(x) + ".increased_voltage", configSelection, 0, (("no", _("No")), ("yes", _("Yes"))))
620 nim.advanced.lnb[x].toneburst = configElement(cname + "advanced.lnb" + str(x) + ".toneburst", configSelection, 0, (("none", _("None")), ("A", _("A")), ("B", _("B"))))
621 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"))))
622 nim.advanced.lnb[x].commitedDiseqcCommand = configElement(cname + "advanced.lnb" + str(x) + ".commitedDiseqcCommand", configSelection, 0, (("none", _("None")), ("AA", _("AA")), ("AB", _("AB")), ("BA", _("BA")), ("BB", _("BB"))))
623 nim.advanced.lnb[x].fastDiseqc = configElement(cname + "advanced.lnb" + str(x) + ".fastDiseqc", configSelection, 0, (("no", _("No")), ("yes", _("Yes"))))
624 nim.advanced.lnb[x].sequenceRepeat = configElement(cname + "advanced.lnb" + str(x) + ".sequenceRepeat", configSelection, 0, (("no", _("No")), ("yes", _("Yes"))))
625 nim.advanced.lnb[x].commandOrder1_0 = configElement(cname + "advanced.lnb" + str(x) + ".commandOrder1_0", configSelection, 0, ("committed, toneburst", "toneburst, committed"))
626 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"))
628 for y in range(1, 17):
629 disCmd.append("Input " + str(y))
630 nim.advanced.lnb[x].uncommittedDiseqcCommand = configElement(cname + "advanced.lnb" + str(x) + ".uncommittedDiseqcCommand", configSelection, 0, disCmd)
631 nim.advanced.lnb[x].diseqcRepeats = configElement(cname + "advanced.lnb" + str(x) + ".diseqcRepeats", configSelection, 0, (("none", _("None")), ("one", _("One")), ("two", _("Two")), ("three", _("Three"))))
632 nim.advanced.lnb[x].longitude = configElement(cname + "advanced.lnb" + str(x) + ".longitude", configSequence, [5,100], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
633 nim.advanced.lnb[x].longitudeOrientation = configElement(cname + "advanced.lnb" + str(x) + ".longitudeOrientation", configSelection, 0, (_("East"), _("West")))
634 nim.advanced.lnb[x].latitude = configElement(cname + "advanced.lnb" + str(x) + ".latitude", configSequence, [50,767], configsequencearg.get("FLOAT", [(0,90),(0,999)]));
635 nim.advanced.lnb[x].latitudeOrientation = configElement(cname + "advanced.lnb" + str(x) + ".latitudeOrientation", configSelection, 0, (("north", _("North")), ("south", _("South"))))
636 nim.advanced.lnb[x].powerMeasurement = configElement(cname + "advanced.lnb" + str(x) + ".powerMeasurement", configSelection, 0, (("yes", _("Yes")), ("no", _("No"))))
637 nim.advanced.lnb[x].powerThreshold = configElement(cname + "advanced.lnb" + str(x) + ".powerThreshold", configSequence, [50], configsequencearg.get("INTEGER", (0, 100)))
638 elif slot.nimType == nimmgr.nimType["DVB-C"]:
639 nim.cable = configElement(cname + "cable", configSelection, 0, nimmgr.cablesList);
640 elif slot.nimType == nimmgr.nimType["DVB-T"]:
641 nim.cable = configElement(cname + "terrestrial", configSelection, 0, nimmgr.terrestrialsList);
643 print "pls add support for this frontend type!"
645 nimmgr.sec = SecConfigure(nimmgr)
647 nimmanager = NimManager()