Implemented PROFILE PUTS command

Sun, 27 Jul 2014 17:06:08 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 27 Jul 2014 17:06:08 +0200
changeset 140
1b001de37945
parent 139
ffcabb9166bf
child 141
f19a52a25ff5

Implemented PROFILE PUTS command

thermferm/server.c file | annotate | diff | comparison | revisions
www-thermferm/css/style.css file | annotate | diff | comparison | revisions
www-thermferm/devices.php file | annotate | diff | comparison | revisions
www-thermferm/profiles.php file | annotate | diff | comparison | revisions
www-thermferm/units.php file | annotate | diff | comparison | revisions
--- a/thermferm/server.c	Sat Jul 26 22:26:30 2014 +0200
+++ b/thermferm/server.c	Sun Jul 27 17:06:08 2014 +0200
@@ -499,15 +499,22 @@
 /*
  * PROFILE		List profile status of current unit
  * PROFILE uuid,name	Rename profile name
+ * PROFILE GETS uuid	Get profile steps list
+ * PROFILE PUTS uuid	Put profile steps list
  */
 int cmd_profile(char *buf)
 {
+    char                ibuf[SS_BUFSIZE], *sstep, *rest, *targ;
+    int                 i, rlen, istep, irest;
+    float		ftarg;
+    socklen_t           fromlen;
     char		*opt, *uuid, *param;
     profiles_list	*profile;
+    prof_step		*step, *olds;
     units_list		*unit;
 
     opt = strtok(buf, " \0");
-    opt = strtok(NULL, "\0");
+    opt = strtok(NULL, " \0");
 
     if (opt == NULL) {
 	/*
@@ -536,6 +543,117 @@
 	srv_send((char *)".");
 	return 1;
 
+    } else if (strcmp(opt, (char *)"GETS") == 0) {
+
+	uuid = strtok(NULL, "\0\n\r");
+	if (uuid == NULL) {
+	    srv_send((char *)"502 Unknown command option");
+	    return 1;
+	}
+
+	for (profile = Config.profiles; profile; profile = profile->next) {
+	    if (strcmp(profile->uuid, uuid) == 0) {
+		srv_send((char *)"215 Profile steps follow:");
+		for (step = profile->steps; step; step = step->next) {
+		    srv_send((char *)"%d,%d,%.1f", step->steptime, step->resttime, step->target);
+		}
+		srv_send((char *)".");
+		return 1;
+	    }
+	}
+
+	srv_send((char *)"440 No such profile");
+	return 1;
+
+    } else if (strcmp(opt, (char *)"PUTS") == 0) {
+
+        uuid = strtok(NULL, "\0\n\r");
+	if (uuid == NULL) {
+	    srv_send((char *)"502 Unknown command option");
+	    return 1;
+	}
+ 
+	for (profile = Config.profiles; profile; profile = profile->next) {
+	    if (strcmp(profile->uuid, uuid) == 0) {
+
+		    fprintf(stdout, "profile found\n");
+		if (profile->steps) {
+		    for (step = profile->steps; step; step = olds) {
+			olds = step->next;
+			free(step);
+		    }
+		    profile->steps = NULL;		    
+		}
+		fprintf(stdout, "profile cleared\n");
+
+            	while (1) {	
+	    	    memset((char *)&ibuf, 0, SS_BUFSIZE);
+            	    fromlen = sizeof(peeraddr_in);
+	    	    rlen = recvfrom(s, ibuf, sizeof(ibuf) -1, 0, (struct sockaddr *)&peeraddr_in, &fromlen);
+	    	    if (rlen == -1) {
+	    	    	syslog(LOG_NOTICE, "recvfrom(): %s", strerror(errno));
+		    	srv_send((char *)"518 recfrom(): %s", strerror(errno));
+		    	return 1;
+	    	    } else {
+	    	    	for (i = 0; i < strlen(ibuf); i++) {
+		            if (ibuf[i] == '\n')
+		    	    	ibuf[i] = '\0';
+		    	    if (ibuf[i] == '\r')
+		    	    	ibuf[i] = '\0';
+	                }
+	                for (i = strlen(ibuf) -1; i > 0; i--) {
+		    	    if (ibuf[i] == ' ')
+		    	    	ibuf[i] = '\0';
+		    	    else
+		     	    	break;
+	    	    	}
+	    	    	if (strlen(ibuf)) {
+		    	    if (debug) {
+		    	    	syslog(LOG_NOTICE, "recv: \"%s\"", ibuf);
+		    	    	fprintf(stdout, "recv: \"%s\"\n", ibuf);
+		    	    }
+		    	    if (strcmp(ibuf, (char *)".") == 0) {
+
+		    	    	srv_send((char *)"219 Accepted profile steps");
+		    	    	return 0;
+		    	    }
+			    sstep = strtok(ibuf, ",\0");
+			    rest = strtok(NULL, ",\0");
+			    targ = strtok(NULL, "\0");
+
+			    if ((sscanf(sstep, "%d", &istep) == 1) &&
+				(sscanf(rest, "%d", &irest) == 1) &&
+				(sscanf(targ, "%f", &ftarg) == 1)) {
+
+				step = (prof_step *)malloc(sizeof(prof_step));
+				step->next = NULL;
+				step->version = 1;
+				step->steptime = istep;
+				step->resttime = irest;
+				step->target = ftarg;
+
+				if (profile->steps == NULL) {
+				    profile->steps = step;
+				} else {
+				    for (olds = profile->steps; olds; olds = olds->next) {
+					if (olds->next == NULL) {
+					    olds->next = step;
+					    break;
+					}
+				    }
+				}
+			    }
+
+			    fprintf(stdout, "this was data\n");
+		    	}
+	    	    }
+		}
+	    }
+	}
+
+	srv_send((char *)"440 No such profile");
+	return 1;
+
     } else {
 	/*
 	 * uuid,name rename profile
@@ -827,6 +945,8 @@
 		srv_send((char *)"MODE OFF|NONE|BEER|FRIDGE|PROFILE");
 //		srv_send((char *)"PROFILE                       Profile status of current unit");
 		srv_send((char *)"PROFILE uuid,name             Profile rename");
+		srv_send((char *)"PROFILE GETS uuid             Profile get steps list");
+		srv_send((char *)"PROFILE PUTS uuid             Profile put steps list");
 		srv_send((char *)"SET BEER val                  Set beer temperature");
 		srv_send((char *)"SET FRIDGE val                Set fridge temperature");
 		srv_send((char *)"SET IDLE_LOW val              Set idle temperature low (-5.0 .. -0.1)");
--- a/www-thermferm/css/style.css	Sat Jul 26 22:26:30 2014 +0200
+++ b/www-thermferm/css/style.css	Sun Jul 27 17:06:08 2014 +0200
@@ -83,6 +83,11 @@
     border-collapse: collapse;
 }
 
+.trhead {
+    font-weight: bold;
+    background: #5c9ccc url(../jqwidgets/styles/images/redmond/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x;
+}
+
 tr.setup:nth-child(odd) {
     background: #FFFFFF;
 }
@@ -115,10 +120,14 @@
 }
 
 td.editfield {
-    width: 550px;
+    width: 500px;
     padding: 1px 3px 1px 3px;
 }
 
+td.editsub {
+    width: 50px;
+    padding: 1px 3px 1px 3px;
+}
 
 #jqxTabs {
     width: 980px;
--- a/www-thermferm/devices.php	Sat Jul 26 22:26:30 2014 +0200
+++ b/www-thermferm/devices.php	Sun Jul 27 17:06:08 2014 +0200
@@ -64,7 +64,7 @@
 $outstr .= '    <div id="etable">'.PHP_EOL;
 
 $outstr .= '     <table class="setup">'.PHP_EOL;
-$outstr .= '      <tr style="background-color: #FFCC01;"><td class="setup">Address</td><td class="setup">Refcnt</td><td class="setup">Chip</td><td class="setup">Description</td></tr>'.PHP_EOL;
+$outstr .= '      <tr class="trhead"><td class="setup">Address</td><td class="setup">Refcnt</td><td class="setup">Chip</td><td class="setup">Description</td></tr>'.PHP_EOL;
 
 if (startsWith($arr[0], "212")) {
     $j = 1;
--- a/www-thermferm/profiles.php	Sat Jul 26 22:26:30 2014 +0200
+++ b/www-thermferm/profiles.php	Sun Jul 27 17:06:08 2014 +0200
@@ -46,16 +46,21 @@
 $arr = explode("\r\n", $answer);
 
 
+
 if (isset($_GET['action'])) {
     switch ($_GET['action']) {
 	case 'edit':		profile_edit();
-	    			break;
+				break;
+	case 'esteps':		profile_steps();
+				break;
 	default:		break;
     }
 } elseif (isset($_POST['action'])) {
     switch ($_POST['action']) {
 	case 'testdata':	testdata();
-	    			break;
+				break;
+	case 'teststeps':	teststeps();
+				break;
 	default:		break;
     }
 } else {
@@ -66,6 +71,111 @@
 
 
 
+/*
+ * Profile steps
+ */
+function profile_steps()
+{
+    global $arr;
+    $UUID = $_GET['UUID'];
+    
+    /*
+     * $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 ),
+    );
+
+    $sock = open_socket();
+    if ($sock == false) {
+	load('profiles.php');
+    }
+
+    socket_write($sock, "PROFILES GETS ".$UUID, 4096);
+    $answer = "";
+    while (1) {
+	$line = socket_read($sock, 4096);
+	if ($line === '')
+	    break;
+	$answer .= $line;
+    }
+    socket_close($sock);
+    $psteps = explode("\r\n", $answer);
+
+    if (startsWith($arr[0], "212")) {
+	$j = 1;
+	while (1) {
+	    if (strcmp($psteps[$j], ".") == 0)
+		break;
+	    $f = explode(",", $psteps[$j]);
+	    $steps[$j]["steptime"] = $f[0];
+	    $steps[$j]["resttime"] = $f[1];
+	    $steps[$j]["target"] = $f[2];
+	    $j++;
+	}
+    }
+
+    edit_steps($UUID, $steps, "", "ThermFerm - Edit Profile Steps");
+}
+
+
+function edit_steps($UUID, $steps, $error_message, $heading)
+{
+    $outstr  = build_header($heading);
+    $outstr .= '    <div id="errors">'.PHP_EOL;
+    $outstr .= '     '.$error_message.PHP_EOL;
+    $outstr .= '    </div> <!-- errors -->'.PHP_EOL;
+    $outstr .= '    <div id="etable">'.PHP_EOL;
+    $outstr .= '     <form method="POST" action="profiles.php">'.PHP_EOL;
+    $outstr .= '      <table class="editor">'.PHP_EOL;
+    $outstr .= '       <tr class="trhead">'.PHP_EOL;
+    $outstr .= '        <td>Step</td>'.PHP_EOL;
+    $outstr .= '        <td>Steptime</td>'.PHP_EOL;
+    $outstr .= '        <td>Resttime</td>'.PHP_EOL;
+    $outstr .= '        <td>Temperature</td>'.PHP_EOL;
+    $outstr .= '       </tr>'.PHP_EOL;
+
+    for ($i = 1; $i <= 8; $i++) {
+    	$outstr .= '       <tr class="editor">'.PHP_EOL;
+    	$outstr .= '        <td>Step '.$i.'</td>'.PHP_EOL;
+    	$outstr .= '        <td><input type="text" name="steptime'.$i.'" size="4" value="'.$steps[$i]["steptime"].'"></td>'.PHP_EOL;
+    	$outstr .= '        <td><input type="text" name="resttime'.$i.'" size="4" value="'.$steps[$i]["resttime"].'"></td>'.PHP_EOL;
+    	$outstr .= '        <td><input type="text" name="target'.$i.'" size="4" value="'.$steps[$i]["target"].'"></td>'.PHP_EOL;
+    	$outstr .= '       </tr>'.PHP_EOL;
+    }
+
+    $outstr .= '       <tr class="editor">'.PHP_EOL;
+    $outstr .= '        <td class="editname">&nbsp;</td>'.PHP_EOL;
+    $outstr .= '        <td class="editname"><input type="submit" value="Save" name="key"></td>'.PHP_EOL;
+    $outstr .= '        <td class="editname"><input type="submit" value="Cancel" name="key">';
+    $outstr .= '<input type="hidden" value="teststeps" name="action">';
+    $outstr .= '<input type="hidden" value="'.$UUID.'" name="UUID"></td>'.PHP_EOL;
+    $outstr .= '        <td class="editname">&nbsp;</td>'.PHP_EOL;
+    $outstr .= '       </tr>'.PHP_EOL;
+    $outstr .= '      </table>'.PHP_EOL;
+    $outstr .= '     </form>'.PHP_EOL;
+    $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 .= '    Order is important.'.PHP_EOL;
+    $outstr .= '    Lines with a steptime of zero are ignored.'.PHP_EOL;
+    $outstr .= '    The step- and resttimes are in hours.'.PHP_EOL;
+    $outstr .= '    </div> <!-- atable -->'.PHP_EOL;
+    $outstr .= build_footer();
+    echo $outstr;
+}
+
+
+
 
 /*
  * Profile add
@@ -74,24 +184,27 @@
  */
 function profile_add() {
 
-    $cmd = "ADD PROFILE ".$_POST['Name'];
+    if ($_POST['key'] == 'Add') {
+	    
+	$cmd = "ADD PROFILE ".$_POST['Name'];
 
-    $sock = open_socket();
-    if ($sock != false) {
-	/*
-	 * Send command and absorb the result.
-	 */
-	socket_write($sock, $cmd, 4096);
-	while (1) {
-	    $line = socket_read($sock, 4096);
-	    if ($line === '')
-		break;
-	}
-	socket_close($sock);
+    	$sock = open_socket();
+    	if ($sock != false) {
+	    /*
+	     * Send command and absorb the result.
+	     */
+	    socket_write($sock, $cmd, 4096);
+	    while (1) {
+	    	$line = socket_read($sock, 4096);
+	    	if ($line === '')
+		    break;
+	    }
+	    socket_close($sock);
+    	}
     }
-
     unset($_POST['UUID']);
     unset($_POST['Name']);
+    unset($_POST['Steps']);
     unset($_POST['key']);
     unset($_POST['command']);
     load('profiles.php');
@@ -131,6 +244,7 @@
 
     unset($_POST['UUID']);
     unset($_POST['Name']);
+    unset($_POST['Steps']);
     unset($_POST['key']);
     unset($_POST['command']);
     load('profiles.php');
@@ -142,7 +256,117 @@
  * Test input of a modified or new profile.
  *
  * @param string $_POST['UUID'] Unique record UUID
+ * @param int $_POST['steptime'n] Profile steptime
+ * @param int $_POST['resttime'n] Profile resttime
+ * @param float $_POST['target'n] Profile target temperature
+ * @param string $_POST['key'] Key choice, Save or Cancel
+ *
+ * Return: 0 = Ok
+ *         1 = Missing data
+ *         2 = A resttime < steptime
+ *         3 = A target temperature out of range
+ *        99 = Cancel key
+ */
+function test_thesteps() {
+
+    global $arr;
+
+    print_r($_POST);
+
+    for ($i = 1; $i <= 8; $i++) {
+	if ((! isset($_POST['steptime'.$i])) || (! isset($_POST['resttime'.$i])) || (! isset($_POST['target'.$i])))
+		return 1;
+	if ((strlen($_POST['steptime'.$i]) == 0) || (strlen($_POST['resttime'.$i]) == 0) || (strlen($_POST['target'.$i]) == 0))
+		return 1;
+    }
+
+    if (isset($_POST['UUID']) && isset($_POST['key'])) {
+
+        if ($_POST['key'] == 'Cancel')
+            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;
+	}
+    } else {
+        return 1;
+    }
+
+    return 0;
+}
+
+
+
+/*
+ * Test result from edit_steps screen and do next action
+ */
+function teststeps() {
+
+    $result = test_thesteps();
+    $error = '';
+
+    switch ($result) {
+    	case 0: $sock = open_socket();
+		if ($sock != false) {
+		    socket_write($sock, 'PROFILE PUTS '.$_POST['UUID'], 4096);
+		    for ($i = 1; $i <= 8; $i++) {
+			if ($_POST['steptime'.$i] > 0)
+			    socket_write($sock, $_POST['steptime'.$i].','.$_POST['resttime'.$i].','.$_POST['target'.$i], 4096);
+			unset($_POST['steptime'.$i]);
+			unset($_POST['resttime'.$i]);
+			unset($_POST['target'.$i]);
+		    }
+		    socket_write($sock, '.', 4096);
+		    /* Absorb response */
+		    while (1) {
+			$line = socket_read($sock, 4096);
+			if ($line === '')
+			    break;
+		    }
+		    socket_close($sock);
+		    unset($_POST['UUID']);
+		    unset($_POST['key']);
+		    load('profiles.php');
+		    return;
+    		}
+		break;
+        case 1: $error = 'Missing data';
+		break;
+	case 2: $error = 'A resttime is shorter then the steptime';
+		break;
+	case 3:	$error = 'A target temperature is out of range';
+		break;
+        case 99:
+                load('profiles.php');
+                break;
+    }
+
+    $steps = array (
+	1  => array("steptime" => $_POST['steptime1'], "resttime" => $_POST['resttime1'], "target" => $_POST['target1'] ),
+	2  => array("steptime" => $_POST['steptime2'], "resttime" => $_POST['resttime2'], "target" => $_POST['target2'] ),
+	3  => array("steptime" => $_POST['steptime3'], "resttime" => $_POST['resttime3'], "target" => $_POST['target3'] ),
+	4  => array("steptime" => $_POST['steptime4'], "resttime" => $_POST['resttime4'], "target" => $_POST['target4'] ),
+	5  => array("steptime" => $_POST['steptime5'], "resttime" => $_POST['resttime5'], "target" => $_POST['target5'] ),
+	6  => array("steptime" => $_POST['steptime6'], "resttime" => $_POST['resttime6'], "target" => $_POST['target6'] ),
+	7  => array("steptime" => $_POST['steptime7'], "resttime" => $_POST['resttime7'], "target" => $_POST['target7'] ),
+	8  => array("steptime" => $_POST['steptime8'], "resttime" => $_POST['resttime8'], "target" => $_POST['target8'] ),
+    );
+    
+    edit_steps($_POST['UUID'], $steps, $error, "ThermFerm - Edit Profile Steps");
+}
+
+
+
+/*
+ * Test input of a modified or new profile.
+ *
+ * @param string $_POST['UUID'] Unique record UUID
  * @param string $_POST['Name'] Profile name
+ * @param int $_POST['Steps'] Profile steps
  * @param string $_POST['key'] Key choice, Save or Cancel
  * @param string $_POST['command'] Command used, 'add' or 'update'
  *
@@ -252,6 +476,10 @@
     $outstr .= '        <td class="editfield"><input type="text" name="Name" size="50" value="'.$Name.'"></td>'.PHP_EOL;
     $outstr .= '       </tr>'.PHP_EOL;
     $outstr .= '       <tr class="editor">'.PHP_EOL;
+    $outstr .= '        <td class="editname">Profile Steps</td>'.PHP_EOL;
+    $outstr .= '        <td class="editfield">'.$Steps.'</td>'.PHP_EOL;
+    $outstr .= '       </tr>'.PHP_EOL;
+    $outstr .= '       <tr class="editor">'.PHP_EOL;
     $outstr .= '        <td class="editname"><input type="submit" value="Save" name="key"></td>'.PHP_EOL;
     $outstr .= '        <td class="editfield"><input type="submit" value="Cancel" name="key">';
     $outstr .= '<input type="submit" value="Delete" name="key" style="margin-left: 100px;">';
@@ -317,11 +545,11 @@
     $outstr .= '    </div> <!-- errors -->'.PHP_EOL;
     $outstr .= '    <div id="etable">'.PHP_EOL;
     $outstr .= '     <table class="setup">'.PHP_EOL;
-    $outstr .= '      <tr style="background-color: #FFCC01;">'.PHP_EOL;
-    $outstr .= '       <td class="setup">UUID</td>'.PHP_EOL;
-    $outstr .= '       <td class="setup">Name</td>'.PHP_EOL;
-    $outstr .= '       <td class="setup">Steps</td>'.PHP_EOL;
-    $outstr .= '       <td class="setup">Edit</td>'.PHP_EOL;
+    $outstr .= '      <tr class="trhead">'.PHP_EOL;
+    $outstr .= '       <td class="setup" style="width: 300px;">UUID</td>'.PHP_EOL;
+    $outstr .= '       <td class="setup" style="width: 300px;">Name</td>'.PHP_EOL;
+    $outstr .= '       <td class="setup" style="width: 40px;">Steps</td>'.PHP_EOL;
+    $outstr .= '       <td class="setup" style="width: 40px;">Edit</td>'.PHP_EOL;
     $outstr .= '      </tr>'.PHP_EOL;
 
     if (startsWith($arr[0], "212")) {
@@ -333,11 +561,13 @@
 	    $outstr .= '      <tr class="setup">'.PHP_EOL;
 	    $outstr .= '       <td class="setup">'.$f[0].'</td>'.PHP_EOL;
 	    $outstr .= '       <td class="setup">'.$f[1].'</td>'.PHP_EOL;
-	    $outstr .= '       <td class="setup">'.$f[2].'</td>'.PHP_EOL;
-	    if ($f[3] == 1)
+	    if ($f[3] == 1) {
+		$outstr .= '       <td class="setup">'.$f[2].'</td>'.PHP_EOL;
 	    	$outstr .= '       <td class="setup">Busy</td>'.PHP_EOL;
-	    else
-	    	$outstr .= '       <td class="setup"><a href="profiles.php?action=edit&amp;UUID='.$f[0].'">Edit</a></td>'.PHP_EOL;
+	    } else {
+		$outstr .= '       <td class="setup"><a href="profiles.php?action=esteps&amp;UUID='.$f[0].'">'.$f[2].'</a></td>'.PHP_EOL;
+		$outstr .= '       <td class="setup"><a href="profiles.php?action=edit&amp;UUID='.$f[0].'">Edit</a></td>'.PHP_EOL;
+	    }
 	    $outstr .= '      </tr>'.PHP_EOL;
 	    $j++;
     	}
@@ -349,14 +579,14 @@
 
     $outstr .= '     <form method="POST" action="profiles.php">'.PHP_EOL;
     $outstr .= '      <table class="editor">'.PHP_EOL;
+    $outstr .= '      <tr class="trhead"><td colspan="3">Add new profile</td></tr>'.PHP_EOL;
     $outstr .= '       <tr class="editor">'.PHP_EOL;
     $outstr .= '        <td class="editname">Profile Name</td>'.PHP_EOL;
-    $outstr .= '        <td class="editfield"><input type="text" name="Name" size="50" value="'.$Name.'"></td>'.PHP_EOL;
-    $outstr .= '       </tr>'.PHP_EOL;
-    $outstr .= '       <tr class="editor">'.PHP_EOL;
-    $outstr .= '        <td class="editname"><input type="submit" value="Add" name="key"></td>'.PHP_EOL;
+    $outstr .= '        <td class="editfield"><input type="text" name="Name" size="50" value=""></td>'.PHP_EOL;
+    $outstr .= '        <td class="editsub"><input type="submit" value="Add" name="key"></td>'.PHP_EOL;
     $outstr .= '<input type="hidden" value="testdata" name="action">';
     $outstr .= '<input type="hidden" value="add" name="command">';
+    $outstr .= '<input type="hidden" value="0" name="Steps"></td>';
     $outstr .= '<input type="hidden" value="00000000-0000-0000-0000-000000000000" name="UUID">';
     $outstr .= '       </tr>'.PHP_EOL;
     $outstr .= '      </table>'.PHP_EOL;
--- a/www-thermferm/units.php	Sat Jul 26 22:26:30 2014 +0200
+++ b/www-thermferm/units.php	Sun Jul 27 17:06:08 2014 +0200
@@ -48,7 +48,11 @@
 $outstr .= '    <div id="etable">'.PHP_EOL;
 
 $outstr .= '     <table class="setup">'.PHP_EOL;
-$outstr .= '      <tr style="background-color: #FFCC01;"><td class="setup">UUID</td><td class="setup">Name</td><td class="setup">Mode</td></tr>'.PHP_EOL;
+$outstr .= '      <tr class="trhead">'.PHP_EOL;
+$outstr .= '       <td class="setup" style="width: 300px;">UUID</td>'.PHP_EOL;
+$outstr .= '       <td class="setup" style="width: 300px;">Name</td>'.PHP_EOL;
+$outstr .= '       <td class="setup" style="width: 60px;">Mode</td>'.PHP_EOL;
+$outstr .= '      </tr>'.PHP_EOL;
 
 if (startsWith($arr[0], "212")) {
     $j = 1;

mercurial