diff -r 13555c27b592 -r 5b6d7b640e52 www-thermferm/liveview.php --- a/www-thermferm/liveview.php Thu Apr 25 14:26:47 2024 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,431 +0,0 @@ - - * - * This file is part of ThermFerm - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * ThermFerm is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with ThermFerm; see the file COPYING. If not, write to the Free - * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - *****************************************************************************/ - - -require_once('utilities.php'); - - - -function showunit($unit, $unr, $alias) -{ - global $my_style; - - $outstr = ' ' . PHP_EOL; - $air_state = $beer_state = $chiller_state = 1; - $answer = send_cmd("UNIT GET ".$unit); - $arr = explode("\r\n", $answer); - - if (startsWith($arr[0], "213")) { - - $set_temperature_lo = "NA"; - $set_temperature_hi = "NA"; - $air_temperature = "NA"; - $beer_temperature = "NA"; - $chiller_temperature = "NA"; - $profile_uuid = $profile_name = ""; - $producr_code = ""; - $product_name = ""; - $prof_state = "OFF"; - $power_led = $alarm_led = $cooler_led = $heater_led = $fan_led = "off"; - $heater = $cooler = $fan = "no"; - $heater_state = $cooler_state = $fan_state = 0; - - foreach($arr as $l) { -// syslog(LOG_NOTICE, $l); - $vals = explode(",", $l); - if (strcmp($vals[0], "MODE") == 0) { - $mode = $vals[1]; - if (strcmp($mode, "OFF")) - $power_led = "on"; - } - if (strcmp($vals[0], "PRODUCT_CODE") == 0) { - $product_code = $vals[1]; - } - if (strcmp($vals[0], "PRODUCT_NAME") == 0) { - $product_name = $vals[1]; - } - if (strcmp($vals[0], "AIR_STATE") == 0) { - $air_state = $vals[1]; - } - if ((strcmp($vals[0], "AIR_TEMPERATURE") == 0) && (strcmp($air_state, "YES") == 0)) { - $air_temperature = $vals[1]; - } - if (strcmp($vals[0], "BEER_STATE") == 0) { - $beer_state = $vals[1]; - } - 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"; - } - if (strcmp($vals[0], "HEATER_STATE") == 0) { - $heater_state = $vals[1]; - } - if ((strcmp($vals[0], "COOLER_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) { - $cooler = "yes"; - } - if (strcmp($vals[0], "COOLER_STATE") == 0) { - $cooler_state = $vals[1]; - } - if ((strcmp($vals[0], "FAN_ADDRESS") == 0) && (strcmp($vals[1], "(null)"))) { - $fan = "yes"; - } - if (strcmp($vals[0], "FAN_STATE") == 0) { - $fan_state = $vals[1]; - } - if (strcmp($vals[0], "PROFILE_UUID") == 0) { - $profile_uuid = $vals[1]; - } - if (strcmp($vals[0], "PROFILE_NAME") == 0) { - $profile_name = $vals[1]; - } - if (strcmp($vals[0], "PROF_STATE") == 0) { - $prof_state = $vals[1]; - } - if (($vals[0] == "BEER_SET_LO") && ($mode == "BEER")) { - $set_temperature_lo = $vals[1]; - } - if (($vals[0] == "BEER_SET_HI") && ($mode == "BEER")) { - $set_temperature_hi = $vals[1]; - } - if (($vals[0] == "FRIDGE_SET_LO") && ($mode == "FRIDGE")) { - $set_temperature_lo = $vals[1]; - } - if (($vals[0] == "FRIDGE_SET_HI") && ($mode == "FRIDGE")) { - $set_temperature_hi = $vals[1]; - } - if (($vals[0] == "PROF_TARGET_LO") && ($mode == "PROFILE")) { - $set_temperature_lo = $vals[1]; - } - if (($vals[0] == "PROF_TARGET_HI") && ($mode == "PROFILE")) { - $set_temperature_hi = $vals[1]; - } - } - - $logname = $product_code . " " . $product_name; - $outstr .= ' '.PHP_EOL; - - $outstr .= '