-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpex.html
More file actions
115 lines (110 loc) · 5.02 KB
/
Copy pathpex.html
File metadata and controls
115 lines (110 loc) · 5.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
$def with(pex, gv)
$ pex_c = pex.pex_c
$ pex_e = pex.edit_conf
$var title: $_(u'SIP PEX Plugin')
$var page: pex
<script>
// Initialize behaviors
jQuery(document).ready(function(){
jQuery("#cSubmit").click(function() {
jQuery("#pexConfigForm").submit();
});
jQuery("button#docButton").click(function(){
window.open("static/docs/plugins/pex-docs.html", "_blank");
});
});
</script>
<div id="plugin">
<div class="pex">
<div class="Intro">
<div class="title">$_(u'PEX -- Port Extender for SIP Irrigation Controller.')
<button class="execute" id="docButton" type="button" >$_(u'Help')</button></div>
<p>PEX allows up to 128 stations to be controlled by the SIP irrigation controller.</p>
<p>It uses the I2C System Management Bus (smbus) to automatically configure and
operate up to eight I/O extender devices.</p>
<hr>
<h2>Status PEX:
<span style="color:${"green" if pex_c[u"pex_status"]=="enabled" else "red"}">$pex_c[u"pex_status"]</span>
Autoconfig: ${"enabled" if pex_c["auto_configure"] else "disabled"}</h2>
$if not pex.smbus_avail:
<span style="color:red">"Missing library module smbus."</span>
Only Demo Mode supported.
<br>
$if pex_c[u"demo_mode"]:
<span style="color:red">"Demo Mode selected."</span>
</div>
<hr>
<div class="pex_Cur_HW_Config">
<h3>Current Configuration</h3>
<table>
<td>Number of SIP Stations:</td>
<td>$gv.sd["nst"]</td>
<td style="padding-left:20px">Number of PEX Stations:</td>
<td>$pex_c["num_PEX_stations"]</td>
</table>
<div>
$if not len(pex_c["dev_configs"]):
No Hardware Devices Configured.
$else:
<table class="collapsable" border="1">
<tr>
<th>$_(u'Port ID')</th>
<th>$_(u'SMBus')</th>
<th>$_(u'Port Addr')</th>
<th>$_(u'IC Type')</th>
<th>$_(u'Spanned SIP Stations')</th>
</tr>
$for dev in pex_c["dev_configs"]:
$ SIP_span = u"{} thru {}".format(gv.snames[dev[u"first"]], gv.snames[dev[u"last"]-1])
<tr>
<td style="text-align: center">$loop.index</td>
<td style="text-align: center">$dev['bus_id']</td>
<td style="text-align: center">$dev['dev_addr']</td>
<td style="text-align: center">$dev['ic_type']</td>
<td style="text-align: center">$SIP_span</td>
</tr>
</table>
</div>
</div>
<hr>
<div class="pex-controller">
<h3>Edit Configuration</h3>
<form id="pexConfigForm" action="/pex-cfs">
<div class="pex_Edit_Config">
<div>
<input type="checkbox"
id = "pex_en"
name="enable_pex"
value="1"
${"checked" if pex_c["pex_status"] == "enabled" else ""}/>
<label style="display: inline;" for="pex_en">Enable PEX</label>
</div>
<div>
<input type="checkbox"
id = "auto_conf"
name="auto_configure"
value="1"
${"checked" if pex_c["auto_configure"] else ""}/>
<label style="display: inline;" for="auto_conf">Enable Autoconfigure</label>
<label for="auto_ic" style="display: inline">Default IC Type:</label>
<select name="auto_ic" id="auto_ic">
$for ic in pex.supported_devices:
<option value=${ic} ${"selected" if ic == pex_c["default_ic_type"] else ""}>${ic}</option>
</select>
</div>
<div>
<input type="checkbox"
id = "demo_mode"
name="demo_mode"
value="1"
${"checked" if pex_c["demo_mode"] else ""}/>
<label style="display: inline;" for="demo_mode">Enable demo mode</label>
</div>
</div>
</form>
</div>
</div>
<div class="controls">
<button id="cSubmit" class="submit"><b>$_(u'Save')</b></button>
</div>
</div>