www-thermferm/profiles.php

changeset 274
111b0e9663dc
parent 253
7b6abc0dd1c6
child 378
313efe6bf5b3
--- a/www-thermferm/profiles.php	Sun Aug 31 18:25:32 2014 +0200
+++ b/www-thermferm/profiles.php	Mon Sep 01 15:43:13 2014 +0200
@@ -68,14 +68,14 @@
      * $steps contains all steps of a profile
      */
     $steps = array (
-	1  => array("steptime" => 0, "resttime" => 1, "target" => 20.0 ),
-	2  => array("steptime" => 0, "resttime" => 1, "target" => 20.0 ),
-	3  => array("steptime" => 0, "resttime" => 1, "target" => 20.0 ),
-	4  => array("steptime" => 0, "resttime" => 1, "target" => 20.0 ),
-	5  => array("steptime" => 0, "resttime" => 1, "target" => 20.0 ),
-	6  => array("steptime" => 0, "resttime" => 1, "target" => 20.0 ),
-	7  => array("steptime" => 0, "resttime" => 1, "target" => 20.0 ),
-	8  => array("steptime" => 0, "resttime" => 1, "target" => 20.0 ),
+	1  => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ),
+	2  => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ),
+	3  => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ),
+	4  => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ),
+	5  => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ),
+	6  => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ),
+	7  => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ),
+	8  => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ),
     );
 
     $answer = send_cmd("PROFILE GETS ".$UUID);
@@ -136,10 +136,11 @@
     $outstr .= '    </div> <!-- etable -->'.PHP_EOL;
     $outstr .= '    <div id="atable" style="margin-left: 100px; width:780px;">'.PHP_EOL;
     $outstr .= '    The steptime is the time to go from the previous to the target temperature.'.PHP_EOL;
-    $outstr .= '    The resttime is the total time in this step including the steptime.'.PHP_EOL;
-    $outstr .= '    Steps are valid if the steptime is greater then zero.'.PHP_EOL;
+    $outstr .= '    The resttime is the time in this step holding the target temperature.'.PHP_EOL;
+    $outstr .= '    The duration of the step is steptime + resttime.'.PHP_EOL;
+    $outstr .= '    Steps are valid if the steptime or resttime is greater then zero.'.PHP_EOL;
     $outstr .= '    Order is important.'.PHP_EOL;
-    $outstr .= '    Lines with a steptime of zero are ignored.'.PHP_EOL;
+    $outstr .= '    Lines with a zero steptime and zero resttime are ignored.'.PHP_EOL;
     $outstr .= '    The step- and resttimes are in hours.'.PHP_EOL;
     $outstr .= '    </div> <!-- atable -->'.PHP_EOL;
     $outstr .= build_footer();
@@ -214,7 +215,6 @@
  *
  * Return: 0 = Ok
  *         1 = Missing data
- *         2 = A resttime < steptime
  *         3 = A target temperature out of range
  *        99 = Cancel key
  */
@@ -235,8 +235,6 @@
             return 99;
 
 	for ($i = 1; $i <= 8; $i++) {
-	    if ($_POST['resttime'.$i] < $_POST['steptime'.$i])
-		return 2;
 
 	    if (($_POST['target'.$i] < -5) || ($_POST['target'.$i] > 30))
 		return 3;
@@ -269,7 +267,7 @@
 			 * the PHP side is line oriented, the server is reading blocks.
 			 * So we just send the data slowly and the server just sees lines.
 			 */
-			if ($_POST['steptime'.$i] > 0) {
+			if (($_POST['steptime'.$i] > 0) || ($_POST['resttime'.$i] > 0)) {
 			    usleep(20000);
 			    socket_write($sock, $_POST['steptime'.$i].','.$_POST['resttime'.$i].','.$_POST['target'.$i], 4096);
 			}

mercurial