www-thermferm/liveview.php

changeset 521
28d1f5188c1d
parent 517
5fd12d9f3f84
child 522
4d9ed666431d
equal deleted inserted replaced
520:32bf084df5af 521:28d1f5188c1d
42 $air_temperature = "NA"; 42 $air_temperature = "NA";
43 $beer_temperature = "NA"; 43 $beer_temperature = "NA";
44 $profile = ""; 44 $profile = "";
45 $prof_state = "OFF"; 45 $prof_state = "OFF";
46 $power_led = $cooler_led = $heater_led = $fan_led = "off"; 46 $power_led = $cooler_led = $heater_led = $fan_led = "off";
47 $heater = $cooler = $fan = "no"; 47 $heater = $cooler = $chiller = $fan = "no";
48 $heater_state = $cooler_state = $fan_state = 0; 48 $heater_state = $cooler_state = $chiller_state = $fan_state = 0;
49 49
50 foreach($arr as $l) { 50 foreach($arr as $l) {
51 $vals = explode(",", $l); 51 $vals = explode(",", $l);
52 if (strcmp($vals[0], "MODE") == 0) { 52 if (strcmp($vals[0], "MODE") == 0) {
53 $mode = $vals[1]; 53 $mode = $vals[1];
75 if ((strcmp($vals[0], "COOLER_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) { 75 if ((strcmp($vals[0], "COOLER_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) {
76 $cooler = "yes"; 76 $cooler = "yes";
77 } 77 }
78 if (strcmp($vals[0], "COOLER_STATE") == 0) { 78 if (strcmp($vals[0], "COOLER_STATE") == 0) {
79 $cooler_state = $vals[1]; 79 $cooler_state = $vals[1];
80 }
81 if ((strcmp($vals[0], "CHILLER_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) {
82 $chiller = "yes";
83 }
84 if (strcmp($vals[0], "CHILLER_STATE") == 0) {
85 $chiller_state = $vals[1];
80 } 86 }
81 if ((strcmp($vals[0], "FAN_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) { 87 if ((strcmp($vals[0], "FAN_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) {
82 $fan = "yes"; 88 $fan = "yes";
83 } 89 }
84 if (strcmp($vals[0], "FAN_STATE") == 0) { 90 if (strcmp($vals[0], "FAN_STATE") == 0) {
163 $outstr .= ' $("#gaugeContainer_air'.$unr.'").jqxGauge(\'value\', data.air_temperature);'.PHP_EOL; 169 $outstr .= ' $("#gaugeContainer_air'.$unr.'").jqxGauge(\'value\', data.air_temperature);'.PHP_EOL;
164 } 170 }
165 if ("$beer_state" == "OK") { 171 if ("$beer_state" == "OK") {
166 $outstr .= ' $("#load_beer_'.$unr.'").html(data.beer_temperature);'.PHP_EOL; 172 $outstr .= ' $("#load_beer_'.$unr.'").html(data.beer_temperature);'.PHP_EOL;
167 $outstr .= ' $("#gaugeContainer_beer'.$unr.'").jqxGauge(\'value\', data.beer_temperature);'.PHP_EOL; 173 $outstr .= ' $("#gaugeContainer_beer'.$unr.'").jqxGauge(\'value\', data.beer_temperature);'.PHP_EOL;
174 }
175 if ("$chiller_state" == "OK") {
176 $outstr .= ' $("#load_chiller_'.$unr.'").html(data.chiller_temperature);'.PHP_EOL;
177 $outstr .= ' $("#gaugeContainer_chiller'.$unr.'").jqxGauge(\'value\', data.chiller_temperature);'.PHP_EOL;
168 } 178 }
169 $outstr .= ' $("#load_target_lo_'.$unr.'").html(data.target_temperature_lo);'.PHP_EOL; 179 $outstr .= ' $("#load_target_lo_'.$unr.'").html(data.target_temperature_lo);'.PHP_EOL;
170 $outstr .= ' $("#load_target_hi_'.$unr.'").html(data.target_temperature_hi);'.PHP_EOL; 180 $outstr .= ' $("#load_target_hi_'.$unr.'").html(data.target_temperature_hi);'.PHP_EOL;
171 $outstr .= ' $("#load_select_'.$unr.'").html(data.mode);'.PHP_EOL; 181 $outstr .= ' $("#load_select_'.$unr.'").html(data.mode);'.PHP_EOL;
172 $outstr .= ' $("#load_led1_'.$unr.'").html(data.led1);'.PHP_EOL; 182 $outstr .= ' $("#load_led1_'.$unr.'").html(data.led1);'.PHP_EOL;
396 $outstr .= ' <input type="submit" id="maintenance" value="Graph" />'.PHP_EOL; 406 $outstr .= ' <input type="submit" id="maintenance" value="Graph" />'.PHP_EOL;
397 $outstr .= ' <input type="hidden" name="action" value="view">'.PHP_EOL; 407 $outstr .= ' <input type="hidden" name="action" value="view">'.PHP_EOL;
398 $outstr .= ' <input type="hidden" name="return" value="index">'.PHP_EOL; 408 $outstr .= ' <input type="hidden" name="return" value="index">'.PHP_EOL;
399 $outstr .= ' <input type="hidden" name="name" value="'.urlencode($name).'">'.PHP_EOL; 409 $outstr .= ' <input type="hidden" name="name" value="'.urlencode($name).'">'.PHP_EOL;
400 $outstr .= ' </form>'.PHP_EOL; 410 $outstr .= ' </form>'.PHP_EOL;
401 // $outstr .= ' <input style="float: left;" id="print_'.$unr.'" type="button" value="Grafiek" />'.PHP_EOL; 411 $outstr .= ' </div>'.PHP_EOL;
402 /* $outstr .= ' <input style="float: left; margin-left: 7px;" id="pngButton_'.$unr.'" type="button" value="as PNG" />'.PHP_EOL;
403 $outstr .= ' <input style="float: left; margin-left: 7px;" id="pdfButton_'.$unr.'" type="button" value="as PDF" />'.PHP_EOL;
404 */ $outstr .= ' </div>'.PHP_EOL;
405 $outstr .= ' </div> <!-- fermentor_panel_buttons -->'.PHP_EOL; 412 $outstr .= ' </div> <!-- fermentor_panel_buttons -->'.PHP_EOL;
406 413
407 $outstr .= ' </div> <!-- fermentor -->'.PHP_EOL; 414 $outstr .= ' </div> <!-- fermentor -->'.PHP_EOL;
408 } 415 }
409 416

mercurial