Fri, 22 Aug 2014 17:12:42 +0200
Added framework for a simulation of a fridge with heater to use as controlled fermentor
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | <?php |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | /***************************************************************************** |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * Copyright (C) 2014 |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * Michiel Broek <mbroek at mbse dot eu> |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * This file is part of ThermFerm |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * This is free software; you can redistribute it and/or modify it |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * Free Software Foundation; either version 2, or (at your option) any |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * later version. |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * ThermFerm is distributed in the hope that it will be useful, but |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | * General Public License for more details. |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | * along with ThermFerm; see the file COPYING. If not, write to the Free |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | *****************************************************************************/ |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | require_once('utilities.php'); |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | |
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:
140
diff
changeset
|
27 | /* |
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:
140
diff
changeset
|
28 | * $arr contains the complete reply of the LIST command. |
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:
140
diff
changeset
|
29 | */ |
196 | 30 | $answer = send_cmd("UNIT LIST"); |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | $arr = explode("\r\n", $answer); |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | |
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:
140
diff
changeset
|
34 | if (isset($_GET['action'])) { |
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:
140
diff
changeset
|
35 | switch ($_GET['action']) { |
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:
140
diff
changeset
|
36 | case 'edit': unit_edit(); |
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:
140
diff
changeset
|
37 | break; |
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:
140
diff
changeset
|
38 | default: break; |
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:
140
diff
changeset
|
39 | } |
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:
140
diff
changeset
|
40 | } elseif (isset($_POST['action'])) { |
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:
140
diff
changeset
|
41 | switch ($_POST['action']) { |
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:
140
diff
changeset
|
42 | case 'testdata': testdata(); |
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:
140
diff
changeset
|
43 | break; |
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:
140
diff
changeset
|
44 | default: break; |
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:
140
diff
changeset
|
45 | } |
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:
140
diff
changeset
|
46 | } else { |
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:
140
diff
changeset
|
47 | unit_list(); |
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:
140
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:
140
diff
changeset
|
49 | |
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:
140
diff
changeset
|
50 | exit; |
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:
140
diff
changeset
|
51 | |
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:
140
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:
140
diff
changeset
|
53 | * |
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:
140
diff
changeset
|
54 | */ |
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:
140
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:
140
diff
changeset
|
56 | /* |
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:
140
diff
changeset
|
57 | * Unit add |
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:
140
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:
140
diff
changeset
|
59 | * @param string $_POST['Name'] The rpofile name |
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:
140
diff
changeset
|
60 | */ |
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:
140
diff
changeset
|
61 | function unit_add() { |
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:
140
diff
changeset
|
62 | |
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:
140
diff
changeset
|
63 | if ($_POST['key'] == 'Add') { |
196 | 64 | send_cmd("UNIT ADD ".$_POST['Name']); |
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:
140
diff
changeset
|
65 | } |
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:
140
diff
changeset
|
66 | |
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:
140
diff
changeset
|
67 | unset($_POST['UUID']); |
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:
140
diff
changeset
|
68 | unset($_POST['Name']); |
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:
140
diff
changeset
|
69 | unset($_POST['key']); |
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:
140
diff
changeset
|
70 | unset($_POST['command']); |
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:
140
diff
changeset
|
71 | load('units.php'); |
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:
140
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:
140
diff
changeset
|
73 | |
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:
140
diff
changeset
|
74 | |
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:
140
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:
140
diff
changeset
|
76 | /* |
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:
140
diff
changeset
|
77 | * Unit update |
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:
140
diff
changeset
|
78 | * |
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:
140
diff
changeset
|
79 | * @param string $_POST['UUID'] The unit UUID |
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:
140
diff
changeset
|
80 | * @param string $_POST['Name'] The unit name |
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:
140
diff
changeset
|
81 | * @param string $_POST['key'] The button pressed. |
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:
140
diff
changeset
|
82 | */ |
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:
140
diff
changeset
|
83 | function unit_update() { |
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:
140
diff
changeset
|
84 | /* |
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:
140
diff
changeset
|
85 | * Build the update command |
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:
140
diff
changeset
|
86 | */ |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
87 | if ($_POST['key'] == 'Delete') { |
196 | 88 | send_cmd("UNIT DEL ".$_POST['UUID']); |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
89 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
90 | |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
91 | if ($_POST['key'] == 'Save') { |
254
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
92 | $cmd = array("UNIT PUT ".$_POST['UUID']); |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
93 | $cmd[] = "NAME,".$_POST['Name']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
94 | $cmd[] = "VOLUME,".$_POST['Volume']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
95 | $cmd[] = "AIR_ADDRESS,".$_POST['AirAddress']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
96 | $cmd[] = "BEER_ADDRESS,".$_POST['BeerAddress']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
97 | $cmd[] = "HEATER_ADDRESS,".$_POST['HeaterAddress']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
98 | $cmd[] = "COOLER_ADDRESS,".$_POST['CoolerAddress']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
99 | $cmd[] = "FAN_ADDRESS,".$_POST['FanAddress']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
100 | $cmd[] = "DOOR_ADDRESS,".$_POST['DoorAddress']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
101 | $cmd[] = "TEMP_SET_MIN,".$_POST['TempSetMin']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
102 | $cmd[] = "TEMP_SET_MAX,".$_POST['TempSetMax']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
103 | $cmd[] = "IDLE_RANGE_L,".$_POST['IdleRangeL']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
104 | $cmd[] = "IDLE_RANGE_H,".$_POST['IdleRangeH']; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
105 | $cmd[] = "."; |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
106 | send_array($cmd); |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
107 | } |
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:
140
diff
changeset
|
108 | |
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:
140
diff
changeset
|
109 | unset($_POST['UUID']); |
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:
140
diff
changeset
|
110 | unset($_POST['Name']); |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
111 | unset($_POST['Volume']); |
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:
140
diff
changeset
|
112 | unset($_POST['key']); |
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:
140
diff
changeset
|
113 | unset($_POST['command']); |
254
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
114 | unset($_POST['AirAddress']); |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
115 | unset($_POST['BeerAddress']); |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
116 | unset($_POST['HeaterAddress']); |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
117 | unset($_POST['CoolerAddress']); |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
118 | unset($_POST['FanAddress']); |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
119 | unset($_POST['DoorAddress']); |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
120 | unset($_POST['TempSetMin']); |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
121 | unset($_POST['TempSetMax']); |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
122 | unset($_POST['IdleRangeL']); |
b29f80afaeac
Units editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
123 | unset($_POST['IdleRangeH']); |
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:
140
diff
changeset
|
124 | load('units.php'); |
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:
140
diff
changeset
|
125 | } |
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:
140
diff
changeset
|
126 | |
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:
140
diff
changeset
|
127 | |
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:
140
diff
changeset
|
128 | |
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:
140
diff
changeset
|
129 | /* |
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:
140
diff
changeset
|
130 | * Test input of a modified or new profile. |
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:
140
diff
changeset
|
131 | * |
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:
140
diff
changeset
|
132 | * @param string $_POST['UUID'] Unique record UUID |
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:
140
diff
changeset
|
133 | * @param string $_POST['Name'] Profile name |
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:
140
diff
changeset
|
134 | * @param string $_POST['key'] Key choice, Save or Cancel |
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:
140
diff
changeset
|
135 | * @param string $_POST['command'] Command used, 'add' or 'update' |
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:
140
diff
changeset
|
136 | * |
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:
140
diff
changeset
|
137 | * Return: 0 = Ok |
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:
140
diff
changeset
|
138 | * 1 = Missing data |
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:
140
diff
changeset
|
139 | * 2 = Name field too short |
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:
140
diff
changeset
|
140 | * 3 = Name already in use |
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:
140
diff
changeset
|
141 | * 99 = Cancel key |
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:
140
diff
changeset
|
142 | */ |
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:
140
diff
changeset
|
143 | function test_thedata() { |
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:
140
diff
changeset
|
144 | |
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:
140
diff
changeset
|
145 | global $arr; |
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:
140
diff
changeset
|
146 | |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
147 | if (isset($_POST['UUID']) && isset($_POST['Name']) && isset($_POST['Volume']) && isset($_POST['AirAddress']) && |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
148 | isset($_POST['BeerAddress']) && isset($_POST['HeaterAddress']) && isset($_POST['CoolerAddress']) && |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
149 | isset($_POST['FanAddress']) && isset($_POST['DoorAddress']) && isset($_POST['TempSetMin']) && isset($_POST['TempSetMax']) && |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
150 | isset($_POST['IdleRangeL']) && isset($_POST['IdleRangeH']) && isset($_POST['key']) && isset($_POST['command'])) { |
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:
140
diff
changeset
|
151 | |
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:
140
diff
changeset
|
152 | if ($_POST['key'] == 'Cancel') |
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:
140
diff
changeset
|
153 | return 99; |
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:
140
diff
changeset
|
154 | |
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:
140
diff
changeset
|
155 | if (strlen($_POST['Name']) < 2) |
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:
140
diff
changeset
|
156 | return 2; |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
157 | |
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:
140
diff
changeset
|
158 | if (startsWith($arr[0], "212")) { |
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:
140
diff
changeset
|
159 | $j = 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:
140
diff
changeset
|
160 | while (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:
140
diff
changeset
|
161 | if (strcmp($arr[$j], ".") == 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:
140
diff
changeset
|
162 | break; |
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:
140
diff
changeset
|
163 | $f = explode(",", $arr[$j]); |
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:
140
diff
changeset
|
164 | if (strcmp($f[0], $_POST['UUID']) && (strcmp($f[1], $_POST['Name']) == 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:
140
diff
changeset
|
165 | return 3; |
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:
140
diff
changeset
|
166 | } |
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:
140
diff
changeset
|
167 | $j++; |
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:
140
diff
changeset
|
168 | } |
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:
140
diff
changeset
|
169 | } |
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:
140
diff
changeset
|
170 | |
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:
140
diff
changeset
|
171 | } else { |
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:
140
diff
changeset
|
172 | return 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:
140
diff
changeset
|
173 | } |
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:
140
diff
changeset
|
174 | |
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:
140
diff
changeset
|
175 | return 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:
140
diff
changeset
|
176 | } |
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:
140
diff
changeset
|
177 | |
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:
140
diff
changeset
|
178 | |
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:
140
diff
changeset
|
179 | |
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:
140
diff
changeset
|
180 | /* |
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:
140
diff
changeset
|
181 | * Test result from edit screen and do next action |
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:
140
diff
changeset
|
182 | */ |
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:
140
diff
changeset
|
183 | function testdata() { |
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:
140
diff
changeset
|
184 | |
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:
140
diff
changeset
|
185 | $result = test_thedata(); |
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:
140
diff
changeset
|
186 | $error = ''; |
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:
140
diff
changeset
|
187 | |
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:
140
diff
changeset
|
188 | switch ($result) { |
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:
140
diff
changeset
|
189 | case 0: if ($_POST['command'] == 'add') { |
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:
140
diff
changeset
|
190 | unit_add(); |
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:
140
diff
changeset
|
191 | return; |
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:
140
diff
changeset
|
192 | } else if ($_POST['command'] == 'update') { |
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:
140
diff
changeset
|
193 | unit_update(); |
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:
140
diff
changeset
|
194 | return; |
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:
140
diff
changeset
|
195 | } |
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:
140
diff
changeset
|
196 | break; |
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:
140
diff
changeset
|
197 | case 1: $error = 'Missing data'; |
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:
140
diff
changeset
|
198 | break; |
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:
140
diff
changeset
|
199 | case 2: $error = 'The name is too short'; |
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:
140
diff
changeset
|
200 | break; |
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:
140
diff
changeset
|
201 | case 3: $error = 'The name is already in use, choose another one'; |
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:
140
diff
changeset
|
202 | break; |
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:
140
diff
changeset
|
203 | case 99: |
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:
140
diff
changeset
|
204 | load('units.php'); |
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:
140
diff
changeset
|
205 | break; |
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:
140
diff
changeset
|
206 | } |
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:
140
diff
changeset
|
207 | |
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:
140
diff
changeset
|
208 | if ($_POST['command'] == 'add') { |
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:
140
diff
changeset
|
209 | $heading = 'ThermFerm - Add Unit'; |
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:
140
diff
changeset
|
210 | } else { |
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:
140
diff
changeset
|
211 | $heading = 'ThermFerm - Edit Unit'; |
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:
140
diff
changeset
|
212 | } |
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:
140
diff
changeset
|
213 | |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
214 | edit_screen($_POST['UUID'], $_POST['command'], $heading, $error); |
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:
140
diff
changeset
|
215 | } |
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:
140
diff
changeset
|
216 | |
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:
140
diff
changeset
|
217 | |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
218 | |
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:
140
diff
changeset
|
219 | /* |
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:
140
diff
changeset
|
220 | * Unit edit screen. Used by unit_edit(), unit_add() and testdata() |
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:
140
diff
changeset
|
221 | * |
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:
140
diff
changeset
|
222 | * @param string $UUID The record UUID (fixed). |
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:
140
diff
changeset
|
223 | * @param string $command 'add' or 'update' |
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:
140
diff
changeset
|
224 | * @param string $heading Page heading title. |
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:
140
diff
changeset
|
225 | * @Param string $error_message Blank or previous error. |
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:
140
diff
changeset
|
226 | */ |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
227 | function edit_screen($UUID, $command, $heading, $error_message) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
228 | |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
229 | /* |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
230 | * Get list of devices, we need it later |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
231 | */ |
196 | 232 | $answer = send_cmd("DEVICE LIST"); |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
233 | $devices = explode("\r\n", $answer); |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
234 | |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
235 | /* |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
236 | * Get current unit data |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
237 | */ |
196 | 238 | $answer = send_cmd("UNIT GET ".$UUID); |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
239 | $reply = explode("\r\n", $answer); |
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:
140
diff
changeset
|
240 | |
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:
140
diff
changeset
|
241 | $outstr = build_header($heading); |
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:
140
diff
changeset
|
242 | $outstr .= ' <div id="errors">'.PHP_EOL; |
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:
140
diff
changeset
|
243 | $outstr .= ' '.$error_message.PHP_EOL; |
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:
140
diff
changeset
|
244 | $outstr .= ' </div> <!-- errors -->'.PHP_EOL; |
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:
140
diff
changeset
|
245 | $outstr .= ' <div id="etable">'.PHP_EOL; |
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:
140
diff
changeset
|
246 | $outstr .= ' <form method="POST" action="units.php">'.PHP_EOL; |
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:
140
diff
changeset
|
247 | $outstr .= ' <table class="editor">'.PHP_EOL; |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
248 | |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
249 | if (startsWith($reply[0], "213")) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
250 | $i = 1; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
251 | while (1) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
252 | if (strcmp($reply[$i], ".") == 0) |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
253 | break; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
254 | $f = explode(",", $reply[$i]); |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
255 | |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
256 | if ($f[0] == "NAME") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
257 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
258 | $outstr .= ' <td class="editname">Unit Name</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
259 | $outstr .= ' <td class="editfield"><input type="text" name="Name" size="50" value="'.$f[1].'"></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
260 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
261 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
262 | if ($f[0] == "VOLUME") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
263 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
264 | $outstr .= ' <td class="editname">Unit Volume</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
265 | $outstr .= ' <td class="editfield"><input type="text" name="Volume" size="5" value="'.$f[1].'"></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
266 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
267 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
268 | if ($f[0] == "AIR_ADDRESS") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
269 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
270 | $outstr .= ' <td class="editname">Air Sensor Address</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
271 | $outstr .= ' <td class="editfield"><select name="AirAddress">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
272 | $outstr .= ' <option value="">Not Assigned</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
273 | if (startsWith($devices[0], "212")) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
274 | $j = 1; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
275 | while (1) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
276 | if (strcmp($devices[$j], ".") == 0) |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
277 | break; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
278 | $g = explode(",", $devices[$j]); |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
279 | if ($g[5] == "IN_ANALOG") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
280 | ($f[1] == $g[0]) ? $se = " selected" : $se = ""; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
281 | $outstr .= ' <option value="'.$g[0].'"'.$se.'>'.$g[1].' '.$g[4].'</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
282 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
283 | $j++; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
284 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
285 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
286 | $outstr .= ' </select></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
287 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
288 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
289 | if ($f[0] == "BEER_ADDRESS") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
290 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
291 | $outstr .= ' <td class="editname">Beer Sensor Address</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
292 | $outstr .= ' <td class="editfield"><select name="BeerAddress">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
293 | $outstr .= ' <option value="">Not Assigned</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
294 | if (startsWith($devices[0], "212")) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
295 | $j = 1; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
296 | while (1) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
297 | if (strcmp($devices[$j], ".") == 0) |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
298 | break; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
299 | $g = explode(",", $devices[$j]); |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
300 | if ($g[5] == "IN_ANALOG") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
301 | ($f[1] == $g[0]) ? $se = " selected" : $se = ""; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
302 | $outstr .= ' <option value="'.$g[0].'"'.$se.'>'.$g[1].' '.$g[4].'</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
303 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
304 | $j++; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
305 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
306 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
307 | $outstr .= ' </select></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
308 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
309 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
310 | if ($f[0] == "HEATER_ADDRESS") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
311 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
312 | $outstr .= ' <td class="editname">Heater Switch Address</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
313 | $outstr .= ' <td class="editfield"><select name="HeaterAddress">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
314 | $outstr .= ' <option value="">Not Assigned</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
315 | if (startsWith($devices[0], "212")) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
316 | $j = 1; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
317 | while (1) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
318 | if (strcmp($devices[$j], ".") == 0) |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
319 | break; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
320 | $g = explode(",", $devices[$j]); |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
321 | if (($g[5] == "OUT_ANALOG") || ($g[5] == "OUT_BIN")) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
322 | ($f[1] == $g[0]) ? $se = " selected" : $se = ""; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
323 | $outstr .= ' <option value="'.$g[0].'"'.$se.'>'.$g[1].' '.$g[4].'</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
324 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
325 | $j++; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
326 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
327 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
328 | $outstr .= ' </select></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
329 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
330 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
331 | if ($f[0] == "COOLER_ADDRESS") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
332 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
333 | $outstr .= ' <td class="editname">Cooler Switch Address</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
334 | $outstr .= ' <td class="editfield"><select name="CoolerAddress">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
335 | $outstr .= ' <option value="">Not Assigned</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
336 | if (startsWith($devices[0], "212")) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
337 | $j = 1; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
338 | while (1) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
339 | if (strcmp($devices[$j], ".") == 0) |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
340 | break; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
341 | $g = explode(",", $devices[$j]); |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
342 | if (($g[5] == "OUT_ANALOG") || ($g[5] == "OUT_BIN")) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
343 | ($f[1] == $g[0]) ? $se = " selected" : $se = ""; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
344 | $outstr .= ' <option value="'.$g[0].'"'.$se.'>'.$g[1].' '.$g[4].'</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
345 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
346 | $j++; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
347 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
348 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
349 | $outstr .= ' </select></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
350 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
351 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
352 | if ($f[0] == "FAN_ADDRESS") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
353 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
354 | $outstr .= ' <td class="editname">Fan Switch Address</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
355 | $outstr .= ' <td class="editfield"><select name="FanAddress">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
356 | $outstr .= ' <option value="">Not Assigned</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
357 | if (startsWith($devices[0], "212")) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
358 | $j = 1; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
359 | while (1) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
360 | if (strcmp($devices[$j], ".") == 0) |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
361 | break; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
362 | $g = explode(",", $devices[$j]); |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
363 | if (($g[5] == "OUT_ANALOG") || ($g[5] == "OUT_BIN")) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
364 | ($f[1] == $g[0]) ? $se = " selected" : $se = ""; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
365 | $outstr .= ' <option value="'.$g[0].'"'.$se.'>'.$g[1].' '.$g[4].'</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
366 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
367 | $j++; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
368 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
369 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
370 | $outstr .= ' </select></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
371 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
372 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
373 | if ($f[0] == "DOOR_ADDRESS") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
374 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
375 | $outstr .= ' <td class="editname">Door Sensor Address</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
376 | $outstr .= ' <td class="editfield"><select name="DoorAddress">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
377 | $outstr .= ' <option value="">Not Assigned</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
378 | if (startsWith($devices[0], "212")) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
379 | $j = 1; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
380 | while (1) { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
381 | if (strcmp($devices[$j], ".") == 0) |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
382 | break; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
383 | $g = explode(",", $devices[$j]); |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
384 | if ($g[5] == "IN_BIN") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
385 | ($f[1] == $g[0]) ? $se = " selected" : $se = ""; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
386 | $outstr .= ' <option value="'.$g[0].'"'.$se.'>'.$g[1].' '.$g[4].'</option>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
387 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
388 | $j++; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
389 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
390 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
391 | $outstr .= ' </select></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
392 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
393 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
394 | if ($f[0] == "TEMP_SET_MIN") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
395 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
396 | $outstr .= ' <td class="editname">Min. temp setting</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
397 | $outstr .= ' <td class="editfield"><input type="text" name="TempSetMin" size="5" value="'.$f[1].'"></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
398 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
399 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
400 | if ($f[0] == "TEMP_SET_MAX") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
401 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
402 | $outstr .= ' <td class="editname">Max. temp setting</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
403 | $outstr .= ' <td class="editfield"><input type="text" name="TempSetMax" size="5" value="'.$f[1].'"></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
404 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
405 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
406 | if ($f[0] == "IDLE_RANGE_L") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
407 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
408 | $outstr .= ' <td class="editname">Idle Range Low</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
409 | $outstr .= ' <td class="editfield"><input type="text" name="IdleRangeL" size="5" value="'.$f[1].'"></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
410 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
411 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
412 | if ($f[0] == "IDLE_RANGE_H") { |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
413 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
414 | $outstr .= ' <td class="editname">Idle Range High</td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
415 | $outstr .= ' <td class="editfield"><input type="text" name="IdleRangeH" size="5" value="'.$f[1].'"></td>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
416 | $outstr .= ' </tr>'.PHP_EOL; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
417 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
418 | $i++; |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
419 | } |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
420 | } |
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:
140
diff
changeset
|
421 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
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:
140
diff
changeset
|
422 | $outstr .= ' <td class="editname"><input type="submit" value="Save" name="key"></td>'.PHP_EOL; |
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:
140
diff
changeset
|
423 | $outstr .= ' <td class="editfield"><input type="submit" value="Cancel" name="key">'; |
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:
140
diff
changeset
|
424 | $outstr .= '<input type="submit" value="Delete" name="key" style="margin-left: 100px;">'; |
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:
140
diff
changeset
|
425 | $outstr .= '<input type="hidden" value="testdata" name="action">'; |
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:
140
diff
changeset
|
426 | $outstr .= '<input type="hidden" value="'.$command.'" name="command">'; |
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:
140
diff
changeset
|
427 | $outstr .= '<input type="hidden" value="'.$UUID.'" name="UUID"></td>'.PHP_EOL; |
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:
140
diff
changeset
|
428 | $outstr .= ' </tr>'.PHP_EOL; |
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:
140
diff
changeset
|
429 | $outstr .= ' </table>'.PHP_EOL; |
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:
140
diff
changeset
|
430 | $outstr .= ' </form>'.PHP_EOL; |
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:
140
diff
changeset
|
431 | $outstr .= ' </div> <!-- etable -->'.PHP_EOL; |
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:
140
diff
changeset
|
432 | $outstr .= build_footer(); |
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:
140
diff
changeset
|
433 | echo $outstr; |
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:
140
diff
changeset
|
434 | } |
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:
140
diff
changeset
|
435 | |
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:
140
diff
changeset
|
436 | |
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:
140
diff
changeset
|
437 | |
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:
140
diff
changeset
|
438 | /* |
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:
140
diff
changeset
|
439 | * Edit a Unit. Fetches the record data and shows the edit screen. |
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:
140
diff
changeset
|
440 | * |
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:
140
diff
changeset
|
441 | * @param string $_GET['action'] Must be 'edit'. |
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:
140
diff
changeset
|
442 | * @param string $_GET['UUID'] The UUID of the Unit. |
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:
140
diff
changeset
|
443 | */ |
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:
140
diff
changeset
|
444 | function unit_edit() { |
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:
140
diff
changeset
|
445 | if ($_GET['action'] == 'edit') { |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
446 | edit_screen($_GET['UUID'], 'update', 'ThermFerm - Edit Unit', ''); |
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
447 | return; |
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:
140
diff
changeset
|
448 | } else { |
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:
140
diff
changeset
|
449 | load('units.php'); |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
450 | } |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
451 | } |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
452 | |
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:
140
diff
changeset
|
453 | |
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:
140
diff
changeset
|
454 | |
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:
140
diff
changeset
|
455 | /* |
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:
140
diff
changeset
|
456 | * @link edit unit |
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:
140
diff
changeset
|
457 | * @link add unit |
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:
140
diff
changeset
|
458 | */ |
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:
140
diff
changeset
|
459 | function unit_list() { |
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:
140
diff
changeset
|
460 | |
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:
140
diff
changeset
|
461 | global $arr; |
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:
140
diff
changeset
|
462 | |
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:
140
diff
changeset
|
463 | $outstr = build_header('ThermFerm - Units Maintenance'); |
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:
140
diff
changeset
|
464 | $outstr .= ' <div id="errors">'.PHP_EOL; |
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:
140
diff
changeset
|
465 | $outstr .= ' </div> <!-- errors -->'.PHP_EOL; |
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:
140
diff
changeset
|
466 | $outstr .= ' <div id="etable">'.PHP_EOL; |
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:
140
diff
changeset
|
467 | $outstr .= ' <table class="setup">'.PHP_EOL; |
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:
140
diff
changeset
|
468 | $outstr .= ' <tr class="trhead">'.PHP_EOL; |
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:
140
diff
changeset
|
469 | $outstr .= ' <td class="setup" style="width: 300px;">UUID</td>'.PHP_EOL; |
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:
140
diff
changeset
|
470 | $outstr .= ' <td class="setup" style="width: 300px;">Name</td>'.PHP_EOL; |
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:
140
diff
changeset
|
471 | $outstr .= ' <td class="setup" style="width: 60px;">Mode</td>'.PHP_EOL; |
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:
140
diff
changeset
|
472 | $outstr .= ' <td class="setup" style="width: 40px;">Edit</td>'.PHP_EOL; |
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:
140
diff
changeset
|
473 | $outstr .= ' </tr>'.PHP_EOL; |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
474 | |
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:
140
diff
changeset
|
475 | if (startsWith($arr[0], "212")) { |
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:
140
diff
changeset
|
476 | $j = 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:
140
diff
changeset
|
477 | while (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:
140
diff
changeset
|
478 | if (strcmp($arr[$j], ".") == 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:
140
diff
changeset
|
479 | break; |
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:
140
diff
changeset
|
480 | $f = explode(",", $arr[$j]); |
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:
140
diff
changeset
|
481 | $outstr .= ' <tr class="setup">'.PHP_EOL; |
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:
140
diff
changeset
|
482 | $outstr .= ' <td class="setup">'.$f[0].'</td>'.PHP_EOL; |
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:
140
diff
changeset
|
483 | $outstr .= ' <td class="setup">'.$f[1].'</td>'.PHP_EOL; |
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:
140
diff
changeset
|
484 | $outstr .= ' <td class="setup">'.$f[2].'</td>'.PHP_EOL; |
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:
140
diff
changeset
|
485 | if (strcmp($f[2], "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:
140
diff
changeset
|
486 | $outstr .= ' <td class="setup">Busy</td>'.PHP_EOL; |
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:
140
diff
changeset
|
487 | } else { |
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:
140
diff
changeset
|
488 | $outstr .= ' <td class="setup"><a href="units.php?action=edit&UUID='.$f[0].'">Edit</a></td>'.PHP_EOL; |
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:
140
diff
changeset
|
489 | } |
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:
140
diff
changeset
|
490 | $outstr .= ' </tr>'.PHP_EOL; |
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:
140
diff
changeset
|
491 | $j++; |
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:
140
diff
changeset
|
492 | } |
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:
140
diff
changeset
|
493 | } |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
494 | |
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:
140
diff
changeset
|
495 | $outstr .= ' </table>'.PHP_EOL; |
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:
140
diff
changeset
|
496 | $outstr .= ' </div> <!-- etable -->'.PHP_EOL; |
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:
140
diff
changeset
|
497 | |
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:
140
diff
changeset
|
498 | $outstr .= ' <div id="atable">'.PHP_EOL; |
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:
140
diff
changeset
|
499 | $outstr .= ' <form method="POST" action="units.php">'.PHP_EOL; |
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:
140
diff
changeset
|
500 | $outstr .= ' <table class="editor">'.PHP_EOL; |
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:
140
diff
changeset
|
501 | $outstr .= ' <tr class="trhead"><td colspan="3">Add new unit</td></tr>'.PHP_EOL; |
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:
140
diff
changeset
|
502 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
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:
140
diff
changeset
|
503 | $outstr .= ' <td class="editname">Unit Name</td>'.PHP_EOL; |
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:
140
diff
changeset
|
504 | $outstr .= ' <td class="editfield"><input type="text" name="Name" size="50" value=""></td>'.PHP_EOL; |
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:
140
diff
changeset
|
505 | $outstr .= ' <td class="editsub"><input type="submit" value="Add" name="key"></td>'.PHP_EOL; |
175
b73490398368
Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents:
153
diff
changeset
|
506 | $outstr .= '<input type="hidden" value="0.0" name="Volume">'; |
243
ab75ff8e26e1
Fixed add unit web interface
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
507 | $outstr .= '<input type="hidden" value="" name="AirAddress">'; |
ab75ff8e26e1
Fixed add unit web interface
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
508 | $outstr .= '<input type="hidden" value="" name="BeerAddress">'; |
ab75ff8e26e1
Fixed add unit web interface
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
509 | $outstr .= '<input type="hidden" value="" name="HeaterAddress">'; |
ab75ff8e26e1
Fixed add unit web interface
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
510 | $outstr .= '<input type="hidden" value="" name="CoolerAddress">'; |
ab75ff8e26e1
Fixed add unit web interface
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
511 | $outstr .= '<input type="hidden" value="" name="FanAddress">'; |
ab75ff8e26e1
Fixed add unit web interface
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
512 | $outstr .= '<input type="hidden" value="" name="DoorAddress">'; |
ab75ff8e26e1
Fixed add unit web interface
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
513 | $outstr .= '<input type="hidden" value="1.0" name="TempSetMin">'; |
ab75ff8e26e1
Fixed add unit web interface
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
514 | $outstr .= '<input type="hidden" value="30.0" name="TempSetMax">'; |
ab75ff8e26e1
Fixed add unit web interface
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
515 | $outstr .= '<input type="hidden" value="-1.0" name="IdleRangeL">'; |
ab75ff8e26e1
Fixed add unit web interface
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
516 | $outstr .= '<input type="hidden" value="1.0" name="IdleRangeH">'; |
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:
140
diff
changeset
|
517 | $outstr .= '<input type="hidden" value="testdata" name="action">'; |
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:
140
diff
changeset
|
518 | $outstr .= '<input type="hidden" value="add" name="command">'; |
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:
140
diff
changeset
|
519 | $outstr .= '<input type="hidden" value="00000000-0000-0000-0000-000000000000" name="UUID">'; |
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:
140
diff
changeset
|
520 | $outstr .= ' </tr>'.PHP_EOL; |
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:
140
diff
changeset
|
521 | $outstr .= ' </table>'.PHP_EOL; |
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:
140
diff
changeset
|
522 | $outstr .= ' </form>'.PHP_EOL; |
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:
140
diff
changeset
|
523 | $outstr .= ' </div> <!-- atable -->'.PHP_EOL; |
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:
140
diff
changeset
|
524 | $outstr .= build_footer(); |
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:
140
diff
changeset
|
525 | echo $outstr; |
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:
140
diff
changeset
|
526 | } |
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:
140
diff
changeset
|
527 |