Tue, 23 Apr 2024 20:45:29 +0200
Device Save implemented.
100 | 1 | <?php |
2 | /***************************************************************************** | |
570
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
3 | * Copyright (C) 2014-2019 |
100 | 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 | ||
554
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
29 | function showunit($unit, $unr, $alias) |
100 | 30 | { |
117 | 31 | global $my_style; |
32 | ||
554
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
33 | $outstr = ' <!-- showunit(' . $unit . ', ' . $unr . ', ' . $alias . ') -->' . PHP_EOL; |
522
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
34 | $air_state = $beer_state = $chiller_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 | ||
397
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
40 | $set_temperature_lo = "NA"; |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
41 | $set_temperature_hi = "NA"; |
169 | 42 | $air_temperature = "NA"; |
43 | $beer_temperature = "NA"; | |
522
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
44 | $chiller_temperature = "NA"; |
570
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
45 | $profile_uuid = $profile_name = ""; |
554
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
46 | $producr_code = ""; |
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
47 | $product_name = ""; |
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
|
48 | $prof_state = "OFF"; |
529 | 49 | $power_led = $alarm_led = $cooler_led = $heater_led = $fan_led = "off"; |
522
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
50 | $heater = $cooler = $fan = "no"; |
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
51 | $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
|
52 | |
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 | foreach($arr as $l) { |
570
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
54 | // syslog(LOG_NOTICE, $l); |
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
|
55 | $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
|
56 | 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
|
57 | $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
|
58 | 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
|
59 | $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
|
60 | } |
554
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
61 | if (strcmp($vals[0], "PRODUCT_CODE") == 0) { |
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
62 | $product_code = $vals[1]; |
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
63 | } |
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
64 | if (strcmp($vals[0], "PRODUCT_NAME") == 0) { |
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
65 | $product_name = $vals[1]; |
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
66 | } |
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
|
67 | 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
|
68 | $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
|
69 | } |
693
3518c07737d8
Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents:
604
diff
changeset
|
70 | if ((strcmp($vals[0], "AIR_TEMPERATURE") == 0) && (strcmp($air_state, "YES") == 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
|
71 | $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
|
72 | } |
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
|
73 | 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
|
74 | $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
|
75 | } |
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 | 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
|
77 | $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
|
78 | } |
522
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
79 | if (strcmp($vals[0], "CHILLER_STATE") == 0) { |
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
80 | $chiller_state = $vals[1]; |
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
81 | } |
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
82 | if ((strcmp($vals[0], "CHILLER_TEMPERATURE") == 0) && ($chiller_state == 0)) { |
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
83 | $chiller_temperature = $vals[1]; |
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
84 | } |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
85 | 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
|
86 | $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
|
87 | } |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
88 | if (strcmp($vals[0], "HEATER_STATE") == 0) { |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
89 | $heater_state = $vals[1]; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
90 | } |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
91 | 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
|
92 | $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
|
93 | } |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
94 | if (strcmp($vals[0], "COOLER_STATE") == 0) { |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
95 | $cooler_state = $vals[1]; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
96 | } |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
97 | 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
|
98 | $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
|
99 | } |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
100 | if (strcmp($vals[0], "FAN_STATE") == 0) { |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
101 | $fan_state = $vals[1]; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
102 | } |
570
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
103 | if (strcmp($vals[0], "PROFILE_UUID") == 0) { |
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
104 | $profile_uuid = $vals[1]; |
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
105 | } |
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
106 | if (strcmp($vals[0], "PROFILE_NAME") == 0) { |
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
107 | $profile_name = $vals[1]; |
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
|
108 | } |
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
|
109 | 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
|
110 | $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
|
111 | } |
578
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
112 | if (($vals[0] == "BEER_SET_LO") && ($mode == "BEER")) { |
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
113 | $set_temperature_lo = $vals[1]; |
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
114 | } |
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
115 | if (($vals[0] == "BEER_SET_HI") && ($mode == "BEER")) { |
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
116 | $set_temperature_hi = $vals[1]; |
186
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
117 | } |
578
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
118 | if (($vals[0] == "FRIDGE_SET_LO") && ($mode == "FRIDGE")) { |
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
119 | $set_temperature_lo = $vals[1]; |
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
120 | } |
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
121 | if (($vals[0] == "FRIDGE_SET_HI") && ($mode == "FRIDGE")) { |
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
122 | $set_temperature_hi = $vals[1]; |
186
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
123 | } |
397
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
124 | if (($vals[0] == "PROF_TARGET_LO") && ($mode == "PROFILE")) { |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
125 | $set_temperature_lo = $vals[1]; |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
126 | } |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
127 | if (($vals[0] == "PROF_TARGET_HI") && ($mode == "PROFILE")) { |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
128 | $set_temperature_hi = $vals[1]; |
186
7c44b11a10b0
Added setting of initial target temperature
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
129 | } |
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
|
130 | } |
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
|
131 | |
554
ab9f22ab57b5
Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents:
529
diff
changeset
|
132 | $logname = $product_code . " " . $product_name; |
117 | 133 | $outstr .= ' <script type="text/javascript">'.PHP_EOL; |
134 | $outstr .= ' $(document).ready(function () {'.PHP_EOL; | |
121
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
135 | |
693
3518c07737d8
Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents:
604
diff
changeset
|
136 | if ("$air_state" == "YES") { |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
137 | $outstr .= ' $("#gaugeContainer_air'.$unr.'").jqxGauge({'.PHP_EOL; |
604
e2766e538d0e
Version 0.9.7. Increased the maximum fermentation temperature to 45 degrees to allow Kveik fermentations.
Michiel Broek <mbroek@mbse.eu>
parents:
593
diff
changeset
|
138 | $outstr .= ' min: -5, max: 45, width: 275, height: 275,'.PHP_EOL; |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
139 | $outstr .= ' ranges: [{ startValue: -5, endValue: 0, style: { fill: \'#3399FF\', stroke: \'#3399FF\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
140 | $outstr .= ' { startValue: 0, endValue: 16, style: { fill: \'#00CC33\', stroke: \'#00CC33\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
141 | $outstr .= ' { startValue: 16, endValue: 24, style: { fill: \'#FCA76A\', stroke: \'#FCA76A\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
604
e2766e538d0e
Version 0.9.7. Increased the maximum fermentation temperature to 45 degrees to allow Kveik fermentations.
Michiel Broek <mbroek@mbse.eu>
parents:
593
diff
changeset
|
142 | $outstr .= ' { startValue: 24, endValue: 45, style: { fill: \'#FC6A6A\', stroke: \'#FC6A6A\' }, endWidth: 10, startWidth: 10 }],'.PHP_EOL; |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
143 | $outstr .= ' ticksMinor: { interval: 1, size: \'5%\' },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
144 | $outstr .= ' ticksMajor: { interval: 5, size: \'9%\' },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
145 | $outstr .= ' labels: { interval: 5 },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
146 | $outstr .= ' value: '.$air_temperature.','.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
147 | $outstr .= ' colorScheme: \'scheme05\','.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
148 | $outstr .= ' animationDuration: 5000,'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
149 | $outstr .= ' caption: { value: \'Air\', position: \'bottom\', offset: [0, 10] }'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
150 | $outstr .= ' });'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
151 | } |
121
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
152 | |
693
3518c07737d8
Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents:
604
diff
changeset
|
153 | if ("$beer_state" == "YES") { |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
154 | $outstr .= ' $(\'#gaugeContainer_beer'.$unr.'\').jqxGauge({'.PHP_EOL; |
604
e2766e538d0e
Version 0.9.7. Increased the maximum fermentation temperature to 45 degrees to allow Kveik fermentations.
Michiel Broek <mbroek@mbse.eu>
parents:
593
diff
changeset
|
155 | $outstr .= ' min: -5, max: 45, width: 275, height: 275,'.PHP_EOL; |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
156 | $outstr .= ' ranges: [{ startValue: -5, endValue: 0, style: { fill: \'#3399FF\', stroke: \'#3399FF\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
157 | $outstr .= ' { startValue: 0, endValue: 16, style: { fill: \'#00CC33\', stroke: \'#00CC33\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
158 | $outstr .= ' { startValue: 16, endValue: 24, style: { fill: \'#FCA76A\', stroke: \'#FCA76A\' }, endWidth: 10, startWidth: 10 },'.PHP_EOL; |
604
e2766e538d0e
Version 0.9.7. Increased the maximum fermentation temperature to 45 degrees to allow Kveik fermentations.
Michiel Broek <mbroek@mbse.eu>
parents:
593
diff
changeset
|
159 | $outstr .= ' { startValue: 24, endValue: 45, style: { fill: \'#FC6A6A\', stroke: \'#FC6A6A\' }, endWidth: 10, startWidth: 10 }],'.PHP_EOL; |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
160 | $outstr .= ' ticksMinor: { interval: 1, size: \'5%\' },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
161 | $outstr .= ' ticksMajor: { interval: 5, size: \'9%\' },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
162 | $outstr .= ' labels: { interval: 5 },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
163 | $outstr .= ' value: '.$beer_temperature.','.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
164 | $outstr .= ' colorScheme: \'scheme05\','.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
165 | $outstr .= ' animationDuration: 5000,'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
166 | $outstr .= ' caption: { value: \'Beer\', position: \'bottom\', offset: [0, 10] }'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
167 | $outstr .= ' });'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
168 | } |
185 | 169 | |
693
3518c07737d8
Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents:
604
diff
changeset
|
170 | if ("$chiller_state" == "YES") { |
523 | 171 | $outstr .= ' $(\'#gaugeContainer_chiller'.$unr.'\').jqxGauge({'.PHP_EOL; |
172 | $outstr .= ' min: -20, max: 25, width: 150, height: 150,'.PHP_EOL; | |
173 | $outstr .= ' ranges: [{ startValue: -20, endValue: 0, startWidth: 5, endWidth: 5, style: { fill: \'#3399FF\', stroke: \'#3399FF\' }},'.PHP_EOL; | |
174 | $outstr .= ' { startValue: 0, endValue: 25, startWidth: 5, endWidth: 5, style: { fill: \'#FC6A6A\', stroke: \'#FC6A6A\' }}],'.PHP_EOL; | |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
175 | $outstr .= ' ticksMinor: { interval: 1, size: \'5%\' },'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
176 | $outstr .= ' ticksMajor: { interval: 5, size: \'9%\' },'.PHP_EOL; |
523 | 177 | $outstr .= ' labels: { interval: 5 },'.PHP_EOL; |
522
4d9ed666431d
Liveview completed the chiller thermometer.
Michiel Broek <mbroek@mbse.eu>
parents:
521
diff
changeset
|
178 | $outstr .= ' value: '.$chiller_temperature.','.PHP_EOL; |
523 | 179 | $outstr .= ' colorScheme: \'scheme05\','.PHP_EOL; |
180 | $outstr .= ' animationDuration: 5000,'.PHP_EOL; | |
181 | $outstr .= ' caption: { value: \'Chiller\', position: \'bottom\', offset: [0, 10] }'.PHP_EOL; | |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
182 | $outstr .= ' });'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
183 | } |
295
e88d182657ca
Added print and save as png buttons
Michiel Broek <mbroek@mbse.eu>
parents:
294
diff
changeset
|
184 | |
171
15f92e5eecef
Ajax screen updates now use a single call to the server
Michiel Broek <mbroek@mbse.eu>
parents:
169
diff
changeset
|
185 | $outstr .= ' setInterval(function(){'.PHP_EOL; |
185 | 186 | $outstr .= ' $.getJSON("getstate.php?uuid='.$unit.'", function(data) {'.PHP_EOL; |
693
3518c07737d8
Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents:
604
diff
changeset
|
187 | if ("$air_state" == "YES") { |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
188 | $outstr .= ' $("#load_air_'.$unr.'").html(data.air_temperature);'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
189 | $outstr .= ' $("#gaugeContainer_air'.$unr.'").jqxGauge(\'value\', data.air_temperature);'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
190 | } |
693
3518c07737d8
Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents:
604
diff
changeset
|
191 | if ("$beer_state" == "YES") { |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
192 | $outstr .= ' $("#load_beer_'.$unr.'").html(data.beer_temperature);'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
193 | $outstr .= ' $("#gaugeContainer_beer'.$unr.'").jqxGauge(\'value\', data.beer_temperature);'.PHP_EOL; |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
194 | } |
693
3518c07737d8
Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents:
604
diff
changeset
|
195 | if ("$chiller_state" == "YES") { |
521 | 196 | $outstr .= ' $("#gaugeContainer_chiller'.$unr.'").jqxGauge(\'value\', data.chiller_temperature);'.PHP_EOL; |
197 | } | |
397
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
198 | $outstr .= ' $("#load_target_lo_'.$unr.'").html(data.target_temperature_lo);'.PHP_EOL; |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
199 | $outstr .= ' $("#load_target_hi_'.$unr.'").html(data.target_temperature_hi);'.PHP_EOL; |
257
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
200 | $outstr .= ' $("#load_select_'.$unr.'").html(data.mode);'.PHP_EOL; |
193
4136193a0c22
Auto refresh LED's state added.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
201 | $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
|
202 | $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
|
203 | $outstr .= ' $("#load_led3_'.$unr.'").html(data.led3);'.PHP_EOL; |
257
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
204 | $outstr .= ' $("#load_sw1_'.$unr.'").html(data.sw1);'.PHP_EOL; |
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
205 | $outstr .= ' $("#load_sw2_'.$unr.'").html(data.sw2);'.PHP_EOL; |
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
206 | $outstr .= ' $("#load_sw3_'.$unr.'").html(data.sw3);'.PHP_EOL; |
284
9e6fb5aed618
Profile progress is visible in the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
271
diff
changeset
|
207 | if ($mode == "PROFILE") |
529 | 208 | $outstr .= ' $("#prof_state_'.$unr.'").html(data.profile_state);'.PHP_EOL; |
209 | $outstr .= ' $("#load_alarm_'.$unr.'").html(data.alarm);'.PHP_EOL; | |
185 | 210 | $outstr .= ' });'.PHP_EOL; |
211 | $outstr .= ' }, 10000);'.PHP_EOL; | |
400
d36f4fefd4e2
Adding tooltips in the liveview screen.
Michiel Broek <mbroek@mbse.eu>
parents:
397
diff
changeset
|
212 | |
d36f4fefd4e2
Adding tooltips in the liveview screen.
Michiel Broek <mbroek@mbse.eu>
parents:
397
diff
changeset
|
213 | /* |
d36f4fefd4e2
Adding tooltips in the liveview screen.
Michiel Broek <mbroek@mbse.eu>
parents:
397
diff
changeset
|
214 | * Tooltips |
d36f4fefd4e2
Adding tooltips in the liveview screen.
Michiel Broek <mbroek@mbse.eu>
parents:
397
diff
changeset
|
215 | */ |
404 | 216 | $outstr .= ' $("#load_air_'.$unr.'").jqxTooltip({ content: "The measured air temperature.", theme: "'.$my_style.'" });'.PHP_EOL; |
217 | $outstr .= ' $("#load_beer_'.$unr.'").jqxTooltip({ content: "The measured beer temperature.", theme: "'.$my_style.'" });'.PHP_EOL; | |
218 | $outstr .= ' $("#load_target_lo_'.$unr.'").jqxTooltip({ content: "The target low temperature.", theme: "'.$my_style.'" });'.PHP_EOL; | |
219 | $outstr .= ' $("#load_target_hi_'.$unr.'").jqxTooltip({ content: "The target high temperature.", theme: "'.$my_style.'" });'.PHP_EOL; | |
220 | $outstr .= ' $("#load_select_'.$unr.'").jqxTooltip({ content: "Select unit mode.", theme: "'.$my_style.'" });'.PHP_EOL; | |
403 | 221 | if (($mode == "NONE") && ($cooler == "yes")) |
404 | 222 | $outstr .= ' $("#load_sw1_'.$unr.'").jqxTooltip({ content: "Manual control cooler.", theme: "'.$my_style.'" });'.PHP_EOL; |
403 | 223 | if (($mode == "NONE") && ($heater == "yes")) |
404 | 224 | $outstr .= ' $("#load_sw2_'.$unr.'").jqxTooltip({ content: "Manual control heater.", theme: "'.$my_style.'" });'.PHP_EOL; |
403 | 225 | if (($mode == "NONE") && ($fan== "yes")) |
404 | 226 | $outstr .= ' $("#load_sw3_'.$unr.'").jqxTooltip({ content: "Manual control fan.", theme: "'.$my_style.'" });'.PHP_EOL; |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
227 | |
117 | 228 | $outstr .= ' });'.PHP_EOL; |
229 | $outstr .= ' </script>'.PHP_EOL; | |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
230 | |
100 | 231 | $outstr .= ' <div id="fermentor">'.PHP_EOL; |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
232 | $outstr .= ' <div id="fermentor_thermometers">'.PHP_EOL; |
693
3518c07737d8
Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents:
604
diff
changeset
|
233 | if (("$air_state" == "YES") && ("$beer_state" == "YES") && ("$chiller_state" == "YES")) { |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
234 | $outstr .= ' <div id="gaugeContainer_air'.$unr.'" style="float: left; margin-top: 10px; margin-left: 10px;"></div>'.PHP_EOL; |
523 | 235 | $outstr .= ' <div id="gaugeContainer_beer'.$unr.'" style="float: right; margin-top: 10px; margin-right: 10px;"></div>'.PHP_EOL; |
236 | $outstr .= ' <div id="gaugeContainer_chiller'.$unr.'" style="float: left; margin-top: 200px;"></div>'.PHP_EOL; | |
693
3518c07737d8
Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents:
604
diff
changeset
|
237 | } else if (("$air_state" == "YES") && ("$beer_state" == "YES")) { |
523 | 238 | $outstr .= ' <div id="gaugeContainer_air'.$unr.'" style="float: left; margin-top: 48px; margin-left: 48px;"></div>'.PHP_EOL; |
239 | $outstr .= ' <div id="gaugeContainer_beer'.$unr.'" style="float: right; margin-top: 48px; margin-right: 48px;"></div>'.PHP_EOL; | |
693
3518c07737d8
Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents:
604
diff
changeset
|
240 | } else if ("$air_state" == "YES") { |
523 | 241 | $outstr .= ' <div id="gaugeContainer_air'.$unr.'" style="margin-top: 48px; margin-left: 222px;"></div>'.PHP_EOL; |
517
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
242 | } |
5fd12d9f3f84
Changed livescreen, now displays thermometers. The chart is loaded on request. This speeds up loading the application.
Michiel Broek <mbroek@mbse.eu>
parents:
404
diff
changeset
|
243 | $outstr .= ' </div>'.PHP_EOL; |
100 | 244 | |
151
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
245 | $outstr .= ' <div id="fermentor_panel_top">'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
246 | $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
|
247 | $outstr .= ' <form id="select_'.$unr.'" action="index.php" method="post">'.PHP_EOL; |
257
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
248 | $outstr .= ' <div id="load_select_'.$unr.'">'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
249 | strcmp($mode, "OFF") ? $se = "" : $se = " checked"; |
168
1288dbf0f9b5
Temperature auto refresh and some layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
155
diff
changeset
|
250 | $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
|
251 | strcmp($mode, "NONE") ? $se = "" : $se = " checked"; |
168
1288dbf0f9b5
Temperature auto refresh and some layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
155
diff
changeset
|
252 | $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
|
253 | (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
|
254 | strcmp($mode, "FRIDGE") ? $se = "" : $se = " checked"; |
168
1288dbf0f9b5
Temperature auto refresh and some layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
155
diff
changeset
|
255 | $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
|
256 | strcmp($mode, "BEER") ? $se = "" : $se = " checked"; |
168
1288dbf0f9b5
Temperature auto refresh and some layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
155
diff
changeset
|
257 | $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
|
258 | strcmp($mode, "PROFILE") ? $se = "" : $se = " checked"; |
168
1288dbf0f9b5
Temperature auto refresh and some layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
155
diff
changeset
|
259 | $outstr .= ' <input type="radio" name="mode" onchange="this.form.submit()" class="select" value="PROFILE"'.$se.$dis.'>Profile'.PHP_EOL; |
257
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
260 | $outstr .= ' </div>'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
261 | $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
|
262 | $outstr .= ' </form>'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
263 | $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
|
264 | |
529 | 265 | $outstr .= ' <div id="fermentor_alarmled">'.PHP_EOL; |
266 | $outstr .= ' <div id="load_alarm_'.$unr.'"><div class="LEDred_'.$alarm_led.'"></div></div>Alm'.PHP_EOL; | |
267 | $outstr .= ' </div>'.PHP_EOL; | |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
268 | $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
|
269 | $outstr .= ' <div class="LEDblue_'.$power_led.'"></div>Pwr'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
270 | $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
|
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 | $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
|
273 | 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
|
274 | $outstr .= ' <form id="set_fridge_'.$unr.'" action="index.php" method="post">'.PHP_EOL; |
578
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
275 | $outstr .= ' <input type="text" name="Fridge_lo" size="5" value="'.$set_temperature_lo.'"><br>'.PHP_EOL; |
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
276 | $outstr .= ' <input type="text" name="Fridge_hi" size="5" value="'.$set_temperature_hi.'"><br>'.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
|
277 | $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
|
278 | $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
|
279 | $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
|
280 | } |
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
|
281 | 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
|
282 | $outstr .= ' <form id="set_beer_'.$unr.'" action="index.php" method="post">'.PHP_EOL; |
578
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
283 | $outstr .= ' <input type="text" name="Beer_lo" size="5" value="'.$set_temperature_lo.'">'.PHP_EOL; |
d694abd9d809
Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents:
570
diff
changeset
|
284 | $outstr .= ' <input type="text" name="Beer_hi" size="5" value="'.$set_temperature_hi.'">'.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
|
285 | $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
|
286 | $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
|
287 | $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
|
288 | } |
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
|
289 | if ($mode == "PROFILE") { |
570
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
290 | $outstr .= ' <div style="color: blue; width: 148px; height: 23px; overflow: hidden;">Profile: '.$profile_name.'</div>'.PHP_EOL; |
284
9e6fb5aed618
Profile progress is visible in the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
271
diff
changeset
|
291 | $outstr .= ' <div id="prof_state_'.$unr.'" style="color: blue; width: 148px; height: 23px; overflow: hidden;">State: '.$prof_state.'</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
|
292 | |
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
|
293 | $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
|
294 | if ($prof_state == "OFF") { |
570
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
295 | if ($profile_name != "") |
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
|
296 | $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
|
297 | |
284
9e6fb5aed618
Profile progress is visible in the web interface
Michiel Broek <mbroek@mbse.eu>
parents:
271
diff
changeset
|
298 | } else if (startsWith($prof_state, "RUN")) { |
219
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
299 | $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
|
300 | $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
|
301 | } else if ($prof_state == "PAUSE") { |
219
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
302 | $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
|
303 | $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
|
304 | } else if ($prof_state == "DONE") { |
219
ae720212accc
Added profile running and steps handling.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
305 | $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
|
306 | } |
570
1e0192b295b9
Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
307 | $outstr .= ' <input type="hidden" value="'.$profile_uuid.'" name="SetProfile">'.PHP_EOL; // Only to select the right form. |
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
|
308 | $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
|
309 | $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
|
310 | } |
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
|
311 | $outstr .= ' </div>'.PHP_EOL; |
151
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
312 | $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
|
313 | |
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
314 | $outstr .= ' <div id="fermentor_panel_display">'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
315 | $outstr .= ' <div id="fermentor_display1">'.PHP_EOL; |
397
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
316 | $outstr .= ' <div id="load_target_hi_'.$unr.'" class="htemp">'.$set_temperature_hi.'</div>'.PHP_EOL; |
00ca08f5a6f8
Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents:
387
diff
changeset
|
317 | $outstr .= ' <div id="load_target_lo_'.$unr.'" class="ltemp">'.$set_temperature_lo.'</div>'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
318 | $outstr .= ' </div>'.PHP_EOL; |
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
319 | $outstr .= ' <div id="fermentor_display2">'.PHP_EOL; |
173 | 320 | $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
|
321 | $outstr .= ' </div>'.PHP_EOL; |
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
322 | $outstr .= ' <div id="fermentor_display3">'.PHP_EOL; |
173 | 323 | $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
|
324 | $outstr .= ' </div>'.PHP_EOL; |
151
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
325 | $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
|
326 | |
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
327 | $outstr .= ' <div id="fermentor_panel_control">'.PHP_EOL; |
360
0f3fe4fa0977
Leds on if any state value is set.
Michiel Broek <mbroek@mbse.eu>
parents:
358
diff
changeset
|
328 | if ($cooler_state) |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
329 | $cooler_led = "on"; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
330 | $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
|
331 | $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
|
332 | $outstr .= ' </div>'.PHP_EOL; |
360
0f3fe4fa0977
Leds on if any state value is set.
Michiel Broek <mbroek@mbse.eu>
parents:
358
diff
changeset
|
333 | if ($heater_state) |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
334 | $heater_led = "on"; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
335 | $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
|
336 | $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
|
337 | $outstr .= ' </div>'.PHP_EOL; |
360
0f3fe4fa0977
Leds on if any state value is set.
Michiel Broek <mbroek@mbse.eu>
parents:
358
diff
changeset
|
338 | if ($fan_state) |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
339 | $fan_led = "on"; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
340 | $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
|
341 | $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
|
342 | $outstr .= ' </div>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
343 | |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
344 | $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
|
345 | $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
|
346 | (($mode == "NONE") && ($cooler == "yes")) ? $dis = "" : $dis = " disabled"; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
347 | ($cooler_state == "0") ? $ch = " checked" : $ch = ""; |
257
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
348 | $outstr .= ' <div id="load_sw1_'.$unr.'">'.PHP_EOL; |
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
349 | $outstr .= ' <input type="radio" name="CoolerState" onchange="this.form.submit()" value="0"'.$dis.$ch.'>Off<br>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
350 | ($cooler_state == "100") ? $ch = " checked" : $ch = ""; |
257
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
351 | $outstr .= ' <input type="radio" name="CoolerState" onchange="this.form.submit()" value="100"'.$dis.$ch.'>On'.PHP_EOL; |
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
352 | $outstr .= ' </div>'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
353 | $outstr .= ' <input type="hidden" name="UUID" value="'.$unit.'">'.PHP_EOL; |
117 | 354 | $outstr .= ' </form>'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
355 | $outstr .= ' </div>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
356 | |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
357 | $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
|
358 | $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
|
359 | (($mode == "NONE") && ($heater == "yes")) ? $dis = "" : $dis = " disabled"; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
360 | ($heater_state == "0") ? $ch = " checked" : $ch = ""; |
257
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
361 | $outstr .= ' <div id="load_sw2_'.$unr.'">'.PHP_EOL; |
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
362 | $outstr .= ' <input type="radio" name="HeaterState" onchange="this.form.submit()" value="0"'.$dis.$ch.'>Off<br>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
363 | ($heater_state == "100") ? $ch = " checked" : $ch = ""; |
257
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
364 | $outstr .= ' <input type="radio" name="HeaterState" onchange="this.form.submit()" value="100"'.$dis.$ch.'>On'.PHP_EOL; |
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
365 | $outstr .= ' </div>'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
366 | $outstr .= ' <input type="hidden" name="UUID" value="'.$unit.'">'.PHP_EOL; |
117 | 367 | $outstr .= ' </form>'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
368 | $outstr .= ' </div>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
369 | |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
370 | $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
|
371 | $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
|
372 | (($mode == "NONE") && ($fan== "yes")) ? $dis = "" : $dis = " disabled"; |
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
373 | ($fan_state == "0") ? $ch = " checked" : $ch = ""; |
257
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
374 | $outstr .= ' <div id="load_sw3_'.$unr.'">'.PHP_EOL; |
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
375 | $outstr .= ' <input type="radio" name="FanState" onchange="this.form.submit()" value="0"'.$dis.$ch.'>Off<br>'.PHP_EOL; |
178
988a898974f3
Web - server communication for switches improved.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
376 | ($fan_state == "100") ? $ch = " checked" : $ch = ""; |
257
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
377 | $outstr .= ' <input type="radio" name="FanState" onchange="this.form.submit()" value="100"'.$dis.$ch.'>On'.PHP_EOL; |
abdba3f9d9e2
Automatic ajax updates of radio buttons
Michiel Broek <mbroek@mbse.eu>
parents:
225
diff
changeset
|
378 | $outstr .= ' </div>'.PHP_EOL; |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
379 | $outstr .= ' <input type="hidden" name="UUID" value="'.$unit.'">'.PHP_EOL; |
117 | 380 | $outstr .= ' </form>'.PHP_EOL; |
113
cf3f906ffe0d
Created control panel layout
Michiel Broek <mbroek@mbse.eu>
parents:
112
diff
changeset
|
381 | $outstr .= ' </div>'.PHP_EOL; |
151
ab90da2da45d
Improved dashboard panel style, added (ugly) led's
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
382 | $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
|
383 | |
122
e57043423e72
Added fermentor maintenance windows
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
384 | $outstr .= ' </div> <!-- fermentor -->'.PHP_EOL; |
100 | 385 | } |
386 | ||
387 | return $outstr; | |
388 | } | |
389 | ||
390 | ||
391 | ||
392 | function liveview() | |
393 | { | |
394 | $outstr = PHP_EOL; | |
395 | ||
196 | 396 | $answer = send_cmd("LIST"); |
397 | if (strlen($answer)) { | |
100 | 398 | $arr = explode("\r\n", $answer); |
399 | ||
117 | 400 | $outstr .= ' <div id="jqxTabs">'.PHP_EOL; |
401 | $outstr .= ' <ul>'.PHP_EOL; | |
100 | 402 | if (startsWith($arr[0], "212")) { |
403 | $i = 1; | |
404 | while (1) { | |
405 | if (strcmp($arr[$i], ".") == 0) | |
406 | break; | |
407 | $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
|
408 | $outstr .= ' <li style="margin-left: 20px;">'.$parts[1].'</li>'.PHP_EOL; |
117 | 409 | $i++; |
410 | } | |
411 | } | |
412 | $outstr .= ' </ul>'.PHP_EOL; | |
413 | ||
414 | if (startsWith($arr[0], "212")) { | |
415 | $i = 1; | |
416 | while (1) { | |
417 | if (strcmp($arr[$i], ".") == 0) | |
418 | break; | |
419 | $parts = explode(",", $arr[$i]); | |
295
e88d182657ca
Added print and save as png buttons
Michiel Broek <mbroek@mbse.eu>
parents:
294
diff
changeset
|
420 | $outstr .= showunit($parts[0], $i, $parts[1]); |
100 | 421 | $i++; |
422 | } | |
423 | } | |
117 | 424 | $outstr .= ' </div> <!-- jqxTabs -->'.PHP_EOL; |
100 | 425 | } |
426 | ||
427 | return $outstr; | |
428 | } | |
429 | ||
430 | ||
431 | ?> |