Sun, 12 Aug 2018 21:24:33 +0200
Added fermentable inventory
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | <?php |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | $my_style = 'android'; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | require_once('version.php'); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | ?> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | <!DOCTYPE html> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | <html lang="en"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | <head>' |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | <title id='Description'>Brewery Managment System v<?php echo $my_version; ?></title> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | <link type="text/css" href="css/style.css" rel="stylesheet" media="all" /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | <link type="text/css" href="jqwidgets/styles/jqx.base.css" rel="stylesheet" /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | <link type="text/css" href="jqwidgets/styles/jqx.<?php echo $my_style; ?>.css" rel="stylesheet" /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | <script src="js/jquery-1.11.1.min.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | <script src="jqwidgets/jqxcore.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | <script src="jqwidgets/jqxbuttons.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | <script src="jqwidgets/jqxscrollbar.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | <script src="jqwidgets/jqxpanel.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | <script src="jqwidgets/jqxtree.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | <script src="jqwidgets/jqxexpander.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | <script src="jqwidgets/jqxsplitter.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | <script src="jqwidgets/jqxdata.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | <script src="jqwidgets/jqxcheckbox.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | <script src="jqwidgets/jqxradiobutton.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | <script src="jqwidgets/jqxchart.core.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | <script src="jqwidgets/jqxgauge.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | <script src="jqwidgets/jqxdraw.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | <script src="jqwidgets/jqxtooltip.js"></script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | <script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | $(document).ready(function () { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | /* |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | * Different right panel pages |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | */ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
34 | var refreshIntervalId = 0; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | $("#fermenter_thermometers").hide(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | $("#splitter").jqxSplitter({ theme: "<?php echo $my_style; ?>", width: 1278, height: 618, panels: [{ size: 250}] }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
37 | $("#jqxTree").jqxTree({ theme: "<?php echo $my_style; ?>", height: "100%", width: "100%" }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
38 | /* |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | * Build the nodes subtree |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
40 | */ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
41 | var nodeByID = $("#jqxTree").find("#Nodes")[0]; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
42 | $.getJSON("getnodes.php", function(data) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
43 | for( i = 0; i < data.length; i++ ) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
44 | $("#jqxTree").jqxTree("addTo", { id: 'node-' + data[i].uuid, label: data[i].node, icon: 'images/folder.png' }, nodeByID); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
47 | /* |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
48 | * Build the fermenters subtree |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
49 | */ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
50 | var fermenterByID = $("#jqxTree").find("#Fermenters")[0]; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
51 | $.getJSON("getfermenters.php", function(data) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
52 | for( i = 0; i < data.length; i++ ) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
53 | $("#jqxTree").jqxTree("addTo", { id: 'fermenter-' + data[i].uuid, label: data[i].node + "/" + data[i].alias, icon: 'images/folder.png' }, fermenterByID); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
54 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
55 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
56 | |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
57 | $("#jqxTree").css("visibility", "visible"); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
58 | |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
59 | $("#jqxTree").on("select", function (event) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
60 | /* |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
61 | * Cancel a running refresh loop. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
62 | */ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
63 | if (refreshIntervalId > 0) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
64 | console.log( "RefreshIIntervald: " + refreshIntervalId + " stopped" ); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
65 | clearInterval(refreshIntervalId); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
66 | refreshIntervalId = 0; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
67 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
68 | $("#fermenter_thermometers").hide(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
69 | $("#gaugeContainer_air").hide(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
70 | $("#gaugeContainer_beer").hide(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
71 | $("#gaugeContainer_chiller").hide(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
72 | /* |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
73 | * Process the selected id from the left panel tree and show the correct page in the right panel. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
74 | */ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
75 | var estr = event.args.element.id; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
76 | if (estr == "Root") { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
77 | $("#ContentPanel").html("<div style='margin: 10px;'><a href='index.php'>Hoofdmenu</a></div>"); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
78 | |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
79 | } else if (estr.indexOf("node-", 0) == 0) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
80 | // Load and show a node. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
81 | // The parameter is: node-36d4d030-4d62-4f2f-a96b-472e643687f7 |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
82 | var uuid = estr.substr(5); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
83 | var url = "getnode.php?uuid='" + uuid + "'"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
84 | var source = { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
85 | datatype: "json", |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
86 | datafields: [ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
87 | { name: 'record', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
88 | { name: 'uuid', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
89 | { name: 'node', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
90 | { name: 'online', type: 'bool' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
91 | { name: 'group_id', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
92 | { name: 'hardwaremake', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
93 | { name: 'hardwaremodel', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
94 | { name: 'os', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
95 | { name: 'os_version', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
96 | { name: 'firmware', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
97 | { name: 'firstseen', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
98 | { name: 'lastseen', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
99 | { name: 'temperature', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
100 | { name: 'humidity', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
101 | { name: 'barometer', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
102 | { name: 'gps_latitude', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
103 | { name: 'gps_longitude', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
104 | { name: 'gps_altitude', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
105 | { name: 'net_address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
106 | { name: 'net_ifname', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
107 | { name: 'net_rssi', type: 'int' } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
108 | ], |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
109 | id: 'record', |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
110 | url: url |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
111 | }; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
112 | var dataAdapter = new $.jqx.dataAdapter(source, { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
113 | loadComplete: function (records) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
114 | var record = dataAdapter.records[0]; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
115 | var html = "<div style='background: #252526; margin: 50px;'>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
116 | html += "<table style='width: 100%; padding: 10px;'>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
117 | html += "<tr><th colspan=2>Systeem overzicht</th></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
118 | html += "<tr><td>Uuid</td><td>" + record.uuid + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
119 | html += "<tr><td>Systeem</td><td>" + record.node + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
120 | html += "<tr><td>Online</td><td>" + record.online + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
121 | html += "<tr><td>Type</td><td>" + record.group_id + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
122 | html += "<tr><td>Eerst gezien</td><td>" + record.firstseen + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
123 | html += "<tr><td>Laatst gezien</td><td>" + record.lastseen + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
124 | html += "<tr><td>Hardware maker</td><td>" + record.hardwaremake+ "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
125 | html += "<tr><td>Hardware model</td><td>" + record.harwaremodel+ "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
126 | html += "<tr><td>OS</td><td>" + record.os + " versie: " + record.os_version + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
127 | html += "<tr><td>Firmware</td><td>" + record.firmware + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
128 | if (record.online) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
129 | html += "<tr><td>Temperatuur</td><td>" + record.temperature + "°C</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
130 | if (record.humidity > 0) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
131 | html += "<tr><td>Vochtigheid</td><td>" + record.humidity + "%</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
132 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
133 | if (record.barometer > 0) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
134 | html += "<tr><td>Luchtdruk</td><td>" + record.barometer + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
135 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
136 | if ((record.gps_latitude != 0) && (record.gps_longitude != 0)) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
137 | html += "<tr><td>GPS</td><td>"+ record.gps_latitude + " " + record.gps_longitude + " " + record.gps_altitude + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
138 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
139 | html += "<tr><td>Netwerk</td><td>"+ record.net_ifname + " " + record.net_address + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
140 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
141 | html += "</<table>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
142 | html += "</div>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
143 | $("#ContentPanel").html(html); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
144 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
145 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
146 | // Get the data immediatly and then at regular intervals to refresh. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
147 | dataAdapter.dataBind(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
148 | refreshIntervalId = setInterval(function(){ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
149 | dataAdapter.dataBind(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
150 | }, 30000); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
151 | |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
152 | } else if (estr.indexOf("fermenter-", 0) == 0) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
153 | // Load and show a fermenter. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
154 | // The parameter is: fermenter-36d4d030-4d62-4f2f-a96b-472e643687f7 |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
155 | var gaugeoptions = { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
156 | min: -5, max: 35, width: 275, height: 275, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
157 | ranges: [{ startValue: -5, endValue: 0, style: { fill: '#3399FF', stroke: '#3399FF' }, endWidth: 10, startWidth: 10 }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
158 | { startValue: 0, endValue: 16, style: { fill: '#00CC33', stroke: '#00CC33' }, endWidth: 10, startWidth: 10 }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
159 | { startValue: 16, endValue: 24, style: { fill: '#FCA76A', stroke: '#FCA76A' }, endWidth: 10, startWidth: 10 }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
160 | { startValue: 24, endValue: 35, style: { fill: '#FC6A6A', stroke: '#FC6A6A' }, endWidth: 10, startWidth: 10 }], |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
161 | ticksMinor: { interval: 1, size: '5%' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
162 | ticksMajor: { interval: 5, size: '9%' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
163 | labels: { interval: 5 }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
164 | style: { fill: '#eeeeee', stroke: '#666666' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
165 | value: 0, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
166 | colorScheme: 'scheme05', |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
167 | animationDuration: 1200 |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
168 | }; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
169 | var gaugeSmalloptions = { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
170 | min: -20, max: 25, width: 150, height: 150, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
171 | ranges: [{ startValue: -20, endValue: 0, startWidth: 5, endWidth: 5, style: { fill: '#3399FF', stroke: '#3399FF' }}, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
172 | { startValue: 0, endValue: 25, startWidth: 5, endWidth: 5, style: { fill: '#FC6A6A', stroke: '#FC6A6A' }}], |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
173 | ticksMinor: { interval: 1, size: '5%' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
174 | ticksMajor: { interval: 5, size: '9%' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
175 | labels: { interval: 5 }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
176 | style: { fill: '#eeeeee', stroke: '#666666' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
177 | value: 0, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
178 | colorScheme: 'scheme05', |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
179 | animationDuration: 1200, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
180 | caption: { value: 'Chiller', position: 'bottom', offset: [0, 10] } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
181 | }; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
182 | $("#fermenter_thermometers").show(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
183 | $("#gaugeContainer_air").show(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
184 | $("#gaugeContainer_air").jqxGauge( gaugeoptions ); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
185 | $("#gaugeContainer_air").jqxGauge( { caption: { value: 'Air', position: 'bottom', offset: [0, 10] }} ); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
186 | $("#gaugeContainer_beer").show(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
187 | $("#gaugeContainer_beer").jqxGauge( gaugeoptions ); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
188 | $("#gaugeContainer_beer").jqxGauge( { caption: { value: 'Beer', position: 'bottom', offset: [0, 10] }} ); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
189 | $("#gaugeContainer_chiller").show(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
190 | $("#gaugeContainer_chiller").jqxGauge( gaugeSmalloptions ); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
191 | var uuid = estr.substr(10); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
192 | var url = "getfermenter.php?uuid='" + uuid + "'"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
193 | var source = { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
194 | datatype: "json", |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
195 | datafields: [ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
196 | { name: 'record', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
197 | { name: 'uuid', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
198 | { name: 'alias', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
199 | { name: 'node', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
200 | { name: 'online', type: 'bool' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
201 | { name: 'beercode', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
202 | { name: 'beername', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
203 | { name: 'air_address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
204 | { name: 'air_state', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
205 | { name: 'air_temperature', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
206 | { name: 'beer_address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
207 | { name: 'beer_state', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
208 | { name: 'beer_temperature', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
209 | { name: 'chiller_address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
210 | { name: 'chiller_state', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
211 | { name: 'chiller_temperature', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
212 | { name: 'heater_address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
213 | { name: 'heater_state', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
214 | { name: 'heater_usage', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
215 | { name: 'cooler_address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
216 | { name: 'cooler_state', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
217 | { name: 'cooler_usage', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
218 | { name: 'fan_address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
219 | { name: 'fan_state', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
220 | { name: 'fan_usage', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
221 | { name: 'light_address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
222 | { name: 'light_state', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
223 | { name: 'light_usage', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
224 | { name: 'door_address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
225 | { name: 'door_state', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
226 | { name: 'psu_address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
227 | { name: 'psu_state', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
228 | { name: 'mode', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
229 | { name: 'alarm', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
230 | { name: 'setpoint_high', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
231 | { name: 'setpoint_low', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
232 | { name: 'profile_uuid', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
233 | { name: 'profile_name', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
234 | { name: 'profile_state', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
235 | { name: 'profile_precent', type: 'int' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
236 | { name: 'profile_inittemp_high', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
237 | { name: 'profile_inittemp_low', type: 'float' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
238 | { name: 'profile_steps', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
239 | { name: 'stage', type: 'string' } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
240 | ], |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
241 | id: 'record', |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
242 | url: url |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
243 | }; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
244 | var dataAdapter = new $.jqx.dataAdapter(source, { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
245 | loadComplete: function (records) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
246 | var record = dataAdapter.records[0]; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
247 | var oline = (record.online) ? "On-line" : "Off-line"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
248 | var html = "<div id='fermenter_table'>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
249 | html += "<table style='width: 100%; padding: 10px;'>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
250 | html += "<tr><th colspan=2>Klimaatkast overzicht</th></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
251 | html += "<tr><td>Uuid</td><td>" + record.uuid + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
252 | html += "<tr><td>Systeem</td><td>" + record.node + "/" + record.alias + " " + oline + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
253 | html += "<tr><td>Bier</td><td>" + record.beercode + " - " + record.beername + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
254 | html += "<tr><td>Werking</td><td>" + record.mode + "</td></tr>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
255 | html += "<tr><td>Fase</td><td>" + record.stage + "</td></tr>" |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
256 | html += "</<table>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
257 | html += "</div>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
258 | $("#ContentPanel").html(html); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
259 | $('#gaugeContainer_air').jqxGauge({ value: record.air_temperature }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
260 | if (record.online && (record.air_state == "OK")) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
261 | $("#gaugeContainer_air").jqxGauge({ disabled: false }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
262 | } else { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
263 | $("#gaugeContainer_air").jqxGauge({ disabled: true }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
264 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
265 | $('#gaugeContainer_beer').jqxGauge({ value: record.beer_temperature }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
266 | if (record.online && (record.beer_state == "OK")) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
267 | $("#gaugeContainer_beer").jqxGauge({ disabled: false }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
268 | } else { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
269 | $("#gaugeContainer_beer").jqxGauge({ disabled: true }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
270 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
271 | $("#gaugeContainer_chiller").jqxGauge({ value: record.chiller_temperature }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
272 | if (record.online && (record.chiller_state == "OK")) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
273 | $("#gaugeContainer_chiller").jqxGauge({ disabled: false }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
274 | } else { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
275 | $("#gaugeContainer_chiller").jqxGauge({ disabled: true }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
276 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
277 | html = "<div>SpH <span class='temperature NUM'>" + record.setpoint_high + "</span></div>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
278 | html += "<div>SpL <span class='temperature NUM'>" + record.setpoint_low + "</span></div>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
279 | html += "<div>Air <span class='temperature NUM'>" + record.air_temperature + "</span></div>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
280 | html += "<div>Beer <span class='temperature NUM'>" + record.beer_temperature + "</span></div>"; |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
281 | $("#fermenter_tempdigits").html(html); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
282 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
283 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
284 | // Get the data immediatly and then at regular intervals to refresh. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
285 | dataAdapter.dataBind(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
286 | refreshIntervalId = setInterval(function(){ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
287 | dataAdapter.dataBind(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
288 | }, 10000); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
289 | |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
290 | } else if (event.args.element.id == "Nodes") { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
291 | $("#ContentPanel").html("<div></div"); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
292 | } else { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
293 | $("#ContentPanel").html("<div style='margin: 10px;'>" + event.args.element.id + "</div>"); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
294 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
295 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
296 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
297 | </script> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
298 | </head> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
299 | |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
300 | <body class="default"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
301 | <div id="jqxWidget"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
302 | <div id="header"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
303 | <div id="title">BMS <?php echo $my_version; ?></div> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
304 | </div> <!-- header --> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
305 | <div id="splitter"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
306 | <div> <!-- tree panel --> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
307 | <div style="visibility: hidden; border: none;" id='jqxTree'> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
308 | <ul> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
309 | <li id="Root" item-expanded='true'> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
310 | <img style='float: left; margin-right: 5px;' src='images/earth.png' /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
311 | <span item-title="true">Root</span> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
312 | <ul> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
313 | <li id="Nodes"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
314 | <img style='float: left; margin-right: 5px;' src='images/folder.png' /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
315 | <span item-title="true">Systemen</span> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
316 | <!-- Subtree nodes --> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
317 | </li> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
318 | <li id="Fermenters"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
319 | <img style='float: left; margin-right: 5px;' src='images/folder.png' /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
320 | <span item-title="true">Klimaatkasten</span> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
321 | <!-- Subtree fermenters --> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
322 | </li> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
323 | <li id="Brewboards"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
324 | <img src='images/settings.png' /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
325 | <span item-title="true">Brouw apparatuur</span> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
326 | </li> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
327 | <li id="Prducing"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
328 | <img src='images/system.png' /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
329 | <span item-title="true">In productie</span> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
330 | </li> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
331 | <li id="Recipes"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
332 | <img style='float: left; margin-right: 5px;' src='images/beer.png' /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
333 | <span item-title="true">Recepten</span> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
334 | </li> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
335 | <li id="Settings"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
336 | <img style='float: left; margin-right: 5px;' src='images/setupIcon.png' /> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
337 | <span item-title="true">Instellingen</span> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
338 | </li> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
339 | </ul> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
340 | </li> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
341 | </ul> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
342 | </div> <!-- jqxTree --> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
343 | </div> <!-- tree panel --> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
344 | <div id="RightPanel"> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
345 | <div id="ContentPanel"></div> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
346 | <div id='fermenter_thermometers'> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
347 | <div id="gaugeContainer_air" style='float: left; margin-top: 10px; margin-left: 10px;'></div> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
348 | <div id="gaugeContainer_beer" style="float: right; margin-top: 10px; margin-right: 10px;"></div> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
349 | <div id="gaugeContainer_chiller" style="float: left; margin-top: 15px;"></div> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
350 | <div id="fermenter_tempdigits"></div> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
351 | </div> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
352 | </div> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
353 | </div> <!--- splitter --> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
354 | </div> <!-- jqxWidget --> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
355 | </body> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
356 | </html> |