main/recipes.c

Sat, 25 Jun 2022 15:24:55 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 25 Jun 2022 15:24:55 +0200
changeset 121
30aca5888d2b
parent 116
bafc2d6a0790
child 124
73ee3cc32a49
permissions
-rw-r--r--

Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.

0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /**
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * @file recipes.c
4
6d1f512cd074 Updated documentation
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
3 * @brief Recipes management. If new beerxml recipes are detected in
6d1f512cd074 Updated documentation
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
4 * the /recipe directory on the SD card they will be imported
6d1f512cd074 Updated documentation
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
5 * when you enter the recipes menu. After successfull import the
6d1f512cd074 Updated documentation
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
6 * xml file extensions will be changed to xok to prevent that
6d1f512cd074 Updated documentation
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
7 * the recipe is imported again. After the import the recipe
6d1f512cd074 Updated documentation
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
8 * editor is shown.
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 #include "config.h"
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
14 extern sButton Buttons[MAXBUTTONS]; ///< Buttons definitions
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
15 extern int Main_Screen; ///< Current screen
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
17 bool r_UpdateRec = false; ///< Update record flag
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
18 int r_CurrentRec = 1; ///< Current record
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
19 int r_Records = 1; ///< Total records
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
20 int r_Imported = 0; ///< Total imported
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
21 char _xml_element[10][32]; ///< XML element array
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
22 int _xml_depth; ///< Current depths
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
23 char _xml_add_name[64]; ///< Addition name
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
24 int _xml_add_type; ///< Addition type
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
25 int _xml_add_time; ///< Mash rest time
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
26 int _xml_add_ramp; ///< Mash ramp time
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
27 float _xml_add_temp; ///< Mash start temperature
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
28 float _xml_add_end; ///< Mash end temperature
15
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
29 float _xml_add_amount; ///< Mash infusion amount
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
30 float _xml_add_infusion; ///< Mash infusion temperature
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
31 float _xml_tun_temp; ///< TUN temperature
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
32 bool _xml_add_valid; ///< Add is valid
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 static const char *TAG = "recipes";
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
36 char char_data_buffer[1024]; ///< Data buffer
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
37 size_t offs; ///< Offset in buffer
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
38 bool overflow; ///< Overflow in buffer
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39
19
49e2960d4642 Implemented infusion mash.
Michiel Broek <mbroek@mbse.eu>
parents: 17
diff changeset
40 extern const char *mashTypes[];
49e2960d4642 Implemented infusion mash.
Michiel Broek <mbroek@mbse.eu>
parents: 17
diff changeset
41
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
44 /**
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
45 * @brief Add addition to the recipe.
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
46 * @param Name The addition name.
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
47 * @param Type The addition type.
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
48 * @param Time The addition time to add.
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
49 */
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 void Addition_Add(char *Name, uint8_t Type, uint16_t Time)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 {
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
52 if (Type == ADDITION_HOP_AROMA && Time > 0) {
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
53 /*
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
54 * Whirlpool hop.
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
55 */
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
56 recipe.Whirlpool7 = Time;
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
57 return;
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
58 }
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
59 if (Type == ADDITION_HOP_AROMA)
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
60 Type = ADDITION_HOP_BOIL; /* Flame-out hop, change to boil with zero time. */
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
61
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 if (! recipe.Additions) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 // No entries yet, add the first one.
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
64 snprintf(recipe.Addition[recipe.Additions].Name, 63, "%s", Name);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 recipe.Addition[recipe.Additions].Type = Type;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 recipe.Addition[recipe.Additions].Time = Time;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 recipe.Additions++;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 return;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 // See if we already got one with the same time.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 for (int i = 0; i < recipe.Additions; i++) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 if (recipe.Addition[i].Time == Time) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 // Yes, update the name.
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
75 strncat(recipe.Addition[i].Name, ", ", 63 - strlen(recipe.Addition[i].Name));
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
76 strncat(recipe.Addition[i].Name, Name, 63 - strlen(recipe.Addition[i].Name));
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 return;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 // A new entry and we already have some. Add it and keep the list sorted.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 for (int i = 0; i < recipe.Additions; i++) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 if (Time > recipe.Addition[i].Time) {
17
f3451031d6c6 Version 0.2.5. Removed debug console messages during recipe import. Removed old SyncDirs code to install /spiffs from the SD card since we now do this via the internet.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
84 // Make room
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
85 for (int j = recipe.Additions; j > i; j--) {
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
86 sprintf(recipe.Addition[j].Name, "%s", recipe.Addition[j-1].Name);
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
87 recipe.Addition[j].Type = recipe.Addition[j-1].Type;
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
88 recipe.Addition[j].Time = recipe.Addition[j-1].Time;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 }
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
90 snprintf(recipe.Addition[i].Name, 63, "%s", Name);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 recipe.Addition[i].Type = Type;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 recipe.Addition[i].Time = Time;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 recipe.Additions++;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94 return;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 // Just append.
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
99 snprintf(recipe.Addition[recipe.Additions].Name, 63, "%s", Name);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 recipe.Addition[recipe.Additions].Type = Type;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101 recipe.Addition[recipe.Additions].Time = Time;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 recipe.Additions++;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
105
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
107 /**
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
108 * @brief Reset the parser buffer.
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
109 */
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
110 void reset_char_data_buffer (void)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 offs = 0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
113 overflow = false;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
118 /**
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
119 * @brief Datahandler get bytes into the data buffer.
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
120 */
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
121 void char_data(void *userData, const XML_Char *s, int len)
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 if (!overflow) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 if (len + offs >= sizeof(char_data_buffer) ) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 overflow = true;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 } else {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 memcpy(char_data_buffer + offs, s, len);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 offs += len;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
134 /**
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
135 * @brief Process the XML parser data buffer.
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
136 */
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 void process_char_data_buffer (void)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 bool allspace = true;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 if (offs > 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142 char_data_buffer[ offs ] = '\0';
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 /*
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 * If all spaces and control characters, the data is invalid.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147 for (int i = 0; i < strlen(char_data_buffer); i++) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 if (char_data_buffer[i] > ' ')
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 allspace = false;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 if (allspace)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152 return;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 if ((_xml_depth > 2) && (strcmp(_xml_element[0], "RECIPES") == 0) && (strcmp(_xml_element[1], "RECIPE") == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 /*
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 * We are in a recipe
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 if ((_xml_depth == 3) && (strcmp("NAME", _xml_element[2]) == 0)) {
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
159 recipe.Name[0] = '\0';
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
160 strncat(recipe.Name, char_data_buffer, 127);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161 } else if ((_xml_depth == 3) && (strcmp("BOIL_TIME", _xml_element[2]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 recipe.BoilTime = atoi(char_data_buffer);
93
24cb415af787 Version 0.3.13. Recipe import parse BMS_COOLING_TO to set the cooling temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 89
diff changeset
163 } else if ((_xml_depth == 3) && (strcmp("BMS_COOLING_TO", _xml_element[2]) == 0)) {
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
164 recipe.CoolTemp = atof(char_data_buffer);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165 } else if ((_xml_depth == 5) && (strcmp("HOPS", _xml_element[2]) == 0) && (strcmp("HOP", _xml_element[3]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 /*
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 * Hops that are added during the boil.
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
168 * But check for "Aroma" hops too.
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
169 */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170 if (strcmp("NAME", _xml_element[4]) == 0) {
56
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
171 _xml_add_name[0] = '\0';
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
172 strncat(_xml_add_name, char_data_buffer, 63);
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
173 _xml_add_time = 0; // reset
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
174 } else if (strcmp("USE", _xml_element[4]) == 0) {
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
175 if (strcmp("Boil", char_data_buffer) == 0) {
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
176 _xml_add_valid = true;
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
177 _xml_add_type = ADDITION_HOP_BOIL;
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
178 } else if (strcmp("Aroma", char_data_buffer) == 0) {
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
179 _xml_add_type = ADDITION_HOP_AROMA;
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
180 _xml_add_valid = true;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
181 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182 } else if (strcmp("TIME", _xml_element[4]) == 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
183 _xml_add_time = atoi(char_data_buffer);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
184 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
185 } else if ((_xml_depth >= 3) && (strcmp("STYLE", _xml_element[2]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
186 // Ignore
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
187 } else if ((_xml_depth >= 3) && (strcmp("EQUIPMENT", _xml_element[2]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
188 // Ignora
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
189 } else if ((_xml_depth >= 3) && (strcmp("YEASTS", _xml_element[2]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
190 // Ignore
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
191 } else if ((_xml_depth >= 3) && (strcmp("WATERS", _xml_element[2]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
192 // Ignore
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
193 } else if ((_xml_depth == 5) && (strcmp("FERMENTABLES", _xml_element[2]) == 0) && (strcmp("FERMENTABLE", _xml_element[3]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
194 /*
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
195 * Fermentabes that must be added during the boil.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
196 */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197 if (strcmp("NAME", _xml_element[4]) == 0) {
56
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
198 _xml_add_name[0] = '\0';
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
199 strncat(_xml_add_name, char_data_buffer, 63);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
200 } else if (strcmp("TYPE", _xml_element[4]) == 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
201 if ((strcmp("Sugar", char_data_buffer) == 0)/* || (strcmp("Adjunct", char_data_buffer) == 0)*/) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
202 _xml_add_type = ADDITION_FERMENTABLE;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
203 _xml_add_time = 10;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
204 } else {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205 _xml_add_type = -1;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
207 } else if (strcmp("ADD_AFTER_BOIL", _xml_element[4]) == 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
208 _xml_add_valid = (strcmp("FALSE", char_data_buffer) == 0);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
209 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
210 } else if ((_xml_depth == 5) && (strcmp("MISCS", _xml_element[2]) == 0) && (strcmp("MISC", _xml_element[3]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
211 /*
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
212 * Check for Misc additions to add during the boil.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
213 */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
214 if (strcmp("NAME", _xml_element[4]) == 0) {
56
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
215 _xml_add_name[0] = '\0';
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
216 strncat(_xml_add_name, char_data_buffer, 63);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
217 } else if (strcmp("USE", _xml_element[4]) == 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
218 _xml_add_valid = (strcmp("Boil", char_data_buffer) == 0); // Only "Boil" is a valid hop.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
219 } else if (strcmp("TYPE", _xml_element[4]) == 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
220 if (strcmp("Spice", char_data_buffer) == 0)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
221 _xml_add_type = ADDITION_SPICE;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
222 if (strcmp("Fining", char_data_buffer) == 0)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
223 _xml_add_type = ADDITION_FINING;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
224 if (strcmp("Herb", char_data_buffer) == 0)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
225 _xml_add_type = ADDITION_HERB;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
226 if (strcmp("Flavor", char_data_buffer) == 0)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
227 _xml_add_type = ADDITION_FLAVOR;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
228 if (strcmp("Other", char_data_buffer) == 0)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
229 _xml_add_type = ADDITION_OTHER;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
230 } else if (strcmp("TIME", _xml_element[4]) == 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
231 _xml_add_time = atoi(char_data_buffer);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
232 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
233 } else if ((_xml_depth >= 4) && (strcmp("MASH", _xml_element[2]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
234 if ((_xml_depth >= 6) && (strcmp("MASH_STEP", _xml_element[4]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
235 if (strcmp("NAME", _xml_element[5]) == 0) {
56
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
236 _xml_add_name[0] = '\0';
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
237 strncat(_xml_add_name, char_data_buffer, 63);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
238 } else if (strcmp("TYPE", _xml_element[5]) == 0) {
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
239 // Step_temp Infusion Decoction
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
240 _xml_add_valid = (strcmp("Step_temp", char_data_buffer) == 0);
15
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
241 if (strcmp("Infusion", char_data_buffer) == 0)
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
242 _xml_add_type = MASHTYPE_INFUSION;
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
243 else if (strcmp("Temperature", char_data_buffer) == 0)
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
244 _xml_add_type = MASHTYPE_TEMPERATURE;
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
245 else if (strcmp("Decoction", char_data_buffer) == 0)
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
246 _xml_add_type = MASHTYPE_DECOCTION;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
247 } else if (strcmp("STEP_TEMP", _xml_element[5]) == 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
248 _xml_add_temp = atof(char_data_buffer);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
249 } else if (strcmp("STEP_TIME", _xml_element[5]) == 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
250 _xml_add_time = atoi(char_data_buffer);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
251 } else if (strcmp("RAMP_TIME", _xml_element[5]) == 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
252 _xml_add_ramp = atoi(char_data_buffer);
15
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
253 } else if (strcmp("INFUSE_AMOUNT", _xml_element[5]) == 0) {
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
254 _xml_add_amount = atof(char_data_buffer);
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
255 } else if (strcmp("INFUSE_TEMP", _xml_element[5]) == 0) {
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
256 _xml_add_infusion = atof(char_data_buffer);
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
257 } else if (strcmp("DECOCTION_AMT", _xml_element[5]) == 0) {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
258 _xml_add_amount = atof(char_data_buffer);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
259 } else if (strcmp("END_TEMP", _xml_element[5]) == 0) {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
260 _xml_add_end = atof(char_data_buffer);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
261 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
262 } else if ((_xml_depth >= 4) && (strcmp("TUN_TEMP", _xml_element[3]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
263 // Save this and check later if this is the strike temperature.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
264 _xml_tun_temp = atof(char_data_buffer);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
265 } else if ((_xml_depth >= 4) && (strcmp("SPARGE_TEMP", _xml_element[3]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
266 recipe.SpargeTemp = atof(char_data_buffer);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
267 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
268 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
269 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
270 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
271 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
272
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
273
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
274
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
275 /**
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
276 * @brief Start new XML element.
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
277 * @param userData
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
278 * @param name XML element name
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
279 * @param attr XML element attribute
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
280 */
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
281 void startElement(void *userData, const char *name, const char **attr)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
282 {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283 sprintf(_xml_element[_xml_depth], "%s", name);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
284 _xml_depth++;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 process_char_data_buffer();
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
286 reset_char_data_buffer();
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
288
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
289
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
291 /**
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
292 * @brief End XML element
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
293 * @param userData
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
294 * @param name XML element name
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
295 */
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
296 void endElement(void *userData, const char *name)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
297 {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
298 process_char_data_buffer();
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
299 reset_char_data_buffer();
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
300 if ((_xml_depth == 4) && (strcmp("HOP", _xml_element[3]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
301 if (_xml_add_valid) {
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
302 Addition_Add(_xml_add_name, _xml_add_type, _xml_add_time);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
303 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
304 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
305 if ((_xml_depth == 4) && (strcmp("FERMENTABLE", _xml_element[3]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
306 if (_xml_add_valid && (_xml_add_type == ADDITION_FERMENTABLE)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
307 Addition_Add(_xml_add_name, _xml_add_type, _xml_add_time);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
308 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
309 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 if ((_xml_depth == 4) && (strcmp("MISC", _xml_element[3]) == 0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311 if (_xml_add_valid) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
312 Addition_Add(_xml_add_name, _xml_add_type, _xml_add_time);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
313 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
314 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
315 if ((_xml_depth == 5) && (strcmp("MASH_STEP", _xml_element[4]) == 0)) {
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
316 recipe.MashStep[recipe.Mashsteps].Name[0] = '\0';
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
317 strncat(recipe.MashStep[recipe.Mashsteps].Name, _xml_add_name, 31);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
318 recipe.MashStep[recipe.Mashsteps].Step_temp = _xml_add_temp;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
319 recipe.MashStep[recipe.Mashsteps].Step_time = _xml_add_time;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
320 recipe.MashStep[recipe.Mashsteps].Ramp_time = _xml_add_ramp;
114
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
321 recipe.MashStep[recipe.Mashsteps].End_temp = (_xml_add_end > 0.0) ? _xml_add_end : _xml_add_temp;
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
322 /*
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
323 * Fix problems created by Brewfather and possible others that say that
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
324 * the first mash step is a temperature step. It just isn't.
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
325 */
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
326 if (_xml_add_type == MASHTYPE_TEMPERATURE && recipe.Mashsteps == 0) {
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
327 _xml_add_type = MASHTYPE_INFUSION;
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
328 recipe.MashStep[recipe.Mashsteps].Ramp_time = 1;
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
329 }
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
330 recipe.MashStep[recipe.Mashsteps].Type = _xml_add_type;
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
331 if (_xml_add_ramp == 0 && recipe.Mashsteps) {
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
332 recipe.MashStep[recipe.Mashsteps].Ramp_time = (uint16_t)(_xml_add_temp - recipe.MashStep[recipe.Mashsteps - 1].End_temp) + 1;
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
333 }
15
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
334 if (_xml_add_type == MASHTYPE_INFUSION) {
116
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
335 if (recipe.Mashsteps == 0 && _xml_add_infusion < _xml_add_temp) {
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
336 recipe.MashStep[recipe.Mashsteps].Infuse_temp = _xml_add_temp + 1.25;
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
337 } else {
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
338 recipe.MashStep[recipe.Mashsteps].Infuse_temp = _xml_add_infusion;
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
339 }
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
340 recipe.MashStep[recipe.Mashsteps].Infuse_amount = _xml_add_amount;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
341 } else if (_xml_add_type == MASHTYPE_DECOCTION) {
114
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
342 recipe.MashStep[recipe.Mashsteps].Infuse_temp = 98.0;
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
343 recipe.MashStep[recipe.Mashsteps].Infuse_amount = _xml_add_amount;
15
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
344 } else {
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
345 recipe.MashStep[recipe.Mashsteps].Infuse_temp = 0.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
346 recipe.MashStep[recipe.Mashsteps].Infuse_amount = 0.0;
15
34b1eb93e71a Added extra mash step fields for infusion steps. Added these fields in recipe import too.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
347 }
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
348 recipe.Mashsteps++;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
349 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
350 _xml_depth--;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
351 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
352
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
353
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
354
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
355 int ParseRecipe(char *fn, char *code)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
356 {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
357 char buf[512];
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
358
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
359 memset(&recipe, 0, recipe_hdr.recsize);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
360 for (int i = 0; i < recipe_hdr.mashmax; i++)
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
361 recipe.MashStep[i].Type = 255;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
362 XML_Parser parser = XML_ParserCreate(NULL);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
363
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
364 int done;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
365 _xml_depth = 0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
366 _xml_tun_temp = 0.0;
114
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
367 _xml_add_infusion = 0.0;
93
24cb415af787 Version 0.3.13. Recipe import parse BMS_COOLING_TO to set the cooling temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 89
diff changeset
368 recipe.CoolTemp = 20.0;
114
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
369 recipe.SpargeTemp = equipment.TempHLT;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
370
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
371 XML_SetElementHandler(parser, startElement, endElement);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
372 XML_SetCharacterDataHandler(parser, char_data);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
373
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
374 FILE *fp = fopen(fn, "r");
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
375
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
376 do {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
377 int len = (int)fread(buf, 1, sizeof(buf), fp);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
378 done = len < sizeof(buf);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
379 if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) {
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
380 ESP_LOGE(TAG, "%s at line %5lu", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
381 return 1;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
382 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
383 vTaskDelay(2 / portTICK_PERIOD_MS);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
384 } while (!done);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
385
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
386 XML_ParserFree(parser);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
387 fclose(fp);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
388
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
389 /*
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
390 * Fix missing things.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
391 */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
392 snprintf(recipe.Code, 31, "%s", code);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
393 // The code is created from the recipe filename.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
394 for (int i = 0; i < strlen(recipe.Code); i++) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
395 if ((recipe.Code[i] == ' ') || (recipe.Code[i] == '.')) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
396 recipe.Code[i] = '\0';
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
397 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
398 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
399 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
400
17
f3451031d6c6 Version 0.2.5. Removed debug console messages during recipe import. Removed old SyncDirs code to install /spiffs from the SD card since we now do this via the internet.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
401 #if 0
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
402 printf("Recipe: %s\n", recipe.Name);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
403 printf("Code : %s\n", recipe.Code);
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
404 printf("Boil : %d minutes\n", recipe.BoilTime);
114
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
405 printf("n Stepname T temp end time ramp inft infa\n");
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
406 printf("- ------------------------------ - ----- ----- ---- ---- ----- -----\n");
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
407 for (int i = 0; i < recipe.Mashsteps; i++) {
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
408 printf("%d %-30s %d %5.2f %5.2f %4d %4d %5.2f %5.2f\n", i, recipe.MashStep[i].Name, recipe.MashStep[i].Type,
114
1413c4c5cd8c Fixed Brewfather beerxml import.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
409 recipe.MashStep[i].Step_temp, recipe.MashStep[i].End_temp,
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
410 recipe.MashStep[i].Step_time, recipe.MashStep[i].Ramp_time,
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
411 recipe.MashStep[i].Infuse_temp, recipe.MashStep[i].Infuse_amount);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
412 }
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
413 printf("\n%d additions\n", recipe.Additions);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
414 printf("n Addition name t Tim\n");
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
415 printf("- --------------------------------------------------------------- - ---\n");
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
416 for (int i = 0; i < recipe.Additions; i++) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
417 printf("%d %-63s %d %3d\n", i, recipe.Addition[i].Name, recipe.Addition[i].Type, recipe.Addition[i].Time);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
418 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
419 printf("Cooltemp %5.2f\n", recipe.CoolTemp);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
420 if (recipe.Whirlpool9)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
421 printf("Whirlpool9 %d\n", recipe.Whirlpool9);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
422 if (recipe.Whirlpool7)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
423 printf("Whirlpool7 %d\n", recipe.Whirlpool7);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
424 if (recipe.Whirlpool6)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
425 printf("Whirlpool6 %d\n", recipe.Whirlpool6);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
426 if (recipe.Whirlpool2)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
427 printf("Whirlpool2 %d\n", recipe.Whirlpool2);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
428 printf("SpargeTemp %5.2f\n", recipe.SpargeTemp);
1
ad2c8b13eb88 Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
429 #endif
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
430
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
431 return 0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
432 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
433
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
434
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
435
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
436 /*
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
437 * Recipes init function, only runs once a new screen is entered.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
438 */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
439 void Recipes_Init(void)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
440 {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
441 FILE *f;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
442 DIR *dir;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
443 struct dirent *de;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
444 size_t bytes;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
445 uint8_t *dst;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
446 uint16_t y;
56
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
447 char filename[288], newname[288];
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
448 int rc;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
449
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
450 switch (Main_Screen) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
451 case MAIN_TOOLS_RECIPE:
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
452 TopMessage((char *)"Recepten importeren");
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
453 r_Imported = 0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
454 TFT_setFont(DEFAULT_FONT, NULL);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
455 y = 28;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
456 if ((dir = opendir("/sdcard/recipe"))) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
457 de = readdir(dir);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
458 while (de) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
459 if (strstr(de->d_name, ".xml") || strstr(de->d_name, ".XML")) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
460 _fg = TFT_YELLOW;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
461 TFT_print(de->d_name, 2, y);
56
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
462 snprintf(filename, 287, "/sdcard/recipe/%s", de->d_name);
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
463 snprintf(newname, 287, "/sdcard/recipe/%s", de->d_name);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
464 newname[strlen(newname) -2] = 'o';
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
465 newname[strlen(newname) -1] = 'k';
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
466 rc = ParseRecipe(filename, de->d_name);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
467 ESP_LOGI(TAG, "Recipe %s parsed, rc=%d", filename, rc);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
468 if (rc == 0) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
469 append_recipe();
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
470 rename(filename, newname);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
471 _fg = TFT_GREEN;
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
472 TFT_print((char *)" Ok", LASTX, y);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
473 } else {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
474 _fg = TFT_RED;
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
475 TFT_print((char *)" Fout", LASTX, y);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
476 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
477 r_Imported++; // Count them all
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
478 y += 16;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
479 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
480 de = readdir(dir);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
481 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
482 closedir(dir);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
483 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
484
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
485 f = fopen("/spiffs/etc/recipe.conf", "r");
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
486 fseek(f, recipe_hdr.hdrsize, SEEK_SET);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
487 dst = (uint8_t*)&recipe;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
488 r_Records = 0;
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
489 while ((bytes = fread(dst, 1, recipe_hdr.recsize, f))) {
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
490 r_Records++;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
491 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
492 fclose(f);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
493 // Load the default record.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
494 r_CurrentRec = config.RecipeRec;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
495 r_UpdateRec = true;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
496 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
497
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
498 case MAIN_TOOLS_RECIPE_EDIT:
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
499 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
500
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
501 default: break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
502 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
503 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
504
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
505
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
506
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
507 /*
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
508 * Recipes management loop, non-blocking.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
509 */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
510 void Recipes_Loop(void)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
511 {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
512 uint32_t crc1, crc2;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
513 uint8_t *dst;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
514 uint16_t y;
56
756d1a63d129 Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
515 char tmp[64];
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
516 float mintemp, maxtemp;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
517 int i;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
518
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
519 switch (Main_Screen) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
520 case MAIN_TOOLS_RECIPE:
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
521 if (r_Imported) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
522 Buttons_Clear();
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
523 Buttons_Add(135, 210, 50, 30, (char *)"Ok" , 0);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
524 Buttons_Show();
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
525
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
526 while (true) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
527 if (Buttons_Scan() == 0)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
528 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
529 vTaskDelay(20 / portTICK_PERIOD_MS);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
530 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
531 Buttons_Clear();
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
532 r_Imported = 0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
533 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
534 if (r_UpdateRec) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
535 _bg = TFT_BLACK;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
536 TFT_fillScreen(_bg);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
537 TFT_resetclipwin();
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
538 TopMessage((char *)"Recepten");
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
539 r_UpdateRec = false;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
540 read_recipe(r_CurrentRec);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
541 TFT_setFont(DEFAULT_FONT, NULL);
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
542 ShowText(2, 28, (char *)"Naam", recipe.Name);
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
543 ShowText(2, 44, (char *)"Code", recipe.Code);
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
544 ShowInteger(162, 44, (char *)"Record", NULL, r_CurrentRec);
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
545 ShowInteger(2, 60, (char *)"Kooktijd", (char *)" min", recipe.BoilTime);
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
546 ShowFloat(162, 60, (char *)"Koel tot", (char *)" C", recipe.CoolTemp, 2);
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
547 ShowFloat(2, 76, (char *)"Maisch in", (char *)" C", recipe.MashStep[0].Infuse_temp, 3);
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
548 ShowFloat(162, 76, (char *)"Spoelwater", (char *)" C", recipe.SpargeTemp, 2);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
549 y = 92;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
550 _fg = TFT_WHITE;
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
551 TFT_print((char *)"Maisch stap", 2, y);
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
552 TFT_print((char *)"T", 180, y);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
553 TFT_print((char *)"Temp.", 200, y);
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
554 TFT_print((char *)"Rust", 280, y);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
555 _fg = TFT_YELLOW;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
556 y += 16;
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
557 for (i = 0; i < recipe_hdr.mashmax; i++) {
89
fa44bd094e01 Added power usage counters to manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
558 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,
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
559 recipe.MashStep[i].Step_temp, recipe.MashStep[i].End_temp, recipe.MashStep[i].Step_time, recipe.MashStep[i].Ramp_time,
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
560 recipe.MashStep[i].Infuse_temp, recipe.MashStep[i].Infuse_amount);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
561 if (recipe.MashStep[i].Type != 255) {
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
562 TFT_print(recipe.MashStep[i].Name, 2, y);
19
49e2960d4642 Implemented infusion mash.
Michiel Broek <mbroek@mbse.eu>
parents: 17
diff changeset
563 strcpy(tmp, mashTypes[recipe.MashStep[i].Type]);
49e2960d4642 Implemented infusion mash.
Michiel Broek <mbroek@mbse.eu>
parents: 17
diff changeset
564 tmp[1] = '\0';
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
565 TFT_print(tmp, 180, y);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
566 sprintf(tmp, "%.1f %.1f", recipe.MashStep[i].Step_temp, recipe.MashStep[i].End_temp);
19
49e2960d4642 Implemented infusion mash.
Michiel Broek <mbroek@mbse.eu>
parents: 17
diff changeset
567 TFT_print(tmp, 200, y);
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
568 sprintf(tmp, "%2d m", recipe.MashStep[i].Step_time);
16
d43b393a4461 Improved recipes import.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
569 TFT_print(tmp, 280, y);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
570 y += 16;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
571 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
572 }
75
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
573 if (recipe.BoilTime) {
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
574 if (recipe.Additions) {
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
575 _fg = TFT_YELLOW;
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
576 sprintf(tmp, "%d ", recipe.Additions);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
577 TFT_print(tmp, 2, y);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
578 _fg = TFT_WHITE;
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
579 TFT_print((char *)"toevoegingen om", LASTX, y);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
580 _fg = TFT_YELLOW;
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
581 for (int i = 1; i <= recipe.Additions; i++) {
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
582 sprintf(tmp, " %d", recipe.Addition[i-1].Time);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
583 TFT_print(tmp, LASTX, y);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
584 }
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
585 _fg = TFT_WHITE;
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
586 TFT_print((char *)" minuten", LASTX, y);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
587 } else {
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
588 _fg = TFT_WHITE;
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
589 TFT_print((char *)"Geen hop toevoegingen.", 2, y);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
590 }
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
591 y += 16;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
592 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
593 if (recipe.Whirlpool9 || recipe.Whirlpool7 || recipe.Whirlpool6 || recipe.Whirlpool2) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
594 _fg = TFT_WHITE;
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
595 TFT_print((char *)"Whirlpool ", 2, y);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
596 _fg = TFT_YELLOW;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
597 if (recipe.Whirlpool9)
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
598 TFT_print((char *)"88+ ", LASTX, y);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
599 if (recipe.Whirlpool7)
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
600 TFT_print((char *)"71+ ", LASTX, y);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
601 if (recipe.Whirlpool6)
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
602 TFT_print((char *)"60+ ", LASTX, y);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
603 if (recipe.Whirlpool2)
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
604 TFT_print((char *)"koud", LASTX, y);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
605 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
606
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
607 Buttons_Clear();
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
608 Buttons_Add( 0, 210, 45, 30, (char *)"Ok" , 0);
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
609 Buttons_Add( 46, 210, 45, 30, (char *)"+" , 1);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
610 if (r_CurrentRec != config.RecipeRec)
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
611 Buttons_Add( 92, 210, 45, 30, (char *)"-", 2);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
612 else
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
613 Buttons_Add( 92, 210, 45, 30, (char *)"" , 2);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
614 if (r_CurrentRec > 1)
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
615 Buttons_Add(138, 210, 45, 30, (char *)"<", 3);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
616 else
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
617 Buttons_Add(138, 210, 45, 30, (char *)"", 3);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
618 if (r_CurrentRec < r_Records)
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
619 Buttons_Add(184, 210, 45, 30, (char *)">", 4);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
620 else
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
621 Buttons_Add(184, 210, 45, 30, (char *)"", 4);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
622 if (r_CurrentRec != config.RecipeRec)
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
623 Buttons_Add(230, 210, 45, 30, (char *)"Std", 5);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
624 else
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
625 Buttons_Add(230, 210, 45, 30, (char *)"", 5);
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
626 Buttons_Add(276, 210, 45, 30, (char *)"Ed" , 6);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
627 Buttons[0].dark = true;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
628 Buttons_Show();
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
629 } /* if (r_UpdateRec) */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
630 switch (Buttons_Scan()) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
631 case 0: Main_Screen = MAIN_TOOLS;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
632 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
633
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
634 case 1: memset(&recipe, 0, sizeof(recipe)); // new recipe
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
635 for (i = 1; i < recipe_hdr.mashmax; i++)
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
636 recipe.MashStep[i].Type = 255;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
637 sprintf(recipe.Name, "Recept %d", r_Records + 1);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
638 sprintf(recipe.Code, "00%d", r_Records + 1);
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
639 sprintf(recipe.MashStep[0].Name, "Maischen");
16
d43b393a4461 Improved recipes import.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
640 recipe.MashStep[0].Type = MASHTYPE_INFUSION;
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
641 recipe.MashStep[0].Step_temp = recipe.MashStep[0].End_temp = 67.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
642 recipe.MashStep[0].Infuse_temp = 67.5;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
643 recipe.MashStep[0].Infuse_amount = 15.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
644 recipe.MashStep[0].Step_time = 75;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
645 recipe.MashStep[0].Ramp_time = 1;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
646 sprintf(recipe.MashStep[1].Name, "Mash-out");
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
647 recipe.MashStep[1].Type = MASHTYPE_TEMPERATURE;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
648 recipe.MashStep[1].Step_temp = recipe.MashStep[1].End_temp = 78.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
649 recipe.MashStep[1].Step_time = 10;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
650 recipe.MashStep[1].Ramp_time = 13;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
651 recipe.Mashsteps = 2;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
652 recipe.BoilTime = 60;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
653 recipe.Additions = 2;
16
d43b393a4461 Improved recipes import.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
654 sprintf(recipe.Addition[0].Name, "Bitterhop");
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
655 recipe.Addition[0].Time = 60;
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
656 recipe.Addition[0].Type = ADDITION_HOP_BOIL;
16
d43b393a4461 Improved recipes import.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
657 sprintf(recipe.Addition[1].Name, "Aromahop");
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
658 recipe.Addition[1].Time = 10;
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
659 recipe.Addition[1].Type = ADDITION_HOP_BOIL;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
660 recipe.CoolTemp = 20.0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
661 recipe.Whirlpool9 = 0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
662 recipe.Whirlpool7 = 0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
663 recipe.Whirlpool6 = 0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
664 recipe.Whirlpool2 = 0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
665 recipe.SpargeTemp = 85.0;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
666 append_recipe();
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
667 r_Records++;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
668 r_CurrentRec = r_Records;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
669 r_UpdateRec = true;
6
e84200edc852 Updated esp-ide. Removed VNC server corre encoding because no clients would use it. Enabled WiFi error logmessages. Write runtime record is now debug logging. Removed recipe.Record number, not usefull and was wrong too. Removed console print of json log data.
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
670 ESP_LOGI(TAG, "New recipe record %d", r_CurrentRec);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
671 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
672
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
673 case 2: if ((r_CurrentRec != config.RecipeRec) && (r_Records > 1)) {
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
674 _bg = TFT_BLACK;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
675 TFT_fillScreen(_bg);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
676 TFT_resetclipwin();
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
677 TopMessage((char *)"Recept verwijderen");
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
678 delete_recipe(r_CurrentRec);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
679 r_Records--;
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
680 if (r_CurrentRec >= r_Records)
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
681 r_CurrentRec = r_Records;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
682 r_UpdateRec = true;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
683 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
684 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
685
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
686 case 3: if (r_CurrentRec > 1) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
687 r_CurrentRec--;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
688 r_UpdateRec = true;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
689 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
690 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
691
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
692 case 4: if (r_CurrentRec < r_Records) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
693 r_CurrentRec++;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
694 r_UpdateRec = true;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
695 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
696 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
697
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
698 case 5: if (r_CurrentRec != config.RecipeRec) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
699 config.RecipeRec = r_CurrentRec;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
700 write_config();
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
701 r_UpdateRec = true;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
702 ESP_LOGI(TAG, "Recipe %d `%s' set as default", r_CurrentRec, recipe.Name);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
703 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
704 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
705
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
706 case 6: Main_Screen = MAIN_TOOLS_RECIPE_EDIT;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
707 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
708
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
709 default: break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
710 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
711 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
712
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
713 case MAIN_TOOLS_RECIPE_EDIT:
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
714 dst = (uint8_t*)&recipe;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
715 crc1 = crc32_le(0, dst, sizeof(recipe));
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
716
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
717 EditText((char *)"Naam", recipe.Name, 31);
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
718 EditText((char *)"Code", recipe.Code, 31);
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
719 EditUint8((char *)"Maisch stappen", &recipe.Mashsteps, 1, 6);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
720 for (i = 0; i < recipe.Mashsteps; i++) {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
721 int step = i + 1;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
722 if (i == (recipe.Mashsteps - 1)) {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
723 mintemp = 75.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
724 maxtemp = 80.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
725 } else {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
726 mintemp = 35.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
727 maxtemp = 74.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
728 }
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
729 if (recipe.MashStep[i].Type == 255) {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
730 // A new step, set default values.
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
731 recipe.MashStep[i].Type = MASHTYPE_TEMPERATURE;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
732 recipe.MashStep[i].Step_time = 20;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
733 if (i == 0) {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
734 recipe.MashStep[i].Type = MASHTYPE_INFUSION;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
735 recipe.MashStep[i].Step_temp = recipe.MashStep[i].End_temp = 62.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
736 recipe.MashStep[i].Infuse_temp = 62.5;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
737 recipe.MashStep[i].Infuse_amount = 15;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
738 recipe.MashStep[i].Ramp_time = 1;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
739 } else if (i == (recipe.Mashsteps - 1)) {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
740 recipe.MashStep[i].Step_temp = recipe.MashStep[i].End_temp = 78.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
741 recipe.MashStep[i].Step_time = 10;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
742 recipe.MashStep[i].Ramp_time = (int)(recipe.MashStep[i].Step_temp - recipe.MashStep[i - 1].Step_temp + 2);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
743 } else {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
744 recipe.MashStep[i].Step_temp = recipe.MashStep[i].End_temp = recipe.MashStep[i - 1].Step_temp + 2.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
745 recipe.MashStep[i].Ramp_time = (int)(recipe.MashStep[i].Step_temp - recipe.MashStep[i - 1].Step_temp + 2);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
746 }
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
747 }
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
748 sprintf(tmp, "Maisch stap %d naam", step);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
749 EditText(tmp, recipe.MashStep[i].Name, 31);
19
49e2960d4642 Implemented infusion mash.
Michiel Broek <mbroek@mbse.eu>
parents: 17
diff changeset
750 EditMashType(&recipe.MashStep[i].Type);
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
751 sprintf(tmp, "Maisch stap %d start temperatuur", step);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
752 EditFloat(tmp, &recipe.MashStep[i].Step_temp, mintemp, maxtemp, 2);
76
3ff381bfa469 Version 0.3.10 Updated the webui. The recipe mash infusiont temperature rounding from 0.25 to 0.0625 degrees.
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
753 // Round to 0.25 values
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
754 recipe.MashStep[i].Step_temp = ((int)(recipe.MashStep[i].Step_temp * 4)) / 4.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
755 sprintf(tmp, "Maisch stap %d eind temperatuur", step);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
756 EditFloat(tmp, &recipe.MashStep[i].End_temp, mintemp, maxtemp, 2);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
757 recipe.MashStep[i].End_temp = ((int)(recipe.MashStep[i].End_temp * 4)) / 4.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
758 sprintf(tmp, "Maisch stap %d rusttijd in minuten", step);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
759 EditUint16(tmp, &recipe.MashStep[i].Step_time, 1, 480);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
760 if (recipe.MashStep[i].Type == MASHTYPE_INFUSION) {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
761 sprintf(tmp, "Stap %d infusie temperatuur", step);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
762 EditFloat(tmp, &recipe.MashStep[i].Infuse_temp, 10, 99, 3);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
763 recipe.MashStep[i].Infuse_temp = ((int)(recipe.MashStep[i].Infuse_temp * 16)) / 16.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
764 sprintf(tmp, "Stap %d infusie volume", step);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
765 EditFloat(tmp, &recipe.MashStep[i].Infuse_amount, 0.5, 1000.0, 3);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
766 recipe.MashStep[i].Ramp_time = 2;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
767 } else if (recipe.MashStep[i].Type == MASHTYPE_DECOCTION) {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
768 recipe.MashStep[i].Infuse_temp = 0.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
769 recipe.MashStep[i].Ramp_time = 2;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
770 sprintf(tmp, "Stap %d decoctie volume", step);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
771 EditFloat(tmp, &recipe.MashStep[i].Infuse_amount, 0.5, 1000.0, 3);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
772 } else {
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
773 recipe.MashStep[i].Infuse_temp = recipe.MashStep[i].Infuse_amount = 0.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
774 sprintf(tmp, "Stap %d opwarm tijd", step);
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
775 EditUint16(tmp, &recipe.MashStep[i].Ramp_time, 1, 480);
19
49e2960d4642 Implemented infusion mash.
Michiel Broek <mbroek@mbse.eu>
parents: 17
diff changeset
776 }
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
777 }
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
778 for (i = recipe.Mashsteps; i < recipe_hdr.mashmax; i++) {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
779 recipe.MashStep[i].Type = 255;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
780 recipe.MashStep[i].Step_temp = recipe.MashStep[i].End_temp = recipe.MashStep[i].Infuse_temp = recipe.MashStep[i].Infuse_amount = 0.0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
781 recipe.MashStep[i].Step_time = recipe.MashStep[i].Ramp_time = 0;
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
782 recipe.MashStep[i].Name[0] = '\0';
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
783 }
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
784
75
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
785 EditUint16((char *)"Kook tijd in minuten", &recipe.BoilTime, 0, 480);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
786 if (recipe.BoilTime) {
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
787 EditUint8((char *)"Hop/kruiden toevoegingen", &recipe.Additions, 1, 10);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
788 for (uint8_t i = 0; i < recipe.Additions; i++) {
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
789 sprintf(tmp, "Toevoeging %d naam", i+1);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
790 if (strlen(recipe.Addition[i].Name) == 00) {
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
791 sprintf(recipe.Addition[i].Name, "Hop %d", (int)i+1);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
792 }
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
793 EditText(tmp, recipe.Addition[i].Name, 40);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
794 sprintf(tmp, "Toevoeging %d tijd", i+1);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
795 if (i == 0) {
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
796 EditUint16(tmp, &recipe.Addition[i].Time, 0, recipe.BoilTime);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
797 } else {
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
798 EditUint16(tmp, &recipe.Addition[i].Time, 0, recipe.Addition[i-1].Time - 1);
224851e81117 Version 0.3.9. Added no-boil handling. Fixed cooling temp during cooling to allow 45 degrees setpoint.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
799 }
121
30aca5888d2b Version 0.3.21. Changed HLT heatup speed calculation to 0.67 degrees/minute. Include the mash ramp times in the calculation for the initial temperature. With a combined HLT and MLT setup, the HLT preheat time is now much shorter. Fixed problems reading beerxml if there is an aroma hop. If the time was 0 or missing it was assumed to be a whirlpool hop. Now it's treated as flameout hop as it should be. Fixed sorting hop/misc additions, this could lead to missing ingredients warnings. The recipe cool temperature was treated as an integer value.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
800 recipe.Addition[i].Type = ADDITION_HOP_BOIL;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
801 }
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
802 } else {
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
803 recipe.Additions = 0;
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
804 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
805
70
d6838a268020 Version 0.3.7. The WiFi task uses the new event handlers. Cooling temperature top is now 45 instead of 30 degreees for pitching Kveik. One extra cosmetic message during OTA update.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
806 EditFloat((char *)"Koel temperatuur", &recipe.CoolTemp, 10, 45, 2);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
807 recipe.CoolTemp = ((int)(recipe.CoolTemp * 4)) / 4.0;
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
808 EditFloat((char *)"Spoelwater temperatuur", &recipe.SpargeTemp, 75, 98, 2);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
809 recipe.SpargeTemp = ((int)(recipe.SpargeTemp * 4)) / 4.0;
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
810 EditUint16((char *)"Whirlpool 88..100 graden, 0 = niet", &recipe.Whirlpool9, 0, 120);
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
811 EditUint16((char *)"Whirlpool 71..77 graden, 0 = niet", &recipe.Whirlpool7, 0, 120);
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
812 EditUint16((char *)"Whirlpool 60..66 graden, 0 = niet", &recipe.Whirlpool6, 0, 120);
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
813 EditUint16((char *)"Whirlpool koud, 0 = niet", &recipe.Whirlpool2, 0, 120);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
814
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
815 crc2 = crc32_le(0, dst, sizeof(recipe));
54
7b134c27fadb Upgraded esp-ide and compilers. Adjusted the sources for the new compiler warnings.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
816 if ((crc1 != crc2) && Confirm((char *)"Gewijzigd, opslaan?", (char *)"Ja", (char *)"Nee")) {
6
e84200edc852 Updated esp-ide. Removed VNC server corre encoding because no clients would use it. Enabled WiFi error logmessages. Write runtime record is now debug logging. Removed recipe.Record number, not usefull and was wrong too. Removed console print of json log data.
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
817 write_recipe(r_CurrentRec);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
818 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
819 Main_Screen = MAIN_TOOLS_RECIPE;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
820 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
821
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
822 default: break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
823 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
824 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
825
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
826

mercurial