# HG changeset patch # User Michiel Broek # Date 1406896964 -7200 # Node ID 1288dbf0f9b576f2a3c6dba7e38c2ecc8a6912e8 # Parent 56b008563db8a103deaecbf2e5235094e5d2e5c9 Temperature auto refresh and some layout improvements. diff -r 56b008563db8 -r 1288dbf0f9b5 www-thermferm/css/style.css --- a/www-thermferm/css/style.css Fri Aug 01 11:45:35 2014 +0200 +++ b/www-thermferm/css/style.css Fri Aug 01 14:42:44 2014 +0200 @@ -168,7 +168,7 @@ #fermentor_panel_top { width: 236px; - height: 143px; + height: 156px; float: right; background-color: #bbb; border: 2px solid; @@ -183,6 +183,11 @@ float: left; } +input.select { + margin-left: 10px; + margin-top: 10px; +} + #fermentor_powerled { width: 78px; height: 56px; diff -r 56b008563db8 -r 1288dbf0f9b5 www-thermferm/getdata.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www-thermferm/getdata.php Fri Aug 01 14:42:44 2014 +0200 @@ -0,0 +1,50 @@ + + * + * 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'); + +$what = $_GET['what']; +$uuid = $_GET["uuid"]; + +$sock = open_socket(); +if ($sock == false) { + echo ""; + return; +} + +socket_write($sock, 'GET '.$what.' '.$uuid, 4096); +$answer = ""; +while (1) { + $line = socket_read($sock, 4096); + if ($line === '') + break; + $answer .= $line; +} +socket_close($sock); + +$arr = explode(",", $answer); + + +echo $arr[1]; + +?> diff -r 56b008563db8 -r 1288dbf0f9b5 www-thermferm/index.php --- a/www-thermferm/index.php Fri Aug 01 11:45:35 2014 +0200 +++ b/www-thermferm/index.php Fri Aug 01 14:42:44 2014 +0200 @@ -37,6 +37,8 @@ if (isset($_POST['mode']) && isset($_POST['UUID'])) { send_cmd('UNIT '.$_POST['UUID']); send_cmd('MODE '.$_POST['mode']); + unset($_POST['UUID']); + unset($_POST['mode']); } diff -r 56b008563db8 -r 1288dbf0f9b5 www-thermferm/liveview.php --- a/www-thermferm/liveview.php Fri Aug 01 11:45:35 2014 +0200 +++ b/www-thermferm/liveview.php Fri Aug 01 14:42:44 2014 +0200 @@ -160,6 +160,18 @@ $outstr .= ' }]'.PHP_EOL; $outstr .= ' };'.PHP_EOL; $outstr .= ' $("#fermentor_chart_'.$unit.'").jqxChart(settings'.$unr.');'.PHP_EOL; + $outstr .= ' var target_refresh_'.$unr.' = setInterval('.PHP_EOL; + $outstr .= ' function () {'.PHP_EOL; + $outstr .= ' $("#load_target_'.$unr.'").load("getdata.php?uuid='.$unit.'&what=TARGET").fadeIn("slow");'.PHP_EOL; + $outstr .= ' }, 65000);'.PHP_EOL; + $outstr .= ' var air_refresh_'.$unr.' = setInterval('.PHP_EOL; + $outstr .= ' function () {'.PHP_EOL; + $outstr .= ' $("#load_air_'.$unr.'").load("getdata.php?uuid='.$unit.'&what=AIR").fadeIn("slow");'.PHP_EOL; + $outstr .= ' }, 10001);'.PHP_EOL; + $outstr .= ' var beer_refresh_'.$unr.' = setInterval('.PHP_EOL; + $outstr .= ' function () {'.PHP_EOL; + $outstr .= ' $("#load_beer_'.$unr.'").load("getdata.php?uuid='.$unit.'&what=BEER").fadeIn("slow");'.PHP_EOL; + $outstr .= ' }, 10100);'.PHP_EOL; $outstr .= ' });'.PHP_EOL; $outstr .= ' '.PHP_EOL; $outstr .= '
'.PHP_EOL; @@ -169,16 +181,16 @@ $outstr .= '
'.PHP_EOL; $outstr .= '
'.PHP_EOL; strcmp($mode, "OFF") ? $se = "" : $se = " checked"; - $outstr .= ' Off
'.PHP_EOL; + $outstr .= ' Off
'.PHP_EOL; strcmp($mode, "NONE") ? $se = "" : $se = " checked"; - $outstr .= ' None
'.PHP_EOL; + $outstr .= ' None
'.PHP_EOL; (strcmp($heater, "no") || strcmp($cooler, "no")) ? $dis = "" : $dis = " disabled"; strcmp($mode, "FRIDGE") ? $se = "" : $se = " checked"; - $outstr .= ' Fridge
'.PHP_EOL; + $outstr .= ' Fridge
'.PHP_EOL; strcmp($mode, "BEER") ? $se = "" : $se = " checked"; - $outstr .= ' Beer
'.PHP_EOL; + $outstr .= ' Beer
'.PHP_EOL; strcmp($mode, "PROFILE") ? $se = "" : $se = " checked"; - $outstr .= ' Profile'.PHP_EOL; + $outstr .= ' Profile'.PHP_EOL; $outstr .= ' '.PHP_EOL; $outstr .= '
'.PHP_EOL; $outstr .= '
'.PHP_EOL; @@ -189,13 +201,13 @@ $outstr .= '
'.PHP_EOL; $outstr .= '
'.PHP_EOL; - $outstr .= ' '.$set_temperature.'
Set'.PHP_EOL; + $outstr .= '
'.$set_temperature.'
Set'.PHP_EOL; $outstr .= '
'.PHP_EOL; $outstr .= '
'.PHP_EOL; - $outstr .= ' '.$air_temperature.'
Air'.PHP_EOL; + $outstr .= '
'.$air_temperature.'
Air'.PHP_EOL; $outstr .= '
'.PHP_EOL; $outstr .= '
'.PHP_EOL; - $outstr .= ' '.$beer_temperature.'
Beer'.PHP_EOL; + $outstr .= '
'.$beer_temperature.'
Beer'.PHP_EOL; $outstr .= '
'.PHP_EOL; $outstr .= '
'.PHP_EOL;