Wed, 20 Aug 2014 12:46:31 +0200
Device editor uses array commands
100 | 1 | <?php |
2 | /***************************************************************************** | |
3 | * Copyright (C) 2014 | |
4 | * | |
5 | * Michiel Broek <mbroek at mbse dot eu> | |
6 | * | |
7 | * This file is part of ThermFerm | |
8 | * | |
9 | * This is free software; you can redistribute it and/or modify it | |
10 | * under the terms of the GNU General Public License as published by the | |
11 | * Free Software Foundation; either version 2, or (at your option) any | |
12 | * later version. | |
13 | * | |
14 | * ThermFerm is distributed in the hope that it will be useful, but | |
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | * General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with ThermFerm; see the file COPYING. If not, write to the Free | |
21 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
22 | *****************************************************************************/ | |
23 | ||
24 | ||
25 | require_once('utilities.php'); | |
26 | ||
27 | ||
28 | ||
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
29 | function showunit($unit, $unr) |
100 | 30 | { |
117 | 31 | global $my_style; |
32 | ||
100 | 33 | $outstr = ''; |
102
e37b9c571a56
Units can display the temperature
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
34 | $air_state = $beer_state = 1; |
196 | 35 | $answer = send_cmd("UNIT GET ".$unit); |
100 | 36 | $arr = explode("\r\n", $answer); |
37 | ||
38 | if (startsWith($arr[0], "213")) { | |
39 | ||
169 | 40 | $set_temperature = "NA"; |
41 | $air_temperature = "NA"; | |
42 | $beer_temperature = "NA"; | |
195
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
43 | $profile = ""; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
44 | $prof_state = "OFF"; |
153
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
45 | $power_led = $cooler_led = $heater_led = $fan_led = "off"; |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
46 | $heater = $cooler = $fan = "no"; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
47 | $heater_state = $cooler_state = $fan_state = 0; |
153
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
48 | |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
49 | foreach($arr as $l) { |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
50 | $vals = explode(",", $l); |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
51 | if (strcmp($vals[0], "MODE") == 0) { |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
52 | $mode = $vals[1]; |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
53 | if (strcmp($mode, "OFF")) |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
54 | $power_led = "on"; |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
55 | } |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
56 | if (strcmp($vals[0], "AIR_STATE") == 0) { |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
57 | $air_state = $vals[1]; |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
58 | } |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
59 | if ((strcmp($vals[0], "AIR_TEMPERATURE") == 0) && ($air_state == 0)) { |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
60 | $air_temperature = $vals[1]; |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
61 | } |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
62 | if (strcmp($vals[0], "BEER_STATE") == 0) { |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
63 | $beer_state = $vals[1]; |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
64 | } |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
65 | if ((strcmp($vals[0], "BEER_TEMPERATURE") == 0) && ($beer_state == 0)) { |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
66 | $beer_temperature = $vals[1]; |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
67 | } |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
68 | if ((strcmp($vals[0], "HEATER_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) { |
153
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
69 | $heater = "yes"; |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
70 | } |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
71 | if (strcmp($vals[0], "HEATER_STATE") == 0) { |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
72 | $heater_state = $vals[1]; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
73 | } |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
74 | if ((strcmp($vals[0], "COOLER_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) { |
153
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
75 | $cooler = "yes"; |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
76 | } |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
77 | if (strcmp($vals[0], "COOLER_STATE") == 0) { |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
78 | $cooler_state = $vals[1]; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
79 | } |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
80 | if ((strcmp($vals[0], "FAN_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) { |
153
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
81 | $fan = "yes"; |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
82 | } |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
83 | if (strcmp($vals[0], "FAN_STATE") == 0) { |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
84 | $fan_state = $vals[1]; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
85 | } |
195
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
86 | if (strcmp($vals[0], "PROFILE") == 0) { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
87 | $profile = $vals[1]; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
88 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
89 | if (strcmp($vals[0], "PROF_STATE") == 0) { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
90 | $prof_state = $vals[1]; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
91 | } |
186
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
92 | if (($vals[0] == "BEER_SET") && ($mode == "BEER")) { |
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
93 | $set_temperature = $vals[1]; |
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
94 | } |
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
95 | if (($vals[0] == "FRIDGE_SET") && ($mode == "FRIDGE")) { |
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
96 | $set_temperature = $vals[1]; |
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
97 | } |
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
98 | if (($vals[0] == "PROF_TARGET") && ($mode == "PROFILE")) { |
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
99 | $set_temperature = $vals[1]; |
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
100 | } |
153
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
101 | } |
866a947b732a
Added the framework for the units editor. In the dashboard the radio selector buttons are converteed to jqwidgets radiobuttons.
Michiel Broek <mbroek@mbse.eu>
parents:
151
diff
changeset
|
102 | |
117 | 103 | $outstr .= ' <script type="text/javascript">'.PHP_EOL; |
104 | $outstr .= ' $(document).ready(function () {'.PHP_EOL; | |
121
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
105 | |
123
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
106 | $outstr .= ' var source'.$unr.' ='.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
107 | $outstr .= ' {'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
108 | $outstr .= ' datatype: "json",'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
109 | $outstr .= ' datafields: ['.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
110 | $outstr .= ' { name: \'Date\' },'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
111 | $outstr .= ' { name: \'Mode\' },'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
112 | $outstr .= ' { name: \'Air\', type: \'float\' },'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
113 | $outstr .= ' { name: \'Beer\', type: \'float\' },'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
114 | $outstr .= ' { name: \'Target\', type: \'float\' },'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
115 | $outstr .= ' { name: \'Heater\' },'.PHP_EOL; |
185 | 116 | $outstr .= ' { name: \'Cooler\', type: \'int\' },'.PHP_EOL; |
123
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
117 | $outstr .= ' { name: \'Fan\' },'.PHP_EOL; |
185 | 118 | $outstr .= ' { name: \'Door\', type: \'bool\' }'.PHP_EOL; |
123
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
119 | $outstr .= ' ],'.PHP_EOL; |
124
350401bac16e
Added maintenance tabs and extended server output
Michiel Broek <mbroek@mbse.eu>
parents:
123
diff
changeset
|
120 | $outstr .= ' url: \'getlog.php?unit='.$unit.'\''.PHP_EOL; |
123
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
121 | $outstr .= ' };'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
122 | |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
123 | $outstr .= ' var dataAdapter'.$unr.' = new $.jqx.dataAdapter(source'.$unr.','.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
124 | $outstr .= ' {'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
125 | $outstr .= ' autoBind: true,'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
126 | $outstr .= ' async: false,'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
127 | $outstr .= ' downloadComplete: function () { },'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
128 | $outstr .= ' loadComplete: function () { },'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
129 | $outstr .= ' loadError: function () { }'.PHP_EOL; |
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
130 | $outstr .= ' });'.PHP_EOL; |
121
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
131 | |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
132 | $outstr .= ' var settings'.$unr.' = {'.PHP_EOL; |
193
4136193a0c22
Auto refresh LED's state added.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
133 | $outstr .= ' title: "Fermentation history",'.PHP_EOL; |
121
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
134 | $outstr .= ' description: "",'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
135 | $outstr .= ' padding: { left: 5, top: 5, right: 5, bottom: 5 },'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
136 | $outstr .= ' titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },'.PHP_EOL; |
123
597688feda2f
Now uses the real data for the chart
Michiel Broek <mbroek@mbse.eu>
parents:
122
diff
changeset
|
137 | $outstr .= ' source: dataAdapter'.$unr.','.PHP_EOL; |
121
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
138 | $outstr .= ' categoryAxis:'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
139 | $outstr .= ' {'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
140 | $outstr .= ' dataField: \'Date\','.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
141 | $outstr .= ' textRotationAngle: 45,'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
142 | $outstr .= ' showGridLines: false'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
143 | $outstr .= ' },'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
144 | $outstr .= ' colorScheme: \'scheme01\','.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
145 | $outstr .= ' seriesGroups:'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
146 | $outstr .= ' [{'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
147 | $outstr .= ' type: \'line\','.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
148 | $outstr .= ' columnsGapPercent: 30,'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
149 | $outstr .= ' seriesGapPercent: 0,'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
150 | $outstr .= ' valueAxis:'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
151 | $outstr .= ' {'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
152 | $outstr .= ' description: \'Degrees C\''.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
153 | $outstr .= ' },'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
154 | $outstr .= ' series: ['.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
155 | $outstr .= ' { dataField: \'Air\', displayText: \'Air\' },'.PHP_EOL; |
185 | 156 | $outstr .= ' { dataField: \'Beer\', displayText: \'Beer\' },'.PHP_EOL; |
157 | $outstr .= ' { dataField: \'Target\', displayText: \'Target\' }'.PHP_EOL; | |
121
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
158 | $outstr .= ' ]'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
159 | $outstr .= ' }]'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
160 | $outstr .= ' };'.PHP_EOL; |
185 | 161 | /* Direct draw for the first time */ |
154 | 162 | $outstr .= ' $("#fermentor_chart_'.$unit.'").jqxChart(settings'.$unr.');'.PHP_EOL; |
185 | 163 | /* Regular updates of the chart */ |
164 | // $outstr .= ' setInterval(function(){'.PHP_EOL; | |
165 | // $outstr .= ' $("#fermentor_chart_'.$unit.'").jqxChart("update");'.PHP_EOL; | |
166 | // $outstr .= ' }, 3000);'.PHP_EOL; | |
167 | ||
171
15f92e5eecef
Ajax screen updates now use a single call to the server
Michiel Broek <mbroek@mbse.eu>
parents:
169
diff
changeset
|
168 | $outstr .= ' setInterval(function(){'.PHP_EOL; |
185 | 169 | $outstr .= ' $.getJSON("getstate.php?uuid='.$unit.'", function(data) {'.PHP_EOL; |
170 | $outstr .= ' $("#load_air_'.$unr.'").html(data.air_temperature);'.PHP_EOL; | |
171 | $outstr .= ' $("#load_beer_'.$unr.'").html(data.beer_temperature);'.PHP_EOL; | |
172 | $outstr .= ' $("#load_target_'.$unr.'").html(data.target_temperature);'.PHP_EOL; | |
193
4136193a0c22
Auto refresh LED's state added.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
173 | $outstr .= ' $("#load_led1_'.$unr.'").html(data.led1);'.PHP_EOL; |
4136193a0c22
Auto refresh LED's state added.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
174 | $outstr .= ' $("#load_led2_'.$unr.'").html(data.led2);'.PHP_EOL; |
4136193a0c22
Auto refresh LED's state added.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
175 | $outstr .= ' $("#load_led3_'.$unr.'").html(data.led3);'.PHP_EOL; |
185 | 176 | $outstr .= ' });'.PHP_EOL; |
177 | $outstr .= ' }, 10000);'.PHP_EOL; | |
117 | 178 | $outstr .= ' });'.PHP_EOL; |
179 | $outstr .= ' </script>'.PHP_EOL; | |
100 | 180 | $outstr .= ' <div id="fermentor">'.PHP_EOL; |
154 | 181 | $outstr .= ' <div id="fermentor_chart_'.$unit.'" style="width:720px; height:377px; float:left"></div>'.PHP_EOL; |
100 | 182 | |
151
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
183 | $outstr .= ' <div id="fermentor_panel_top">'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
184 | $outstr .= ' <div id="fermentor_selector">'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
185 | $outstr .= ' <form id="select_'.$unr.'" action="index.php" method="post">'.PHP_EOL; |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
186 | strcmp($mode, "OFF") ? $se = "" : $se = " checked"; |
168
1288dbf0f9b5
Temperature auto refresh and some layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
155
diff
changeset
|
187 | $outstr .= ' <input type="radio" name="mode" onchange="this.form.submit()" class="select" value="OFF"'.$se.'>Off<br>'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
188 | strcmp($mode, "NONE") ? $se = "" : $se = " checked"; |
168
1288dbf0f9b5
Temperature auto refresh and some layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
155
diff
changeset
|
189 | $outstr .= ' <input type="radio" name="mode" onchange="this.form.submit()" class="select" value="NONE"'.$se.'>None<br>'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
190 | (strcmp($heater, "no") || strcmp($cooler, "no")) ? $dis = "" : $dis = " disabled"; |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
191 | strcmp($mode, "FRIDGE") ? $se = "" : $se = " checked"; |
168
1288dbf0f9b5
Temperature auto refresh and some layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
155
diff
changeset
|
192 | $outstr .= ' <input type="radio" name="mode" onchange="this.form.submit()" class="select" value="FRIDGE"'.$se.$dis.'>Fridge<br>'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
193 | strcmp($mode, "BEER") ? $se = "" : $se = " checked"; |
168
1288dbf0f9b5
Temperature auto refresh and some layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
155
diff
changeset
|
194 | $outstr .= ' <input type="radio" name="mode" onchange="this.form.submit()" class="select" value="BEER"'.$se.$dis.'>Beer<br>'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
195 | strcmp($mode, "PROFILE") ? $se = "" : $se = " checked"; |
168
1288dbf0f9b5
Temperature auto refresh and some layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
155
diff
changeset
|
196 | $outstr .= ' <input type="radio" name="mode" onchange="this.form.submit()" class="select" value="PROFILE"'.$se.$dis.'>Profile'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
197 | $outstr .= ' <input type="hidden" name="UUID" value="'.$unit.'">'.PHP_EOL; |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
198 | $outstr .= ' </form>'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
199 | $outstr .= ' </div>'.PHP_EOL; |
195
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
200 | |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
201 | $outstr .= ' <div id="fermentor_powerled">'.PHP_EOL; |
225
b18b06c17a80
Changed CSS colors for the LED's. Removed the old LED's.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
202 | $outstr .= ' <div class="LEDblue_'.$power_led.'"></div>Pwr'.PHP_EOL; |
b18b06c17a80
Changed CSS colors for the LED's. Removed the old LED's.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
203 | //$outstr .= ' <img src="images/led_green_'.$power_led.'.png"><br>Pwr'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
204 | $outstr .= ' </div>'.PHP_EOL; |
195
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
205 | |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
206 | $outstr .= ' <div id="fermentor_mode_control">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
207 | if ($mode == "FRIDGE") { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
208 | $outstr .= ' <form id="set_fridge_'.$unr.'" action="index.php" method="post">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
209 | $outstr .= ' <input type="text" name="Fridge" size="5" value="'.$set_temperature.'"><br>'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
210 | $outstr .= ' <input type="submit" value="Set" name="key">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
211 | $outstr .= ' <input type="hidden" value="'.$unit.'" name="UUID">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
212 | $outstr .= ' </form>'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
213 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
214 | if ($mode == "BEER") { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
215 | $outstr .= ' <form id="set_beer_'.$unr.'" action="index.php" method="post">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
216 | $outstr .= ' <input type="text" name="Beer" size="5" value="'.$set_temperature.'">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
217 | $outstr .= ' <input type="submit" value="Set" name="key">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
218 | $outstr .= ' <input type="hidden" value="'.$unit.'" name="UUID">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
219 | $outstr .= ' </form>'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
220 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
221 | if ($mode == "PROFILE") { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
222 | /* |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
223 | * First, load a list with available profiles. |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
224 | */ |
196 | 225 | $answer = send_cmd("PROFILE LIST"); |
226 | $reply = explode("\r\n", $answer); | |
195
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
227 | |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
228 | /* |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
229 | * Show loaded profile. |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
230 | */ |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
231 | if ($profile == "(null)") { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
232 | $prof_name = "None"; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
233 | }else { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
234 | if (startsWith($reply[0], "212")) { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
235 | $i = 1; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
236 | while (1) { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
237 | if (strcmp($reply[$i], ".") == 0) |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
238 | break; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
239 | $f = explode(",", $reply[$i]); |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
240 | if ($f[0] == $profile) { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
241 | $prof_name = $f[1]; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
242 | break; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
243 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
244 | $i++; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
245 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
246 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
247 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
248 | $outstr .= ' <div style="color: blue; width: 148px; height: 20px; overflow: hidden;">Profile: '.$prof_name.'</div>'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
249 | |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
250 | $outstr .= ' <form id="set_profile_'.$unr.'" action="index.php" method="post">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
251 | if ($prof_state == "OFF") { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
252 | $outstr .= ' <select name="SetProfile" style="width: 130px;">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
253 | $outstr .= ' <option value="">None</option>'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
254 | if (startsWith($reply[0], "212")) { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
255 | $i = 1; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
256 | while (1) { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
257 | if (strcmp($reply[$i], ".") == 0) |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
258 | break; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
259 | $f = explode(",", $reply[$i]); |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
260 | if ($f[2] > 0) { |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
261 | ($f[0] == $profile) ? $se = " selected" : $se = ""; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
262 | $outstr .= ' <option value="'.$f[0].'"'.$se.'>'.$f[1].'</option>'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
263 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
264 | $i++; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
265 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
266 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
267 | $outstr .= ' </select>'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
268 | $outstr .= ' <input type="submit" value="Set" name="key">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
269 | if ($profile != "(null)") |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
270 | $outstr .= ' <input type="submit" value="Start" name="key">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
271 | |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
272 | } else if ($prof_state == "RUN") { |
219
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
273 | $outstr .= ' <input type="hidden" value="'.$profile.'" name="SetProfile">'.PHP_EOL; |
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
274 | $outstr .= ' <input type="submit" value="Pause" name="key">'.PHP_EOL; |
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
275 | $outstr .= ' <input type="submit" value="Abort" name="key">'.PHP_EOL; |
195
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
276 | } else if ($prof_state == "PAUSE") { |
219
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
277 | $outstr .= ' <input type="hidden" value="'.$profile.'" name="SetProfile">'.PHP_EOL; |
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
278 | $outstr .= ' <input type="submit" value="Resume" name="key">'.PHP_EOL; |
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
279 | $outstr .= ' <input type="submit" value="Abort" name="key">'.PHP_EOL; |
195
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
280 | } else if ($prof_state == "DONE") { |
219
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
281 | $outstr .= ' <input type="hidden" value="'.$profile.'" name="SetProfile">'.PHP_EOL; |
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
282 | $outstr .= ' <input type="submit" value="Off" name="key">'.PHP_EOL; |
195
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
283 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
284 | //$outstr .= ' <input type="text" name="Beer" size="5" value="'.$set_temperature.'">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
285 | $outstr .= ' <input type="hidden" value="'.$unit.'" name="UUID">'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
286 | $outstr .= ' </form>'.PHP_EOL; |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
287 | } |
b34a1b2421fb
Reset output when a different profile is selected. Better startup logging about the unit state. Added Beer, Fridge and partial Profile settings from the liveview weeb screen.
Michiel Broek <mbroek@mbse.eu>
parents:
193
diff
changeset
|
288 | $outstr .= ' </div>'.PHP_EOL; |
151
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
289 | $outstr .= ' </div> <!-- fermentor_panel_top -->'.PHP_EOL; |
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
290 | |
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
291 | $outstr .= ' <div id="fermentor_panel_display">'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
292 | $outstr .= ' <div id="fermentor_display1">'.PHP_EOL; |
173 | 293 | $outstr .= ' <div id="load_target_'.$unr.'" class="dtemp">'.$set_temperature.'</div>Set'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
294 | $outstr .= ' </div>'.PHP_EOL; |
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
295 | $outstr .= ' <div id="fermentor_display2">'.PHP_EOL; |
173 | 296 | $outstr .= ' <div id="load_air_'.$unr.'" class="dtemp">'.$air_temperature.'</div>Air'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
297 | $outstr .= ' </div>'.PHP_EOL; |
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
298 | $outstr .= ' <div id="fermentor_display3">'.PHP_EOL; |
173 | 299 | $outstr .= ' <div id="load_beer_'.$unr.'" class="dtemp">'.$beer_temperature.'</div>Beer'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
300 | $outstr .= ' </div>'.PHP_EOL; |
151
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
301 | $outstr .= ' </div> <!-- fermentor_panel_display -->'.PHP_EOL; |
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
302 | |
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
303 | $outstr .= ' <div id="fermentor_panel_control">'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
304 | if ($cooler_state == "100") |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
305 | $cooler_led = "on"; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
306 | $outstr .= ' <div id="fermentor_led1">'.PHP_EOL; |
225
b18b06c17a80
Changed CSS colors for the LED's. Removed the old LED's.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
307 | $outstr .= ' <div id="load_led1_'.$unr.'"><div class="LEDgreen_'.$cooler_led.'"></div></div>Cool'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
308 | $outstr .= ' </div>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
309 | if ($heater_state == "100") |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
310 | $heater_led = "on"; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
311 | $outstr .= ' <div id="fermentor_led2">'.PHP_EOL; |
225
b18b06c17a80
Changed CSS colors for the LED's. Removed the old LED's.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
312 | $outstr .= ' <div id="load_led2_'.$unr.'"><div class="LEDgreen_'.$heater_led.'"></div></div>Heat'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
313 | $outstr .= ' </div>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
314 | if ($fan_state == "100") |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
315 | $fan_led = "on"; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
316 | $outstr .= ' <div id="fermentor_led3">'.PHP_EOL; |
225
b18b06c17a80
Changed CSS colors for the LED's. Removed the old LED's.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
317 | $outstr .= ' <div id="load_led3_'.$unr.'"><div class="LEDgreen_'.$fan_led.'"></div></div>Fan'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
318 | $outstr .= ' </div>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
319 | |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
320 | $outstr .= ' <div id="fermentor_toggle1">'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
321 | $outstr .= ' <form action="index.php" method="post">'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
322 | (($mode == "NONE") && ($cooler == "yes")) ? $dis = "" : $dis = " disabled"; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
323 | ($cooler_state == "0") ? $ch = " checked" : $ch = ""; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
324 | $outstr .= ' <input type="radio" name="CoolerState" onchange="this.form.submit()" value="0"'.$dis.$ch.'>Off<br>'.PHP_EOL; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
325 | ($cooler_state == "100") ? $ch = " checked" : $ch = ""; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
326 | $outstr .= ' <input type="radio" name="CoolerState" onchange="this.form.submit()" value="100"'.$dis.$ch.'>On'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
327 | $outstr .= ' <input type="hidden" name="UUID" value="'.$unit.'">'.PHP_EOL; |
117 | 328 | $outstr .= ' </form>'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
329 | $outstr .= ' </div>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
330 | |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
331 | $outstr .= ' <div id="fermentor_toggle2">'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
332 | $outstr .= ' <form action="index.php" method="post">'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
333 | (($mode == "NONE") && ($heater == "yes")) ? $dis = "" : $dis = " disabled"; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
334 | ($heater_state == "0") ? $ch = " checked" : $ch = ""; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
335 | $outstr .= ' <input type="radio" name="HeaterState" onchange="this.form.submit()" value="0"'.$dis.$ch.'>Off<br>'.PHP_EOL; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
336 | ($heater_state == "100") ? $ch = " checked" : $ch = ""; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
337 | $outstr .= ' <input type="radio" name="HeaterState" onchange="this.form.submit()" value="100"'.$dis.$ch.'>On'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
338 | $outstr .= ' <input type="hidden" name="UUID" value="'.$unit.'">'.PHP_EOL; |
117 | 339 | $outstr .= ' </form>'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
340 | $outstr .= ' </div>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
341 | |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
342 | $outstr .= ' <div id="fermentor_toggle3">'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
343 | $outstr .= ' <form action="index.php" method="post">'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
344 | (($mode == "NONE") && ($fan== "yes")) ? $dis = "" : $dis = " disabled"; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
345 | ($fan_state == "0") ? $ch = " checked" : $ch = ""; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
346 | $outstr .= ' <input type="radio" name="FanState" onchange="this.form.submit()" value="0"'.$dis.$ch.'>Off<br>'.PHP_EOL; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
347 | ($fan_state == "100") ? $ch = " checked" : $ch = ""; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
348 | $outstr .= ' <input type="radio" name="FanState" onchange="this.form.submit()" value="100"'.$dis.$ch.'>On'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
349 | $outstr .= ' <input type="hidden" name="UUID" value="'.$unit.'">'.PHP_EOL; |
117 | 350 | $outstr .= ' </form>'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
351 | $outstr .= ' </div>'.PHP_EOL; |
151
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
352 | $outstr .= ' </div> <!-- fermentor_panel_control -->'.PHP_EOL; |
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
353 | |
122
e57043423e72
Added fermentor maintenance windows
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
354 | $outstr .= ' </div> <!-- fermentor -->'.PHP_EOL; |
100 | 355 | } |
356 | ||
357 | return $outstr; | |
358 | } | |
359 | ||
360 | ||
361 | ||
362 | function liveview() | |
363 | { | |
364 | $outstr = PHP_EOL; | |
365 | ||
196 | 366 | $answer = send_cmd("LIST"); |
367 | if (strlen($answer)) { | |
100 | 368 | $arr = explode("\r\n", $answer); |
369 | ||
117 | 370 | $outstr .= ' <div id="jqxTabs">'.PHP_EOL; |
371 | $outstr .= ' <ul>'.PHP_EOL; | |
100 | 372 | if (startsWith($arr[0], "212")) { |
373 | $i = 1; | |
374 | while (1) { | |
375 | if (strcmp($arr[$i], ".") == 0) | |
376 | break; | |
377 | $parts = explode(",", $arr[$i]); | |
131
528dc0bb81ab
Always use uuid to select units and remove numeric record id's.
Michiel Broek <mbroek@mbse.eu>
parents:
124
diff
changeset
|
378 | $outstr .= ' <li style="margin-left: 20px;">'.$parts[1].'</li>'.PHP_EOL; |
117 | 379 | $i++; |
380 | } | |
381 | } | |
382 | $outstr .= ' </ul>'.PHP_EOL; | |
383 | ||
384 | if (startsWith($arr[0], "212")) { | |
385 | $i = 1; | |
386 | while (1) { | |
387 | if (strcmp($arr[$i], ".") == 0) | |
388 | break; | |
389 | $parts = explode(",", $arr[$i]); | |
131
528dc0bb81ab
Always use uuid to select units and remove numeric record id's.
Michiel Broek <mbroek@mbse.eu>
parents:
124
diff
changeset
|
390 | $outstr .= showunit($parts[0], $i); |
100 | 391 | $i++; |
392 | } | |
393 | } | |
117 | 394 | $outstr .= ' </div> <!-- jqxTabs -->'.PHP_EOL; |
100 | 395 | } |
396 | ||
397 | return $outstr; | |
398 | } | |
399 | ||
400 | ||
401 | ?> |