Fri, 28 Dec 2018 23:18:42 +0100
Some pH calculations cane use twice as much loops, probably because we have better float precision then the original pascal code. More variables to prevent html reads. Use predicted mash pH (the grist in demi water) to calculate the pH shift from the tapwater to the target pH. It's better but not right yet. Or it is right and brouwhulp is far off.
16 | 1 | <?php |
2 | require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php'); | |
3 | page_header('Hoofdmenu', NULL); | |
4 | $uuid = $_GET["uuid"]; | |
5 | ?> | |
6 | <script> | |
7 | $(document).ready(function () { | |
8 | ||
9 | var uuid = "<?php echo $uuid; ?>"; | |
10 | var url = "getnode.php?uuid='" + uuid + "'"; | |
11 | var source = { | |
12 | datatype: "json", | |
13 | datafields: [ | |
14 | { name: 'record', type: 'int' }, | |
15 | { name: 'uuid', type: 'string' }, | |
16 | { name: 'node', type: 'string' }, | |
17 | { name: 'online', type: 'bool' }, | |
18 | { name: 'group_id', type: 'string' }, | |
19 | { name: 'hardwaremake', type: 'string' }, | |
20 | { name: 'hardwaremodel', type: 'string' }, | |
21 | { name: 'os', type: 'string' }, | |
22 | { name: 'os_version', type: 'string' }, | |
23 | { name: 'firmware', type: 'string' }, | |
24 | { name: 'firstseen', type: 'string' }, | |
25 | { name: 'lastseen', type: 'string' }, | |
26 | { name: 'temperature', type: 'float' }, | |
27 | { name: 'humidity', type: 'float' }, | |
28 | { name: 'barometer', type: 'float' }, | |
29 | { name: 'gps_latitude', type: 'float' }, | |
30 | { name: 'gps_longitude', type: 'float' }, | |
31 | { name: 'gps_altitude', type: 'float' }, | |
32 | { name: 'net_address', type: 'string' }, | |
33 | { name: 'net_ifname', type: 'string' }, | |
34 | { name: 'net_rssi', type: 'int' } | |
35 | ], | |
36 | id: 'record', | |
37 | url: url | |
38 | }; | |
39 | var dataAdapter = new $.jqx.dataAdapter(source, { | |
40 | loadComplete: function (records) { | |
41 | var record = dataAdapter.records[0]; | |
42 | var html = "<div id='node_table'>"; | |
43 | html += "<table style='width: 100%; padding: 10px;'>"; | |
44 | html += "<tr><th colspan=2>Systeem overzicht</th></tr>"; | |
45 | html += "<tr><td>Uuid</td><td>" + record.uuid + "</td></tr>"; | |
46 | html += "<tr><td>Systeem</td><td>" + record.node + "</td></tr>"; | |
47 | html += "<tr><td>Online</td><td>" + record.online + "</td></tr>"; | |
48 | html += "<tr><td>Type</td><td>" + record.group_id + "</td></tr>"; | |
49 | html += "<tr><td>Eerst gezien</td><td>" + record.firstseen + "</td></tr>"; | |
50 | html += "<tr><td>Laatst gezien</td><td>" + record.lastseen + "</td></tr>"; | |
51 | html += "<tr><td>Hardware maker</td><td>" + record.hardwaremake+ "</td></tr>"; | |
75
1a3c6480e057
Added support for brewcontrol nodes
Michiel Broek <mbroek@mbse.eu>
parents:
40
diff
changeset
|
52 | html += "<tr><td>Hardware model</td><td>" + record.hardwaremodel+ "</td></tr>"; |
16 | 53 | html += "<tr><td>OS</td><td>" + record.os + " versie: " + record.os_version + "</td></tr>"; |
54 | html += "<tr><td>Firmware</td><td>" + record.firmware + "</td></tr>"; | |
55 | if (record.online) { | |
40
b825c675987d
Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
56 | html += "<tr><td>Temperatuur</td><td>" + record.temperature.toFixed(1) + "°C</td></tr>"; |
16 | 57 | if (record.humidity > 0) { |
40
b825c675987d
Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
58 | html += "<tr><td>Vochtigheid</td><td>" + record.humidity.toFixed(1) + "%</td></tr>"; |
16 | 59 | } |
60 | if (record.barometer > 0) { | |
40
b825c675987d
Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
61 | html += "<tr><td>Luchtdruk</td><td>" + record.barometer.toFixed(0) + "</td></tr>"; |
16 | 62 | } |
63 | if ((record.gps_latitude != 0) && (record.gps_longitude != 0)) { | |
64 | html += "<tr><td>GPS</td><td>"+ record.gps_latitude + " " + record.gps_longitude + " " + record.gps_altitude + "</td></tr>"; | |
65 | } | |
66 | html += "<tr><td>Netwerk</td><td>"+ record.net_ifname + " " + record.net_address + "</td></tr>"; | |
67 | } | |
68 | html += "</<table>"; | |
69 | html += "</div>"; | |
70 | $("#ContentPanel").html(html); | |
71 | } | |
72 | }); | |
73 | ||
74 | // Get the data immediatly and then at regular intervals to refresh. | |
75 | dataAdapter.dataBind(); | |
76 | setInterval(function(){ | |
77 | dataAdapter.dataBind(); | |
78 | }, 30000); | |
79 | }); | |
80 | </script> | |
81 | ||
82 | <div id="MainPanel"> | |
83 | <div id="ContentPanel"></div> | |
84 | </div> | |
85 | ||
86 | <?php | |
87 | page_footer(); | |
88 | ?> |