148 }); |
148 }); |
149 $('#cooler_power,#heater_power,#fan_power,#light_power').jqxNumberInput(Perc0); |
149 $('#cooler_power,#heater_power,#fan_power,#light_power').jqxNumberInput(Perc0); |
150 $('#cooler_temp,#heater_temp').jqxNumberInput(Spin1dec); |
150 $('#cooler_temp,#heater_temp').jqxNumberInput(Spin1dec); |
151 $('#cooler_time,#heater_time').jqxNumberInput(PosInt); |
151 $('#cooler_time,#heater_time').jqxNumberInput(PosInt); |
152 $('#cooler_size,#heater_size').jqxNumberInput(Spin4dec); |
152 $('#cooler_size,#heater_size').jqxNumberInput(Spin4dec); |
153 $('#door_value').jqxSwitchButton({ height: 23, width: 100, theme: theme }); |
153 $('#door_value').jqxSwitchButton({ height: 23, width: 120, theme: theme, onLabel:'Closed', offLabel: 'Open' }); |
154 $('#psu_value').jqxSwitchButton({ height: 23, width: 100, theme: theme }); |
154 $('#psu_value').jqxSwitchButton({ height: 23, width: 120, theme: theme }); |
155 |
155 |
156 // initialize jqxGrid |
156 // initialize jqxGrid |
157 $('#jqxgrid').jqxGrid({ |
157 $('#jqxgrid').jqxGrid({ |
158 width: 1280, |
158 width: 1280, |
159 height: 630, |
159 height: 630, |
198 }); |
198 }); |
199 }); |
199 }); |
200 }, |
200 }, |
201 columns: [ |
201 columns: [ |
202 { text: 'Name', datafield: 'name' }, |
202 { text: 'Name', datafield: 'name' }, |
203 { text: 'No.', datafield: 'simno', width: 80 }, |
203 { text: 'No.', datafield: 'simno', width: 60 }, |
204 { text: 'Air temp', datafield: 'air_temperature', width: 100 }, |
204 { text: 'Air temp', datafield: 'air_temperature', width: 100, cellsformat: 'f3' }, |
205 { text: 'Beer temp', datafield: 'beer_temperature', width: 100 }, |
205 { text: 'Beer temp', datafield: 'beer_temperature', width: 100, cellsformat: 'f3' }, |
|
206 { text: 'Chiller', datafield: 'chiller_temperature', width: 100, cellsformat: 'f3' }, |
206 { text: 'Heater', datafield: 'heater_power', width: 80 }, |
207 { text: 'Heater', datafield: 'heater_power', width: 80 }, |
207 { text: 'Cooler', datafield: 'cooler_power', width: 80 }, |
208 { text: 'Cooler', datafield: 'cooler_power', width: 80 }, |
208 { text: 'Fan', datafield: 'fan_power', width: 80 }, |
209 { text: 'Fan', datafield: 'fan_power', width: 80 }, |
|
210 { text: 'Light', datafield: 'light_power', width: 80 }, |
|
211 { text: 'Door', datafield: 'door_value', width: 60 }, |
|
212 { text: 'PSU', datafield: 'psu_value', width: 60 }, |
209 { text: 'Last change', datafield: 'timestamp', width: 190, |
213 { text: 'Last change', datafield: 'timestamp', width: 190, |
210 cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { |
214 cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { |
211 var date = new Date((value * 1000) - tzoffset).toISOString().slice(0, 19).replace("T", " "); |
215 var date = new Date((value * 1000) - tzoffset).toISOString().slice(0, 19).replace("T", " "); |
212 return '<span style="margin: 3px; margin-top: 6px; float: left;">' + date + '</span>'; |
216 return '<span style="margin: 3px; margin-top: 6px; float: left;">' + date + '</span>'; |
213 } |
217 } |