Design live view page

Sat, 22 Jul 2017 23:04:44 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 22 Jul 2017 23:04:44 +0200
changeset 521
28d1f5188c1d
parent 520
32bf084df5af
child 522
4d9ed666431d

Design live view page

www-thermferm/liveview.php file | annotate | diff | comparison | revisions
--- a/www-thermferm/liveview.php	Thu Jul 06 22:31:01 2017 +0200
+++ b/www-thermferm/liveview.php	Sat Jul 22 23:04:44 2017 +0200
@@ -44,8 +44,8 @@
 	$profile = "";
 	$prof_state = "OFF";
 	$power_led = $cooler_led = $heater_led = $fan_led = "off";
-	$heater = $cooler = $fan = "no";
-	$heater_state = $cooler_state = $fan_state = 0;
+	$heater = $cooler = $chiller = $fan = "no";
+	$heater_state = $cooler_state = $chiller_state = $fan_state = 0;
 
 	foreach($arr as $l) {
 	    $vals = explode(",", $l);
@@ -78,6 +78,12 @@
 	    if (strcmp($vals[0], "COOLER_STATE") == 0) {
 		$cooler_state = $vals[1];
 	    }
+	    if ((strcmp($vals[0], "CHILLER_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) {
+		$chiller = "yes";
+	    }
+	    if (strcmp($vals[0], "CHILLER_STATE") == 0) {
+		$chiller_state = $vals[1];
+	    }
 	    if ((strcmp($vals[0], "FAN_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) {
 		$fan = "yes";
 	    }
@@ -166,6 +172,10 @@
 	    $outstr .= '           $("#load_beer_'.$unr.'").html(data.beer_temperature);'.PHP_EOL;
 	    $outstr .= '           $("#gaugeContainer_beer'.$unr.'").jqxGauge(\'value\', data.beer_temperature);'.PHP_EOL;
 	}
+	if ("$chiller_state" == "OK") {
+	    $outstr .= '           $("#load_chiller_'.$unr.'").html(data.chiller_temperature);'.PHP_EOL;
+	    $outstr .= '           $("#gaugeContainer_chiller'.$unr.'").jqxGauge(\'value\', data.chiller_temperature);'.PHP_EOL;
+	}
 	$outstr .= '           $("#load_target_lo_'.$unr.'").html(data.target_temperature_lo);'.PHP_EOL;
 	$outstr .= '           $("#load_target_hi_'.$unr.'").html(data.target_temperature_hi);'.PHP_EOL;
 	$outstr .= '           $("#load_select_'.$unr.'").html(data.mode);'.PHP_EOL;
@@ -398,10 +408,7 @@
 	$outstr .= '       <input type="hidden" name="return" value="index">'.PHP_EOL;
 	$outstr .= '       <input type="hidden" name="name" value="'.urlencode($name).'">'.PHP_EOL;
 	$outstr .= '      </form>'.PHP_EOL;
-//	$outstr .= '      <input style="float: left;" id="print_'.$unr.'" type="button" value="Grafiek" />'.PHP_EOL;
-/*	$outstr .= '      <input style="float: left; margin-left: 7px;" id="pngButton_'.$unr.'" type="button" value="as PNG" />'.PHP_EOL;
-	$outstr .= '      <input style="float: left; margin-left: 7px;" id="pdfButton_'.$unr.'" type="button" value="as PDF" />'.PHP_EOL;
- */	$outstr .= '     </div>'.PHP_EOL;
+ 	$outstr .= '     </div>'.PHP_EOL;
 	$outstr .= '     </div> <!-- fermentor_panel_buttons -->'.PHP_EOL;
 
 	$outstr .= '    </div> <!-- fermentor -->'.PHP_EOL;

mercurial