1 from Screens.Satconfig import NimSelection
2 from Screens.Screen import Screen
3 from Screens.TextBox import TextBox
4 from Screens.MessageBox import MessageBox
6 from Plugins.Plugin import PluginDescriptor
8 from Components.ActionMap import ActionMap, NumberActionMap
9 from Components.NimManager import nimmanager
10 from Components.ResourceManager import resourcemanager
11 from Components.Sources.FrontendStatus import FrontendStatus
12 from Components.TuneTest import TuneTest
13 from Components.Sources.List import List
14 from Components.Sources.Progress import Progress
15 from Components.Sources.StaticText import StaticText
16 from Components.ConfigList import ConfigListScreen
17 from Components.config import getConfigListEntry, ConfigSelection, ConfigYesNo
18 from Components.Harddisk import harddiskmanager
24 # setResultParameter(parameter)
33 def setResultType(self, type):
36 def setResultParameter(self, parameter):
37 if self.type == self.TYPE_BYORBPOS:
38 self.orbpos = parameter
39 elif self.type == self.TYPE_BYINDEX:
40 self.index = parameter
42 def getTextualResultForIndex(self, index, logfulltransponders = False):
44 text += "%s:\n" % self.getTextualIndexRepresentation(index)
46 failed, successful = self.results[index]["failed"], self.results[index]["successful"]
47 countfailed = len(failed)
48 countsuccessful = len(successful)
49 countall = countfailed + countsuccessful
50 percentfailed = round(countfailed / float(countall + 0.0001) * 100)
51 percentsuccessful = round(countsuccessful / float(countall + 0.0001) * 100)
52 text += "Tested %d transponders\n%d (%d %%) transponders succeeded\n%d (%d %%) transponders failed\n" % (countall, countsuccessful, percentsuccessful, countfailed, percentfailed)
56 for transponder in failed:
57 completelist.append({"transponder": transponder[0], "fedata": transponder[-1]})
58 reasons[transponder[2]] = reasons.get(transponder[2], [])
59 reasons[transponder[2]].append(transponder)
60 if transponder[2] == "pids_failed":
61 print transponder[2], "-", transponder[3]
63 text += "The %d unsuccessful tuning attempts failed for the following reasons:\n" % countfailed
65 for reason in reasons.keys():
66 text += "%s: %d transponders failed\n" % (reason, len(reasons[reason]))
68 for reason in reasons.keys():
70 text += "%s previous planes:\n" % reason
71 for transponder in reasons[reason]:
72 if transponder[1] is not None:
73 text += self.getTextualIndexRepresentation(self.getIndexForTransponder(transponder[1]))
75 text += "No transponder tuned"
76 text += " ==> " + self.getTextualIndexRepresentation(self.getIndexForTransponder(transponder[0]))
78 if logfulltransponders:
79 text += str(transponder[1])
81 text += str(transponder[0])
83 if reason == "pids_failed":
84 text += "(tsid, onid): "
85 text += str(transponder[3]['real'])
86 text += "(read from sat) != "
87 text += str(transponder[3]['expected'])
88 text += "(read from file)"
91 if countsuccessful > 0:
93 text += "Successfully tuned transponders' previous planes:\n"
94 for transponder in successful:
95 completelist.append({"transponder": transponder[0], "fedata": transponder[-1]})
96 if transponder[1] is not None:
97 text += self.getTextualIndexRepresentation(self.getIndexForTransponder(transponder[1]))
99 text += "No transponder tuned"
100 text += " ==> " + self.getTextualIndexRepresentation(self.getIndexForTransponder(transponder[0]))
103 text += "------------------------------------------------\n"
104 text += "complete transponderlist:\n"
105 for entry in completelist:
106 text += str(entry["transponder"]) + " -- " + str(entry["fedata"]) + "\n"
109 def getTextualResult(self):
111 if self.type == self.TYPE_BYINDEX:
112 text += self.getTextualResultForIndex(self.index)
113 elif self.type == self.TYPE_BYORBPOS:
114 for index in self.results.keys():
115 if index[2] == self.orbpos:
116 text += self.getTextualResultForIndex(index)
117 text += "\n-----------------------------------------------------\n"
118 elif self.type == self.TYPE_ALL:
120 for index in self.results.keys():
122 orderedResults[orbpos] = orderedResults.get(orbpos, [])
123 orderedResults[orbpos].append(index)
124 ordered_orbpos = orderedResults.keys()
125 ordered_orbpos.sort()
126 for orbpos in ordered_orbpos:
127 text += "\n*****************************************\n"
128 text += "Orbital position %s:" % str(orbpos)
129 text += "\n*****************************************\n"
130 for index in orderedResults[orbpos]:
131 text += self.getTextualResultForIndex(index, logfulltransponders = True)
132 text += "\n-----------------------------------------------------\n"
137 class DiseqcTester(Screen, TuneTest, ResultParser):
139 <screen position="90,100" size="520,400" title="DiSEqC Tester" >
140 <!--ePixmap pixmap="skin_default/icons/dish_scan.png" position="5,25" zPosition="0" size="119,110" transparent="1" alphatest="on" />
141 <widget source="Frontend" render="Label" position="190,10" zPosition="2" size="260,20" font="Regular;19" halign="center" valign="center" transparent="1">
142 <convert type="FrontendInfo">SNRdB</convert>
144 <eLabel name="snr" text="SNR:" position="120,35" size="60,22" font="Regular;21" halign="right" transparent="1" />
145 <widget source="Frontend" render="Progress" position="190,35" size="260,20" pixmap="skin_default/bar_snr.png" borderWidth="2" borderColor="#cccccc">
146 <convert type="FrontendInfo">SNR</convert>
148 <widget source="Frontend" render="Label" position="460,35" size="60,22" font="Regular;21">
149 <convert type="FrontendInfo">SNR</convert>
151 <eLabel name="agc" text="AGC:" position="120,60" size="60,22" font="Regular;21" halign="right" transparent="1" />
152 <widget source="Frontend" render="Progress" position="190,60" size="260,20" pixmap="skin_default/bar_snr.png" borderWidth="2" borderColor="#cccccc">
153 <convert type="FrontendInfo">AGC</convert>
155 <widget source="Frontend" render="Label" position="460,60" size="60,22" font="Regular;21">
156 <convert type="FrontendInfo">AGC</convert>
158 <eLabel name="ber" text="BER:" position="120,85" size="60,22" font="Regular;21" halign="right" transparent="1" />
159 <widget source="Frontend" render="Progress" position="190,85" size="260,20" pixmap="skin_default/bar_ber.png" borderWidth="2" borderColor="#cccccc">
160 <convert type="FrontendInfo">BER</convert>
162 <widget source="Frontend" render="Label" position="460,85" size="60,22" font="Regular;21">
163 <convert type="FrontendInfo">BER</convert>
165 <eLabel name="lock" text="Lock:" position="120,115" size="60,22" font="Regular;21" halign="right" />
166 <widget source="Frontend" render="Pixmap" pixmap="skin_default/icons/lock_on.png" position="190,110" zPosition="1" size="38,31" alphatest="on">
167 <convert type="FrontendInfo">LOCK</convert>
168 <convert type="ConditionalShowHide" />
170 <widget source="Frontend" render="Pixmap" pixmap="skin_default/icons/lock_off.png" position="190,110" zPosition="1" size="38,31" alphatest="on">
171 <convert type="FrontendInfo">LOCK</convert>
172 <convert type="ConditionalShowHide">Invert</convert>
174 <widget source="progress_list" render="Listbox" position="0,0" size="510,150" scrollbarMode="showOnDemand">
175 <convert type="TemplatedMultiContent">
177 MultiContentEntryText(pos = (10, 0), size = (330, 25), flags = RT_HALIGN_LEFT, text = 1), # index 1 is the index name,
178 MultiContentEntryText(pos = (330, 0), size = (150, 25), flags = RT_HALIGN_RIGHT, text = 2) # index 2 is the status,
180 "fonts": [gFont("Regular", 20)],
185 <eLabel name="overall_progress" text="Overall progress:" position="20,162" size="480,22" font="Regular;21" halign="center" transparent="1" />
186 <widget source="overall_progress" render="Progress" position="20,192" size="480,20" borderWidth="2" backgroundColor="#254f7497" />
187 <eLabel name="overall_progress" text="Progress:" position="20,222" size="480,22" font="Regular;21" halign="center" transparent="1" />
188 <widget source="sub_progress" render="Progress" position="20,252" size="480,20" borderWidth="2" backgroundColor="#254f7497" />
190 <eLabel name="" text="Failed:" position="20,282" size="140,22" font="Regular;21" halign="left" transparent="1" />
191 <widget source="failed_counter" render="Label" position="160,282" size="100,20" font="Regular;21" />
193 <eLabel name="" text="Succeeded:" position="20,312" size="140,22" font="Regular;21" halign="left" transparent="1" />
194 <widget source="succeeded_counter" render="Label" position="160,312" size="100,20" font="Regular;21" />
196 <eLabel name="" text="With errors:" position="20,342" size="140,22" font="Regular;21" halign="left" transparent="1" />
197 <widget source="witherrors_counter" render="Label" position="160,342" size="100,20" font="Regular;21" />
199 <eLabel name="" text="Not tested:" position="20,372" size="140,22" font="Regular;21" halign="left" transparent="1" />
200 <widget source="untestable_counter" render="Label" position="160,372" size="100,20" font="Regular;21" />
202 <widget source="CmdText" render="Label" position="300,282" size="180,200" font="Regular;21" />
207 TEST_TYPE_COMPLETE = 2
208 def __init__(self, session, feid, test_type = TEST_TYPE_QUICK, loopsfailed = 3, loopssuccessful = 1, log = False):
209 Screen.__init__(self, session)
211 self.test_type = test_type
212 self.loopsfailed = loopsfailed
213 self.loopssuccessful = loopssuccessful
216 self["actions"] = NumberActionMap(["SetupActions"],
219 "cancel": self.keyCancel,
222 TuneTest.__init__(self, feid, stopOnSuccess = self.loopssuccessful, stopOnError = self.loopsfailed)
223 #self["Frontend"] = FrontendStatus(frontend_source = lambda : self.frontend, update_interval = 100)
224 self["overall_progress"] = Progress()
225 self["sub_progress"] = Progress()
227 self["failed_counter"] = StaticText("0")
228 self["succeeded_counter"] = StaticText("0")
229 self["witherrors_counter"] = StaticText("0")
230 self["untestable_counter"] = StaticText("0")
233 self["progress_list"] = List(self.list)
234 self["progress_list"].onSelectionChanged.append(self.selectionChanged)
236 self["CmdText"] = StaticText(_("Please wait while scanning is in progress..."))
239 self.readTransponderList()
244 self.resultsstatus = {}
246 self.onLayoutFinish.append(self.go)
248 def getProgressListComponent(self, index, status):
249 return (index, self.getTextualIndexRepresentation(index), status)
251 def clearProgressList(self):
253 self["progress_list"].list = self.list
255 def addProgressListItem(self, index):
256 if index in self.indexlist:
257 for entry in self.list:
258 if entry[0] == index:
259 self.changeProgressListStatus(index, "working")
261 self.list.append(self.getProgressListComponent(index, _("working")))
262 self["progress_list"].list = self.list
263 self["progress_list"].setIndex(len(self.list) - 1)
265 def changeProgressListStatus(self, index, status):
269 for entry in self.list:
270 if entry[0] == index:
271 self.newlist.append(self.getProgressListComponent(index, status))
274 self.newlist.append(entry)
276 self.list = self.newlist
277 self["progress_list"].list = self.list
278 self["progress_list"].setIndex(indexpos)
280 def readTransponderList(self):
281 for sat in nimmanager.getSatListForNim(self.feid):
282 for transponder in nimmanager.getTransponders(sat[0]):
284 mytransponder = (transponder[1] / 1000, transponder[2] / 1000, transponder[3], transponder[4], transponder[7], sat[0], transponder[5], transponder[6], transponder[8], transponder[9], transponder[10], transponder[11])
285 self.analyseTransponder(mytransponder)
287 def getIndexForTransponder(self, transponder):
289 if transponder[0] < 11700:
294 polarisation = transponder[2]
298 index = (band, polarisation, sat)
301 # sort the transponder into self.transponderlist
302 def analyseTransponder(self, transponder):
303 index = self.getIndexForTransponder(transponder)
304 if index not in self.indexlist:
305 self.indexlist[index] = []
306 self.indexlist[index].append(transponder)
307 #print "self.indexlist:", self.indexlist
309 # returns a string for the user representing a human readable output for index
310 def getTextualIndexRepresentation(self, index):
311 print "getTextualIndexRepresentation:", index
314 text += nimmanager.getSatDescription(index[2]) + ", "
319 text += "High Band, "
327 def fillTransponderList(self):
328 self.clearTransponder()
329 print "----------- fillTransponderList"
330 print "index:", self.currentlyTestedIndex
331 keys = self.indexlist.keys()
332 if self.getContinueScanning():
333 print "index:", self.getTextualIndexRepresentation(self.currentlyTestedIndex)
334 for transponder in self.indexlist[self.currentlyTestedIndex]:
335 self.addTransponder(transponder)
336 print "transponderList:", self.transponderlist
341 def progressCallback(self, progress):
342 if progress[0] != self["sub_progress"].getRange():
343 self["sub_progress"].setRange(progress[0])
344 self["sub_progress"].setValue(progress[1])
346 # logic for scanning order of transponders
347 # on go getFirstIndex is called
348 def getFirstIndex(self):
349 # TODO use other function to scan more randomly
350 if self.test_type == self.TEST_TYPE_QUICK:
352 keys = self.indexlist.keys()
353 keys.sort(key = lambda a: a[2]) # sort by orbpos
354 self["overall_progress"].setRange(len(keys))
355 self["overall_progress"].setValue(self.myindex)
357 elif self.test_type == self.TEST_TYPE_RANDOM:
358 self.randomkeys = self.indexlist.keys()
359 random.shuffle(self.randomkeys)
361 self["overall_progress"].setRange(len(self.randomkeys))
362 self["overall_progress"].setValue(self.myindex)
363 return self.randomkeys[0]
364 elif self.test_type == self.TEST_TYPE_COMPLETE:
365 keys = self.indexlist.keys()
369 successorindex[index] = []
370 for otherindex in keys:
371 if otherindex != index:
372 successorindex[index].append(otherindex)
373 random.shuffle(successorindex[index])
378 if currindex is None or len(successorindex[currindex]) == 0:
380 for index in successorindex.keys():
381 if len(successorindex[index]) > 0:
383 self.keylist.append(currindex)
385 if currindex == oldindex:
388 currindex = successorindex[currindex].pop()
389 self.keylist.append(currindex)
390 print "self.keylist:", self.keylist
392 self["overall_progress"].setRange(len(self.keylist))
393 self["overall_progress"].setValue(self.myindex)
394 return self.keylist[0]
397 # after each index is finished, getNextIndex is called to get the next index to scan
398 def getNextIndex(self):
399 # TODO use other function to scan more randomly
400 if self.test_type == self.TEST_TYPE_QUICK:
402 keys = self.indexlist.keys()
403 keys.sort(key = lambda a: a[2]) # sort by orbpos
405 self["overall_progress"].setValue(self.myindex)
406 if self.myindex < len(keys):
407 return keys[self.myindex]
410 elif self.test_type == self.TEST_TYPE_RANDOM:
412 keys = self.randomkeys
414 self["overall_progress"].setValue(self.myindex)
415 if self.myindex < len(keys):
416 return keys[self.myindex]
419 elif self.test_type == self.TEST_TYPE_COMPLETE:
423 self["overall_progress"].setValue(self.myindex)
424 if self.myindex < len(keys):
425 return keys[self.myindex]
429 # after each index is finished and the next index is returned by getNextIndex
430 # the algorithm checks, if we should continue scanning
431 def getContinueScanning(self):
432 if self.test_type == self.TEST_TYPE_QUICK or self.test_type == self.TEST_TYPE_RANDOM:
433 return (self.myindex < len(self.indexlist.keys()))
434 elif self.test_type == self.TEST_TYPE_COMPLETE:
435 return (self.myindex < len(self.keylist))
437 def addResult(self, index, status, failedTune, successfullyTune):
438 self.results[index] = self.results.get(index, {"failed": [], "successful": [], "status": None, "internalstatus": None})
439 self.resultsstatus[status] = self.resultsstatus.get(status, [])
441 oldstatus = self.results[index]["internalstatus"]
442 if oldstatus is None:
443 self.results[index]["status"] = status
444 elif oldstatus == "successful":
445 if status == "failed":
446 self.results[index]["status"] = "with_errors"
447 elif status == "successful":
448 self.results[index]["status"] = oldstatus
449 elif status == "with_errors":
450 self.results[index]["status"] = "with_errors"
451 elif status == "not_tested":
452 self.results[index]["status"] = oldstatus
453 elif oldstatus == "failed":
454 if status == "failed":
455 self.results[index]["status"] = oldstatus
456 elif status == "successful":
457 self.results[index]["status"] = "with_errors"
458 elif status == "with_errors":
459 self.results[index]["status"] = "with_errors"
460 elif status == "not_tested":
461 self.results[index]["status"] = oldstatus
462 elif oldstatus == "with_errors":
463 if status == "failed":
464 self.results[index]["status"] = oldstatus
465 elif status == "successful":
466 self.results[index]["status"] = oldstatus
467 elif status == "with_errors":
468 self.results[index]["status"] = oldstatus
469 elif status == "not_tested":
470 self.results[index]["status"] = oldstatus
471 elif oldstatus == "not_tested":
472 self.results[index]["status"] = status
474 if self.results[index]["status"] != "working":
475 self.results[index]["internalstatus"] = self.results[index]["status"]
476 self.results[index]["failed"] = failedTune + self.results[index]["failed"]
477 self.results[index]["successful"] = successfullyTune + self.results[index]["successful"]
479 self.resultsstatus[status].append(index)
481 def finishedChecking(self):
482 print "finishedChecking"
483 TuneTest.finishedChecking(self)
485 if not self.results.has_key(self.currentlyTestedIndex):
486 self.results[self.currentlyTestedIndex] = {"failed": [], "successful": [], "status": None, "internalstatus": None}
488 if len(self.failedTune) > 0 and len(self.successfullyTune) > 0:
489 self.changeProgressListStatus(self.currentlyTestedIndex, "with errors")
490 self["witherrors_counter"].setText(str(int(self["witherrors_counter"].getText()) + 1))
491 self.addResult(self.currentlyTestedIndex, "with_errors", self.failedTune, self.successfullyTune)
492 elif len(self.failedTune) == 0 and len(self.successfullyTune) == 0:
493 self.changeProgressListStatus(self.currentlyTestedIndex, "not tested")
494 self["untestable_counter"].setText(str(int(self["untestable_counter"].getText()) + 1))
495 self.addResult(self.currentlyTestedIndex, "untestable", self.failedTune, self.successfullyTune)
496 elif len(self.failedTune) > 0:
497 self.changeProgressListStatus(self.currentlyTestedIndex, "failed")
498 #self["failed_counter"].setText(str(int(self["failed_counter"].getText()) + len(self.failedTune)))
499 self["failed_counter"].setText(str(int(self["failed_counter"].getText()) + 1))
500 self.addResult(self.currentlyTestedIndex, "failed", self.failedTune, self.successfullyTune)
502 self.changeProgressListStatus(self.currentlyTestedIndex, "successful")
503 #self["succeeded_counter"].setText(str(int(self["succeeded_counter"].getText()) + len(self.successfullyTune)))
504 self["succeeded_counter"].setText(str(int(self["succeeded_counter"].getText()) + 1))
505 self.addResult(self.currentlyTestedIndex, "successful", self.failedTune, self.successfullyTune)
508 #self["failed_counter"].setText(str(int(self["failed_counter"].getText()) + len(self.failedTune)))
509 #self["succeeded_counter"].setText(str(int(self["succeeded_counter"].getText()) + len(self.successfullyTune)))
510 #if len(self.failedTune) == 0 and len(self.successfullyTune) == 0:
511 #self["untestable_counter"].setText(str(int(self["untestable_counter"].getText()) + 1))
513 self.currentlyTestedIndex = self.getNextIndex()
514 self.addProgressListItem(self.currentlyTestedIndex)
516 if self.fillTransponderList():
517 self.run(checkPIDs = True)
520 self["progress_list"].setIndex(0)
521 print "results:", self.results
522 print "resultsstatus:", self.resultsstatus
524 file = open("/media/hdd/diseqctester.log", "w")
525 self.setResultType(ResultParser.TYPE_ALL)
526 file.write(self.getTextualResult())
528 self.session.open(MessageBox, text=_("The results have been written to %s.") % "/media/hdd/diseqctester.log", type = MessageBox.TYPE_INFO)
532 self["failed_counter"].setText("0")
533 self["succeeded_counter"].setText("0")
534 self["untestable_counter"].setText("0")
535 self.currentlyTestedIndex = self.getFirstIndex()
537 self.clearProgressList()
538 self.addProgressListItem(self.currentlyTestedIndex)
540 if self.fillTransponderList():
547 print "selectedIndex:", self["progress_list"].getCurrent()[0]
549 index = self["progress_list"].getCurrent()[0]
550 #self.setResultType(ResultParser.TYPE_BYORBPOS)
551 #self.setResultParameter(index[2])
552 self.setResultType(ResultParser.TYPE_BYINDEX)
553 self.setResultParameter(index)
554 #self.setResultType(ResultParser.TYPE_ALL)
555 self.session.open(TextBox, self.getTextualResult())
557 def selectionChanged(self):
558 print "selection changed"
559 if len(self.list) > 0 and not self.running:
560 self["CmdText"].setText(_("Press OK to get further details for %s") % str(self["progress_list"].getCurrent()[1]))
562 class DiseqcTesterTestTypeSelection(Screen, ConfigListScreen):
564 def __init__(self, session, feid):
565 Screen.__init__(self, session)
566 # for the skin: first try MediaPlayerSettings, then Setup, this allows individual skinning
567 self.skinName = ["DiseqcTesterTestTypeSelection", "Setup" ]
568 self.setup_title = _("DiSEqC-Tester settings")
569 self.onChangedEntry = [ ]
573 ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.changedEntry)
575 self["actions"] = ActionMap(["SetupActions"],
577 "cancel": self.keyCancel,
582 self["key_red"] = StaticText(_("Cancel"))
583 self["key_green"] = StaticText(_("OK"))
586 self.onLayoutFinish.append(self.layoutFinished)
588 def layoutFinished(self):
589 self.setTitle(self.setup_title)
591 def createSetup(self):
592 self.testtype = ConfigSelection(choices={"quick": _("Quick"), "random": _("Random"), "complete": _("Complete")}, default = "quick")
593 self.testtypeEntry = getConfigListEntry(_("Test Type"), self.testtype)
594 self.list.append(self.testtypeEntry)
596 self.loopsfailed = ConfigSelection(choices={"-1": "Every known", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7", "8": "8"}, default = "3")
597 self.loopsfailedEntry = getConfigListEntry(_("Stop testing plane after # failed transponders"), self.loopsfailed)
598 self.list.append(self.loopsfailedEntry)
600 self.loopssuccessful = ConfigSelection(choices={"-1": "Every known", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7", "8": "8"}, default = "1")
601 self.loopssuccessfulEntry = getConfigListEntry(_("Stop testing plane after # successful transponders"), self.loopssuccessful)
602 self.list.append(self.loopssuccessfulEntry)
604 self.log = ConfigYesNo(False)
605 if harddiskmanager.HDDCount() > 0:
606 self.logEntry = getConfigListEntry(_("Log results to harddisk"), self.log)
607 self.list.append(self.logEntry)
609 self["config"].list = self.list
610 self["config"].l.setList(self.list)
613 print self.testtype.getValue()
614 testtype = DiseqcTester.TEST_TYPE_QUICK
615 if self.testtype.getValue() == "quick":
616 testtype = DiseqcTester.TEST_TYPE_QUICK
617 elif self.testtype.getValue() == "random":
618 testtype = DiseqcTester.TEST_TYPE_RANDOM
619 elif self.testtype.getValue() == "complete":
620 testtype = DiseqcTester.TEST_TYPE_COMPLETE
621 self.session.open(DiseqcTester, feid = self.feid, test_type = testtype, loopsfailed = int(self.loopsfailed.value), loopssuccessful = int(self.loopssuccessful.value), log = self.log.value)
627 def changedEntry(self):
628 for x in self.onChangedEntry:
631 def getCurrentEntry(self):
632 return self["config"].getCurrent()[0]
634 def getCurrentValue(self):
635 return str(self["config"].getCurrent()[1].getText())
637 def createSummary(self):
638 from Screens.Setup import SetupSummary
641 class DiseqcTesterNimSelection(NimSelection):
643 <screen position="160,123" size="400,330" title="Choose Tuner">
644 <widget source="nimlist" render="Listbox" position="0,0" size="380,300" scrollbarMode="showOnDemand">
645 <convert type="TemplatedMultiContent">
647 MultiContentEntryText(pos = (10, 5), size = (360, 30), flags = RT_HALIGN_LEFT, text = 1), # index 1 is the nim name,
648 MultiContentEntryText(pos = (50, 30), size = (320, 30), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is a description of the nim settings,
650 "fonts": [gFont("Regular", 20), gFont("Regular", 15)],
657 def __init__(self, session, args = None):
658 NimSelection.__init__(self, session)
660 def setResultClass(self):
661 #self.resultclass = DiseqcTester
662 self.resultclass = DiseqcTesterTestTypeSelection
664 def showNim(self, nim):
665 nimConfig = nimmanager.getNimConfig(nim.slot)
666 if nim.isCompatible("DVB-S"):
667 if nimConfig.configMode.value in ("loopthrough", "equal", "satposdepends", "nothing"):
669 if nimConfig.configMode.value == "simple":
670 if nimConfig.diseqcMode.value == "positioner":
675 def DiseqcTesterMain(session, **kwargs):
676 session.open(DiseqcTesterNimSelection)
678 def autostart(reason, **kwargs):
679 resourcemanager.addResource("DiseqcTester", DiseqcTesterMain)
681 def Plugins(**kwargs):
682 return [ PluginDescriptor(name="DiSEqC Tester", description=_("Test DiSEqC settings"), where = PluginDescriptor.WHERE_PLUGINMENU, needsRestart = False, fnc=DiseqcTesterMain),
683 PluginDescriptor(where = PluginDescriptor.WHERE_AUTOSTART, needsRestart = False, fnc = autostart)]