X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/574f425cc1ebece0aa5f09fb77a8cb7ad0310a1f..HEAD:/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py diff --git a/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py b/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py index a4793949..4dcf6c6b 100644 --- a/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py +++ b/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py @@ -51,8 +51,10 @@ class ResultParser: percentsuccessful = round(countsuccessful / float(countall + 0.0001) * 100) text += "Tested %d transponders\n%d (%d %%) transponders succeeded\n%d (%d %%) transponders failed\n" % (countall, countsuccessful, percentsuccessful, countfailed, percentfailed) reasons = {} + completelist = [] if countfailed > 0: for transponder in failed: + completelist.append({"transponder": transponder[0], "fedata": transponder[-1]}) reasons[transponder[2]] = reasons.get(transponder[2], []) reasons[transponder[2]].append(transponder) if transponder[2] == "pids_failed": @@ -78,16 +80,30 @@ class ResultParser: text += " ==> " text += str(transponder[0]) text += "\n" + if reason == "pids_failed": + text += "(tsid, onid): " + text += str(transponder[3]['real']) + text += "(read from sat) != " + text += str(transponder[3]['expected']) + text += "(read from file)" + text += "\n" + text += "\n" if countsuccessful > 0: text += "\n" text += "Successfully tuned transponders' previous planes:\n" for transponder in successful: + completelist.append({"transponder": transponder[0], "fedata": transponder[-1]}) if transponder[1] is not None: text += self.getTextualIndexRepresentation(self.getIndexForTransponder(transponder[1])) else: text += "No transponder tuned" text += " ==> " + self.getTextualIndexRepresentation(self.getIndexForTransponder(transponder[0])) text += "\n" + + text += "------------------------------------------------\n" + text += "complete transponderlist:\n" + for entry in completelist: + text += str(entry["transponder"]) + " -- " + str(entry["fedata"]) + "\n" return text def getTextualResult(self): @@ -544,24 +560,34 @@ class DiseqcTester(Screen, TuneTest, ResultParser): self["CmdText"].setText(_("Press OK to get further details for %s") % str(self["progress_list"].getCurrent()[1])) class DiseqcTesterTestTypeSelection(Screen, ConfigListScreen): - skin = """ - - - """ + def __init__(self, session, feid): Screen.__init__(self, session) + # for the skin: first try MediaPlayerSettings, then Setup, this allows individual skinning + self.skinName = ["DiseqcTesterTestTypeSelection", "Setup" ] + self.setup_title = _("DiSEqC-Tester settings") + self.onChangedEntry = [ ] self.feid = feid self.list = [] - ConfigListScreen.__init__(self, self.list) + ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.changedEntry) self["actions"] = ActionMap(["SetupActions"], - { - "cancel": self.keyCancel - }, -2) + { + "cancel": self.keyCancel, + "save": self.keyOK, + "ok": self.keyOK, + }, -2) + + self["key_red"] = StaticText(_("Cancel")) + self["key_green"] = StaticText(_("OK")) self.createSetup() - + self.onLayoutFinish.append(self.layoutFinished) + + def layoutFinished(self): + self.setTitle(self.setup_title) + def createSetup(self): self.testtype = ConfigSelection(choices={"quick": _("Quick"), "random": _("Random"), "complete": _("Complete")}, default = "quick") self.testtypeEntry = getConfigListEntry(_("Test Type"), self.testtype) @@ -597,6 +623,21 @@ class DiseqcTesterTestTypeSelection(Screen, ConfigListScreen): def keyCancel(self): self.close() + # for summary: + def changedEntry(self): + for x in self.onChangedEntry: + x() + + def getCurrentEntry(self): + return self["config"].getCurrent()[0] + + def getCurrentValue(self): + return str(self["config"].getCurrent()[1].getText()) + + def createSummary(self): + from Screens.Setup import SetupSummary + return SetupSummary + class DiseqcTesterNimSelection(NimSelection): skin = """ @@ -638,5 +679,5 @@ def autostart(reason, **kwargs): resourcemanager.addResource("DiseqcTester", DiseqcTesterMain) def Plugins(**kwargs): - return [ PluginDescriptor(name="DiSEqC Tester", description=_("Test DiSEqC settings"), where = PluginDescriptor.WHERE_PLUGINMENU, fnc=DiseqcTesterMain), - PluginDescriptor(where = PluginDescriptor.WHERE_AUTOSTART, fnc = autostart)] + return [ PluginDescriptor(name="DiSEqC Tester", description=_("Test DiSEqC settings"), where = PluginDescriptor.WHERE_PLUGINMENU, needsRestart = False, fnc=DiseqcTesterMain), + PluginDescriptor(where = PluginDescriptor.WHERE_AUTOSTART, needsRestart = False, fnc = autostart)]