278 |
278 |
279 /* |
279 /* |
280 * Brewing state file ~/.brewco/var/brewing.xml |
280 * Brewing state file ~/.brewco/var/brewing.xml |
281 * If present a brew session is running |
281 * If present a brew session is running |
282 */ |
282 */ |
|
283 #define STEP_NA 0 /* Not in any step yet */ |
|
284 #define STEP_BREWINIT 1 /* Initialize brew */ |
|
285 #define STEP_WAITSTART 2 /* Wait for starttime */ |
|
286 #define STEP_PREMASH 3 /* Pre-mash */ |
|
287 #define STEP_MASHING 4 /* Mash steps */ |
|
288 #define STEP_IODINE 5 /* Iodine test */ |
|
289 #define STEP_MASHREMOVE 6 /* Remove mash */ |
|
290 #define STEP_PREBOIL 7 /* Heating before boil */ |
|
291 #define STEP_BOILING 8 /* Boil */ |
|
292 #define STEP_BOILDONE 9 /* Boil done, hopstand */ |
|
293 #define STEP_COOLING 10 /* Cooling */ |
|
294 #define STEP_WHIRLPOOL 11 /* Whirlpool */ |
|
295 #define STEP_CLEANUP 12 /* Cleanup */ |
|
296 #define STEP_BREWDONE 13 /* Final step */ |
283 |
297 |
284 #define MAISH_NA 0 /* Not in any state yet */ |
298 #define MAISH_NA 0 /* Not in any state yet */ |
285 #define MASIH_PROMPT 1 /* Prompt the user */ |
299 #define MASIH_PROMPT 1 /* Prompt the user */ |
286 #define MAISH_HEATING 2 /* Heating phase */ |
300 #define MAISH_HEATING 2 /* Heating phase */ |
287 #define MAISH_REST 3 /* Rest phase */ |
301 #define MAISH_REST 3 /* Rest phase */ |
288 #define MAISH_DONE 4 /* This step is done */ |
302 #define MAISH_DONE 4 /* This step is done */ |
289 |
303 |
290 |
304 |
|
305 |
291 typedef struct _brew_session { |
306 typedef struct _brew_session { |
292 char *uuid_recipe; /* Brewing this recipe */ |
307 char *uuid_recipe; /* Brewing this recipe */ |
293 char *uuid_unit; /* Brewing unit */ |
308 char *uuid_unit; /* Brewing unit */ |
294 int premash; /* In premash state */ |
309 int brewstep; /* Main steps */ |
295 int mashstep; /* In or into maishstep or -1 */ |
310 int mashstep; /* Mash step */ |
296 int mashstate; /* State this step is in */ |
311 int timeout; /* Generic time downcouner */ |
297 int resttime; /* Rest time downcouner */ |
|
298 int iodine; /* Mash iodine test */ |
|
299 int mashremove; /* Mash remove step */ |
|
300 int boilheating; /* Heat for boiling */ |
|
301 int boiling; /* Boiling started */ |
|
302 int boiltimer; /* Boiling downcount */ |
312 int boiltimer; /* Boiling downcount */ |
303 int cooling; /* Cooling phase */ |
|
304 int whirlpool; /* Whirlpool phase */ |
|
305 int cleanup; /* Cleanup phase */ |
|
306 time_t starttime; /* Start of brew */ |
313 time_t starttime; /* Start of brew */ |
307 time_t endtime; /* End of brew */ |
314 time_t endtime; /* End of brew */ |
308 } brew_session; |
315 } brew_session; |
309 |
316 |
310 |
317 |