main/config.h

changeset 77
66c77497d86d
parent 70
d6838a268020
child 82
7d17e2cb31a8
equal deleted inserted replaced
76:3ff381bfa469 77:66c77497d86d
108 MAIN_TOOLS_FILES_BACKUP, ///< Main files backup. 108 MAIN_TOOLS_FILES_BACKUP, ///< Main files backup.
109 MAIN_TOOLS_UPDATES, ///< Main Updates. 109 MAIN_TOOLS_UPDATES, ///< Main Updates.
110 MAIN_AUTO_INIT1 = 96, ///< Automatic start part 1 110 MAIN_AUTO_INIT1 = 96, ///< Automatic start part 1
111 MAIN_AUTO_INIT2, ///< Automatic start part 2 111 MAIN_AUTO_INIT2, ///< Automatic start part 2
112 MAIN_AUTO_DELAYSTART, ///< Delayed start 112 MAIN_AUTO_DELAYSTART, ///< Delayed start
113 MAIN_AUTO_HEATUP, ///< Heatup the system 113 MAIN_AUTO_HEATUP, ///< Heatup the HLT
114 MAIN_AUTO_MASH_IN = 100, ///< Mash-in 114 MAIN_AUTO_MASH = 100, ///< Mash steps
115 MAIN_AUTO_MASH_1, ///< Mash step 1 115 MAIN_AUTO_TOBOIL = 120, ///< Going to boil
116 MAIN_AUTO_MASH_2, ///< Mash step 2
117 MAIN_AUTO_MASH_3, ///< Mash step 3
118 MAIN_AUTO_MASH_4, ///< Mash step 4
119 MAIN_AUTO_MASH_5, ///< Mash step 5
120 MAIN_AUTO_MASH_6, ///< Mash step 6
121 MAIN_AUTO_MASH_OUT, ///< Mash-out
122 MAIN_AUTO_TOBOIL, ///< Going to boil
123 MAIN_AUTO_BOILING, ///< Boiling 116 MAIN_AUTO_BOILING, ///< Boiling
124 MAIN_AUTO_WHIRLPOOL9, ///< Whirlpool 117 MAIN_AUTO_WHIRLPOOL9, ///< Whirlpool
125 MAIN_AUTO_COOLING_H, ///< Cooling hot type 118 MAIN_AUTO_COOLING_H, ///< Cooling hot type
126 MAIN_AUTO_WHIRLPOOL7, ///< Whirlpool 119 MAIN_AUTO_WHIRLPOOL7, ///< Whirlpool
127 MAIN_AUTO_COOLING_M, ///< Cooling medium type 120 MAIN_AUTO_COOLING_M, ///< Cooling medium type
139 */ 132 */
140 typedef enum { 133 typedef enum {
141 MASH_NONE = 0, ///< Initial Mash state 134 MASH_NONE = 0, ///< Initial Mash state
142 MASH_WAITTEMP, ///< Wait to reach temperature. 135 MASH_WAITTEMP, ///< Wait to reach temperature.
143 MASH_REST, ///< Mash rest 136 MASH_REST, ///< Mash rest
144 MASH_ADD, ///< Add mash wait 137 MASH_ADD, ///< Wait add mash
145 MASH_IODINE, ///< Wait iodine test 138 MASH_IODINE, ///< Wait iodine test
146 MASH_REMOVE, ///< Wait mash remove 139 MASH_REMOVE, ///< Wait mash remove
147 MASH_INFUSE, ///< Wait infusion prompt 140 MASH_INFUSE, ///< Wait infusion prompt
141 MASH_DECOCT, ///< Wait decoction prompt
148 } MASH_TYPE; 142 } MASH_TYPE;
149 143
150 /** 144 /**
151 * @brief The working mode of the second heater SSR. 145 * @brief The working mode of the second heater SSR.
152 */ 146 */
305 time_t BrewStart; ///< Brew start time. 299 time_t BrewStart; ///< Brew start time.
306 char Logfile[64]; ///< Brew logfile. 300 char Logfile[64]; ///< Brew logfile.
307 bool UseHLT; ///< Use HLT during brew. 301 bool UseHLT; ///< Use HLT during brew.
308 bool PumpCooling; ///< Pump during cooling. 302 bool PumpCooling; ///< Pump during cooling.
309 uint32_t TimeBrewing; ///< Time we are brewing. 303 uint32_t TimeBrewing; ///< Time we are brewing.
304 uint8_t MashStep; ///< Current mash step.
305 bool MaltAdded; ///< If malt was added.
310 } runtime; ///< Runtime record. 306 } runtime; ///< Runtime record.
311 307
312 308
313 /** 309 /**
314 * @brief Write runtime information to disk. 310 * @brief Write runtime information to disk.
321 */ 317 */
322 void read_runtime(void); 318 void read_runtime(void);
323 319
324 320
325 321
326 /** 322 #define RECIPE_VERSION 2 ///< Recipe file version
327 * @brief Mash step type 323 #define MASH_MAX 16 ///< Maximum 16 mash steps
324 #define ADDITION_MAX 20 ///< Maximum 20 additions
325
326 /**
327 * @brief Mash step types
328 */ 328 */
329 typedef enum { 329 typedef enum {
330 MASHTYPE_INFUSION = 0, 330 MASHTYPE_INFUSION = 0,
331 MASHTYPE_TEMPERATURE, 331 MASHTYPE_TEMPERATURE,
332 MASHTYPE_DECOCTION, 332 MASHTYPE_DECOCTION,
348 348
349 /** 349 /**
350 * @brief Mash steps 350 * @brief Mash steps
351 */ 351 */
352 typedef struct strMashStep { 352 typedef struct strMashStep {
353 char Name[32]; ///< Step name. 353 char Name[32]; ///< Step name.
354 uint8_t Type; ///< Step Type. 354 uint8_t Type; ///< Step Type.
355 float Temperature; ///< Step temperature. 355 float Step_temp; ///< Step start temperature.
356 uint16_t Resttime; ///< Step resttime. 356 uint16_t Step_time; ///< Step rest time.
357 uint16_t Ramptime; ///< Step time to reach temp. 357 uint16_t Ramp_time; ///< Step time to reach temp.
358 float Infusion_amount; ///< Infusion amount in liters. 358 float End_temp; ///< Step end temperature.
359 float Infusion_temp; ///< Infusion temperature. 359 float Infuse_amount; ///< Infuse/decoct amount in liters.
360 float Infuse_temp; ///< Infuse temperature.
360 } mashstep_t; 361 } mashstep_t;
361 362
362 /** 363 /**
363 * @brief Hop and other additions 364 * @brief Hop and other additions
364 */ 365 */
367 uint8_t Type; ///< Addition type, Hop, Syrop ... 368 uint8_t Type; ///< Addition type, Hop, Syrop ...
368 char Name[64]; ///< Addition name. 369 char Name[64]; ///< Addition name.
369 } addition_t; 370 } addition_t;
370 371
371 /** 372 /**
372 * @brief Current recipe 373 * @brief Recipes database. Starts with a header block for future upgrades,
373 */ 374 * followed by the actual recpie records.
375 */
376 struct hdrRecipe {
377 uint32_t version; ///< Structure version.
378 uint32_t hdrsize; ///< Size of this header.
379 uint32_t recsize; ///< Size of a record.
380 uint8_t mashmax; ///< Maximum mash steps.
381 uint8_t additionmax; ///< Maximum additions.
382 } recipe_hdr;
383
374 struct strRecipe { 384 struct strRecipe {
375 uint8_t Version; ///< Record version number.
376 int o_Record; ///< Record number, obsolete.
377 char Name[128]; ///< Recipe name. 385 char Name[128]; ///< Recipe name.
378 char Code[32]; ///< Recipe code. 386 char Code[32]; ///< Recipe code.
379 mashstep_t MashStep[8]; ///< Mash steps.
380 uint16_t BoilTime; ///< Boil time. 387 uint16_t BoilTime; ///< Boil time.
388 uint8_t Mashsteps; ///< Number of mashsteps.
381 uint8_t Additions; ///< Number of additions. 389 uint8_t Additions; ///< Number of additions.
382 addition_t Addition[10]; ///< Additions
383 float CoolTemp; ///< Cool temperature. 390 float CoolTemp; ///< Cool temperature.
384 uint16_t Whirlpool9; ///< Zero or the Hot Whirlpool time 88..100 ° 391 uint16_t Whirlpool9; ///< Zero or the Hot Whirlpool time 88..100 °
385 uint16_t Whirlpool7; ///< Zero or the Sub Isomerization Whirlpool time 71..77 ° 392 uint16_t Whirlpool7; ///< Zero or the Sub Isomerization Whirlpool time 71..77 °
386 uint16_t Whirlpool6; ///< Zero or the "Tepid" Whirlpool time 60..66 ° 393 uint16_t Whirlpool6; ///< Zero or the "Tepid" Whirlpool time 60..66 °
387 uint16_t Whirlpool2; ///< Zero or the Cold Whirlpool time < 30 ° 394 uint16_t Whirlpool2; ///< Zero or the Cold Whirlpool time < 30 °
388 float SpargeTemp; ///< Sparge water temperature. 395 float SpargeTemp; ///< Sparge water temperature.
396 mashstep_t MashStep[MASH_MAX]; ///< Mash steps.
397 addition_t Addition[ADDITION_MAX]; ///< Additions.
389 } recipe; ///< Recipe record. 398 } recipe; ///< Recipe record.
390 399
391 /** 400 /**
392 * @brief Append a recipe record. Create file if it doesn't exist. 401 * @brief Append a recipe record. Create file if it doesn't exist.
393 */ 402 */
409 * @brief Delete recipe record, renumber remaining records. 418 * @brief Delete recipe record, renumber remaining records.
410 * @param RecNo The record to remove. 419 * @param RecNo The record to remove.
411 */ 420 */
412 void delete_recipe(int RecNo); 421 void delete_recipe(int RecNo);
413 422
423
414 #endif 424 #endif

mercurial