SatelliteEquipmentControl: update plugin
authorDima73 <Dima-73@inbox.lv>
Sun, 13 Dec 2015 15:28:58 +0000 (17:28 +0200)
committerErik Slagter <erik@openpli.org>
Fri, 18 Dec 2015 09:28:26 +0000 (10:28 +0100)
-fix BSOD set tiltle
-small update size skin
-add for key menu "Set default settings?" yes/no

(cherry picked from commit a375133c7868ed9614b3037d88df4a3ff63ace89)
Signed-off-by: Erik Slagter <erik@openpli.org>

lib/python/Plugins/SystemPlugins/SatelliteEquipmentControl/plugin.py

index 7b5ae8c..15f3949 100644 (file)
@@ -9,22 +9,21 @@ from Components.NimManager import nimmanager as nimmgr
 
 class SecParameterSetup(Screen, ConfigListScreen):
        skin = """
-               <screen position="100,100" size="560,400" title="Satellite equipment setup" >
-                       <widget name="config" position="10,10" size="540,390" />
+               <screen position="center,center" size="620,455" title="Satellite equipment setup" >
+                       <widget name="config" position="10,10" size="600,450" />
                </screen>"""
        def __init__(self, session):
                self.skin = SecParameterSetup.skin
 
-               self.setTitle(_("Satellite equipment setup"))
-
                self["actions"] = ActionMap(["SetupActions", "MenuActions"],
                {
                        "ok": self.keySave,
                        "cancel": self.keyCancel,
-                       "menu": self.closeRecursive,
+                       "menu": self.setDefault,
                }, -2)
 
                Screen.__init__(self, session)
+               self.setTitle(_("Satellite equipment setup"))
                list = [
                        (_("Delay after diseqc reset command"), config.sec.delay_after_diseqc_reset_cmd),
                        (_("Delay after diseqc peripherial poweron command"), config.sec.delay_after_diseqc_peripherial_poweron_cmd),
@@ -46,6 +45,49 @@ class SecParameterSetup(Screen, ConfigListScreen):
                        (_("Motor command retries"), config.sec.motor_command_retries) ]
                ConfigListScreen.__init__(self, list)
 
+       def setDefault(self):
+               self.session.openWithCallback(self.setDefaultCallback, MessageBox, _("Set default settings?"), MessageBox.TYPE_YESNO)
+
+       def setDefaultCallback(self, answer):
+               if answer:
+                       config.sec.delay_after_diseqc_reset_cmd.value = 50
+                       config.sec.delay_after_diseqc_peripherial_poweron_cmd.value = 150
+                       config.sec.delay_after_continuous_tone_disable_before_diseqc.value = 25
+                       config.sec.delay_after_final_continuous_tone_change.value = 10
+                       config.sec.delay_after_final_voltage_change.value = 10
+                       config.sec.delay_between_diseqc_repeats.value = 120
+                       config.sec.delay_after_last_diseqc_command.value = 50
+                       config.sec.delay_after_toneburst.value = 50
+                       config.sec.delay_after_change_voltage_before_switch_command.value = 20
+                       config.sec.delay_after_enable_voltage_before_switch_command.value = 200
+                       config.sec.delay_between_switch_and_motor_command.value = 700
+                       config.sec.delay_after_voltage_change_before_measure_idle_inputpower.value = 500
+                       config.sec.delay_after_enable_voltage_before_motor_command.value = 900
+                       config.sec.delay_after_motor_stop_command.value = 500
+                       config.sec.delay_after_voltage_change_before_motor_command.value = 500
+                       config.sec.delay_before_sequence_repeat.value = 70
+                       config.sec.motor_running_timeout.value = 360
+                       config.sec.motor_command_retries.value = 1
+                       config.sec.delay_after_diseqc_reset_cmd.save()
+                       config.sec.delay_after_diseqc_peripherial_poweron_cmd.save()
+                       config.sec.delay_after_continuous_tone_disable_before_diseqc.save()
+                       config.sec.delay_after_final_continuous_tone_change.save()
+                       config.sec.delay_after_final_voltage_change.save()
+                       config.sec.delay_between_diseqc_repeats.save()
+                       config.sec.delay_after_last_diseqc_command.save()
+                       config.sec.delay_after_toneburst.save()
+                       config.sec.delay_after_change_voltage_before_switch_command.save()
+                       config.sec.delay_after_enable_voltage_before_switch_command.save()
+                       config.sec.delay_between_switch_and_motor_command.save()
+                       config.sec.delay_after_voltage_change_before_measure_idle_inputpower.save()
+                       config.sec.delay_after_enable_voltage_before_motor_command.save()
+                       config.sec.delay_after_motor_stop_command.save()
+                       config.sec.delay_after_voltage_change_before_motor_command.save()
+                       config.sec.delay_before_sequence_repeat.save()
+                       config.sec.motor_running_timeout.save()
+                       config.sec.motor_command_retries.save()
+                       self.close(True)
+
 session = None
 
 def confirmed(answer):