Added power usage counters to manual mode.

Thu, 11 Jun 2020 20:40:19 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 11 Jun 2020 20:40:19 +0200
changeset 89
fa44bd094e01
parent 88
7f02dbee58d0
child 90
1397fb0b3a9d

Added power usage counters to manual mode.

main/automation.c file | annotate | diff | comparison | revisions
main/manual.c file | annotate | diff | comparison | revisions
main/recipes.c file | annotate | diff | comparison | revisions
--- a/main/automation.c	Wed Jun 10 14:09:27 2020 +0200
+++ b/main/automation.c	Thu Jun 11 20:40:19 2020 +0200
@@ -385,7 +385,7 @@
                 }
 		double mwu = (runtime.MLT_usage / 1000.0 / 60.0 / 60.0) * equipment.MLT_watt / 1000.0;
 		double hwu = (runtime.HLT_usage / 1000.0 / 60.0 / 60.0) * equipment.HLT_watt / 1000.0;
-		log_msg(TAG, "MLT usage %.3f KWU, HLT usage %.3f KWU, total %.3f KWU", mwu, hwu, mwu + hwu);
+		log_msg(TAG, "MLT usage %.3f KWh, HLT usage %.3f KWh, total %.3f KWh", mwu, hwu, mwu + hwu);
                 _fg = TFT_YELLOW;
                 TFT_setFont(DEJAVU24_FONT, NULL);
                 if (Main_Screen == MAIN_AUTO_DONE) {
--- a/main/manual.c	Wed Jun 10 14:09:27 2020 +0200
+++ b/main/manual.c	Thu Jun 11 20:40:19 2020 +0200
@@ -131,6 +131,10 @@
 		    driver_state->mlt_sp = runtime.ManualMLT;
 		    xSemaphoreGive(xSemaphoreDriver);
 		}
+		runtime.MLT_usage = 0;
+		runtime.HLT_usage = 0;
+		write_runtime();
+
 		if (_ManualHLT) {
 		    if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
 			driver_state->hlt_mode = HLT_MODE_OFF;
@@ -168,6 +172,9 @@
 				    driver_state->pump_run = 0;
 				    xSemaphoreGive(xSemaphoreDriver);
 				}
+				double mwu = (runtime.MLT_usage / 1000.0 / 60.0 / 60.0) * equipment.MLT_watt / 1000.0;
+                		double hwu = (runtime.HLT_usage / 1000.0 / 60.0 / 60.0) * equipment.HLT_watt / 1000.0;
+                		log_msg(TAG, "MLT usage %.3f KWh, HLT usage %.3f KWh, total %.3f KWh", mwu, hwu, mwu + hwu);
 				write_runtime();
 				break;
 
--- a/main/recipes.c	Wed Jun 10 14:09:27 2020 +0200
+++ b/main/recipes.c	Thu Jun 11 20:40:19 2020 +0200
@@ -523,7 +523,7 @@
 			    _fg = TFT_YELLOW;
 			    y += 16;
 			    for (i = 0; i < recipe_hdr.mashmax; i++) {
-				ESP_LOGI(TAG, "%2d %-31s %3d %5.2f %5.2f %2d %2d %7.4f %6.3f", i, recipe.MashStep[i].Name, recipe.MashStep[i].Type,
+				ESP_LOGD(TAG, "%2d %-31s %3d %5.2f %5.2f %2d %2d %7.4f %6.3f", i, recipe.MashStep[i].Name, recipe.MashStep[i].Type,
 					recipe.MashStep[i].Step_temp, recipe.MashStep[i].End_temp, recipe.MashStep[i].Step_time, recipe.MashStep[i].Ramp_time,
 					recipe.MashStep[i].Infuse_temp, recipe.MashStep[i].Infuse_amount);
 				if (recipe.MashStep[i].Type != 255) {

mercurial