thermferm/rdconfig.c

Sun, 05 May 2024 17:24:54 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 05 May 2024 17:24:54 +0200
changeset 730
6eba006ed8f5
parent 716
5c30c8ef83a8
permissions
-rw-r--r--

Much faster shutdown of the websocket service.

51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
645
49eb753a958b All thread locks from wiringPi to standard pthreads.
Michiel Broek <mbroek@mbse.eu>
parents: 615
diff changeset
2 * Copyright (C) 2014-2024
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of the mbsePi-apps
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * mbsePi-apps is distributed in the hope that it will be useful, but
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
213
2317b8d644fa Code cleanup, streamlined error messages.
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
106
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents: 101
diff changeset
23 #include "rdconfig.h"
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 #include "thermferm.h"
363
468ec0d96cce Back to the old PID algorythm. Version 0.3.1.
Michiel Broek <mbroek@mbse.eu>
parents: 362
diff changeset
25 #include "pid.h"
106
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents: 101
diff changeset
26 #include "futil.h"
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents: 101
diff changeset
27 #include "xutil.h"
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28
645
49eb753a958b All thread locks from wiringPi to standard pthreads.
Michiel Broek <mbroek@mbse.eu>
parents: 615
diff changeset
29 int debug = FALSE;
666
48cc8868f9f4 Added commandline switch --foreground, the --debug now only activates extra debug logging. No more console output. The thermferm process uses a state table, this makes the code more readable and have less large functions.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
30 int foreground = FALSE;
645
49eb753a958b All thread locks from wiringPi to standard pthreads.
Michiel Broek <mbroek@mbse.eu>
parents: 615
diff changeset
31 sys_config Config; /* System configuration */
49eb753a958b All thread locks from wiringPi to standard pthreads.
Michiel Broek <mbroek@mbse.eu>
parents: 615
diff changeset
32 extern pthread_mutex_t mutexes[5];
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
34 #define MY_ENCODING "utf-8"
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35
90
28ee293654fd Added profile parameters
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
36 const char UNITMODE[5][8] = { "OFF", "NONE", "FRIDGE", "BEER", "PROFILE" };
566
776a605befa5 Added Carbonation stage.
Michiel Broek <mbroek@mbse.eu>
parents: 565
diff changeset
37 const char UNITSTAGE[4][12] = { "PRIMARY", "SECONDARY", "TERTIARY", "CARBONATION" };
217
2922d439ff63 Added profile state ABORT
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
38 const char PROFSTATE[5][6] = { "OFF", "PAUSE", "RUN", "DONE", "ABORT" };
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
39 const char DEVTYPE[8][6] = { "NA", "W1", "GPIO", "RC433", "DHT", "I2C", "SPI", "SIM" };
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
40 const char DEVPRESENT[4][6] = { "UNDEF", "NO", "YES", "ERROR" };
162
6fc9e3f7962f Added Raspberry GPIO devices
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
41 const char DEVDIR[7][11] = { "UNDEF", "IN_BIN", "OUT_BIN", "IN_ANALOG", "OUT_ANALOG", "OUT_PWM", "INTERN" };
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
42 const char PIDMODE[3][5] = { "NONE", "AUTO", "BOO" };
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
45
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
46 int parseSteps(xmlDocPtr doc, xmlNodePtr cur, prof_step **step);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
47
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 void killconfig(void)
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 {
561
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
50 units_list *tmp2, *oldtmp2;
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
51 prof_step *step, *oldstep;
561
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
52 devices_list *device, *olddev;
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
53 #ifdef USE_SIMULATOR
561
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
54 simulator_list *simulator, *oldsim;
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
55 #endif
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 if (Config.name)
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 free(Config.name);
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 Config.name = NULL;
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
61 Config.server_port = 6554;
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
62 Config.websocket_port = 8020;
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
63 if (Config.temp_uuid)
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
64 free(Config.temp_uuid);
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
65 if (Config.hum_uuid)
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
66 free(Config.hum_uuid);
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
67 Config.temp_hum_idx = 0;
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
68 Config.temp_uuid = Config.hum_uuid = NULL;
206
78fb6f99e473 Added GLOBAL GET and GLOBAL PUT commands.
Michiel Broek <mbroek@mbse.eu>
parents: 194
diff changeset
69 Config.temp_value = 20000;
78fb6f99e473 Added GLOBAL GET and GLOBAL PUT commands.
Michiel Broek <mbroek@mbse.eu>
parents: 194
diff changeset
70 Config.temp_state = Config.hum_state = 1; // missing
78fb6f99e473 Added GLOBAL GET and GLOBAL PUT commands.
Michiel Broek <mbroek@mbse.eu>
parents: 194
diff changeset
71 Config.hum_value = 50000;
500
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
72 if (Config.mqtt_host)
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
73 free(Config.mqtt_host);
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
74 Config.mqtt_host = NULL;
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
75 Config.mqtt_port = 1883;
534
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
76 if (Config.mqtt_username)
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
77 free(Config.mqtt_username);
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
78 Config.mqtt_username = NULL;
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
79 if (Config.mqtt_password)
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
80 free(Config.mqtt_password);
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
81 Config.mqtt_password = NULL;
540
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
82 if (Config.uuid)
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
83 free(Config.uuid);
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
84 Config.uuid = NULL;
497
18ace27338e5 Compiles mosquitto code if library is found on the system. Bumped to version 0.5.4
Michiel Broek <mbroek@mbse.eu>
parents: 492
diff changeset
85
561
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
86 for (tmp2 = Config.units; tmp2; tmp2 = oldtmp2) {
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
87 oldtmp2 = tmp2->next;
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
88 if (tmp2->uuid)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
89 free(tmp2->uuid);
554
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
90 if (tmp2->product_uuid)
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
91 free(tmp2->product_uuid);
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
92 if (tmp2->product_code)
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
93 free(tmp2->product_code);
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
94 if (tmp2->product_name)
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
95 free(tmp2->product_name);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
96 if (tmp2->air_address)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
97 free(tmp2->air_address);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
98 if (tmp2->beer_address)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
99 free(tmp2->beer_address);
615
33a5b63e86d7 Fixed init problems.
Michiel Broek <mbroek@mbse.eu>
parents: 614
diff changeset
100 if (tmp2->beer_address2)
33a5b63e86d7 Fixed init problems.
Michiel Broek <mbroek@mbse.eu>
parents: 614
diff changeset
101 free(tmp2->beer_address2);
518
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
102 if (tmp2->chiller_address)
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
103 free(tmp2->chiller_address);
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: 174
diff changeset
104 if (tmp2->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: 174
diff changeset
105 free(tmp2->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: 174
diff changeset
106 if (tmp2->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: 174
diff changeset
107 free(tmp2->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: 174
diff changeset
108 if (tmp2->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: 174
diff changeset
109 free(tmp2->fan_address);
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
110 if (tmp2->light_address)
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
111 free(tmp2->light_address);
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: 174
diff changeset
112 if (tmp2->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: 174
diff changeset
113 free(tmp2->door_address);
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
114 if (tmp2->psu_address)
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
115 free(tmp2->psu_address);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
116 if (tmp2->profile_uuid)
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
117 free(tmp2->profile_uuid);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
118 if (tmp2->profile_name)
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
119 free(tmp2->profile_name);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
120 if (tmp2->profile_steps) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
121 for (step = tmp2->profile_steps; step; step = oldstep) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
122 if (step->name)
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
123 free(step->name);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
124 oldstep = step->next;
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
125 free(step);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
126 }
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
127 }
561
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
128 if (tmp2->PID_cool)
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
129 free(tmp2->PID_cool);
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
130 if (tmp2->PID_heat)
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
131 free(tmp2->PID_heat);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
132 free(tmp2);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
133 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
134 Config.units = NULL;
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135
561
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
136 for (device = Config.devices; device; device = olddev) {
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
137 olddev = device->next;
161
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
138 if (device->uuid)
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
139 free(device->uuid);
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
140 if (device->address)
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
141 free(device->address);
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
142 if (device->description)
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
143 free(device->description);
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
144 if (device->comment)
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
145 free(device->comment);
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
146 free(device);
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
147 }
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
148 Config.devices = NULL;
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
149
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
150 #ifdef USE_SIMULATOR
561
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
151 for (simulator = Config.simulators; simulator; simulator = oldsim) {
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
152 oldsim = simulator->next;
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
153 if (simulator->uuid)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
154 free(simulator->uuid);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
155 if (simulator->name)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
156 free(simulator->name);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
157 if (simulator->room_tempaddress)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
158 free(simulator->room_tempaddress);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
159 if (simulator->room_humaddress)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
160 free(simulator->room_humaddress);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
161 if (simulator->air_address)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
162 free(simulator->air_address);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
163 if (simulator->beer_address)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
164 free(simulator->beer_address);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
165 if (simulator->beer_address2)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
166 free(simulator->beer_address2);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
167 if (simulator->chiller_address)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
168 free(simulator->chiller_address);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
169 if (simulator->cooler_address)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
170 free(simulator->cooler_address);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
171 if (simulator->heater_address)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
172 free(simulator->heater_address);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
173 if (simulator->fan_address)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
174 free(simulator->fan_address);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
175 if (simulator->light_address)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
176 free(simulator->light_address);
716
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
177 if (simulator->door_address)
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
178 free(simulator->door_address);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
179 if (simulator->psu_address)
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
180 free(simulator->psu_address);
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
181 free(simulator);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
182 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
183 Config.simulators = NULL;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
184 #endif
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
185
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
186 Config.lcd_cols = 16;
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
187 Config.lcd_rows = 2;
53
37623517e0ef Added writing configuration
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
188 }
37623517e0ef Added writing configuration
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
189
37623517e0ef Added writing configuration
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
190
37623517e0ef Added writing configuration
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
191
166
c31ea86fec43 Forgot some close functions so tha program ran out of file descriptors. Better loggin for writing the configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
192 int do_wrconfig(void);
c31ea86fec43 Forgot some close functions so tha program ran out of file descriptors. Better loggin for writing the configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
193 int do_wrconfig(void)
53
37623517e0ef Added writing configuration
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
194 {
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
195 int rc = 0;
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
196 FILE *fp;
370
843dc511c877 Fixed memory leak in wrconfig
Michiel Broek <mbroek@mbse.eu>
parents: 363
diff changeset
197 char *mypath = NULL;
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
198 xmlTextWriterPtr writer;
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
199 xmlBufferPtr buf;
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
200 units_list *tmp3;
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
201 prof_step *tmp5;
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
202 devices_list *device;
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
203 #ifdef USE_SIMULATOR
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
204 simulator_list *simulator;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
205 #endif
53
37623517e0ef Added writing configuration
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
206
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
207 /*
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
208 * Create a new XML buffer, to which the XML document will be written
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
209 */
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
210 if ((buf = xmlBufferCreate()) == NULL) {
268
dda91dfa4aa8 All syslog logging only to LOG_NOTICE
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
211 syslog(LOG_NOTICE, "wrconfig: error creating the xml buffer");
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
212 return 1;
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
213 }
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
214
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
215 /*
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
216 * Create a new XmlWriter for memory, with no compression.
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
217 */
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
218 if ((writer = xmlNewTextWriterMemory(buf, 0)) == NULL) {
268
dda91dfa4aa8 All syslog logging only to LOG_NOTICE
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
219 syslog(LOG_NOTICE, "wrconfig: error creating the xml writer");
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
220 return 1;
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
221 }
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
222
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
223 /*
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
224 * Use indentation instead of one long line
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
225 */
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
226 if ((rc = xmlTextWriterSetIndent(writer, 2)) < 0) {
268
dda91dfa4aa8 All syslog logging only to LOG_NOTICE
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
227 syslog(LOG_NOTICE, "wrconfig: error setting Indent");
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
228 return 1;
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
229 }
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
230
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
231 /*
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
232 * Start the document with the xml default for the version,
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
233 * encoding UTF-8 and the default for the standalone declaration.
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
234 */
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
235 xmlTextWriterStartDocument(writer, NULL, MY_ENCODING, NULL);
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
236
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
237 /*
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
238 * Start an element named "THERMFERM". Since thist is the first
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
239 * element, this will be the root element of the document.
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
240 */
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
241 xmlTextWriterStartElement(writer, BAD_CAST "THERMFERM");
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
242
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
243 xmlTextWriterWriteFormatElement(writer, BAD_CAST "NAME", "%s", Config.name);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
244 xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", Config.uuid);
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
245 xmlTextWriterWriteFormatElement(writer, BAD_CAST "SERVER_PORT", "%d", Config.server_port);
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
246 xmlTextWriterWriteFormatElement(writer, BAD_CAST "WS_PORT", "%d", Config.websocket_port);
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
247
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
248 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_UUID", "%s", Config.temp_uuid);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
249 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_STATE", "%d", Config.temp_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
250 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_VALUE", "%d", Config.temp_value);
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
251 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_UUID", "%s", Config.hum_uuid);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
252 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_STATE", "%d", Config.hum_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
253 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_VALUE", "%d", Config.hum_value);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
254 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_HUM_IDX", "%d", Config.temp_hum_idx);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
255
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
256 xmlTextWriterWriteFormatElement(writer, BAD_CAST "NEXT_UNIT", "%d", Config.next_unit);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
257
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
258 xmlTextWriterWriteFormatElement(writer, BAD_CAST "MQTT_HOST", "%s", Config.mqtt_host);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
259 xmlTextWriterWriteFormatElement(writer, BAD_CAST "MQTT_PORT", "%d", Config.mqtt_port);
534
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
260 if (Config.mqtt_username && Config.mqtt_password) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
261 xmlTextWriterWriteFormatElement(writer, BAD_CAST "MQTT_USER", "%s", Config.mqtt_username);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
262 xmlTextWriterWriteFormatElement(writer, BAD_CAST "MQTT_PASS", "%s", Config.mqtt_password);
534
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
263 }
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
264
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
265 /*
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
266 * Start an element named "LCDS" as child of THERMFERM.
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
267 */
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
268 xmlTextWriterStartElement(writer, BAD_CAST "LCDS");
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
269 /*
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
270 * Start one LCD. It is possible to connect 7 LCD displays on the i2c bus.
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
271 * However this program doesn't use more then one yet.
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
272 */
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
273 xmlTextWriterStartElement(writer, BAD_CAST "LCD");
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
274 xmlTextWriterWriteFormatElement(writer, BAD_CAST "ADDRESS", "0x%x", Config.lcd_address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
275 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COLUMNS", "%d", Config.lcd_cols);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
276 xmlTextWriterWriteFormatElement(writer, BAD_CAST "ROWS", "%d", Config.lcd_rows);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
277 xmlTextWriterEndElement(writer); // close LCD
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
278 xmlTextWriterEndElement(writer); // close LCDS
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
279
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
280 /*
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
281 * Fermenter units
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
282 */
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
283 if (Config.units) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
284 xmlTextWriterStartElement(writer, BAD_CAST "FERMENTERS");
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
285 for (tmp3 = Config.units; tmp3; tmp3 = tmp3->next) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
286 xmlTextWriterStartElement(writer, BAD_CAST "FERMENTER");
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
287 xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", tmp3->uuid);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
288 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PRODUCT_UUID", "%s", tmp3->product_uuid);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
289 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PRODUCT_CODE", "%s", tmp3->product_code);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
290 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PRODUCT_NAME", "%s", tmp3->product_name);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
291 xmlTextWriterWriteFormatElement(writer, BAD_CAST "ALIAS", "%s", tmp3->alias);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
292
101
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
293 if (tmp3->air_address) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
294 xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_ADDRESS", "%s", tmp3->air_address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
295 xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_STATE", "%d", tmp3->air_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
296 xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_TEMPERATURE", "%d", tmp3->air_temperature);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
297 xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_IDX", "%d", tmp3->air_idx);
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
298 }
101
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
299 if (tmp3->beer_address) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
300 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_ADDRESS", "%s", tmp3->beer_address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
301 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_STATE", "%d", tmp3->beer_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
302 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_TEMPERATURE", "%d", tmp3->beer_temperature);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
303 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_IDX", "%d", tmp3->beer_idx);
614
389097dc665d Version 0.9.11. Removed lcd debug message after 7 years. Added setup for alternative beer sensor. If the main sensor is gone, the alternative will be used.
Michiel Broek <mbroek@mbse.eu>
parents: 604
diff changeset
304 if (tmp3->beer_address2) {
389097dc665d Version 0.9.11. Removed lcd debug message after 7 years. Added setup for alternative beer sensor. If the main sensor is gone, the alternative will be used.
Michiel Broek <mbroek@mbse.eu>
parents: 604
diff changeset
305 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_ADDRESS2", "%s", tmp3->beer_address2);
389097dc665d Version 0.9.11. Removed lcd debug message after 7 years. Added setup for alternative beer sensor. If the main sensor is gone, the alternative will be used.
Michiel Broek <mbroek@mbse.eu>
parents: 604
diff changeset
306 }
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
307 }
518
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
308 if (tmp3->chiller_address) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
309 xmlTextWriterWriteFormatElement(writer, BAD_CAST "CHILLER_ADDRESS", "%s", tmp3->chiller_address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
310 xmlTextWriterWriteFormatElement(writer, BAD_CAST "CHILLER_STATE", "%d", tmp3->chiller_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
311 xmlTextWriterWriteFormatElement(writer, BAD_CAST "CHILLER_TEMPERATURE", "%d", tmp3->chiller_temperature);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
312 xmlTextWriterWriteFormatElement(writer, BAD_CAST "CHILLER_IDX", "%d", tmp3->chiller_idx);
518
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
313 }
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: 174
diff changeset
314 if (tmp3->heater_address) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
315 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_ADDRESS", "%s", tmp3->heater_address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
316 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_STATE", "%d", tmp3->heater_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
317 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_DELAY", "%d", tmp3->heater_delay);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
318 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_USAGE", "%d", tmp3->heater_usage);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
319 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_IDX", "%d", tmp3->heater_idx);
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
320 }
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: 174
diff changeset
321 if (tmp3->cooler_address) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
322 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_ADDRESS", "%s", tmp3->cooler_address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
323 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_STATE", "%d", tmp3->cooler_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
324 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_DELAY", "%d", tmp3->cooler_delay);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
325 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_USAGE", "%d", tmp3->cooler_usage);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
326 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_IDX", "%d", tmp3->cooler_idx);
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
327 }
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: 174
diff changeset
328 if (tmp3->fan_address) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
329 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_ADDRESS", "%s", tmp3->fan_address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
330 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_STATE", "%d", tmp3->fan_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
331 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_DELAY", "%d", tmp3->fan_delay);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
332 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_USAGE", "%d", tmp3->fan_usage);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
333 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_IDX", "%d", tmp3->fan_idx);
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
334 }
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
335 if (tmp3->light_address) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
336 xmlTextWriterWriteFormatElement(writer, BAD_CAST "LIGHT_ADDRESS", "%s", tmp3->light_address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
337 xmlTextWriterWriteFormatElement(writer, BAD_CAST "LIGHT_STATE", "%d", tmp3->light_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
338 xmlTextWriterWriteFormatElement(writer, BAD_CAST "LIGHT_DELAY", "%d", tmp3->light_delay);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
339 xmlTextWriterWriteFormatElement(writer, BAD_CAST "LIGHT_USAGE", "%d", tmp3->light_usage);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
340 xmlTextWriterWriteFormatElement(writer, BAD_CAST "LIGHT_IDX", "%d", tmp3->light_idx);
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
341 }
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: 174
diff changeset
342 if (tmp3->door_address) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
343 xmlTextWriterWriteFormatElement(writer, BAD_CAST "DOOR_ADDRESS", "%s", tmp3->door_address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
344 xmlTextWriterWriteFormatElement(writer, BAD_CAST "DOOR_STATE", "%d", tmp3->door_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
345 xmlTextWriterWriteFormatElement(writer, BAD_CAST "DOOR_IDX", "%d", tmp3->door_idx);
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
346 }
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
347 if (tmp3->psu_address) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
348 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PSU_ADDRESS", "%s", tmp3->psu_address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
349 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PSU_STATE", "%d", tmp3->psu_state);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
350 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PSU_IDX", "%d", tmp3->psu_idx);
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
351 }
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
352 xmlTextWriterWriteFormatElement(writer, BAD_CAST "MODE", "%s", UNITMODE[tmp3->mode] );
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
353 xmlTextWriterWriteFormatElement(writer, BAD_CAST "STAGE", "%s", UNITSTAGE[tmp3->stage] );
578
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
354 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_SET_LO", "%.1f", tmp3->beer_set_lo);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
355 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_SET_HI", "%.1f", tmp3->beer_set_hi);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
356 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FRIDGE_SET_LO", "%.1f", tmp3->fridge_set_lo);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
357 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FRIDGE_SET_HI", "%.1f", tmp3->fridge_set_hi);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
358 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_SET_MIN", "%.1f", tmp3->temp_set_min);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
359 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_SET_MAX", "%.1f", tmp3->temp_set_max);
579
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
360 xmlTextWriterWriteFormatElement(writer, BAD_CAST "YEAST_LO", "%.1f", tmp3->yeast_lo);
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
361 xmlTextWriterWriteFormatElement(writer, BAD_CAST "YEAST_HI", "%.1f", tmp3->yeast_hi);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
362
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
363 if (tmp3->profile_uuid) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
364 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE_UUID", "%s", tmp3->profile_uuid);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
365 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE_NAME", "%s", tmp3->profile_name);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
366 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE_INITTEMP_LO", "%.1f", tmp3->profile_inittemp_lo);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
367 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE_INITTEMP_HI", "%.1f", tmp3->profile_inittemp_hi);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
368 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE_FRIDGE_MODE", "%d", tmp3->profile_fridge_mode);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
369 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE_DURATION", "%d", tmp3->profile_duration);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
370 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE_TOTALSTEPS", "%d", tmp3->profile_totalsteps);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
371 if (tmp3->profile_steps) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
372 xmlTextWriterStartElement(writer, BAD_CAST "PROFILE_STEPS");
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
373 for (tmp5 = tmp3->profile_steps; tmp5; tmp5 = tmp5->next) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
374 xmlTextWriterStartElement(writer, BAD_CAST "PROFILE_STEP");
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
375 if (tmp5->name)
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
376 xmlTextWriterWriteFormatElement(writer, BAD_CAST "NAME", "%s", tmp5->name);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
377 xmlTextWriterWriteFormatElement(writer, BAD_CAST "RESTTIME", "%d", tmp5->resttime);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
378 xmlTextWriterWriteFormatElement(writer, BAD_CAST "STEPTIME", "%d", tmp5->steptime);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
379 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TARGET_LO", "%.1f", tmp5->target_lo);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
380 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TARGET_HI", "%.1f", tmp5->target_hi);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
381 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FRIDGE_MODE", "%d", tmp5->fridge_mode);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
382 xmlTextWriterEndElement(writer); // close PROFILE_STEP
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
383 }
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
384 xmlTextWriterEndElement(writer); // close PROFILE_STEPS
194
9eaaba49450f Added some ideas about profiles.
Michiel Broek <mbroek@mbse.eu>
parents: 191
diff changeset
385 }
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
386 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_STARTED", "%d", (unsigned int)tmp3->prof_started);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
387 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_PAUSED", "%d", (unsigned int)tmp3->prof_paused);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
388 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_STATE", "%s", PROFSTATE[tmp3->prof_state] );
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
389 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_PEAK_ABS", "%.3f", tmp3->prof_peak_abs);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
390 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_PEAK_REL", "%.3f", tmp3->prof_peak_rel);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
391 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_PRIMARY_DONE", "%d", (unsigned int)tmp3->prof_primary_done);
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
392 }
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
393 if (tmp3->PID_cool) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
394 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_IMAX", "%.2f", tmp3->PID_cool->iMax);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
395 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_IGAIN", "%.3f", tmp3->PID_cool->iGain);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
396 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_PGAIN", "%.3f", tmp3->PID_cool->pGain);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
397 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_DGAIN", "%.3f", tmp3->PID_cool->dGain);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
398 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_IDLERANGE", "%.2f", tmp3->PID_cool->idleRange);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
399 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_INPUT", "%.2f", tmp3->PID_cool->Input);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
400 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_ERR", "%.2f", tmp3->PID_cool->Err);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
401 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_ISTATE", "%.2f", tmp3->PID_cool->iState);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
402 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_SETP", "%.2f", tmp3->PID_cool->SetP);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
403 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_OUTP", "%.2f", tmp3->PID_cool->OutP);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
404 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_MODE", "%s", PIDMODE[tmp3->PID_cool->Mode]);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
405 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_TYPE", "COOL");
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
406 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
407 if (tmp3->PID_heat) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
408 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_IMAX", "%.2f", tmp3->PID_heat->iMax);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
409 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_IGAIN", "%.3f", tmp3->PID_heat->iGain);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
410 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_PGAIN", "%.3f", tmp3->PID_heat->pGain);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
411 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_DGAIN", "%.3f", tmp3->PID_heat->dGain);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
412 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_IDLERANGE", "%.2f", tmp3->PID_heat->idleRange);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
413 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_INPUT", "%.2f", tmp3->PID_heat->Input);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
414 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_ERR", "%.2f", tmp3->PID_heat->Err);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
415 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_ISTATE", "%.2f", tmp3->PID_heat->iState);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
416 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_SETP", "%.2f", tmp3->PID_heat->SetP);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
417 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_OUTP", "%.2f", tmp3->PID_heat->OutP);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
418 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_MODE", "%s", PIDMODE[tmp3->PID_heat->Mode]);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
419 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_TYPE", "HEAT");
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
420 }
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
421 xmlTextWriterEndElement(writer); // close FERMENTER
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
422 }
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
423 xmlTextWriterEndElement(writer); // close FERMENTERS
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
424 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
425
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
426 if (Config.devices) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
427 xmlTextWriterStartElement(writer, BAD_CAST "DEVICES");
645
49eb753a958b All thread locks from wiringPi to standard pthreads.
Michiel Broek <mbroek@mbse.eu>
parents: 615
diff changeset
428 pthread_mutex_lock(&mutexes[LOCK_DEVICES]);
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
429 for (device = Config.devices; device; device = device->next) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
430 xmlTextWriterStartElement(writer, BAD_CAST "DEVICE");
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
431 xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", device->uuid);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
432 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TYPE", "%s", DEVTYPE[device->type]);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
433 xmlTextWriterWriteFormatElement(writer, BAD_CAST "DIRECTION", "%s", DEVDIR[device->direction]);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
434 xmlTextWriterWriteFormatElement(writer, BAD_CAST "VALUE", "%d", device->value);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
435 xmlTextWriterWriteFormatElement(writer, BAD_CAST "OFFSET", "%d", device->offset);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
436 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PRESENT", "%s", DEVPRESENT[device->present]);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
437 xmlTextWriterWriteFormatElement(writer, BAD_CAST "ADDRESS", "%s", device->address);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
438 xmlTextWriterWriteFormatElement(writer, BAD_CAST "SUBDEVICE", "%d", device->subdevice);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
439 xmlTextWriterWriteFormatElement(writer, BAD_CAST "GPIOPIN", "%d", device->gpiopin);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
440 xmlTextWriterWriteFormatElement(writer, BAD_CAST "DESCRIPTION", "%s", device->description);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
441 xmlTextWriterWriteFormatElement(writer, BAD_CAST "INUSE", "%d", device->inuse);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
442 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COMMENT", "%s", device->comment);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
443 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TIMESTAMP", "%d", (int)device->timestamp);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
444 xmlTextWriterEndElement(writer); // close DEVICE
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
445 }
645
49eb753a958b All thread locks from wiringPi to standard pthreads.
Michiel Broek <mbroek@mbse.eu>
parents: 615
diff changeset
446 pthread_mutex_unlock(&mutexes[LOCK_DEVICES]);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
447 xmlTextWriterEndElement(writer); // close DEVICES
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
448 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
449
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
450 #ifdef USE_SIMULATOR
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
451 if (Config.simulators) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
452 xmlTextWriterStartElement(writer, BAD_CAST "SIMULATORS");
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
453 for (simulator = Config.simulators; simulator; simulator = simulator->next) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
454 xmlTextWriterStartElement(writer, BAD_CAST "SIMULATOR");
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
455 xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", simulator->uuid);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
456 xmlTextWriterWriteFormatElement(writer, BAD_CAST "NAME", "%s", simulator->name);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
457 xmlTextWriterWriteFormatElement(writer, BAD_CAST "SIMNO", "%d", simulator->simno);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
458 xmlTextWriterWriteFormatElement(writer, BAD_CAST "VOLUME_AIR", "%d", simulator->volume_air);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
459 xmlTextWriterWriteFormatElement(writer, BAD_CAST "VOLUME_BEER", "%d", simulator->volume_beer);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
460 xmlTextWriterWriteFormatElement(writer, BAD_CAST "ROOM_TEMPADDRESS", "%s", simulator->room_tempaddress);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
461 xmlTextWriterWriteFormatElement(writer, BAD_CAST "ROOM_TEMPERATURE", "%.1f", simulator->room_temperature);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
462 xmlTextWriterWriteFormatElement(writer, BAD_CAST "ROOM_HUMADDRESS", "%s", simulator->room_humaddress);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
463 xmlTextWriterWriteFormatElement(writer, BAD_CAST "ROOM_HUMIDITY", "%.1f", simulator->room_humidity);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
464 xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_ADDRESS", "%s", simulator->air_address);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
465 xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_TEMPERATURE", "%f", simulator->air_temperature);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
466 xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_PRESENT", "%s", DEVPRESENT[simulator->air_present]);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
467 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_ADDRESS", "%s", simulator->beer_address);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
468 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_TEMPERATURE", "%f", simulator->beer_temperature);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
469 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_PRESENT", "%s", DEVPRESENT[simulator->beer_present]);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
470 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_ADDRESS2", "%s", simulator->beer_address2);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
471 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_TEMPERATURE2", "%f", simulator->beer_temperature2);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
472 xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_PRESENT2", "%s", DEVPRESENT[simulator->beer_present2]);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
473 xmlTextWriterWriteFormatElement(writer, BAD_CAST "CHILLER_ADDRESS", "%s", simulator->chiller_address);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
474 xmlTextWriterWriteFormatElement(writer, BAD_CAST "CHILLER_TEMPERATURE", "%f", simulator->chiller_temperature);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
475 xmlTextWriterWriteFormatElement(writer, BAD_CAST "CHILLER_PRESENT", "%s", DEVPRESENT[simulator->chiller_present]);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
476 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_ADDRESS", "%s", simulator->cooler_address);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
477 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_TEMP", "%f", simulator->cooler_temp);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
478 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_TIME", "%d", simulator->cooler_time);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
479 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_SIZE", "%.3f", simulator->cooler_size);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
480 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_PRESENT", "%s", DEVPRESENT[simulator->cooler_present]);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
481 xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_POWER", "%d", simulator->cooler_power);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
482 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_ADDRESS", "%s", simulator->heater_address);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
483 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_TEMP", "%f", simulator->heater_temp);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
484 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_TIME", "%d", simulator->heater_time);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
485 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_SIZE", "%.3f", simulator->heater_size);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
486 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_PRESENT", "%s", DEVPRESENT[simulator->heater_present]);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
487 xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_POWER", "%d", simulator->heater_power);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
488 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_ADDRESS", "%s", simulator->fan_address);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
489 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_PRESENT", "%s", DEVPRESENT[simulator->fan_present]);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
490 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_POWER", "%d", simulator->fan_power);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
491 xmlTextWriterWriteFormatElement(writer, BAD_CAST "LIGHT_ADDRESS", "%s", simulator->light_address);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
492 xmlTextWriterWriteFormatElement(writer, BAD_CAST "LIGHT_PRESENT", "%s", DEVPRESENT[simulator->light_present]);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
493 xmlTextWriterWriteFormatElement(writer, BAD_CAST "LIGHT_POWER", "%d", simulator->light_power);
716
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
494 xmlTextWriterWriteFormatElement(writer, BAD_CAST "DOOR_ADDRESS", "%s", simulator->door_address);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
495 xmlTextWriterWriteFormatElement(writer, BAD_CAST "DOOR_PRESENT", "%s", DEVPRESENT[simulator->door_present]);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
496 xmlTextWriterWriteFormatElement(writer, BAD_CAST "DOOR_VALUE", "%d", simulator->door_value);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
497 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PSU_ADDRESS", "%s", simulator->psu_address);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
498 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PSU_PRESENT", "%s", DEVPRESENT[simulator->psu_present]);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
499 xmlTextWriterWriteFormatElement(writer, BAD_CAST "PSU_VALUE", "%d", simulator->psu_value);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
500 xmlTextWriterWriteFormatElement(writer, BAD_CAST "FRIGO_ISOLATION", "%.3f", simulator->frigo_isolation);
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
501 xmlTextWriterWriteFormatElement(writer, BAD_CAST "TIMESTAMP", "%ld", (long)simulator->timestamp);
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
502 xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_YEAST_HEAT", "%f", simulator->s_yeast_heat);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
503 xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_YEAST_STARTED", "%d", (int)simulator->s_yeast_started);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
504 xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_COOL_TEMP", "%f", simulator->s_cool_temp);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
505 xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_HEAT_TEMP", "%f", simulator->s_heat_temp);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
506 xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_COOL_CHANGED", "%d", (int)simulator->s_cool_changed);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
507 xmlTextWriterWriteFormatElement(writer, BAD_CAST "S_HEAT_CHANGED", "%d", (int)simulator->s_heat_changed);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
508 xmlTextWriterEndElement(writer);
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
509 }
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
510 xmlTextWriterEndElement(writer);
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
511 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
512 #endif
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
513
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
514 /*
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
515 * All done, close any open elements
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
516 */
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
517 if ((rc = xmlTextWriterEndDocument(writer)) < 0) {
268
dda91dfa4aa8 All syslog logging only to LOG_NOTICE
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
518 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndDocument");
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
519 return 1;
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
520 }
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
521 xmlFreeTextWriter(writer);
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
522
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
523 /*
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
524 * Now write the XML configuration
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
525 */
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
526 if (getenv((char *)"USER") == NULL) {
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
527 mypath = xstrcpy((char *)"/root");
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
528 } else {
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
529 mypath = xstrcpy(getenv((char *)"HOME"));
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
530 }
86
3d7a241329e2 Using final user paths for log, configuration and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
531 mypath = xstrcat(mypath, (char *)"/.thermferm/etc/");
3d7a241329e2 Using final user paths for log, configuration and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
532 mkdirs(mypath, 0755);
3d7a241329e2 Using final user paths for log, configuration and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
533 mypath = xstrcat(mypath, (char *)"thermferm.xml");
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
534
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
535 if (debug)
666
48cc8868f9f4 Added commandline switch --foreground, the --debug now only activates extra debug logging. No more console output. The thermferm process uses a state table, this makes the code more readable and have less large functions.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
536 syslog(LOG_NOTICE, "Writing %s", mypath);
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
537
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
538 if ((fp = fopen(mypath, "w")) == NULL) {
268
dda91dfa4aa8 All syslog logging only to LOG_NOTICE
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
539 syslog(LOG_NOTICE, "could not rewrite %s", mypath);
370
843dc511c877 Fixed memory leak in wrconfig
Michiel Broek <mbroek@mbse.eu>
parents: 363
diff changeset
540 free(mypath);
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
541 return 1;
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
542 }
370
843dc511c877 Fixed memory leak in wrconfig
Michiel Broek <mbroek@mbse.eu>
parents: 363
diff changeset
543 free(mypath);
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
544
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
545 fprintf(fp, "%s", (const char *) buf->content);
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
546 fclose(fp);
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
547 xmlBufferFree(buf);
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
548
166
c31ea86fec43 Forgot some close functions so tha program ran out of file descriptors. Better loggin for writing the configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
549 return 0;
c31ea86fec43 Forgot some close functions so tha program ran out of file descriptors. Better loggin for writing the configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
550 }
c31ea86fec43 Forgot some close functions so tha program ran out of file descriptors. Better loggin for writing the configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
551
c31ea86fec43 Forgot some close functions so tha program ran out of file descriptors. Better loggin for writing the configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
552
c31ea86fec43 Forgot some close functions so tha program ran out of file descriptors. Better loggin for writing the configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
553
c31ea86fec43 Forgot some close functions so tha program ran out of file descriptors. Better loggin for writing the configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
554 int wrconfig(void)
c31ea86fec43 Forgot some close functions so tha program ran out of file descriptors. Better loggin for writing the configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
555 {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
556 int rc = do_wrconfig();
268
dda91dfa4aa8 All syslog logging only to LOG_NOTICE
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
557 syslog(LOG_NOTICE, "Rewritten configuration, rc=%d", rc);
53
37623517e0ef Added writing configuration
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
558 return rc;
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
559 }
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
560
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
561
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
562
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
563 /*
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
564 * Parse one LCD display
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
565 */
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
566 int parseLCD(xmlDocPtr doc, xmlNodePtr cur)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
567 {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
568 xmlChar *key;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
569 int ival;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
570
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
571 cur = cur->xmlChildrenNode;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
572 while (cur != NULL) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
573 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COLUMNS"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
574 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
575 if (sscanf((const char *)key, "%d", &ival) == 1)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
576 Config.lcd_cols = ival;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
577 xmlFree(key);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
578 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
579 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROWS"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
580 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
581 if (sscanf((const char *)key, "%d", &ival) == 1)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
582 Config.lcd_rows = ival;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
583 xmlFree(key);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
584 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
585 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ADDRESS"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
586 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
587 if (sscanf((const char *)key, "%x", &ival) == 1)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
588 Config.lcd_address = ival;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
589 xmlFree(key);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
590 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
591 cur = cur->next;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
592 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
593
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
594 return 0;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
595 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
596
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
597
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
598
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
599 int parseLCDs(xmlDocPtr doc, xmlNodePtr cur)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
600 {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
601 cur = cur->xmlChildrenNode;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
602 while (cur != NULL) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
603 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LCD"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
604 parseLCD(doc, cur);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
605 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
606 cur = cur->next;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
607 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
608 return 0;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
609 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
610
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
611
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
612
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
613 /*
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
614 * Parse a fermenter unit
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
615 */
506
cdcd07bbee30 New MQTT protocol
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
616 int parseUnit(xmlDocPtr doc, xmlNodePtr cur/* , int number */)
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
617 {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
618 xmlChar *key;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
619 int i, ival;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
620 float val;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
621 units_list *unit, *tmp;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
622
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
623 unit = (units_list *)malloc(sizeof(units_list));
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
624 unit->next = NULL;
554
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
625 unit->uuid = unit->product_uuid = unit->product_code = unit->product_name = unit->event_msg = \
615
33a5b63e86d7 Fixed init problems.
Michiel Broek <mbroek@mbse.eu>
parents: 614
diff changeset
626 unit->alias = unit->air_address = unit->beer_address = unit->beer_address2 = unit->chiller_address = \
33a5b63e86d7 Fixed init problems.
Michiel Broek <mbroek@mbse.eu>
parents: 614
diff changeset
627 unit->heater_address = unit->cooler_address = unit->fan_address = unit->door_address = \
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
628 unit->light_address = unit->psu_address = unit->profile_uuid = unit->profile_name = NULL;
702
d77891f8915d Drop fermenter volume setting.
Michiel Broek <mbroek@mbse.eu>
parents: 693
diff changeset
629 unit->prof_peak_abs = unit->prof_peak_rel = 0.0;
578
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
630 unit->air_temperature = unit->beer_temperature = unit->chiller_temperature = unit->beer_set_lo = unit->beer_set_hi = \
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
631 unit->fridge_set_lo = unit->fridge_set_hi = unit->profile_inittemp_lo = unit->profile_inittemp_hi = 20.0;
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
632 unit->air_state = unit->beer_state = unit->chiller_state = DEVPRESENT_NO; // missing
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
633 unit->heater_state = unit->cooler_state = unit->fan_state = unit->door_state = \
582
ba340e00aab2 Version 0.9.5, interior lights are now only controlled by the open door or a 5 minutes timer. The timer is started via an MQTT command. The BMS web application sends this command just before a webcam page is requested.
Chiel Broek <mbse@mbse.eu>
parents: 579
diff changeset
634 unit->light_state = unit->light_timer = unit->psu_state = unit->mode = unit->prof_state = unit->stage = 0;
518
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
635 unit->air_idx = unit->beer_idx = unit->chiller_idx = unit->heater_idx = unit->cooler_idx = unit->fan_idx = \
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
636 unit->door_idx = unit->light_idx = unit->psu_idx = unit->profile_fridge_mode = \
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
637 unit->profile_duration = unit->profile_totalsteps = 0;
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
638 unit->profile_steps = NULL;
270
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
639 unit->heater_delay = unit->cooler_delay = unit->fan_delay = 20; /* 5 minutes delay */
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
640 unit->light_delay = 1; /* 15 seconds delay */
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
641 unit->heater_wait = unit->cooler_wait = unit->fan_wait = unit->light_wait = 0;
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
642 unit->heater_usage = unit->cooler_usage = unit->fan_usage = unit->light_usage = 0;
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
643 unit->temp_set_min = 1.0;
604
e2766e538d0e Version 0.9.7. Increased the maximum fermentation temperature to 45 degrees to allow Kveik fermentations.
Michiel Broek <mbroek@mbse.eu>
parents: 582
diff changeset
644 unit->temp_set_max = 45.0;
579
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
645 unit->yeast_lo = 12.0;
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
646 unit->yeast_hi = 24.0;
289
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
647 unit->prof_started = unit->prof_paused = unit->prof_primary_done = (time_t)0;
284
9e6fb5aed618 Profile progress is visible in the web interface
Michiel Broek <mbroek@mbse.eu>
parents: 270
diff changeset
648 unit->prof_percent = 0;
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
649 unit->PID_cool = (pid_var *)malloc(sizeof(pid_var));
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
650 unit->PID_heat = (pid_var *)malloc(sizeof(pid_var));
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
651 InitPID(unit->PID_cool, PID_TYPE_COOL);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
652 InitPID(unit->PID_heat, PID_TYPE_HEAT);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
653
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
654 cur = cur->xmlChildrenNode;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
655 while (cur != NULL) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
656 if ((!xmlStrcmp(cur->name, (const xmlChar *)"UUID"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
657 unit->uuid = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
658 }
554
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
659 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRODUCT_UUID"))) {
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
660 unit->product_uuid = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
661 }
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
662 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRODUCT_CODE"))) {
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
663 unit->product_code = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
664 }
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
665 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRODUCT_NAME"))) {
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
666 unit->product_name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
667 }
500
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
668 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ALIAS"))) {
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
669 unit->alias = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
670 }
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
671 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AIR_ADDRESS"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
672 unit->air_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
673 }
101
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
674 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AIR_STATE"))) {
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
675 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
676 if (sscanf((const char *)key, "%d", &ival) == 1)
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
677 unit->air_state = ival;
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
678 xmlFree(key);
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
679 }
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
680 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AIR_IDX"))) {
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
681 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
682 if (sscanf((const char *)key, "%d", &ival) == 1)
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
683 unit->air_idx = ival;
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
684 xmlFree(key);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
685 }
101
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
686 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AIR_TEMPERATURE"))) {
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
687 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
688 if (sscanf((const char *)key, "%d", &ival) == 1)
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
689 unit->air_temperature = ival;
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
690 xmlFree(key);
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
691 }
708
13555c27b592 Version 0.9.19a6. Fixes after a short trial on the production controller. Fixed json for alternate beer termperature sensor. Fixed division by 1000 for the room temperature and humidity values. The dropdown list for devices shows the address instead of description in the list.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
692 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_ADDRESS2"))) {
13555c27b592 Version 0.9.19a6. Fixes after a short trial on the production controller. Fixed json for alternate beer termperature sensor. Fixed division by 1000 for the room temperature and humidity values. The dropdown list for devices shows the address instead of description in the list.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
693 unit->beer_address2 = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
13555c27b592 Version 0.9.19a6. Fixes after a short trial on the production controller. Fixed json for alternate beer termperature sensor. Fixed division by 1000 for the room temperature and humidity values. The dropdown list for devices shows the address instead of description in the list.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
694 } else if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_ADDRESS"))) {
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
695 unit->beer_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
696 }
101
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
697 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_STATE"))) {
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
698 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
699 if (sscanf((const char *)key, "%d", &ival) == 1)
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
700 unit->beer_state = ival;
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
701 xmlFree(key);
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
702 }
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
703 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_IDX"))) {
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
704 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
705 if (sscanf((const char *)key, "%d", &ival) == 1)
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
706 unit->beer_idx = ival;
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
707 xmlFree(key);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
708 }
101
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
709 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_TEMPERATURE"))) {
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
710 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
711 if (sscanf((const char *)key, "%d", &ival) == 1)
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
712 unit->beer_temperature = ival;
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
713 xmlFree(key);
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
714 }
518
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
715 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CHILLER_ADDRESS"))) {
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
716 unit->chiller_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
717 }
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
718 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CHILLER_STATE"))) {
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
719 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
720 if (sscanf((const char *)key, "%d", &ival) == 1)
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
721 unit->chiller_state = ival;
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
722 xmlFree(key);
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
723 }
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
724 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CHILLER_IDX"))) {
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
725 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
726 if (sscanf((const char *)key, "%d", &ival) == 1)
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
727 unit->chiller_idx = ival;
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
728 xmlFree(key);
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
729 }
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
730 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CHILLER_TEMPERATURE"))) {
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
731 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
732 if (sscanf((const char *)key, "%d", &ival) == 1)
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
733 unit->chiller_temperature = ival;
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
734 xmlFree(key);
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
735 }
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: 174
diff changeset
736 if ((!xmlStrcmp(cur->name, (const xmlChar *)"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: 174
diff changeset
737 unit->heater_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
738 }
270
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
739 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HEATER_DELAY"))) {
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
740 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
741 if (sscanf((const char *)key, "%d", &ival) == 1)
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
742 unit->heater_delay = ival;
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
743 xmlFree(key);
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
744 }
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
745 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HEATER_IDX"))) {
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
746 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
747 if (sscanf((const char *)key, "%d", &ival) == 1)
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
748 unit->heater_idx = ival;
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
749 xmlFree(key);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
750 }
293
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
751 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HEATER_USAGE"))) {
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
752 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
753 if (sscanf((const char *)key, "%d", &ival) == 1)
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
754 unit->heater_usage = ival;
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
755 xmlFree(key);
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
756 }
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: 174
diff changeset
757 if ((!xmlStrcmp(cur->name, (const xmlChar *)"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: 174
diff changeset
758 unit->cooler_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
759 }
270
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
760 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COOLER_DELAY"))) {
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
761 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
762 if (sscanf((const char *)key, "%d", &ival) == 1)
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
763 unit->cooler_delay = ival;
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
764 xmlFree(key);
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
765 }
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
766 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COOLER_IDX"))) {
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
767 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
768 if (sscanf((const char *)key, "%d", &ival) == 1)
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
769 unit->cooler_idx = ival;
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
770 xmlFree(key);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
771 }
293
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
772 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COOLER_USAGE"))) {
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
773 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
774 if (sscanf((const char *)key, "%d", &ival) == 1)
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
775 unit->cooler_usage = ival;
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
776 xmlFree(key);
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
777 }
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: 174
diff changeset
778 if ((!xmlStrcmp(cur->name, (const xmlChar *)"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: 174
diff changeset
779 unit->fan_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
780 }
270
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
781 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FAN_DELAY"))) {
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
782 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
783 if (sscanf((const char *)key, "%d", &ival) == 1)
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
784 unit->fan_delay = ival;
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
785 xmlFree(key);
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 268
diff changeset
786 }
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
787 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FAN_IDX"))) {
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
788 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
789 if (sscanf((const char *)key, "%d", &ival) == 1)
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
790 unit->fan_idx = ival;
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
791 xmlFree(key);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
792 }
293
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
793 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FAN_USAGE"))) {
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
794 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
795 if (sscanf((const char *)key, "%d", &ival) == 1)
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
796 unit->fan_usage = ival;
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
797 xmlFree(key);
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
798 }
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
799 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIGHT_ADDRESS"))) {
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
800 unit->light_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
801 }
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
802 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIGHT_DELAY"))) {
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
803 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
804 if (sscanf((const char *)key, "%d", &ival) == 1)
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
805 unit->light_delay = ival;
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
806 xmlFree(key);
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
807 }
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
808 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIGHT_IDX"))) {
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
809 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
810 if (sscanf((const char *)key, "%d", &ival) == 1)
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
811 unit->light_idx = ival;
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
812 xmlFree(key);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
813 }
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
814 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIGHT_USAGE"))) {
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
815 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
816 if (sscanf((const char *)key, "%d", &ival) == 1)
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
817 unit->light_usage = ival;
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
818 xmlFree(key);
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
819 }
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: 174
diff changeset
820 if ((!xmlStrcmp(cur->name, (const xmlChar *)"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: 174
diff changeset
821 unit->door_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
822 }
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
823 if ((!xmlStrcmp(cur->name, (const xmlChar *)"DOOR_IDX"))) {
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
824 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
825 if (sscanf((const char *)key, "%d", &ival) == 1)
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
826 unit->door_idx = ival;
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
827 xmlFree(key);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
828 }
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
829 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PSU_ADDRESS"))) {
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
830 unit->psu_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
831 }
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
832 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PSU_IDX"))) {
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
833 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
834 if (sscanf((const char *)key, "%d", &ival) == 1)
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
835 unit->psu_idx = ival;
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
836 xmlFree(key);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
837 }
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
838 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MODE"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
839 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
840 for (i = 0; i < 5; i++) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
841 if (! xmlStrcmp(key, (const xmlChar *)UNITMODE[i])) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
842 unit->mode = i;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
843 break;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
844 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
845 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
846 xmlFree(key);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
847 }
564
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 562
diff changeset
848 if ((!xmlStrcmp(cur->name, (const xmlChar *)"STAGE"))) {
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 562
diff changeset
849 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
566
776a605befa5 Added Carbonation stage.
Michiel Broek <mbroek@mbse.eu>
parents: 565
diff changeset
850 for (i = 0; i < 4; i++) {
564
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 562
diff changeset
851 if (! xmlStrcmp(key, (const xmlChar *)UNITSTAGE[i])) {
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 562
diff changeset
852 unit->stage = i;
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 562
diff changeset
853 break;
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 562
diff changeset
854 }
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 562
diff changeset
855 }
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 562
diff changeset
856 xmlFree(key);
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 562
diff changeset
857 }
578
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
858 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_SET"))) { // Remove in 2020.
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
859 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
860 if (sscanf((const char *)key, "%f", &val) == 1)
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
861 unit->beer_set_lo = unit->beer_set_hi = val;
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
862 xmlFree(key);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
863 }
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
864 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_SET_LO"))) {
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
865 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
866 if (sscanf((const char *)key, "%f", &val) == 1)
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
867 unit->beer_set_lo = val;
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
868 xmlFree(key);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
869 }
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
870 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_SET_HI"))) {
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
871 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
872 if (sscanf((const char *)key, "%f", &val) == 1)
578
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
873 unit->beer_set_hi = val;
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
874 xmlFree(key);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
875 }
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
876 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FRIDGE_SET"))) { // Remove in 2020
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
877 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
878 if (sscanf((const char *)key, "%f", &val) == 1)
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
879 unit->fridge_set_lo = unit->fridge_set_hi = val;
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
880 xmlFree(key);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
881 }
578
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
882 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FRIDGE_SET_LO"))) {
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
883 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
884 if (sscanf((const char *)key, "%f", &val) == 1)
578
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
885 unit->fridge_set_lo = val;
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
886 xmlFree(key);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
887 }
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
888 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FRIDGE_SET_HI"))) {
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
889 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
890 if (sscanf((const char *)key, "%f", &val) == 1)
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
891 unit->fridge_set_hi = val;
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
892 xmlFree(key);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
893 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
894 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TEMP_SET_MIN"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
895 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
896 if (sscanf((const char *)key, "%f", &val) == 1)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
897 unit->temp_set_min = val;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
898 xmlFree(key);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
899 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
900 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TEMP_SET_MAX"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
901 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
902 if (sscanf((const char *)key, "%f", &val) == 1)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
903 unit->temp_set_max = val;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
904 xmlFree(key);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
905 }
579
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
906 if ((!xmlStrcmp(cur->name, (const xmlChar *)"YEAST_LO"))) {
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
907 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
908 if (sscanf((const char *)key, "%f", &val) == 1)
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
909 unit->yeast_lo = val;
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
910 xmlFree(key);
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
911 }
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
912 if ((!xmlStrcmp(cur->name, (const xmlChar *)"YEAST_HI"))) {
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
913 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
914 if (sscanf((const char *)key, "%f", &val) == 1)
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
915 unit->yeast_hi = val;
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
916 xmlFree(key);
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
917 }
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
918 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_IMAX"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
919 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
920 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
921 unit->PID_cool->iMax = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
922 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
923 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
924 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_IDLERANGE"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
925 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
926 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
927 unit->PID_cool->idleRange = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
928 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
929 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
930 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_IGAIN"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
931 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
932 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
933 unit->PID_cool->iGain = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
934 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
935 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
936 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_PGAIN"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
937 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
938 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
939 unit->PID_cool->pGain = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
940 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
941 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
942 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_DGAIN"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
943 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
944 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
945 unit->PID_cool->dGain = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
946 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
947 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
948 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_INPUT"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
949 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
950 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
951 unit->PID_cool->Input = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
952 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
953 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
954 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_ERR"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
955 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
956 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
957 unit->PID_cool->Err = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
958 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
959 }
363
468ec0d96cce Back to the old PID algorythm. Version 0.3.1.
Michiel Broek <mbroek@mbse.eu>
parents: 362
diff changeset
960 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_ISTATE"))) {
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
961 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
962 if (sscanf((const char *)key, "%f", &val) == 1)
363
468ec0d96cce Back to the old PID algorythm. Version 0.3.1.
Michiel Broek <mbroek@mbse.eu>
parents: 362
diff changeset
963 unit->PID_cool->iState = val;
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
964 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
965 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
966 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_SETP"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
967 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
968 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
969 unit->PID_cool->SetP = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
970 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
971 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
972 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_OUTP"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
973 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
974 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
975 unit->PID_cool->OutP = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
976 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
977 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
978 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_MODE"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
979 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
980 for (i = 0; i < 3; i++) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
981 if (! xmlStrcmp(key, (const xmlChar *)PIDMODE[i])) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
982 unit->PID_cool->Mode = i;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
983 break;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
984 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
985 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
986 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
987 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
988 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_IMAX"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
989 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
990 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
991 unit->PID_heat->iMax = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
992 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
993 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
994 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_IDLERANGE"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
995 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
996 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
997 unit->PID_heat->idleRange = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
998 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
999 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1000 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_IGAIN"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1001 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1002 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1003 unit->PID_heat->iGain = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1004 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1005 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1006 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_PGAIN"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1007 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1008 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1009 unit->PID_heat->pGain = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1010 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1011 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1012 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_DGAIN"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1013 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1014 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1015 unit->PID_heat->dGain = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1016 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1017 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1018 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_INPUT"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1019 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1020 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1021 unit->PID_heat->Input = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1022 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1023 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1024 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_ERR"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1025 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1026 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1027 unit->PID_heat->Err = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1028 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1029 }
363
468ec0d96cce Back to the old PID algorythm. Version 0.3.1.
Michiel Broek <mbroek@mbse.eu>
parents: 362
diff changeset
1030 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_ISTATE"))) {
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1031 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1032 if (sscanf((const char *)key, "%f", &val) == 1)
363
468ec0d96cce Back to the old PID algorythm. Version 0.3.1.
Michiel Broek <mbroek@mbse.eu>
parents: 362
diff changeset
1033 unit->PID_heat->iState = val;
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1034 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1035 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1036 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_SETP"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1037 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1038 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1039 unit->PID_heat->SetP = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1040 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1041 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1042 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_OUTP"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1043 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1044 if (sscanf((const char *)key, "%f", &val) == 1)
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1045 unit->PID_heat->OutP = val;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1046 xmlFree(key);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1047 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1048 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_MODE"))) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1049 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1050 for (i = 0; i < 3; i++) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1051 if (! xmlStrcmp(key, (const xmlChar *)PIDMODE[i])) {
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1052 unit->PID_heat->Mode = i;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1053 break;
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1054 }
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
1055 }
310
53774295e14a Added Kp, Kd and Ki settings to the units. Bumped to version 0.2.9
Michiel Broek <mbroek@mbse.eu>
parents: 306
diff changeset
1056 xmlFree(key);
53774295e14a Added Kp, Kd and Ki settings to the units. Bumped to version 0.2.9
Michiel Broek <mbroek@mbse.eu>
parents: 306
diff changeset
1057 }
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1058 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILE_UUID"))) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1059 unit->profile_uuid = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1060 }
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1061 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILE_NAME"))) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1062 unit->profile_name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1063 }
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1064 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILE_INITTEMP_LO"))) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1065 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1066 if (sscanf((const char *)key, "%f", &val) == 1)
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1067 unit->profile_inittemp_lo = val;
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1068 xmlFree(key);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1069 }
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1070 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILE_INITTEMP_HI"))) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1071 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1072 if (sscanf((const char *)key, "%f", &val) == 1)
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1073 unit->profile_inittemp_hi = val;
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1074 xmlFree(key);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1075 }
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1076 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILE_FRIDGE_MODE"))) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1077 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1078 if (sscanf((const char *)key, "%d", &ival) == 1)
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1079 unit->profile_fridge_mode = ival;
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1080 xmlFree(key);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1081 }
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1082 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILE_DURATION"))) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1083 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1084 if (sscanf((const char *)key, "%d", &ival) == 1)
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1085 unit->profile_duration = ival;
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1086 xmlFree(key);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1087 }
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1088 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILE_TOTALSTEPS"))) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1089 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1090 if (sscanf((const char *)key, "%d", &ival) == 1)
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1091 unit->profile_totalsteps = ival;
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1092 xmlFree(key);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1093 }
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1094 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILE_STEPS"))) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1095 parseSteps(doc, cur, &(unit)->profile_steps);
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1096 }
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1097
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1098 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_STARTED"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1099 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1100 if (sscanf((const char *)key, "%d", &ival) == 1)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1101 unit->prof_started = ival;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1102 xmlFree(key);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1103 }
194
9eaaba49450f Added some ideas about profiles.
Michiel Broek <mbroek@mbse.eu>
parents: 191
diff changeset
1104 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_PAUSED"))) {
9eaaba49450f Added some ideas about profiles.
Michiel Broek <mbroek@mbse.eu>
parents: 191
diff changeset
1105 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
9eaaba49450f Added some ideas about profiles.
Michiel Broek <mbroek@mbse.eu>
parents: 191
diff changeset
1106 if (sscanf((const char *)key, "%d", &ival) == 1)
9eaaba49450f Added some ideas about profiles.
Michiel Broek <mbroek@mbse.eu>
parents: 191
diff changeset
1107 unit->prof_paused = ival;
9eaaba49450f Added some ideas about profiles.
Michiel Broek <mbroek@mbse.eu>
parents: 191
diff changeset
1108 xmlFree(key);
9eaaba49450f Added some ideas about profiles.
Michiel Broek <mbroek@mbse.eu>
parents: 191
diff changeset
1109 }
90
28ee293654fd Added profile parameters
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
1110 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_STATE"))) {
28ee293654fd Added profile parameters
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
1111 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
217
2922d439ff63 Added profile state ABORT
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
1112 for (i = 0; i < 5; i++) {
90
28ee293654fd Added profile parameters
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
1113 if (! xmlStrcmp(key, (const xmlChar *)PROFSTATE[i])) {
28ee293654fd Added profile parameters
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
1114 unit->prof_state = i;
28ee293654fd Added profile parameters
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
1115 break;
28ee293654fd Added profile parameters
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
1116 }
28ee293654fd Added profile parameters
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
1117 }
28ee293654fd Added profile parameters
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
1118 xmlFree(key);
28ee293654fd Added profile parameters
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
1119 }
289
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1120 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_PEAK_ABS"))) {
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1121 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1122 if (sscanf((const char *)key, "%f", &val) == 1)
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1123 unit->prof_peak_abs = val;
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1124 xmlFree(key);
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1125 }
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1126 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_PEAK_REL"))) {
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1127 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1128 if (sscanf((const char *)key, "%f", &val) == 1)
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1129 unit->prof_peak_rel = val;
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1130 xmlFree(key);
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1131 }
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1132 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_PRIMARY_DONE"))) {
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1133 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1134 if (sscanf((const char *)key, "%d", &ival) == 1)
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1135 unit->prof_primary_done = ival;
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1136 xmlFree(key);
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
1137 }
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1138 cur = cur->next;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1139 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1140
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1141 if (Config.units == NULL) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1142 Config.units = unit;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1143 } else {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1144 for (tmp = Config.units; tmp; tmp = tmp->next) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1145 if (tmp->next == NULL) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1146 tmp->next = unit;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1147 break;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1148 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1149 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1150 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1151
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1152 return 0;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1153 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1154
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1155
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1156
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1157 int parseFermenters(xmlDocPtr doc, xmlNodePtr cur)
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1158 {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1159 cur = cur->xmlChildrenNode;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1160 while (cur != NULL) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1161 // Accept the wrong UNIT name as well as FERMENTER
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1162 if ((!xmlStrcmp(cur->name, (const xmlChar *)"UNIT")) || (!xmlStrcmp(cur->name, (const xmlChar *)"FERMENTER"))) {
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
1163 parseUnit(doc, cur);
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1164 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1165 cur = cur->next;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1166 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1167 return 0;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1168 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1169
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1170
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1171
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1172 int parseStep(xmlDocPtr doc, xmlNodePtr cur, prof_step **profstep)
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1173 {
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1174 xmlChar *key;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1175 int ival;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1176 float val;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1177 prof_step *step, *tmp;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1178
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1179 step = (prof_step *)malloc(sizeof(prof_step));
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1180 step->next = NULL;
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1181 step->name = NULL;
397
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1182 step->steptime = step->resttime = step->fridge_mode = 0;
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1183 step->target_lo = step->target_hi = 20.0;
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1184
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1185 cur = cur->xmlChildrenNode;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1186 while (cur != NULL) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1187 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1188 step->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1189 }
92
116226a8c70a Added profiles configuration
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
1190 if ((!xmlStrcmp(cur->name, (const xmlChar *)"RESTTIME"))) {
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1191 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1192 if (sscanf((const char *)key, "%d", &ival) == 1)
92
116226a8c70a Added profiles configuration
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
1193 step->resttime = ival;
116226a8c70a Added profiles configuration
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
1194 xmlFree(key);
116226a8c70a Added profiles configuration
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
1195 }
116226a8c70a Added profiles configuration
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
1196 if ((!xmlStrcmp(cur->name, (const xmlChar *)"STEPTIME"))) {
116226a8c70a Added profiles configuration
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
1197 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
116226a8c70a Added profiles configuration
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
1198 if (sscanf((const char *)key, "%d", &ival) == 1)
116226a8c70a Added profiles configuration
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
1199 step->steptime = ival;
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1200 xmlFree(key);
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1201 }
397
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1202 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TARGET_LO"))) {
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1203 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1204 if (sscanf((const char *)key, "%f", &val) == 1)
397
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1205 step->target_lo = val;
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1206 xmlFree(key);
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1207 }
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1208 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TARGET_HI"))) {
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1209 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1210 if (sscanf((const char *)key, "%f", &val) == 1)
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1211 step->target_hi = val;
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1212 xmlFree(key);
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1213 }
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1214 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FRIDGE_MODE"))) {
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1215 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1216 if (sscanf((const char *)key, "%d", &ival) == 1)
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 388
diff changeset
1217 step->fridge_mode = ival;
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1218 xmlFree(key);
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1219 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1220 cur = cur->next;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1221 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1222
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1223 if (*profstep == NULL) {
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1224 *profstep = step;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1225 } else {
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1226 for (tmp = *profstep; tmp; tmp = tmp->next) {
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1227 if (tmp->next == NULL) {
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1228 tmp->next = step;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1229 break;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1230 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1231 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1232 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1233 return 0;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1234 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1235
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1236
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1237
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1238 int parseSteps(xmlDocPtr doc, xmlNodePtr cur, prof_step **step)
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1239 {
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1240 cur = cur->xmlChildrenNode;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1241 while (cur != NULL) {
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 566
diff changeset
1242 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILE_STEP"))) {
91
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1243 parseStep(doc, cur, step);
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1244 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1245 cur = cur->next;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1246 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1247 return 0;
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1248 }
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1249
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1250
901ca9858a7a Added fermenting profiles to the configuration
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
1251
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1252 int parseDevice(xmlDocPtr doc, xmlNodePtr cur)
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1253 {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1254 xmlChar *key;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1255 devices_list *device, *tmp;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1256 int i, ival;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1257
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1258 device = (devices_list *)malloc(sizeof(devices_list));
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1259 device->next = NULL;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1260 device->uuid = device->address = device->description = device->comment = NULL;
209
c5b1dfd83e81 Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
1261 device->type = device->direction = device->present = device->subdevice = device->inuse = device->offset = 0;
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1262 device->gpiopin = -1;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1263 device->timestamp = (time_t)0;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1264
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1265 cur = cur->xmlChildrenNode;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1266 while (cur != NULL) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1267 if ((!xmlStrcmp(cur->name, (const xmlChar *)"UUID"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1268 device->uuid = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1269 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1270 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TYPE"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1271 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1272 for (i = 0; i < 8; i++) {
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1273 if (! xmlStrcmp(key, (const xmlChar *)DEVTYPE[i])) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1274 device->type = i;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1275 break;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1276 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1277 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1278 xmlFree(key);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1279 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1280 if ((!xmlStrcmp(cur->name, (const xmlChar *)"DIRECTION"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1281 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
162
6fc9e3f7962f Added Raspberry GPIO devices
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1282 for (i = 0; i < 7; i++) {
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1283 if (! xmlStrcmp(key, (const xmlChar *)DEVDIR[i])) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1284 device->direction = i;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1285 break;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1286 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1287 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1288 xmlFree(key);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1289 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1290 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VALUE"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1291 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1292 if (sscanf((const char *)key, "%d", &ival) == 1)
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1293 device->value = ival;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1294 xmlFree(key);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1295 }
209
c5b1dfd83e81 Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
1296 if ((!xmlStrcmp(cur->name, (const xmlChar *)"OFFSET"))) {
c5b1dfd83e81 Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
1297 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
c5b1dfd83e81 Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
1298 if (sscanf((const char *)key, "%d", &ival) == 1)
c5b1dfd83e81 Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
1299 device->offset = ival;
c5b1dfd83e81 Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
1300 xmlFree(key);
c5b1dfd83e81 Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
1301 }
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1302 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1303 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1304 for (i = 0; i < 4; i++) {
174
244de612c572 Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 166
diff changeset
1305 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1306 device->present = i;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1307 break;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1308 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1309 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1310 xmlFree(key);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1311 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1312 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ADDRESS"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1313 device->address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1314 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1315 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUBDEVICE"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1316 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1317 if (sscanf((const char *)key, "%d", &ival) == 1)
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1318 device->subdevice = ival;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1319 xmlFree(key);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1320 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1321 if ((!xmlStrcmp(cur->name, (const xmlChar *)"GPIOPIN"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1322 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1323 if (sscanf((const char *)key, "%d", &ival) == 1)
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1324 device->gpiopin = ival;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1325 xmlFree(key);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1326 }
161
493e39bb0a08 Small fixes for device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
1327 if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESCRIPTION"))) {
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1328 device->description = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1329 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1330 if ((!xmlStrcmp(cur->name, (const xmlChar *)"INUSE"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1331 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1332 if (sscanf((const char *)key, "%d", &ival) == 1)
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1333 device->inuse = ival;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1334 xmlFree(key);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1335 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1336 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COMMENT"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1337 device->comment = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1338 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1339 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMESTAMP"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1340 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1341 if (sscanf((const char *)key, "%d", &ival) == 1)
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1342 device->timestamp = (time_t)ival;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1343 xmlFree(key);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1344 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1345
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1346 cur = cur->next;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1347 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1348
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1349 if (Config.devices == NULL) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1350 Config.devices = device;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1351 } else {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1352 for (tmp = Config.devices; tmp; tmp = tmp->next) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1353 if (tmp->next == NULL) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1354 tmp->next = device;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1355 break;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1356 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1357 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1358 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1359
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1360 return 0;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1361 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1362
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1363
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1364
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1365 int parseDevices(xmlDocPtr doc, xmlNodePtr cur)
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1366 {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1367 cur = cur->xmlChildrenNode;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1368 while (cur != NULL) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1369 if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEVICE"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1370 parseDevice(doc, cur);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1371 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1372 cur = cur->next;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1373 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1374 return 0;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1375 }
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1376
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1377
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1378
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1379 #ifdef USE_SIMULATOR
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1380 int parseSimulator(xmlDocPtr doc, xmlNodePtr cur)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1381 {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1382 xmlChar *key;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1383 simulator_list *simulator, *tmp;
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1384 int ival, i;
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1385 float fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1386
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1387 simulator = (simulator_list *)malloc(sizeof(simulator_list));
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1388 simulator->next = NULL;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1389 simulator->uuid = simulator->name = NULL;
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1390 simulator->room_tempaddress = simulator->room_humaddress = simulator->air_address = simulator->beer_address = simulator->beer_address2 = NULL;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1391 simulator->chiller_address = simulator->cooler_address = simulator->heater_address = simulator->fan_address = simulator->light_address = NULL;
716
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1392 simulator->door_address = simulator->psu_address = NULL;
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1393 simulator->simno = simulator->volume_air = simulator->volume_beer = 0;
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1394 simulator->room_temperature = simulator->air_temperature = simulator->beer_temperature = simulator->s_cool_temp = simulator->s_heat_temp = 20.0;
553
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1395 simulator->chiller_temperature = 1.5;
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1396 simulator->room_humidity = 49.2;
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1397 simulator->cooler_temp = simulator->cooler_size = simulator->heater_temp = simulator->heater_size = simulator->frigo_isolation = 0.0;
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1398 simulator->cooler_time = simulator->heater_time = 0;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1399 simulator->air_present = simulator->beer_present = DEVPRESENT_YES;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1400 simulator->beer_present2 = simulator->chiller_present = simulator->cooler_present = simulator->heater_present = DEVPRESENT_UNDEF;
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1401 simulator->s_yeast_started = simulator->s_cool_changed = simulator->s_heat_changed = (time_t)0;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1402 simulator->s_yeast_heat = simulator->s_cool_temp = simulator->s_heat_temp = 0.0;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1403
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1404 cur = cur->xmlChildrenNode;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1405 while (cur != NULL) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1406 if ((!xmlStrcmp(cur->name, (const xmlChar *)"UUID"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1407 simulator->uuid = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1408 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1409 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1410 simulator->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1411 }
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1412 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIMNO"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1413 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1414 if (sscanf((const char *)key, "%d", &ival) == 1)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1415 simulator->simno = ival;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1416 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1417 }
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1418 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VOLUME_AIR"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1419 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1420 if (sscanf((const char *)key, "%d", &ival) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1421 simulator->volume_air = ival;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1422 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1423 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1424 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VOLUME_BEER"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1425 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1426 if (sscanf((const char *)key, "%d", &ival) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1427 simulator->volume_beer = ival;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1428 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1429 }
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1430 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOM_TEMPADDRESS"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1431 simulator->room_tempaddress = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1432 }
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1433 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOM_TEMPERATURE"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1434 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1435 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1436 simulator->room_temperature = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1437 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1438 }
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1439 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOM_HUMADDRESS"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1440 simulator->room_humaddress = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1441 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1442 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOM_HUMIDITY"))) {
553
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1443 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1444 if (sscanf((const char *)key, "%f", &fval) == 1)
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1445 simulator->room_humidity= fval;
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1446 xmlFree(key);
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1447 }
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1448 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AIR_ADDRESS"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1449 simulator->air_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1450 }
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1451 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AIR_TEMPERATURE"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1452 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1453 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1454 simulator->air_temperature = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1455 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1456 }
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1457 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AIR_PRESENT"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1458 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1459 for (i = 0; i < 4; i++) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1460 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1461 simulator->air_present = i;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1462 break;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1463 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1464 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1465 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1466 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1467 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_ADDRESS"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1468 simulator->beer_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1469 }
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1470 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_TEMPERATURE"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1471 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1472 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1473 simulator->beer_temperature = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1474 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1475 }
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1476 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_PRESENT"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1477 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1478 for (i = 0; i < 4; i++) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1479 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1480 simulator->beer_present = i;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1481 break;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1482 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1483 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1484 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1485 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1486 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_ADDRESS2"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1487 simulator->beer_address2 = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1488 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1489 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_TEMPERATURE2"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1490 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1491 if (sscanf((const char *)key, "%f", &fval) == 1)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1492 simulator->beer_temperature2 = fval;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1493 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1494 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1495 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEER_PRESENT2"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1496 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1497 for (i = 0; i < 4; i++) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1498 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1499 simulator->beer_present2 = i;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1500 break;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1501 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1502 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1503 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1504 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1505 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CHILLER_ADDRESS"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1506 simulator->chiller_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1507 }
553
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1508 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CHILLER_TEMPERATURE"))) {
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1509 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1510 if (sscanf((const char *)key, "%f", &fval) == 1)
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1511 simulator->chiller_temperature = fval;
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1512 xmlFree(key);
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
1513 }
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1514 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CHILLER_PRESENT"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1515 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1516 for (i = 0; i < 4; i++) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1517 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1518 simulator->chiller_present = i;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1519 break;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1520 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1521 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1522 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1523 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1524 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COOLER_ADDRESS"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1525 simulator->cooler_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1526 }
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1527 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COOLER_TEMP"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1528 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1529 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1530 simulator->cooler_temp = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1531 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1532 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1533 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COOLER_TIME"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1534 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1535 if (sscanf((const char *)key, "%d", &ival) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1536 simulator->cooler_time = ival;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1537 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1538 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1539 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COOLER_SIZE"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1540 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1541 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1542 simulator->cooler_size = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1543 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1544 }
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1545 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COOLER_PRESENT"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1546 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1547 for (i = 0; i < 4; i++) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1548 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1549 simulator->cooler_present = i;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1550 break;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1551 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1552 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1553 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1554 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1555 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COOLER_POWER"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1556 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1557 if (sscanf((const char *)key, "%d", &ival) == 1)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1558 simulator->cooler_power = ival;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1559 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1560 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1561 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HEATER_ADDRESS"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1562 simulator->heater_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1563 }
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1564 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HEATER_TEMP"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1565 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1566 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1567 simulator->heater_temp = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1568 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1569 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1570 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HEATER_TIME"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1571 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1572 if (sscanf((const char *)key, "%d", &ival) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1573 simulator->heater_time = ival;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1574 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1575 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1576 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HEATER_SIZE"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1577 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1578 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1579 simulator->heater_size = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1580 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1581 }
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1582 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HEATER_PRESENT"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1583 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1584 for (i = 0; i < 4; i++) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1585 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1586 simulator->heater_present = i;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1587 break;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1588 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1589 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1590 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1591 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1592 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HEATER_POWER"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1593 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1594 if (sscanf((const char *)key, "%d", &ival) == 1)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1595 simulator->heater_power = ival;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1596 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1597 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1598 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FAN_ADDRESS"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1599 simulator->fan_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1600 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1601 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FAN_PRESENT"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1602 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1603 for (i = 0; i < 4; i++) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1604 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1605 simulator->fan_present = i;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1606 break;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1607 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1608 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1609 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1610 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1611 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FAN_POWER"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1612 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1613 if (sscanf((const char *)key, "%d", &ival) == 1)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1614 simulator->fan_power = ival;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1615 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1616 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1617 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIGHT_ADDRESS"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1618 simulator->light_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1619 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1620 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIGHT_PRESENT"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1621 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1622 for (i = 0; i < 4; i++) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1623 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1624 simulator->light_present = i;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1625 break;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1626 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1627 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1628 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1629 }
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1630 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIGHT_POWER"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1631 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1632 if (sscanf((const char *)key, "%d", &ival) == 1)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1633 simulator->light_power = ival;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1634 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1635 }
716
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1636 if ((!xmlStrcmp(cur->name, (const xmlChar *)"DOOR_ADDRESS"))) {
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1637 simulator->door_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1638 }
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1639 if ((!xmlStrcmp(cur->name, (const xmlChar *)"DOOR_PRESENT"))) {
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1640 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1641 for (i = 0; i < 4; i++) {
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1642 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1643 simulator->door_present = i;
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1644 break;
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1645 }
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1646 }
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1647 xmlFree(key);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1648 }
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1649 if ((!xmlStrcmp(cur->name, (const xmlChar *)"DOOR_VALUE"))) {
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1650 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1651 if (sscanf((const char *)key, "%d", &ival) == 1)
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1652 simulator->door_value = ival;
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1653 xmlFree(key);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1654 }
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1655 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PSU_ADDRESS"))) {
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1656 simulator->psu_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1657 }
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1658 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PSU_PRESENT"))) {
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1659 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1660 for (i = 0; i < 4; i++) {
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1661 if (! xmlStrcmp(key, (const xmlChar *)DEVPRESENT[i])) {
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1662 simulator->psu_present = i;
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1663 break;
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1664 }
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1665 }
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1666 xmlFree(key);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1667 }
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1668 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PSU_VALUE"))) {
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1669 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1670 if (sscanf((const char *)key, "%d", &ival) == 1)
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1671 simulator->psu_value = ival;
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1672 xmlFree(key);
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
1673 }
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1674 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FRIGO_ISOLATION"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1675 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1676 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1677 simulator->frigo_isolation = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1678 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1679 }
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1680 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMESTAMP"))) {
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1681 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1682 if (sscanf((const char *)key, "%d", &ival) == 1)
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1683 simulator->timestamp = ival;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1684 xmlFree(key);
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 708
diff changeset
1685 }
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1686
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1687 if ((!xmlStrcmp(cur->name, (const xmlChar *)"S_YEAST_HEAT"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1688 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1689 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1690 simulator->s_yeast_heat = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1691 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1692 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1693 if ((!xmlStrcmp(cur->name, (const xmlChar *)"S_YEAST_STARTED"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1694 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1695 if (sscanf((const char *)key, "%d", &ival) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1696 simulator->s_yeast_started = (time_t)ival;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1697 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1698 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1699 if ((!xmlStrcmp(cur->name, (const xmlChar *)"S_COOL_TEMP"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1700 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1701 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1702 simulator->s_cool_temp = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1703 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1704 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1705 if ((!xmlStrcmp(cur->name, (const xmlChar *)"S_HEAT_TEMP"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1706 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1707 if (sscanf((const char *)key, "%f", &fval) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1708 simulator->s_heat_temp = fval;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1709 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1710 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1711 if ((!xmlStrcmp(cur->name, (const xmlChar *)"S_COOL_CHANGED"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1712 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1713 if (sscanf((const char *)key, "%d", &ival) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1714 simulator->s_cool_changed = (time_t)ival;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1715 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1716 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1717 if ((!xmlStrcmp(cur->name, (const xmlChar *)"S_HEAT_CHANGED"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1718 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1719 if (sscanf((const char *)key, "%d", &ival) == 1)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1720 simulator->s_heat_changed = (time_t)ival;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1721 xmlFree(key);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1722 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1723
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1724 cur = cur->next;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1725 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1726
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1727 if (Config.simulators == NULL) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1728 Config.simulators = simulator;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1729 } else {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1730 for (tmp = Config.simulators; tmp; tmp = tmp->next) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1731 if (tmp->next == NULL) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1732 tmp->next = simulator;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1733 break;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1734 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1735 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1736 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1737
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1738 return 0;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1739 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1740
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1741
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1742
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1743 int parseSimulators(xmlDocPtr doc, xmlNodePtr cur)
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1744 {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1745 cur = cur->xmlChildrenNode;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1746 while (cur != NULL) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1747 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIMULATOR"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1748 parseSimulator(doc, cur);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1749 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1750 cur = cur->next;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1751 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1752 return 0;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1753 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1754 #endif
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1755
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1756
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1757
86
3d7a241329e2 Using final user paths for log, configuration and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
1758 int rdconfig(void)
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1759 {
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1760 int rc = 0, ival;
370
843dc511c877 Fixed memory leak in wrconfig
Michiel Broek <mbroek@mbse.eu>
parents: 363
diff changeset
1761 char *mypath;
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1762 xmlDocPtr doc;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1763 xmlNodePtr cur;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1764 xmlChar *key;
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1765
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1766 killconfig();
268
dda91dfa4aa8 All syslog logging only to LOG_NOTICE
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
1767 syslog(LOG_NOTICE, "HOME='%s' USER='%s' LOGNAME='%s'", MBSE_SS(getenv((char *)"HOME")), MBSE_SS(getenv((char *)"USER")), MBSE_SS(getenv((char *)"LOGNAME")));
56
f7711c6ac93c Workaround for empty environment at system boot
Michiel Broek <mbroek@mbse.eu>
parents: 55
diff changeset
1768
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1769 /*
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1770 * Search config file
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1771 */
56
f7711c6ac93c Workaround for empty environment at system boot
Michiel Broek <mbroek@mbse.eu>
parents: 55
diff changeset
1772 if (getenv((char *)"USER") == NULL) {
55
11d7cc3bdf31 If /home/mbroek is not set, assume root user.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
1773 mypath = xstrcpy((char *)"/root");
11d7cc3bdf31 If /home/mbroek is not set, assume root user.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
1774 } else {
11d7cc3bdf31 If /home/mbroek is not set, assume root user.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
1775 mypath = xstrcpy(getenv((char *)"HOME"));
11d7cc3bdf31 If /home/mbroek is not set, assume root user.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
1776 }
86
3d7a241329e2 Using final user paths for log, configuration and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
1777 mypath = xstrcat(mypath, (char *)"/.thermferm/etc/");
3d7a241329e2 Using final user paths for log, configuration and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
1778 mkdirs(mypath, 0755);
3d7a241329e2 Using final user paths for log, configuration and profiles
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
1779 mypath = xstrcat(mypath, (char *)"thermferm.xml");
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1780 if ((doc = xmlParseFile(mypath)) == NULL) {
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1781 /*
388
05a55609cd9a Create a new configuration file if it doesn't exist.
Michiel Broek <mbroek@mbse.eu>
parents: 370
diff changeset
1782 * No config file, create a fresh one
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1783 */
388
05a55609cd9a Create a new configuration file if it doesn't exist.
Michiel Broek <mbroek@mbse.eu>
parents: 370
diff changeset
1784 syslog(LOG_NOTICE, "rdconfig: %s not found, creating", mypath);
05a55609cd9a Create a new configuration file if it doesn't exist.
Michiel Broek <mbroek@mbse.eu>
parents: 370
diff changeset
1785 wrconfig();
05a55609cd9a Create a new configuration file if it doesn't exist.
Michiel Broek <mbroek@mbse.eu>
parents: 370
diff changeset
1786
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1787 if ((doc = xmlParseFile(mypath)) == NULL) {
388
05a55609cd9a Create a new configuration file if it doesn't exist.
Michiel Broek <mbroek@mbse.eu>
parents: 370
diff changeset
1788 syslog(LOG_NOTICE, "rdconfig: could not create %s", mypath);
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1789 free(mypath);
388
05a55609cd9a Create a new configuration file if it doesn't exist.
Michiel Broek <mbroek@mbse.eu>
parents: 370
diff changeset
1790 return 1;
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1791 }
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1792 }
268
dda91dfa4aa8 All syslog logging only to LOG_NOTICE
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
1793 syslog(LOG_NOTICE, "rdconfig: using %s", mypath);
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1794
500
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1795 Config.mqtt_host = xstrcpy((char *)"localhost");
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1796 Config.mqtt_port = 1883;
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1797 Config.next_unit = 1;
675
825210ba2707 Added websockets to thermferm. Started new www directory for websocket enabled web. The init script now waits until thermferm is completely stopped.
Michiel Broek <mbroek@mbse.eu>
parents: 666
diff changeset
1798 Config.websocket_port = 8020;
497
18ace27338e5 Compiles mosquitto code if library is found on the system. Bumped to version 0.5.4
Michiel Broek <mbroek@mbse.eu>
parents: 492
diff changeset
1799
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1800 if ((cur = xmlDocGetRootElement(doc)) == NULL) {
268
dda91dfa4aa8 All syslog logging only to LOG_NOTICE
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
1801 syslog(LOG_NOTICE, "XML file %s empty.", mypath);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1802 xmlFreeDoc(doc);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1803 return 1;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1804 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1805 if (xmlStrcmp(cur->name, (const xmlChar*)"THERMFERM")) {
268
dda91dfa4aa8 All syslog logging only to LOG_NOTICE
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
1806 syslog(LOG_NOTICE, "XML file %s is not a valid configuration file.", mypath);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1807 xmlFreeDoc(doc);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1808 return 1;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1809 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1810
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1811 /*
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1812 * Parse configuration
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1813 */
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1814 cur = cur->xmlChildrenNode;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1815 while (cur != NULL) {
286
674efa17be1d The global system name was not saved or restored from the configuration file.
Michiel Broek <mbroek@mbse.eu>
parents: 284
diff changeset
1816 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
674efa17be1d The global system name was not saved or restored from the configuration file.
Michiel Broek <mbroek@mbse.eu>
parents: 284
diff changeset
1817 Config.name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
674efa17be1d The global system name was not saved or restored from the configuration file.
Michiel Broek <mbroek@mbse.eu>
parents: 284
diff changeset
1818 }
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
1819 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SERVER_PORT")) || (!xmlStrcmp(cur->name, (const xmlChar *)"LISTEN_PORT"))) {
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1820 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1821 if (sscanf((const char *)key, "%d", &ival) == 1)
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
1822 Config.server_port = ival;
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1823 xmlFree(key);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1824 }
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
1825 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TEMP_UUID")) || (!xmlStrcmp(cur->name, (const xmlChar *)"TEMP_ADDRESS"))) {
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
1826 Config.temp_uuid = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1827 }
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
1828 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HUM_UUID")) || (!xmlStrcmp(cur->name, (const xmlChar *)"HUM_ADDRESS"))) {
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
1829 Config.hum_uuid = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
95
2c28afc329a5 Removed old brewPi settings
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
1830 }
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
1831 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TEMP_HUM_IDX"))) {
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
1832 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
1833 if (sscanf((const char *)key, "%d", &ival) == 1)
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
1834 Config.temp_hum_idx = ival;
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
1835 xmlFree(key);
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
1836 }
500
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1837 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NEXT_UNIT"))) {
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1838 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1839 if (sscanf((const char *)key, "%d", &ival) == 1)
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1840 Config.next_unit = ival;
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1841 xmlFree(key);
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1842 }
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1843 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MQTT_HOST"))) {
561
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1844 if (Config.mqtt_host)
fcfc3dbe85fa Versie 0.8.7. Fixed a lot of memory leaks with the aid of valgrind.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1845 free(Config.mqtt_host);
500
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1846 Config.mqtt_host = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1847 }
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1848 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MQTT_PORT"))) {
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1849 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1850 if (sscanf((const char *)key, "%d", &ival) == 1)
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1851 Config.mqtt_port = ival;
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1852 xmlFree(key);
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
1853 }
534
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
1854 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MQTT_USER"))) {
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
1855 Config.mqtt_username = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
1856 }
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
1857 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MQTT_PASS"))) {
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
1858 Config.mqtt_password = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
1859 }
540
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1860 if ((!xmlStrcmp(cur->name, (const xmlChar *)"UUID"))) {
675
825210ba2707 Added websockets to thermferm. Started new www directory for websocket enabled web. The init script now waits until thermferm is completely stopped.
Michiel Broek <mbroek@mbse.eu>
parents: 666
diff changeset
1861 Config.uuid = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
540
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1862 }
675
825210ba2707 Added websockets to thermferm. Started new www directory for websocket enabled web. The init script now waits until thermferm is completely stopped.
Michiel Broek <mbroek@mbse.eu>
parents: 666
diff changeset
1863 if ((!xmlStrcmp(cur->name, (const xmlChar *)"WS_PORT"))) {
825210ba2707 Added websockets to thermferm. Started new www directory for websocket enabled web. The init script now waits until thermferm is completely stopped.
Michiel Broek <mbroek@mbse.eu>
parents: 666
diff changeset
1864 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
825210ba2707 Added websockets to thermferm. Started new www directory for websocket enabled web. The init script now waits until thermferm is completely stopped.
Michiel Broek <mbroek@mbse.eu>
parents: 666
diff changeset
1865 if (sscanf((const char *)key, "%d", &ival) == 1)
825210ba2707 Added websockets to thermferm. Started new www directory for websocket enabled web. The init script now waits until thermferm is completely stopped.
Michiel Broek <mbroek@mbse.eu>
parents: 666
diff changeset
1866 Config.websocket_port = ival;
825210ba2707 Added websockets to thermferm. Started new www directory for websocket enabled web. The init script now waits until thermferm is completely stopped.
Michiel Broek <mbroek@mbse.eu>
parents: 666
diff changeset
1867 xmlFree(key);
825210ba2707 Added websockets to thermferm. Started new www directory for websocket enabled web. The init script now waits until thermferm is completely stopped.
Michiel Broek <mbroek@mbse.eu>
parents: 666
diff changeset
1868 }
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1869 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LCDS"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1870 parseLCDs(doc, cur);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1871 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1872 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FERMENTERS"))) {
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1873 parseFermenters(doc, cur);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1874 }
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1875 if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEVICES"))) {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1876 parseDevices(doc, cur);
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1877 }
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1878 #ifdef USE_SIMULATOR
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1879 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIMULATORS"))) {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1880 parseSimulators(doc, cur);
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1881 }
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
1882 #endif
80
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1883 cur = cur->next;
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1884 }
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1885 xmlFreeDoc(doc);
81bf78a7618e Switched to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1886
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1887 free(mypath);
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1888 mypath = NULL;
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1889
540
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1890 /*
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1891 * If the system uuid is not set, do it now.
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1892 */
565
3593b18486d7 Fix not generating a valid system uuid
Michiel Broek <mbroek@mbse.eu>
parents: 564
diff changeset
1893 if (Config.uuid && ! strcmp((char *)"(null)", Config.uuid)) {
3593b18486d7 Fix not generating a valid system uuid
Michiel Broek <mbroek@mbse.eu>
parents: 564
diff changeset
1894 free(Config.uuid);
3593b18486d7 Fix not generating a valid system uuid
Michiel Broek <mbroek@mbse.eu>
parents: 564
diff changeset
1895 Config.uuid = NULL;
3593b18486d7 Fix not generating a valid system uuid
Michiel Broek <mbroek@mbse.eu>
parents: 564
diff changeset
1896 }
540
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1897 if (Config.uuid == NULL) {
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1898 uuid_t uu;
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1899
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1900 Config.uuid = malloc(37);
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1901 uuid_generate(uu);
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1902 uuid_unparse(uu, Config.uuid);
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1903 }
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
1904
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1905 return rc;
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1906 }
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1907
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1908
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1909

mercurial