www-thermferm/liveview.php

changeset 522
4d9ed666431d
parent 521
28d1f5188c1d
child 523
eca3813c21ee
--- a/www-thermferm/liveview.php	Sat Jul 22 23:04:44 2017 +0200
+++ b/www-thermferm/liveview.php	Sat Jul 22 23:34:50 2017 +0200
@@ -31,7 +31,7 @@
     global $my_style;
 
     $outstr = '    <!--  showunit(' . $unit . ', ' . $unr . ', ' . $name . ')  -->' . PHP_EOL;
-    $air_state = $beer_state = 1;
+    $air_state = $beer_state = $chiller_state = 1;
     $answer = send_cmd("UNIT GET ".$unit);
     $arr = explode("\r\n", $answer);
 
@@ -41,11 +41,12 @@
 	$set_temperature_hi = "NA";
 	$air_temperature = "NA";
 	$beer_temperature = "NA";
+	$chiller_temperature = "NA";
 	$profile = "";
 	$prof_state = "OFF";
 	$power_led = $cooler_led = $heater_led = $fan_led = "off";
-	$heater = $cooler = $chiller = $fan = "no";
-	$heater_state = $cooler_state = $chiller_state = $fan_state = 0;
+	$heater = $cooler = $fan = "no";
+	$heater_state = $cooler_state = $fan_state = 0;
 
 	foreach($arr as $l) {
 	    $vals = explode(",", $l);
@@ -66,6 +67,12 @@
 	    if ((strcmp($vals[0], "BEER_TEMPERATURE") == 0) && ($beer_state == 0)) {
 		$beer_temperature = $vals[1];
 	    }
+	    if (strcmp($vals[0], "CHILLER_STATE") == 0) {
+		$chiller_state = $vals[1];
+	    }
+	    if ((strcmp($vals[0], "CHILLER_TEMPERATURE") == 0) && ($chiller_state == 0)) {
+		$chiller_temperature = $vals[1];
+	    }
 	    if ((strcmp($vals[0], "HEATER_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) {
 		$heater = "yes";
 	    }
@@ -78,12 +85,6 @@
 	    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";
 	    }
@@ -155,7 +156,7 @@
 	    $outstr .= '         ticksMinor: { interval: 1, size: \'5%\' },'.PHP_EOL;
 	    $outstr .= '         ticksMajor: { interval: 5, size: \'9%\' },'.PHP_EOL;
 	    $outstr .= '         labels: { interval: 5, position: \'far\' },'.PHP_EOL;
-	    $outstr .= '         value: 0,'.PHP_EOL;
+	    $outstr .= '         value: '.$chiller_temperature.','.PHP_EOL;
 	    $outstr .= '         ticksPosition: \'far\','.PHP_EOL;
 	    $outstr .= '         colorScheme: \'scheme04\','.PHP_EOL;
 	    $outstr .= '         animationDuration: 1200'.PHP_EOL;
@@ -173,7 +174,6 @@
 	    $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;

mercurial