www-thermferm/liveview.php

changeset 284
9e6fb5aed618
parent 271
e3f56dc46bcd
child 294
e07b08283d96
--- a/www-thermferm/liveview.php	Tue Sep 02 16:54:18 2014 +0200
+++ b/www-thermferm/liveview.php	Wed Sep 03 15:02:09 2014 +0200
@@ -194,6 +194,8 @@
 	$outstr .= '           $("#load_sw1_'.$unr.'").html(data.sw1);'.PHP_EOL;
 	$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 .= '         });'.PHP_EOL;
 	$outstr .= '       }, 10000);'.PHP_EOL;
 	$outstr .= '     });'.PHP_EOL;
@@ -268,7 +270,7 @@
 		}
 	    }
 	    $outstr .= '       <div style="color: blue; width: 148px; height: 23px; overflow: hidden;">Profile: '.$prof_name.'</div>'.PHP_EOL;
-	    $outstr .= '       <div style="color: blue; width: 148px; height: 23px; overflow: hidden;">State: '.$prof_state.'</div>'.PHP_EOL;
+	    $outstr .= '       <div id="prof_state_'.$unr.'" style="color: blue; width: 148px; height: 23px; overflow: hidden;">State: '.$prof_state.'</div>'.PHP_EOL;
 
 	    $outstr .= '       <form id="set_profile_'.$unr.'" action="index.php" method="post">'.PHP_EOL;
 	    if ($prof_state == "OFF") {
@@ -292,7 +294,7 @@
 		if ($profile != "(null)")
 		    $outstr .= '        <input type="submit" value="Start" name="key">'.PHP_EOL;
 
-	    } else if ($prof_state == "RUN") {
+	    } else if (startsWith($prof_state, "RUN")) {
 		$outstr .= '        <input type="hidden" value="'.$profile.'" name="SetProfile">'.PHP_EOL;
 		$outstr .= '        <input type="submit" value="Pause" name="key">'.PHP_EOL;
 		$outstr .= '        <input type="submit" value="Abort" name="key">'.PHP_EOL;
@@ -304,7 +306,6 @@
 		$outstr .= '        <input type="hidden" value="'.$profile.'" name="SetProfile">'.PHP_EOL;
 		$outstr .= '        <input type="submit" value="Off" name="key">'.PHP_EOL;
 	    }
-	    //$outstr .= '        <input type="text" name="Beer" size="5" value="'.$set_temperature.'">'.PHP_EOL;
 	    $outstr .= '        <input type="hidden" value="'.$unit.'" name="UUID">'.PHP_EOL;
 	    $outstr .= '       </form>'.PHP_EOL;
 	}

mercurial