www-thermferm/liveview.php

changeset 554
ab9f22ab57b5
parent 529
00b45f2aaac3
child 570
1e0192b295b9
--- a/www-thermferm/liveview.php	Wed Jul 25 20:08:13 2018 +0200
+++ b/www-thermferm/liveview.php	Tue Jul 31 16:42:11 2018 +0200
@@ -1,6 +1,6 @@
 <?php
 /*****************************************************************************
- * Copyright (C) 2014-2017
+ * Copyright (C) 2014-2018
  *   
  * Michiel Broek <mbroek at mbse dot eu>
  *
@@ -26,11 +26,11 @@
 
 
 
-function showunit($unit, $unr, $name)
+function showunit($unit, $unr, $alias)
 {
     global $my_style;
 
-    $outstr = '    <!--  showunit(' . $unit . ', ' . $unr . ', ' . $name . ')  -->' . PHP_EOL;
+    $outstr = '    <!--  showunit(' . $unit . ', ' . $unr . ', ' . $alias . ')  -->' . PHP_EOL;
     $air_state = $beer_state = $chiller_state = 1;
     $answer = send_cmd("UNIT GET ".$unit);
     $arr = explode("\r\n", $answer);
@@ -43,6 +43,8 @@
 	$beer_temperature = "NA";
 	$chiller_temperature = "NA";
 	$profile = "";
+	$producr_code = "";
+	$product_name = "";
 	$prof_state = "OFF";
 	$power_led = $alarm_led = $cooler_led = $heater_led = $fan_led = "off";
 	$heater = $cooler = $fan = "no";
@@ -55,6 +57,12 @@
 		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];
 	    }
@@ -111,6 +119,7 @@
 	    }
 	}
 
+	$logname = $product_code . " " . $product_name;
 	$outstr .= '    <script type="text/javascript">'.PHP_EOL;
 	$outstr .= '     $(document).ready(function () {'.PHP_EOL;
 
@@ -411,7 +420,7 @@
 	$outstr .= '       <input type="submit" id="maintenance" value="Graph" />'.PHP_EOL;
 	$outstr .= '       <input type="hidden" name="action" value="view">'.PHP_EOL;
 	$outstr .= '       <input type="hidden" name="return" value="index">'.PHP_EOL;
-	$outstr .= '       <input type="hidden" name="name" value="'.urlencode($name).'">'.PHP_EOL;
+	$outstr .= '       <input type="hidden" name="name" value="'.urlencode($logname).'">'.PHP_EOL;
 	$outstr .= '      </form>'.PHP_EOL;
  	$outstr .= '     </div>'.PHP_EOL;
 	$outstr .= '     </div> <!-- fermentor_panel_buttons -->'.PHP_EOL;

mercurial