www/js/mon_fermenter.js

Wed, 06 Dec 2023 20:26:00 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 06 Dec 2023 20:26:00 +0100
changeset 855
2d328a2a4025
parent 698
c7b4cb53b37c
permissions
-rw-r--r--

Fixed init scripts names in Makefile. Update crontasks to use the database to check the log entries for products.

180
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
645
3b1510050c9b Changed the last dropdown lists events to select
Michiel Broek <mbroek@mbse.eu>
parents: 548
diff changeset
2 * Copyright (C) 2019-2020
180
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of BMS
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * Brewery Management System istributed in the hope that it will be useful, but
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
191
fd1d7225ca6e Version 0.0.4. Added confirm popup window to abort a running profile. Translated the toggle buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 189
diff changeset
23 function createAbortElements() {
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
24 $('#eventWindow').jqxWindow({
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
25 theme: theme,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
26 position: { x: 440, y: 210 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
27 width: 400,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
28 height: 200,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
29 resizable: false,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
30 isModal: true,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
31 modalOpacity: 0.4,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
32 okButton: $('#delOk'),
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
33 cancelButton: $('#delCancel'),
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
34 initContent: function() {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
35 $('#delOk').jqxButton({ template: 'danger', width: '65px', theme: theme });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
36 $('#delCancel').jqxButton({ template: 'success', width: '65px', theme: theme });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
37 $('#delCancel').focus();
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
38 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
39 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
40 $('#eventWindow').jqxWindow('hide');
191
fd1d7225ca6e Version 0.0.4. Added confirm popup window to abort a running profile. Translated the toggle buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 189
diff changeset
41 }
fd1d7225ca6e Version 0.0.4. Added confirm popup window to abort a running profile. Translated the toggle buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 189
diff changeset
42
180
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
44 $(document).ready(function() {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
45
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
46 var record = {},
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
47 blank = {},
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
48 ppayload = '',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
49 yl = 12, // Normal yeast temp range
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
50 yh = 24,
180
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
52 productSource = {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
53 datatype: 'json',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
54 cache: false,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
55 datafields: [
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
56 { name: 'code', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
57 { name: 'name', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
58 { name: 'uuid', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
59 { name: 'stage', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
60 { name: 'yeast_lo', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
61 { name: 'yeast_hi', type: 'float' }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
62 ],
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
63 id: 'code',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
64 url: 'includes/db_product.php?select=ferment'
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
65 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
66 productlist = new $.jqx.dataAdapter(productSource, {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
67 beforeLoadComplete: function(records) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
68 var row, i, data = new Array();
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
69 // Create a dummy beer on top to store in idle fermenters.
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
70 blank['code'] = 'Free'; // Will override this later.
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
71 blank['name'] = 'Dummy';
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
72 blank['uuid'] = '66ecccbf-e942-4a35-af49-8b02314561a5';
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
73 blank['stage'] = 10;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
74 blank['yeast_lo'] = 12.0;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
75 blank['yeast_hi'] = 24.0;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
76 data.push(blank);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
77 for (i = 0; i < records.length; i++) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
78 row = records[i];
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
79 data.push(row);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
80 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
81 return data;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
82 },
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
83 loadError: function(jqXHR, status, error) { console.log(status + ' ' + error); },
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
84 }),
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
85 profileSource = {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
86 datatype: 'json',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
87 cache: false,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
88 datafields: [
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
89 { name: 'record', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
90 { name: 'uuid', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
91 { name: 'name', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
92 { name: 'inittemp_lo', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
93 { name: 'inittemp_hi', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
94 { name: 'fridgemode', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
95 { name: 'totalsteps', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
96 { name: 'duration', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
97 { name: 'steps', type: 'array' }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
98 ],
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
99 id: 'record',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
100 url: 'includes/db_profile_fermentation.php'
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
101 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
102 profilelist = new $.jqx.dataAdapter(profileSource, {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
103 beforeLoadComplete: function(records) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
104 var data = new Array(),
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
105 empty = {}, i, row;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
106 // Create a dummy profile on top of the list.
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
107 empty['record'] = -1;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
108 empty['uuid'] = '';
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
109 empty['name'] = 'Wis profiel';
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
110 empty['inittemp_lo'] = 20.0;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
111 empty['inittemp_hi'] = 20.2;
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
112 empty['fridgemode'] = 0;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
113 empty['totalsteps'] = 0;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
114 empty['duration'] = 0;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
115 empty['steps'] = '[]';
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
116 data.push(empty);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
117 for (i = 0; i < records.length; i++) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
118 row = records[i];
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
119 data.push(row);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
120 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
121 return data;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
122 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
123 loadError: function(jqXHR, status, error) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
124 $('#err').text(status + ' ' + error);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
125 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
126 }),
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
127 gaugeoptions = {
548
c67cd0d9249b Version 0.3.23. Maximum fermentation temperature changed to 45 degrees.
Michiel Broek <mbroek@mbse.eu>
parents: 526
diff changeset
128 min: 0, max: 45, width: 375, height: 375,
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
129 ranges: [{ startValue: 0, endValue: yl, style: { fill: '#3399FF', stroke: '#3399FF' }, endWidth: 10, startWidth: 10 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
130 { startValue: yl, endValue: yh, style: { fill: '#00CC33', stroke: '#00CC33' }, endWidth: 10, startWidth: 10 },
548
c67cd0d9249b Version 0.3.23. Maximum fermentation temperature changed to 45 degrees.
Michiel Broek <mbroek@mbse.eu>
parents: 526
diff changeset
131 { startValue: yh, endValue: 45, style: { fill: '#FC6A6A', stroke: '#FC6A6A' }, endWidth: 10, startWidth: 10 }],
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
132 ticksMinor: { interval: 1, size: '5%' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
133 ticksMajor: { interval: 5, size: '9%' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
134 labels: { interval: 5 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
135 style: { fill: '#eeeeee', stroke: '#666666' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
136 value: 0,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
137 colorScheme: 'scheme05'
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
138 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
139 gaugeSmalloptions = {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
140 min: -15, max: 25, width: 190, height: 190,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
141 ranges: [{ startValue: -15, endValue: 0, startWidth: 5, endWidth: 5, style: { fill: '#3399FF', stroke: '#3399FF' }},
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
142 { startValue: 0, endValue: 10, startWidth: 5, endWidth: 5, style: { fill: '#00CC33', stroke: '#00CC33' }},
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
143 { startValue: 10, endValue: 25, startWidth: 5, endWidth: 5, style: { fill: '#FC6A6A', stroke: '#FC6A6A' }}],
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
144 ticksMinor: { interval: 1, size: '5%' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
145 ticksMajor: { interval: 5, size: '9%' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
146 labels: { interval: 5 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
147 style: { fill: '#eeeeee', stroke: '#666666' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
148 value: 0,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
149 colorScheme: 'scheme05',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
150 caption: { value: 'Koeler', position: 'bottom', offset: [0, 10] }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
151 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
152 switchoptions = {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
153 height: 68,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
154 width: 35,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
155 onLabel: 'AAN',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
156 offLabel: 'UIT',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
157 theme: theme,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
158 thumbSize: '50%',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
159 orientation: 'vertical'
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
160 },
548
c67cd0d9249b Version 0.3.23. Maximum fermentation temperature changed to 45 degrees.
Michiel Broek <mbroek@mbse.eu>
parents: 526
diff changeset
161 targetoptions = { inputMode: 'simple', theme: theme, width: 70, min: 0, max: 45, decimalDigits: 1, spinButtons: true },
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
162 url = 'getfermenter.php?uuid="' + my_uuid + '"',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
163 source = {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
164 datatype: 'json',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
165 datafields: [
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
166 { name: 'record', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
167 { name: 'uuid', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
168 { name: 'alias', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
169 { name: 'node', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
170 { name: 'online', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
171 { name: 'beercode', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
172 { name: 'beername', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
173 { name: 'air_state', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
174 { name: 'air_temperature', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
175 { name: 'beer_state', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
176 { name: 'beer_temperature', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
177 { name: 'chiller_state', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
178 { name: 'chiller_temperature', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
179 { name: 'heater_state', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
180 { name: 'heater_usage', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
181 { name: 'cooler_state', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
182 { name: 'cooler_usage', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
183 { name: 'fan_state', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
184 { name: 'fan_usage', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
185 { name: 'light_address', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
186 { name: 'light_state', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
187 { name: 'light_usage', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
188 { name: 'door_address', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
189 { name: 'door_state', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
190 { name: 'psu_address', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
191 { name: 'psu_state', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
192 { name: 'mode', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
193 { name: 'alarm', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
194 { name: 'setpoint_high', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
195 { name: 'setpoint_low', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
196 { name: 'profile_uuid', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
197 { name: 'profile_name', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
198 { name: 'profile_state', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
199 { name: 'profile_percent', type: 'int' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
200 { name: 'profile_inittemp_high', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
201 { name: 'profile_inittemp_low', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
202 { name: 'profile_steps', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
203 { name: 'stage', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
204 { name: 'beeruuid', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
205 { name: 'yeast_lo', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
206 { name: 'yeast_hi', type: 'float' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
207 { name: 'webcam_url', type: 'string' },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
208 { name: 'webcam_light', type: 'int' }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
209 ],
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
210 id: 'record',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
211 url: url
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
212 },
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
213 dataAdapter = new $.jqx.dataAdapter(source, {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
214 loadComplete: function(records) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
215 record = dataAdapter.records[0];
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
216 updateScreen();
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
217 blank['name'] = record.alias;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
218 blank['code'] = record.alias.toUpperCase();
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
219 blank['uuid'] = record.uuid;
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
220 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
221 });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
222
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
223 function updateScreen() {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
224 $('#info_uuid').html(record.uuid);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
225 $('#info_system').html(record.node + '/' + record.alias);
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
226
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
227 if (record.online) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
228 $('#info_online').html('On-line');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
229 $('#info_beer').html(record.beercode + ' - ' + record.beername);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
230 $('#info_mode').jqxDropDownList('selectItem', record.mode);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
231 $('#info_stage').jqxDropDownList('selectItem', record.stage);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
232 if (record.door_address) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
233 if (record.door_state != '0') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
234 $('#fermenter_doorled').html('<div class="LEDyellow_on"></div>Door');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
235 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
236 $('#fermenter_doorled').html('<div class="LEDyellow_off"></div>Door');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
237 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
238 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
239 if (record.light_address) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
240 if (record.light_state != '0') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
241 $('#fermenter_lightled').html('<div class="LEDyellow_on"></div>Light');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
242 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
243 $('#fermenter_lightled').html('<div class="LEDyellow_off"></div>Light');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
244 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
245 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
246 if (record.mode != 'OFF') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
247 $('#fermenter_powerled').html('<div class="LEDblue_on"></div>Power');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
248 $('#select_beer').jqxDropDownList({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
249 $('#select_beer').jqxDropDownList('clearSelection');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
250 $('#select_beer').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
251 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
252 $('#fermenter_powerled').html('<div class="LEDblue_off"></div>Power');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
253 $('#select_beer').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
254 $('#select_beer').jqxDropDownList({ disabled: false });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
255 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
256 if (record.alarm != '0') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
257 $('#fermenter_alarmled').html('<div class="LEDred_on"></div>Alarm');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
258 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
259 $('#fermenter_alarmled').html('<div class="LEDred_off"></div>Alarm');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
260 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
261
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
262 $('#target_lo').val(record.setpoint_low);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
263 $('#target_hi').val(record.setpoint_high);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
264 if ((record.mode == 'FRIDGE') || (record.mode == 'BEER')) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
265 $('#target_lo').jqxNumberInput({ readOnly: false, Width: 70, spinButtons: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
266 $('#target_hi').jqxNumberInput({ readOnly: false, Width: 70, spinButtons: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
267 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
268 $('#target_lo').jqxNumberInput({ readOnly: true, Width: 50, spinButtons: false });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
269 $('#target_hi').jqxNumberInput({ readOnly: true, Width: 50, spinButtons: false });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
270 }
180
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
271
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
272 $('.f_control_leds').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
273 if (record.heater_state != '0') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
274 $('#fermenter_led1').html('<div class="LEDgreen_on"></div>Heat');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
275 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
276 $('#fermenter_led1').html('<div class="LEDgreen_off"></div>Heat');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
277 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
278 if (record.cooler_state != '0') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
279 $('#fermenter_led2').html('<div class="LEDgreen_on"></div>Cool');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
280 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
281 $('#fermenter_led2').html('<div class="LEDgreen_off"></div>Cool');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
282 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
283 if (record.fan_state != '0') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
284 $('#fermenter_led3').html('<div class="LEDgreen_on"></div>Fan');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
285 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
286 $('#fermenter_led3').html('<div class="LEDgreen_off"></div>Fan');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
287 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
288
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
289 if (record.mode == 'NONE') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
290 $('.f_control_switches').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
291 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
292 $('.f_control_switches').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
293 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
294 if ((record.heater_state != '0') != $('#fermenter_toggle1').jqxSwitchButton('val'))
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
295 $('#fermenter_toggle1').val(record.heater_state != '0');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
296 if ((record.cooler_state != '0') != $('#fermenter_toggle2').jqxSwitchButton('val'))
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
297 $('#fermenter_toggle2').val(record.cooler_state != '0');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
298 if ((record.fan_state != '0') != $('#fermenter_toggle3').jqxSwitchButton('val'))
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
299 $('#fermenter_toggle3').val(record.fan_state != '0');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
300
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
301 $('#info_profile').html(record.profile_name);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
302 if (record.profile_name == '')
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
303 $('#info_mode').jqxDropDownList('disableItem', 'PROFILE');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
304 else
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
305 $('#info_mode').jqxDropDownList('enableItem', 'PROFILE');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
306
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
307 if (record.mode == 'PROFILE') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
308 if (record.profile_state == 'OFF') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
309 $('#select_profile').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
310 $('#select_profile').jqxDropDownList({ disabled: false });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
311 $('#info_mode').jqxDropDownList({ disabled: false });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
312 $('#Profile1').jqxButton({ template: 'success', value: 'Starten' });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
313 $('#Profile1').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
314 $('#Profile2').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
315 $('#status_profile').html('');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
316 } else if (record.profile_state == 'RUN') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
317 $('#select_profile').jqxDropDownList({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
318 $('#select_profile').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
319 $('#info_mode').jqxDropDownList({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
320 $('#Profile1').jqxButton({ template: 'danger', value: 'Afbreken' });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
321 $('#Profile2').jqxButton({ template: 'primary', value: 'Pauze' });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
322 $('#Profile1').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
323 $('#Profile2').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
324 $('#status_profile').html('Profiel actief, ' + record.profile_percent + '% gereed');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
325 } else if (record.profile_state == 'PAUSE') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
326 $('#select_profile').jqxDropDownList({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
327 $('#select_profile').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
328 $('#info_mode').jqxDropDownList({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
329 $('#Profile1').jqxButton({ template: 'danger', value: 'Afbreken' });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
330 $('#Profile2').jqxButton({ template: 'success', value: 'Doorgaan' });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
331 $('#Profile1').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
332 $('#Profile2').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
333 $('#status_profile').html('Profiel pauze, ' + record.profile_percent + '% gereed');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
334 } else if (record.profile_state == 'DONE') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
335 $('#select_profile').jqxDropDownList({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
336 $('#select_profile').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
337 $('#info_mode').jqxDropDownList({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
338 $('#Profile1').jqxButton({ template: 'primary', value: 'Profiel Ok' });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
339 $('#Profile1').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
340 $('#Profile2').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
341 $('#status_profile').html('Profiel is gereed');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
342 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
343 } else {
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
344 $('#select_profile').show();
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
345 $('#select_profile').jqxDropDownList({ disabled: false });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
346 $('#info_mode').jqxDropDownList({ disabled: false });
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
347 $('#Profile1').hide();
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
348 $('#Profile2').hide();
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
349 $('#status_profile').html('');
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
350 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
351
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
352 if (record.webcam_url != '') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
353 $('#Camera').show();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
354 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
355 $('#Camera').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
356 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
357
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
358 var yl = record.yeast_lo;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
359 var yh = record.yeast_hi;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
360 var range = { ranges: [{ startValue: 0, endValue: yl, style: { fill: '#3399FF', stroke: '#3399FF' }, endWidth: 10, startWidth: 10 },
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
361 { startValue: yl, endValue: yh, style: { fill: '#00CC33', stroke: '#00CC33' }, endWidth: 10, startWidth: 10 },
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
362 { startValue: yh, endValue: 45, style: { fill: '#FC6A6A', stroke: '#FC6A6A' }, endWidth: 10, startWidth: 10 }]};
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
363 $('#gaugeContainer_air').jqxGauge(range);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
364 $('#gaugeContainer_beer').jqxGauge(range);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
365
682
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
366 if (record.air_temperature !== undefined) {
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
367 $('#gaugeContainer_air').jqxGauge({ caption: { value: 'Lucht: ' + record.air_temperature.toFixed(3) }});
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
368 $('#gaugeContainer_air').jqxGauge({ value: record.air_temperature });
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
369 }
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
370 if (record.air_state == 'OK') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
371 $('#gaugeContainer_air').jqxGauge({ disabled: false });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
372 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
373 $('#gaugeContainer_air').jqxGauge({ disabled: true });
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
374 }
682
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
375 if (record.beer_temperature !== undefined) {
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
376 $('#gaugeContainer_beer').jqxGauge({ caption: { value: 'Bier: ' + record.beer_temperature.toFixed(3) }});
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
377 $('#gaugeContainer_beer').jqxGauge({ value: record.beer_temperature });
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
378 }
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
379 if (record.beer_state == 'OK') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
380 $('#gaugeContainer_beer').jqxGauge({ disabled: false });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
381 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
382 $('#gaugeContainer_beer').jqxGauge({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
383 }
682
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
384 if (record.chiller_temperature !== undefined) {
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
385 $('#gaugeContainer_chiller').jqxGauge({ value: record.chiller_temperature });
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
386 }
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
387 if (record.chiller_state == 'OK') {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
388 $('#gaugeContainer_chiller').jqxGauge({ disabled: false });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
389 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
390 $('#gaugeContainer_chiller').jqxGauge({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
391 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
392 } else { // offline
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
393 $('#info_online').html('Off-line');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
394 $('#info_beer').html('');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
395 $('#info_mode').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
396 $('#info_stage').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
397 $('#select_beer').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
398 $('#select_profile').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
399 $('.f_display,.f_control_switches,.f_control_leds').hide();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
400 $('#fermenter_powerled').html('<div class="LEDblue_off"></div>Power');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
401 $('#fermenter_alarmled').html('<div class="LEDred_on"></div>Alarm');
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
402 $('#gaugeContainer_air').jqxGauge({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
403 $('#gaugeContainer_beer').jqxGauge({ disabled: true });
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
404 $('#gaugeContainer_chiller').jqxGauge({ disabled: true });
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
405 $('#Camera').hide();
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
406 }
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
407 }
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 455
diff changeset
408
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
409 $('#select_beer').jqxDropDownList({
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
410 placeHolder: 'Kies bier:',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
411 theme: theme,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
412 source: productlist,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
413 displayMember: 'code',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
414 width: 150,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
415 height: 24,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
416 dropDownWidth: 500,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
417 autoDropDownHeight: true,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
418 renderer: function(index, label, value) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
419 var datarecord = productlist.records[index];
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
420 return datarecord.code + ' - ' + datarecord.name;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
421 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
422 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
423 $('#select_profile').jqxDropDownList({
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
424 placeHolder: 'Kies profiel:',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
425 theme: theme,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
426 source: profilelist,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
427 displayMember: 'name',
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
428 width: 150,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
429 height: 24,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
430 dropDownWidth: 500,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
431 autoDropDownHeight: true,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
432 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
433
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
434 $('#gaugeContainer_air').jqxGauge(gaugeoptions);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
435 $('#gaugeContainer_air').jqxGauge({ caption: { value: 'Lucht: 00.000' }});
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
436 $('#gaugeContainer_beer').jqxGauge(gaugeoptions);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
437 $('#gaugeContainer_beer').jqxGauge({ caption: { value: 'Bier: 00.000' }});
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
438 $('#gaugeContainer_chiller').jqxGauge(gaugeSmalloptions);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
439
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
440 $('#fermenter_toggle1').jqxSwitchButton(switchoptions);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
441 $('#fermenter_toggle2').jqxSwitchButton(switchoptions);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
442 $('#fermenter_toggle3').jqxSwitchButton(switchoptions);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
443
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
444 srcMode = ['OFF', 'NONE', 'FRIDGE', 'BEER', 'PROFILE'];
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
445 srcStage = ['PRIMARY', 'SECONDARY', 'TERTIARY', 'CARBONATION'];
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
446 $('#info_mode').jqxDropDownList({ theme: theme, source: srcMode, width: 100, height: 24, dropDownHeight: 156 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
447 $('#info_stage').jqxDropDownList({ theme: theme, source: srcStage, width: 150, height: 24, dropDownHeight: 125 });
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 455
diff changeset
448
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
449 $('#target_lo').jqxNumberInput(targetoptions);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
450 $('#target_hi').jqxNumberInput(targetoptions);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
451
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
452 $('#Profile1').jqxButton({ template: 'info', width: '150px', height: 24, theme: theme });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
453 $('#Profile2').jqxButton({ template: 'info', width: '150px', height: 24, theme: theme });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
454 $('#Profile1').hide(); // Hide these until they are needed.
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
455 $('#Profile2').hide();
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
456
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
457 // Get the data immediatly and then at regular intervals to refresh.
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
458 dataAdapter.dataBind();
185
4c25db9e8102 Added configuration settings for MQTT in config.php. Finished screen box sizes for the fermenters monitor. Select beername and code from the current brew products and send it to the fermenter. Added switch commands to the fermenter. Delay data get from the fermenter after sending any command so there is time to process the commands. Turn switches off when the mode changes. Removed 0.2 degrees setpoint diffs for low and high, the fermenter must deal with it. Prevent turning the heater and cooler together on.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
459
645
3b1510050c9b Changed the last dropdown lists events to select
Michiel Broek <mbroek@mbse.eu>
parents: 548
diff changeset
460 $('#info_mode').on('select', function(event) {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
461 if (event.args && event.args.item.value != record.mode) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
462 record.mode = event.args.item.value;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
463 console.log('set mode ' + record.mode);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
464 var msg = '{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","mode":"' + record.mode + '"}';
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
465 websocket.send(msg);
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
466 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
467 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
468 $('#info_stage').on('select', function(event) {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
469 if (event.args && event.args.item.value != record.stage) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
470 record.stage = event.args.item.value;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
471 console.log('set stage ' + record.stage);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
472 var msg = '{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","stage":"' + record.stage + '"}';
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
473 websocket.send(msg);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
474 }
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
475 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
476 $('#select_beer').on('select', function(event) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
477 if (event.args) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
478 var index = event.args.index,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
479 datarecord = productlist.records[index];
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
480 record.beercode = datarecord.code;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
481 record.beername = datarecord.name;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
482 record.beeruuid = datarecord.uuid;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
483 record.yeast_lo = datarecord.yeast_lo;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
484 record.yeast_hi = datarecord.yeast_hi;
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
485 console.log('set beer ' + record.beercode + ' ' + record.beername);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
486 var msg = '{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias +
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
487 '","beeruuid":"' + record.beeruuid + '","beercode":"' + record.beercode + '","beername":"' + record.beername +
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
488 '","yeast_lo":' + record.yeast_lo + ',"yeast_hi":' + record.yeast_hi + '}';
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
489 websocket.send(msg);
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
490 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
491 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
492 $('#select_profile').on('select', function(event) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
493 if (event.args) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
494 var index = event.args.index,
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
495 datarecord = profilelist.records[index],
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
496 row, i;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
497 if (datarecord.record == -1) {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
498 ppayload = '","profile":null}';
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
499 } else {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
500 ppayload = '","profile":{"uuid":"' + datarecord.uuid + '","name":"' + datarecord.name + '",';
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
501 ppayload += '"inittemp":{"low":' + datarecord.inittemp_lo + ',"high":' + datarecord.inittemp_hi + '},';
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
502 ppayload += '"fridgemode":' + datarecord.fridgemode + ',"steps":[';
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
503 for (i = 0; i < datarecord.steps.length; i++) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
504 row = datarecord.steps[i];
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
505 if (i > 0)
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
506 ppayload += ',';
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
507 ppayload += '{"steptime":' + row['steptime'] + ',"resttime":' + row['resttime'];
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
508 ppayload += ',"target_lo":' + row['target_lo'] + ',"target_hi":' + row['target_hi'];
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
509 ppayload += ',"fridgemode":' + row['fridgemode'] + ',"name":"' + row['name'] + '"}';
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
510 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
511 ppayload += ']}}';
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
512 }
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
513 var msg = '{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + ppayload;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
514 websocket.send(msg);
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
515 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
516 });
180
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
517
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
518 $('#target_lo').on('change', function(event) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
519 record.setpoint_low = parseFloat(event.args.value);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
520 // Keep the high target above the low.
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
521 if (record.setpoint_low > record.setpoint_high) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
522 record.setpoint_high = record.setpoint_low;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
523 $('#target_hi').val(record.setpoint_high);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
524 }
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
525 console.log('set setpoints ' + record.setpoint_low + ' ' + record.setpoint_high);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
526 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias +
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
527 '","setpoint_low":' + record.setpoint_low + ',"setpoint_high":' + record.setpoint_high + '}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
528 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
529 $('#target_hi').on('change', function(event) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
530 record.setpoint_high = parseFloat(event.args.value);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
531 // Keep the low target below the high.
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
532 if (record.setpoint_high < record.setpoint_low) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
533 record.setpoint_low = record.setpoint_high;
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
534 $('#target_lo').val(record.setpoint_low);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
535 }
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
536 console.log('set setpoints ' + record.setpoint_low + ' ' + record.setpoint_high);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
537 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias +
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
538 '","setpoint_low":' + record.setpoint_low + ',"setpoint_high":' + record.setpoint_high + '}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
539 });
183
a810539dc218 Added cmd_fermenter.php which interfaces http POST commands to MQTT using mosquitto_pub in a shell. Several chnges to the monitor fermenter screen.
Michiel Broek <mbroek@mbse.eu>
parents: 182
diff changeset
540
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
541 $('#fermenter_toggle1').on('checked', function(event) {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
542 if (record.mode == 'NONE' && record.heater_state != 0) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
543 console.log('set heater ' + $("#fermenter_toggle1").jqxSwitchButton('val'));
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
544 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","heater_state":0}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
545 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
546 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
547 $('#fermenter_toggle1').on('unchecked', function(event) {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
548 if (record.mode == 'NONE' && record.heater_state == 0) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
549 console.log('set heater ' + $("#fermenter_toggle1").jqxSwitchButton('val'));
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
550 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","heater_state":100,"cooler_state":0}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
551 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
552 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
553 $('#fermenter_toggle2').on('checked', function(event) {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
554 if (record.mode == 'NONE' && record.cooler_state != 0) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
555 console.log('set cooler ' + $("#fermenter_toggle2").jqxSwitchButton('val'));
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
556 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","cooler_state":0}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
557 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
558 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
559 $('#fermenter_toggle2').on('unchecked', function(event) {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
560 if (record.mode == 'NONE' & record.cooler_state == 0) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
561 console.log('set cooler ' + $("#fermenter_toggle2").jqxSwitchButton('val'));
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
562 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","cooler_state":100,"heater_state":0}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
563 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
564 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
565 $('#fermenter_toggle3').on('checked', function(event) {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
566 if (record.mode == 'NONE' && record.fan_state != 0) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
567 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","fan_state":0}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
568 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
569 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
570 $('#fermenter_toggle3').on('unchecked', function(event) {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
571 if (record.mode == 'NONE' && record.fan_state == 0) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
572 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","fan_state":100}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
573 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
574 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
575 $('#Profile1').click(function() {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
576 if (record.mode == 'PROFILE') {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
577 if (record.profile_state == 'OFF') {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
578 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","profile":{"command":"start"}}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
579 } else if ((record.profile_state == 'RUN') || (record.profile_state == 'PAUSE')) {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
580 // Open a popup to confirm this action.
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
581 $('#eventWindow').jqxWindow('open');
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
582 $('#delOk').click(function() {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
583 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","profile":{"command":"abort"}}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
584 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
585 } else if (record.profile_state == 'DONE') {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
586 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","profile":{"command":"done"}}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
587 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
588 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
589 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
590 $('#Profile2').click(function() {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
591 if (record.mode == 'PROFILE') {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
592 if ((record.profile_state == 'RUN') || (record.profile_state == 'PAUSE')) {
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
593 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","profile":{"command":"pause"}}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
594 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
595 }
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
596 });
183
a810539dc218 Added cmd_fermenter.php which interfaces http POST commands to MQTT using mosquitto_pub in a shell. Several chnges to the monitor fermenter screen.
Michiel Broek <mbroek@mbse.eu>
parents: 182
diff changeset
597
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
598 // The chart button.
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
599 $('#FLog').jqxButton({ template: 'primary', width: '150px', theme: theme });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
600 $('#FLog').click(function() {
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
601 window.open('log_fermentation.php?code=' + record.beercode + '&name=' + record.beername);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
602 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
603 $('#Camera').jqxButton({ template: 'primary', width: '150px', theme: theme });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
604 $('#Camera').click(function() {
698
c7b4cb53b37c Fixed missing light_state commands for the webcam.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
605 // record.light_state = 100;
c7b4cb53b37c Fixed missing light_state commands for the webcam.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
606 websocket.send('{"device":"fermenters","node":"' + record.node + '","unit":"' + record.alias + '","light_state":100}');
526
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
607 window.open(record.webcam_url);
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
608 });
2991acd35cdb Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 494
diff changeset
609 createAbortElements();
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
610
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
611 websocket.onmessage = function(evt) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
612 var msg = evt.data;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
613 var obj = JSON.parse(msg);
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
614
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
615 if (obj.device == "fermenters" && obj.node == record.node && obj.unit == record.alias) {
685
a4fcdf24b5e7 Removed ws_global function because dynamic menus don't work.
Michiel Broek <mbroek@mbse.eu>
parents: 682
diff changeset
616 // console.log('ws got this device ' + msg);
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
617 record.online = obj.online;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
618 if (obj.online) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
619 record.beeruuid = obj.beeruuid;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
620 record.beercode = obj.beercode;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
621 record.beername = obj.beername;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
622 record.yeast_lo = obj.yeast_lo;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
623 record.yeast_hi = obj.yeast_hi;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
624 record.air_state = obj.air_state;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
625 record.air_temperature = obj.air_temperature;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
626 record.beer_state = obj.beer_state;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
627 record.beer_temperature = obj.beer_temperature;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
628 record.chiller_state = obj.chiller_state;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
629 record.chiller_temperature = obj.chiller_temperature;
682
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
630 if (obj.heater_state !== undefined)
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
631 record.heater_state = obj.heater_state;
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
632 if (obj.cooler_state !== undefined)
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
633 record.cooler_state = obj.cooler_state;
f52b18a2a4d1 Fixed undefined errors for missing fermenters hardware devices.
Michiel Broek <mbroek@mbse.eu>
parents: 679
diff changeset
634 if (obj.fan_state !== undefined)
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
635 record.fan_state = obj.fan_state;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
636 if (obj.door_address)
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
637 record.door_state = obj.door_state;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
638 if (obj.light_address)
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
639 record.light_state = obj.light_state;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
640 if (obj.psu_address)
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
641 record.psu_state = obj.psu_state;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
642 record.mode = obj.mode;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
643 record.stage = obj.stage;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
644 record.alarm = obj.alarm;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
645 record.setpoint_low = obj.setpoint_low;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
646 record.setpoint_high = obj.setpoint_high;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
647 record.webcam_url = obj.webcam_url;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
648 record.webcam_light = obj.webcam_light;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
649 if (obj.profile_name) {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
650 record.profile_uuid = obj.profile_uuid;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
651 record.profile_name = obj.profile_name;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
652 record.profile_state = obj.profile_state;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
653 record.profile_percent = obj.profile_percent;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
654 record.profile_inittemp_high = obj.profile_inittemp_high;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
655 record.profile_inittemp_low = obj.profile_inittemp_low;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
656 } else {
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
657 record.profile_uuid = '';
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
658 record.profile_name = '';
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
659 record.profile_state = '';
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
660 record.profile_percent = 0;
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
661 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
662 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
663 updateScreen();
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
664 }
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
665 }
180
a5aa3502310c Updated README. Getfermenter and getnode scripts return 0 and 1 instead of false and true for boolean values. Global variable my_uuid added. Moved the javascript out of mon_fermenter.php. Added log chart view button in the fermenter monitor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
666 });

mercurial