139 { name: 'psu_state', map: 'metric>psu>state' }, |
139 { name: 'psu_state', map: 'metric>psu>state' }, |
140 { name: 'mode', map: 'metric>mode' }, |
140 { name: 'mode', map: 'metric>mode' }, |
141 { name: 'alarm', map: 'metric>alarm', type: 'int' }, |
141 { name: 'alarm', map: 'metric>alarm', type: 'int' }, |
142 { name: 'setpoint_high', map: 'metric>setpoint>high' }, |
142 { name: 'setpoint_high', map: 'metric>setpoint>high' }, |
143 { name: 'setpoint_low', map: 'metric>setpoint>low' }, |
143 { name: 'setpoint_low', map: 'metric>setpoint>low' }, |
144 { name: 'profile_uuid', type: 'string' }, |
144 { name: 'profile_uuid', map: 'metric>profile>uuid' }, |
145 { name: 'profile_name', type: 'string' }, |
145 { name: 'profile_name', map: 'metric>profile>name' }, |
146 { name: 'profile_state', type: 'string' }, |
146 { name: 'profile_state', map: 'metric>profile>state', type: 'string' }, |
147 { name: 'profile_percent', type: 'int' }, |
147 { name: 'profile_percent', map: 'metric>profile>percent', type: 'int' }, |
148 { name: 'profile_inittemp_high', type: 'float' }, |
148 { name: 'profile_inittemp_high', map: 'metric>profile>inittemp>high', type: 'float' }, |
149 { name: 'profile_inittemp_low', type: 'float' }, |
149 { name: 'profile_inittemp_low', map: 'metric>profile>inittemp>low', type: 'float' }, |
150 { name: 'profile_steps', type: 'string' }, |
150 { name: 'profile_steps', map: 'metric>profile>steps', type: 'string' }, |
151 { name: 'stage', map: 'metric>stage', type: 'string' }, |
151 { name: 'stage', map: 'metric>stage', type: 'string' }, |
152 { name: 'beeruuid', map: 'metric>product>uuid' } |
152 { name: 'beeruuid', map: 'metric>product>uuid' } |
153 ], |
153 ], |
154 id: 'alias', |
154 id: 'alias', |
155 url: url |
155 url: url |
184 if (record.mode != 'OFF') { |
185 if (record.mode != 'OFF') { |
185 $('#fermenter_powerled').html('<div class="LEDblue_on"></div>Power'); |
186 $('#fermenter_powerled').html('<div class="LEDblue_on"></div>Power'); |
186 } else { |
187 } else { |
187 $('#fermenter_powerled').html('<div class="LEDblue_off"></div>Power'); |
188 $('#fermenter_powerled').html('<div class="LEDblue_off"></div>Power'); |
188 } |
189 } |
189 if (record.alarm != '0') { |
190 if (record.alarm != '0') { |
190 $('#fermenter_alarmled').html('<div class="LEDred_on"></div>Alarm'); |
191 $('#fermenter_alarmled').html('<div class="LEDred_on"></div>Alarm'); |
191 } else { |
192 } else { |
192 $('#fermenter_alarmled').html('<div class="LEDred_off"></div>Alarm'); |
193 $('#fermenter_alarmled').html('<div class="LEDred_off"></div>Alarm'); |
193 } |
194 } |
194 |
195 |
195 $('#target_lo').val(record.setpoint_low); |
196 $('#target_lo').val(record.setpoint_low); |
196 $('#target_hi').val(record.setpoint_high); |
197 $('#target_hi').val(record.setpoint_high); |
197 if ((record.mode == 'FRIDGE') || (record.mode == 'BEER')) { |
198 if ((record.mode == 'FRIDGE') || (record.mode == 'BEER')) { |
198 $('#target_lo').jqxNumberInput({ readOnly: false, Width: 70, spinButtons: true }); |
199 $('#target_lo').jqxNumberInput({ readOnly: false, Width: 70, spinButtons: true }); |
199 $('#target_hi').jqxNumberInput({ readOnly: false, Width: 70, spinButtons: true }); |
200 $('#target_hi').jqxNumberInput({ readOnly: false, Width: 70, spinButtons: true }); |
200 } else { |
201 } else { |
201 $('#target_lo').jqxNumberInput({ readOnly: true, Width: 50, spinButtons: false }); |
202 $('#target_lo').jqxNumberInput({ readOnly: true, Width: 50, spinButtons: false }); |
202 $('#target_hi').jqxNumberInput({ readOnly: true, Width: 50, spinButtons: false }); |
203 $('#target_hi').jqxNumberInput({ readOnly: true, Width: 50, spinButtons: false }); |
203 } |
204 } |
204 |
205 |
205 $('.f_control_leds').show(); |
206 $('.f_control_leds').show(); |
206 if (record.heater_state != '0') { |
207 if (record.heater_state != '0') { |
207 $('#fermenter_led1').html('<div class="LEDgreen_on"></div>Heat'); |
208 $('#fermenter_led1').html('<div class="LEDgreen_on"></div>Heat'); |
208 } else { |
209 } else { |
209 $('#fermenter_led1').html('<div class="LEDgreen_off"></div>Heat'); |
210 $('#fermenter_led1').html('<div class="LEDgreen_off"></div>Heat'); |
210 } |
211 } |
211 if (record.cooler_state != '0') { |
212 if (record.cooler_state != '0') { |
212 $('#fermenter_led2').html('<div class="LEDgreen_on"></div>Cool'); |
213 $('#fermenter_led2').html('<div class="LEDgreen_on"></div>Cool'); |
213 } else { |
214 } else { |
214 $('#fermenter_led2').html('<div class="LEDgreen_off"></div>Cool'); |
215 $('#fermenter_led2').html('<div class="LEDgreen_off"></div>Cool'); |
215 } |
216 } |
216 if (record.fan_state != '0') { |
217 if (record.fan_state != '0') { |
217 $('#fermenter_led3').html('<div class="LEDgreen_on"></div>Fan'); |
218 $('#fermenter_led3').html('<div class="LEDgreen_on"></div>Fan'); |
218 } else { |
219 } else { |
219 $('#fermenter_led3').html('<div class="LEDgreen_off"></div>Fan'); |
220 $('#fermenter_led3').html('<div class="LEDgreen_off"></div>Fan'); |
220 } |
221 } |
221 |
222 |
222 if (record.mode == 'NONE') { |
223 if (record.mode == 'NONE') { |
223 $('.f_control_switches').show(); |
224 $('.f_control_switches').show(); |
224 } else { |
225 } else { |
225 $('.f_control_switches').hide(); |
226 $('.f_control_switches').hide(); |
226 } |
227 } |
227 if ((record.heater_state != '0') != $('#fermenter_toggle1').jqxSwitchButton('val')) |
228 if ((record.heater_state != '0') != $('#fermenter_toggle1').jqxSwitchButton('val')) |
228 $('#fermenter_toggle1').val(record.heater_state != '0'); |
229 $('#fermenter_toggle1').val(record.heater_state != '0'); |
229 if ((record.cooler_state != '0') != $('#fermenter_toggle2').jqxSwitchButton('val')) |
230 if ((record.cooler_state != '0') != $('#fermenter_toggle2').jqxSwitchButton('val')) |
230 $('#fermenter_toggle2').val(record.cooler_state != '0'); |
231 $('#fermenter_toggle2').val(record.cooler_state != '0'); |
231 if ((record.fan_state != '0') != $('#fermenter_toggle3').jqxSwitchButton('val')) |
232 if ((record.fan_state != '0') != $('#fermenter_toggle3').jqxSwitchButton('val')) |
232 $('#fermenter_toggle3').val(record.fan_state != '0'); |
233 $('#fermenter_toggle3').val(record.fan_state != '0'); |
233 |
234 |
234 $('#info_profile').html(record.profile_name); |
235 $('#info_profile').html(record.profile_name); |
235 if (record.profile_name == '') |
236 if (record.profile_name == '') |
236 $('#info_mode').jqxDropDownList('disableItem', 'PROFILE'); |
237 $('#info_mode').jqxDropDownList('disableItem', 'PROFILE'); |
237 else |
238 else |
238 $('#info_mode').jqxDropDownList('enableItem', 'PROFILE'); |
239 $('#info_mode').jqxDropDownList('enableItem', 'PROFILE'); |
239 |
240 |
240 if (record.mode == 'PROFILE') { |
241 if (record.mode == 'PROFILE') { |
241 if (record.profile_state == 'OFF') { |
242 if (record.profile_state == 'OFF') { |
242 $('#info_mode').jqxDropDownList({ disabled: false }); |
|
243 $('#Profile1').jqxButton({ template: 'success', value: 'Starten' }); |
|
244 $('#Profile1').show(); |
|
245 $('#Profile2').hide(); |
|
246 $('#status_profile').html(''); |
|
247 } else if (record.profile_state == 'RUN') { |
|
248 $('#info_mode').jqxDropDownList({ disabled: true }); |
|
249 $('#Profile1').jqxButton({ template: 'danger', value: 'Afbreken' }); |
|
250 $('#Profile2').jqxButton({ template: 'primary', value: 'Pauze' }); |
|
251 $('#Profile1').show(); |
|
252 $('#Profile2').show(); |
|
253 $('#status_profile').html('Profiel actief, ' + record.profile_percent + '% gereed'); |
|
254 } else if (record.profile_state == 'PAUSE') { |
|
255 $('#info_mode').jqxDropDownList({ disabled: true }); |
|
256 $('#Profile1').jqxButton({ template: 'danger', value: 'Afbreken' }); |
|
257 $('#Profile2').jqxButton({ template: 'success', value: 'Doorgaan' }); |
|
258 $('#Profile1').show(); |
|
259 $('#Profile2').show(); |
|
260 $('#status_profile').html('Profiel pauze, ' + record.profile_percent + '% gereed'); |
|
261 } else if (record.profile_state == 'DONE') { |
|
262 $('#info_mode').jqxDropDownList({ disabled: true }); |
|
263 $('#Profile1').jqxButton({ template: 'primary', value: 'Profiel Ok' }); |
|
264 $('#Profile1').show(); |
|
265 $('#Profile2').hide(); |
|
266 $('#status_profile').html('Profiel is gereed'); |
|
267 } |
|
268 } else { |
|
269 $('#info_mode').jqxDropDownList({ disabled: false }); |
243 $('#info_mode').jqxDropDownList({ disabled: false }); |
270 $('#Profile1').hide(); |
244 $('#Profile1').jqxButton({ template: 'success', value: 'Starten' }); |
|
245 $('#Profile1').show(); |
271 $('#Profile2').hide(); |
246 $('#Profile2').hide(); |
272 $('#status_profile').html(''); |
247 $('#status_profile').html(''); |
|
248 } else if (record.profile_state == 'RUN') { |
|
249 $('#info_mode').jqxDropDownList({ disabled: true }); |
|
250 $('#Profile1').jqxButton({ template: 'danger', value: 'Afbreken' }); |
|
251 $('#Profile2').jqxButton({ template: 'primary', value: 'Pauze' }); |
|
252 $('#Profile1').show(); |
|
253 $('#Profile2').show(); |
|
254 $('#status_profile').html('Profiel actief, ' + record.profile_percent + '% gereed'); |
|
255 } else if (record.profile_state == 'PAUSE') { |
|
256 $('#info_mode').jqxDropDownList({ disabled: true }); |
|
257 $('#Profile1').jqxButton({ template: 'danger', value: 'Afbreken' }); |
|
258 $('#Profile2').jqxButton({ template: 'success', value: 'Doorgaan' }); |
|
259 $('#Profile1').show(); |
|
260 $('#Profile2').show(); |
|
261 $('#status_profile').html('Profiel pauze, ' + record.profile_percent + '% gereed'); |
|
262 } else if (record.profile_state == 'DONE') { |
|
263 $('#info_mode').jqxDropDownList({ disabled: true }); |
|
264 $('#Profile1').jqxButton({ template: 'primary', value: 'Profiel Ok' }); |
|
265 $('#Profile1').show(); |
|
266 $('#Profile2').hide(); |
|
267 $('#status_profile').html('Profiel is gereed'); |
273 } |
268 } |
274 |
269 } else { |
275 var yl = record.yeast_lo; |
270 $('#info_mode').jqxDropDownList({ disabled: false }); |
276 var yh = record.yeast_hi; |
271 $('#Profile1').hide(); |
277 var range = { ranges: [{ startValue: 0, endValue: yl, style: { fill: '#3399FF', stroke: '#3399FF' }, endWidth: 10, startWidth: 10 }, |
272 $('#Profile2').hide(); |
|
273 $('#status_profile').html(''); |
|
274 } |
|
275 |
|
276 var yl = record.yeast_lo; |
|
277 var yh = record.yeast_hi; |
|
278 var range = { ranges: [{ startValue: 0, endValue: yl, style: { fill: '#3399FF', stroke: '#3399FF' }, endWidth: 10, startWidth: 10 }, |
278 { startValue: yl, endValue: yh, style: { fill: '#00CC33', stroke: '#00CC33' }, endWidth: 10, startWidth: 10 }, |
279 { startValue: yl, endValue: yh, style: { fill: '#00CC33', stroke: '#00CC33' }, endWidth: 10, startWidth: 10 }, |
279 { startValue: yh, endValue: 45, style: { fill: '#FC6A6A', stroke: '#FC6A6A' }, endWidth: 10, startWidth: 10 }]}; |
280 { startValue: yh, endValue: 45, style: { fill: '#FC6A6A', stroke: '#FC6A6A' }, endWidth: 10, startWidth: 10 }]}; |
280 $('#gaugeContainer_air').jqxGauge(range); |
281 $('#gaugeContainer_air').jqxGauge(range); |
281 $('#gaugeContainer_beer').jqxGauge(range); |
282 $('#gaugeContainer_beer').jqxGauge(range); |
282 |
283 |
283 if (record.air_temperature !== undefined) { |
284 if (record.air_temperature !== undefined) { |
284 $('#gaugeContainer_air').jqxGauge({ caption: { value: 'Air: ' + record.air_temperature.toFixed(3) }}); |
285 $('#gaugeContainer_air').jqxGauge({ caption: { value: 'Air: ' + record.air_temperature.toFixed(3) }}); |
285 $('#gaugeContainer_air').jqxGauge({ value: record.air_temperature }); |
286 $('#gaugeContainer_air').jqxGauge({ value: record.air_temperature }); |
286 } |
287 } |
287 if (record.air_state == 'OK') { |
288 if (record.air_state == 'OK') { |
288 $('#gaugeContainer_air').jqxGauge({ disabled: false }); |
289 $('#gaugeContainer_air').jqxGauge({ disabled: false }); |
289 } else { |
290 } else { |
290 $('#gaugeContainer_air').jqxGauge({ disabled: true }); |
291 $('#gaugeContainer_air').jqxGauge({ disabled: true }); |
291 } |
292 } |
292 if (record.beer_temperature !== undefined) { |
293 if (record.beer_temperature !== undefined) { |
293 $('#gaugeContainer_beer').jqxGauge({ caption: { value: 'Beer: ' + record.beer_temperature.toFixed(3) }}); |
294 $('#gaugeContainer_beer').jqxGauge({ caption: { value: 'Beer: ' + record.beer_temperature.toFixed(3) }}); |
294 $('#gaugeContainer_beer').jqxGauge({ value: record.beer_temperature }); |
295 $('#gaugeContainer_beer').jqxGauge({ value: record.beer_temperature }); |
295 } |
296 } |
296 if (record.beer_state == 'OK') { |
297 if (record.beer_state == 'OK') { |
297 $('#gaugeContainer_beer').jqxGauge({ disabled: false }); |
298 $('#gaugeContainer_beer').jqxGauge({ disabled: false }); |
298 } else { |
299 } else { |
299 $('#gaugeContainer_beer').jqxGauge({ disabled: true }); |
300 $('#gaugeContainer_beer').jqxGauge({ disabled: true }); |
300 } |
301 } |
301 if (record.chiller_temperature !== undefined) { |
302 if (record.chiller_temperature !== undefined) { |
302 $('#gaugeContainer_chiller').jqxGauge({ value: record.chiller_temperature }); |
303 $('#gaugeContainer_chiller').jqxGauge({ value: record.chiller_temperature }); |
303 } |
304 } |
304 if (record.chiller_state == 'OK') { |
305 if (record.chiller_state == 'OK') { |
305 $('#gaugeContainer_chiller').jqxGauge({ disabled: false }); |
306 $('#gaugeContainer_chiller').jqxGauge({ disabled: false }); |
306 } else { |
307 } else { |
307 $('#gaugeContainer_chiller').jqxGauge({ disabled: true }); |
308 $('#gaugeContainer_chiller').jqxGauge({ disabled: true }); |
308 } |
309 } |
309 } |
310 } |
310 |
311 |
311 $('#gaugeContainer_air').jqxGauge(gaugeoptions); |
312 $('#gaugeContainer_air').jqxGauge(gaugeoptions); |
312 $('#gaugeContainer_air').jqxGauge({ caption: { value: 'Air: 00.000' }}); |
313 $('#gaugeContainer_air').jqxGauge({ caption: { value: 'Air: 00.000' }}); |
313 $('#gaugeContainer_beer').jqxGauge(gaugeoptions); |
314 $('#gaugeContainer_beer').jqxGauge(gaugeoptions); |