Drop fermenter volume setting.

Wed, 24 Apr 2024 11:04:00 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 24 Apr 2024 11:04:00 +0200
changeset 702
d77891f8915d
parent 701
e50a5003c7ac
child 703
344470c6bb1c

Drop fermenter volume setting.

thermferm/rdconfig.c file | annotate | diff | comparison | revisions
thermferm/server.c file | annotate | diff | comparison | revisions
thermferm/thermferm.h file | annotate | diff | comparison | revisions
--- a/thermferm/rdconfig.c	Tue Apr 23 20:45:29 2024 +0200
+++ b/thermferm/rdconfig.c	Wed Apr 24 11:04:00 2024 +0200
@@ -265,7 +265,6 @@
 	    xmlTextWriterWriteFormatElement(writer, BAD_CAST "PRODUCT_CODE", "%s", tmp3->product_code);
 	    xmlTextWriterWriteFormatElement(writer, BAD_CAST "PRODUCT_NAME", "%s", tmp3->product_name);
 	    xmlTextWriterWriteFormatElement(writer, BAD_CAST "ALIAS", "%s", tmp3->alias);
-	    xmlTextWriterWriteFormatElement(writer, BAD_CAST "VOLUME", "%.1f", tmp3->volume);
 
 	    if (tmp3->air_address) {
 	    	xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_ADDRESS", "%s", tmp3->air_address);
@@ -574,7 +573,7 @@
 		 unit->alias = unit->air_address = unit->beer_address = unit->beer_address2 = unit->chiller_address = \
 		 unit->heater_address = unit->cooler_address = unit->fan_address = unit->door_address = \
 		 unit->light_address = unit->psu_address = unit->profile_uuid = unit->profile_name  = NULL;
-    unit->volume = unit->prof_peak_abs = unit->prof_peak_rel = 0.0;
+    unit->prof_peak_abs = unit->prof_peak_rel = 0.0;
     unit->air_temperature = unit->beer_temperature = unit->chiller_temperature = unit->beer_set_lo = unit->beer_set_hi = \
 			    unit->fridge_set_lo = unit->fridge_set_hi = unit->profile_inittemp_lo = unit->profile_inittemp_hi = 20.0;
     unit->air_state = unit->beer_state = unit->chiller_state = DEVPRESENT_NO; // missing
@@ -616,12 +615,6 @@
 	if ((!xmlStrcmp(cur->name, (const xmlChar *)"ALIAS"))) {
 	    unit->alias = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
 	}
-	if ((!xmlStrcmp(cur->name, (const xmlChar *)"VOLUME"))) {
-	    key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
-	    if (sscanf((const char *)key, "%f", &val) == 1)
-		unit->volume = val;
-	    xmlFree(key);
-	}
 	if ((!xmlStrcmp(cur->name, (const xmlChar *)"AIR_ADDRESS"))) {
 	    unit->air_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
 	}
--- a/thermferm/server.c	Tue Apr 23 20:45:29 2024 +0200
+++ b/thermferm/server.c	Wed Apr 24 11:04:00 2024 +0200
@@ -1532,7 +1532,7 @@
 			unit->door_idx = unit->light_idx = unit->psu_idx = unit->profile_fridge_mode = \
 			unit->profile_duration = unit->profile_totalsteps = 0;
 	unit->profile_steps = NULL;
-	unit->volume = unit->prof_peak_abs = unit->prof_peak_rel = 0.0;
+	unit->prof_peak_abs = unit->prof_peak_rel = 0.0;
 	unit->air_state = unit->beer_state = unit->chiller_state = DEVPRESENT_NO;
 	unit->air_temperature = unit->beer_temperature = unit->chiller_temperature = 20000;
 	unit->beer_set_lo = unit->beer_set_hi = unit->fridge_set_lo = unit->fridge_set_hi = unit->profile_inittemp_lo = unit->profile_inittemp_hi =20.0;
@@ -1614,7 +1614,6 @@
 		srv_send(s, (char *)"PRODUCT_CODE,%s", unit->product_code);
 		srv_send(s, (char *)"MODE,%s", UNITMODE[unit->mode]);
 		srv_send(s, (char *)"STAGE,%s", UNITSTAGE[unit->stage]);
-		srv_send(s, (char *)"VOLUME,%2f", unit->volume);
 		srv_send(s, (char *)"AIR_ADDRESS,%s", unit->air_address);
 		srv_send(s, (char *)"AIR_STATE,%s", DEVPRESENT[unit->air_state]);
 		srv_send(s, (char *)"AIR_TEMPERATURE,%.3f", unit->air_temperature / 1000.0);
@@ -1761,13 +1760,6 @@
 				unit->product_name = xstrcpy(val);
 				unit->mqtt_flag |= MQTT_FLAG_DATA;
 
-			    } else if (val && (strcmp(kwd, (char *)"VOLUME") == 0)) {
-				if (sscanf(val, "%f", &fval) == 1) {
-				    if (unit->volume != fval)
-					syslog(LOG_NOTICE, "Fermenter unit %s volume %.3f to %.3f", unit->uuid, unit->volume, fval);
-				    unit->volume = fval;
-				}
-
 			    } else if (strcmp(kwd, (char *)"AIR_ADDRESS") == 0) {
 				if (val && unit->air_address && (strcmp(val, unit->air_address)))
 				    syslog(LOG_NOTICE, "Fermenter unit %s air address `%s' to `%s'", unit->uuid, unit->air_address, val);
--- a/thermferm/thermferm.h	Tue Apr 23 20:45:29 2024 +0200
+++ b/thermferm/thermferm.h	Wed Apr 24 11:04:00 2024 +0200
@@ -147,7 +147,6 @@
     char		*product_code;		/* Beer product code		*/
     char		*product_name;		/* Beer product name		*/
     char		*alias;			/* alias name 'unit1'		*/
-    float		volume;			/* Volume of this unit		*/
     char		*air_address;		/* DS18B20 address		*/
     int			air_state;		/* 0=ok, 1=missing, 2=error	*/
     int			air_temperature;	/* Air temperature in C * 1000	*/

mercurial