# HG changeset patch # User Michiel Broek # Date 1501241291 -7200 # Node ID 00b45f2aaac3c6a38ec8b80e206221dd4170a254 # Parent 908ef02d5d2209b2d5fbec62d985d0ca7143747f Added alarm LED diff -r 908ef02d5d22 -r 00b45f2aaac3 thermferm/server.c --- a/thermferm/server.c Tue Jul 25 21:08:26 2017 +0200 +++ b/thermferm/server.c Fri Jul 28 13:28:11 2017 +0200 @@ -2172,6 +2172,7 @@ srv_send((char *)"PROF_PRIMARY_DONE,%d", (int)unit->prof_primary_done); srv_send((char *)"TEMP_SET_MIN,%.1f", unit->temp_set_min); srv_send((char *)"TEMP_SET_MAX,%.1f", unit->temp_set_max); + srv_send((char *)"ALARM,%d", unit->alarm_flag); srv_send((char *)"."); return 0; } diff -r 908ef02d5d22 -r 00b45f2aaac3 www-thermferm/css/style.css --- a/www-thermferm/css/style.css Tue Jul 25 21:08:26 2017 +0200 +++ b/www-thermferm/css/style.css Fri Jul 28 13:28:11 2017 +0200 @@ -231,13 +231,22 @@ border-radius: 5px 5px 5px 5px; } +#fermentor_alarmled { + width: 38px; + height: 30px; + float: left; + text-align: center; + margin-top: 10px; + margin-left: 10px; +} + #fermentor_powerled { width: 38px; height: 30px; float: left; text-align: center; margin-top: 10px; - margin-left: 90px; + margin-left: 42px; } #fermentor_mode_control { diff -r 908ef02d5d22 -r 00b45f2aaac3 www-thermferm/getstate.php --- a/www-thermferm/getstate.php Tue Jul 25 21:08:26 2017 +0200 +++ b/www-thermferm/getstate.php Fri Jul 28 13:28:11 2017 +0200 @@ -26,7 +26,7 @@ if (isset($_GET["uuid"])) $uuid = $_GET["uuid"]; else - $uuid = "48c9ae27-3f58-41c9-ae4b-1d57b249c45a"; + $uuid = "e53858c3-a97e-4b07-85e9-524257909f45"; $answer = send_cmd('UNIT GET '.$uuid); $arr = explode("\r\n", $answer); @@ -39,7 +39,7 @@ $chiller_state = "NA"; $target_temperature_lo = "NA"; $target_temperature_hi = "NA"; -$led1 = $led2 = $led3 = $sw1 = $sw2 = $sw3 = ""; +$led1 = $led2 = $led3 = $sw1 = $sw2 = $sw3 = $alarmled = ""; $fridge_set = "NA"; $beer_set = "NA"; $heater = $cooler = $chiller = $fan = $psu = $door = "no"; @@ -49,12 +49,11 @@ $heater_state = "NA"; $fan_state = "NA"; - if (startsWith($arr[0], "213")) { $j = 1; while (1) { if (strcmp($arr[$j], ".") == 0) - break; + break; $f = explode(",", $arr[$j]); if ($f[0] == "AIR_STATE") @@ -103,6 +102,8 @@ $target_temperature_hi = $f[1]; if (($f[0] == "PROF_STATE") && ($mode == "PROFILE")) $prof_state = 'State: '.$f[1]; + if ($f[0] == "ALARM") + $alarmled = $f[1] ? '
' : '
'; $j++; } } @@ -160,7 +161,8 @@ 'sw1' => $sw1, 'sw2' => $sw2, 'sw3' => $sw3, - 'profile_state' => $prof_state + 'profile_state' => $prof_state, + 'alarm' => $alarmled ); diff -r 908ef02d5d22 -r 00b45f2aaac3 www-thermferm/liveview.php --- a/www-thermferm/liveview.php Tue Jul 25 21:08:26 2017 +0200 +++ b/www-thermferm/liveview.php Fri Jul 28 13:28:11 2017 +0200 @@ -44,7 +44,7 @@ $chiller_temperature = "NA"; $profile = ""; $prof_state = "OFF"; - $power_led = $cooler_led = $heater_led = $fan_led = "off"; + $power_led = $alarm_led = $cooler_led = $heater_led = $fan_led = "off"; $heater = $cooler = $fan = "no"; $heater_state = $cooler_state = $fan_state = 0; @@ -186,7 +186,8 @@ $outstr .= ' $("#load_sw2_'.$unr.'").html(data.sw2);'.PHP_EOL; $outstr .= ' $("#load_sw3_'.$unr.'").html(data.sw3);'.PHP_EOL; if ($mode == "PROFILE") - $outstr .= ' $("#prof_state_'.$unr.'").html(data.profile_state);'.PHP_EOL; + $outstr .= ' $("#prof_state_'.$unr.'").html(data.profile_state);'.PHP_EOL; + $outstr .= ' $("#load_alarm_'.$unr.'").html(data.alarm);'.PHP_EOL; $outstr .= ' });'.PHP_EOL; $outstr .= ' }, 10000);'.PHP_EOL; @@ -242,6 +243,9 @@ $outstr .= ' '.PHP_EOL; $outstr .= ' '.PHP_EOL; + $outstr .= '
'.PHP_EOL; + $outstr .= '
Alm'.PHP_EOL; + $outstr .= '
'.PHP_EOL; $outstr .= '
'.PHP_EOL; $outstr .= '
Pwr'.PHP_EOL; $outstr .= '
'.PHP_EOL;