Added usage counters to the beer logfiles. Bumped to version 0.2.4

Tue, 11 Nov 2014 16:10:48 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 11 Nov 2014 16:10:48 +0100
changeset 297
a70527a4e56a
parent 296
0569f28b0806
child 298
b88c60e8369e

Added usage counters to the beer logfiles. Bumped to version 0.2.4

configure file | annotate | diff | comparison | revisions
configure.ac file | annotate | diff | comparison | revisions
thermferm/thermferm.c file | annotate | diff | comparison | revisions
--- a/configure	Sun Nov 02 19:47:50 2014 +0100
+++ b/configure	Tue Nov 11 16:10:48 2014 +0100
@@ -2034,7 +2034,7 @@
 
 
 PACKAGE="mbsePi-apps"
-VERSION="0.2.3"
+VERSION="0.2.4"
 COPYRIGHT="Copyright (C) 2014 Michiel Broek, All Rights Reserved"
 CYEARS="2014"
 
--- a/configure.ac	Sun Nov 02 19:47:50 2014 +0100
+++ b/configure.ac	Tue Nov 11 16:10:48 2014 +0100
@@ -8,7 +8,7 @@
 dnl General settings
 dnl After changeing the version number, run autoconf!
 PACKAGE="mbsePi-apps"
-VERSION="0.2.3"
+VERSION="0.2.4"
 COPYRIGHT="Copyright (C) 2014 Michiel Broek, All Rights Reserved"
 CYEARS="2014"
 AC_SUBST(PACKAGE)
--- a/thermferm/thermferm.c	Sun Nov 02 19:47:50 2014 +0100
+++ b/thermferm/thermferm.c	Tue Nov 11 16:10:48 2014 +0100
@@ -829,6 +829,7 @@
 int server(void)
 {
     char                buf[1024], *filename, target[40], heater[40], cooler[40], fan[40], door[40];
+    char		use_heater[40], use_cooler[40], use_fan[40];
     time_t		now, last = (time_t)0;
     units_list		*unit;
     profiles_list	*profile;
@@ -1447,6 +1448,10 @@
 			snprintf(cooler, 39, "NA");
 			snprintf(fan, 39, "NA");
 			snprintf(door, 39, "NA");
+			snprintf(use_heater, 39, "NA");
+			snprintf(use_cooler, 39, "NA");
+			snprintf(use_fan, 39, "NA");
+
 
 			if (unit->mode == UNITMODE_BEER)
 			    snprintf(target, 39, "%.1f", unit->beer_set);
@@ -1457,20 +1462,23 @@
 
 			if (unit->heater_address) {
 			    snprintf(heater, 39, "%d", unit->heater_state);
+			    snprintf(use_heater, 39, "%d", unit->heater_usage);
 			}
 			if (unit->cooler_address) {
 			    snprintf(cooler, 39, "%d", unit->cooler_state);
+			    snprintf(use_cooler, 39, "%d", unit->cooler_usage);
 			}
 			if (unit->fan_address) {
 			    snprintf(fan, 39, "%d", unit->fan_state);
+			    snprintf(use_fan, 39, "%d", unit->fan_usage);
 			}
 			if (unit->door_address) {
 			    snprintf(door, 39, "%d", unit->door_state);
 			}
 
-			snprintf(buf, 1023, "%s,%.3f,%.3f,%s,%s,%s,%s,%s", 
+			snprintf(buf, 1023, "%s,%.3f,%.3f,%s,%s,%s,%s,%s,%s,%s,%s", 
 					UNITMODE[unit->mode], unit->air_temperature / 1000.0, 
-					unit->beer_temperature / 1000.0, target, heater, cooler, fan, door);
+					unit->beer_temperature / 1000.0, target, heater, cooler, fan, door, use_heater, use_cooler, use_fan);
 			filename = xstrcpy(unit->name);
 			filename = xstrcat(filename, (char *)".log");
 			logger(filename, buf);

mercurial