# HG changeset patch # User Michiel Broek # Date 1500759290 -7200 # Node ID 4d9ed666431df66b7306ddd89a072c086485ff4c # Parent 28d1f5188c1d942f57d1b3645baa9735eb05ce21 Liveview completed the chiller thermometer. diff -r 28d1f5188c1d -r 4d9ed666431d www-thermferm/getstate.php --- a/www-thermferm/getstate.php Sat Jul 22 23:04:44 2017 +0200 +++ b/www-thermferm/getstate.php Sat Jul 22 23:34:50 2017 +0200 @@ -1,6 +1,6 @@ * @@ -35,12 +35,14 @@ $air_state = "NA"; $beer_temperature = "NA"; $beer_state = "NA"; +$chiller_temperature = "NA"; +$chiller_state = "NA"; $target_temperature_lo = "NA"; $target_temperature_hi = "NA"; $led1 = $led2 = $led3 = $sw1 = $sw2 = $sw3 = ""; $fridge_set = "NA"; $beer_set = "NA"; -$heater = $cooler = $fan = $psu = $door = "no"; +$heater = $cooler = $chiller = $fan = $psu = $door = "no"; $prof_state = "OFF"; $mode = "NA"; $cooler_state = "NA"; @@ -63,6 +65,10 @@ $beer_state = $f[1]; if (($f[0] == "BEER_TEMPERATURE") && ($beer_state == "OK")) $beer_temperature = $f[1]; + if ($f[0] == "CHILLER_STATE") + $chiller_state = $f[1]; + if (($f[0] == "CHILLER_TEMPERATURE") && ($chiller_state == "OK")) + $chiller_temperature = $f[1]; if ($f[0] == "MODE") $mode = $f[1]; if (($f[0] == "COOLER_ADDRESS") && (strcmp($f[1], "(null)"))) @@ -144,6 +150,7 @@ $reply = array ( 'air_temperature' => $air_temperature, 'beer_temperature' => $beer_temperature, + 'chiller_temperature' => $chiller_temperature, 'target_temperature_lo' => $target_temperature_lo, 'target_temperature_hi' => $target_temperature_hi, 'mode' => $modestr, diff -r 28d1f5188c1d -r 4d9ed666431d www-thermferm/liveview.php --- 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 = ' ' . 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;