Sat, 26 Dec 2015 23:35:42 +0100
Improved steps logging. Some small fixes in the brew automation.
brewco/brewco.c | file | annotate | diff | comparison | revisions | |
brewco/rdsession.c | file | annotate | diff | comparison | revisions | |
brewco/rdsession.h | file | annotate | diff | comparison | revisions |
--- a/brewco/brewco.c Sat Dec 26 21:45:44 2015 +0100 +++ b/brewco/brewco.c Sat Dec 26 23:35:42 2015 +0100 @@ -54,6 +54,7 @@ extern int lcdHandle; extern int slcdHandle; extern int sock; + #ifdef USE_SIMULATOR extern int SIM_cooler; #endif @@ -312,7 +313,12 @@ { int key, save = dosave, i; char data[128]; - static int mash_fase = MASH_NA, hopstand = 0, last_step = -1, last_fase = -1, oldsec = 75, startdelay = 0; + static int mash_fase = MASH_NA, hopstand = 0, last_step = STEP_NA, last_fase = -1, oldsec = 75, startdelay = 0; + + if (brew->brewstep != last_step) { + snprintf(data, 40, brewstep_name(last_step)); + syslog(LOG_NOTICE, "AUTO: brewstep %s to %s", data, brewstep_name(brew->brewstep)); + } switch (brew->brewstep) { case STEP_NA: if (debug) @@ -533,6 +539,7 @@ case MASH_REST: if (last_fase != mash_fase) { prompt(111 + brew->mashstep, NULL); /* "AUTO --> [mashname] " */ + prompt(200, NULL); prompt(300, NULL); prompt(418, NULL); /* "--- --- Pause --- " */ hlt_status(1);
--- a/brewco/rdsession.c Sat Dec 26 21:45:44 2015 +0100 +++ b/brewco/rdsession.c Sat Dec 26 23:35:42 2015 +0100 @@ -38,6 +38,15 @@ #define MY_ENCODING "utf-8" +char *brewstep_name(int val) +{ + static char text[41]; + + snprintf(text, 20, BREWSTEP[val]); + return text; +} + + int do_wrsession(brew_session *brew); int do_wrsession(brew_session *brew) { @@ -185,7 +194,7 @@ int rc; rc = do_wrsession(brew); - syslog(LOG_NOTICE, "Rewritten brewsession, rc=%d", rc); +// syslog(LOG_NOTICE, "Rewritten brewsession, rc=%d", rc); return rc; }