enigma2: 4.3.1r16
[enigma2.git] / usr / lib / enigma2 / python / Plugins / SystemPlugins / SatelliteEquipmentControl / plugin.py
1 from Screens.Screen import Screen
2 from Screens.MessageBox import MessageBox
3 from Plugins.Plugin import PluginDescriptor
4
5 from Components.ConfigList import ConfigListScreen
6 from Components.ActionMap import ActionMap
7 from Components.config import config
8 from Components.NimManager import nimmanager as nimmgr
9
10 class SecParameterSetup(Screen, ConfigListScreen):
11         skin = """
12                 <screen position="100,100" size="1460,940" title="Satellite Equipment Setup" >
13                         <widget name="config" position="10,10" size="1440,930" />
14                 </screen>"""
15         def __init__(self, session):
16                 self.skin = SecParameterSetup.skin
17
18                 self["actions"] = ActionMap(["SetupActions"],
19                 {
20                         "ok": self.keySave,
21                         "cancel": self.keyCancel,
22                 }, -2)
23
24                 Screen.__init__(self, session)
25                 list = [
26                         ("Delay after diseqc reset command (default: 50)", config.sec.delay_after_diseqc_reset_cmd),
27                         ("Delay after diseqc peripherial poweron command (default: 150)", config.sec.delay_after_diseqc_peripherial_poweron_cmd),
28                         ("Delay after continuous tone disable before diseqc (default: 25)", config.sec.delay_after_continuous_tone_disable_before_diseqc),
29                         ("Delay after final continuous tone change (default: 10)", config.sec.delay_after_final_continuous_tone_change),
30                         ("Delay after final voltage change (default: 10)", config.sec.delay_after_final_voltage_change),
31                         ("Delay between diseqc repeat commands (default: 120)", config.sec.delay_between_diseqc_repeats),
32                         ("Delay after last diseqc command (default: 50)", config.sec.delay_after_last_diseqc_command),
33                         ("Delay after toneburst (default: 50)", config.sec.delay_after_toneburst),
34                         ("Delay after change voltage before switch command (default: 20)", config.sec.delay_after_change_voltage_before_switch_command),
35                         ("Delay after enable voltage before switch command (default: 1000)", config.sec.delay_after_enable_voltage_before_switch_command),
36                         ("Delay after change voltage before unicable command (default: 10)", config.sec.delay_after_voltage_change_before_unicable_cmd),
37                         ("Delay after unicable command (default: 5)", config.sec.delay_after_unicable_cmd),
38                         ("Delay after unicable final voltage change (default: 10)", config.sec.delay_after_unicable_final_voltage_change),
39                         ("Delay after set voltage before measure motor power (default: 500)", config.sec.delay_after_voltage_change_before_measure_idle_inputpower),
40                         ("Delay after enable voltage before motor command (default: 900)", config.sec.delay_after_enable_voltage_before_motor_command),
41                         ("Delay after motor stop command (default: 500)", config.sec.delay_after_motor_stop_command),
42                         ("Delay after voltage change before motor command (default: 500)", config.sec.delay_after_voltage_change_before_motor_command),
43                         ("Delay before sequence repeat (default: 70)", config.sec.delay_before_sequence_repeat),
44                         ("Motor running timeout (default: 360)", config.sec.motor_running_timeout),
45                         ("Motor command retries (default: 1)", config.sec.motor_command_retries) ]
46                 ConfigListScreen.__init__(self, list)
47
48 session = None
49
50 def confirmed(answer):
51         global session
52         if answer:
53                 session.open(SecParameterSetup)
54
55 def SecSetupMain(Session, **kwargs):
56         global session
57         session = Session
58         session.openWithCallback(confirmed, MessageBox, _("Please do not change any values unless you know what you are doing!"), MessageBox.TYPE_INFO)
59
60 def SecSetupStart(menuid):
61         # other menu than "scan"?
62         if menuid != "scan": 
63                 return [ ]
64
65         # only show if DVB-S frontends are available
66         for slot in nimmgr.nim_slots:
67                 if slot.isEnabled("DVB-S"):
68                         return [(_("Satellite Equipment Setup"), SecSetupMain, "satellite_equipment_setup", None)]
69
70         return [ ]
71
72 def Plugins(**kwargs):
73         if (nimmgr.hasNimType("DVB-S")):
74                 return PluginDescriptor(name=_("Satellite Equipment Setup"), description="Setup your satellite equipment", where = PluginDescriptor.WHERE_MENU, needsRestart = False, fnc=SecSetupStart)
75         else:
76                 return []