mash/beerxml.h

changeset 538
6d139c21e22c
parent 537
4eebab50993e
child 539
300b5c4cd977
equal deleted inserted replaced
537:4eebab50993e 538:6d139c21e22c
1 #ifndef _BEERXML_H
2 #define _BEERXML_H
3
4
5 /*
6 * See http://www.beerxml.com/beerxml.htm for more information.
7 * This standard isn't perfect, but it works. Note that some
8 * fields are not well defined. Some precentages are safe if you
9 * declare them as float instead of intergers.
10 *
11 * The function parseBeerXML() reads the file and puts the
12 * contents in the following tree:
13 *
14 * recipes recipe hops hop
15 * hop
16 * fermentables fermentable
17 * fermentable
18 * yeasts yeast
19 * yeast
20 * miscs misc
21 * misc
22 * waters water
23 * water
24 * style
25 * mash mash_step
26 * mash_step
27 * equipment
28 * recipe hops hop
29 * and so on.
30 */
31
32 typedef struct _hop_rec {
33 struct _hop_rec *next;
34 char *name; /* Name of the hops */
35 int version; /* Should be 1 for this version of the standard */
36 float alpha; /* Percent alpha of hops */
37 float amount; /* Weight in Kilograms of the hops used. */
38 char *use; /* "Boil", "Dry Hop", "Mash", "First Wort" or "Aroma" */
39 float time; /* The time as measured in minutes. */
40 char *notes; /* Textual notes about the hops. */
41 char *type; /* "Bittering", "Aroma" or "Both" */
42 char *form; /* "Pellet", "Plug" or "Leaf" */
43 float beta; /* Hop beta percentage. */
44 float hsi; /* Hop Stability Index */
45 char *origin; /* Place of origin for the hops */
46 char *substitutes; /* Substitutes that can be used for this hops */
47 float humulene; /* Humulene level in percent. */
48 float caryophyllene; /* Caryophyllene level in percent. */
49 float cohumulone; /* Cohumulone level in percent */
50 float myrcene; /* Myrcene level in percent */
51 } hop_rec;
52
53 typedef struct _fermentable_rec {
54 struct _fermentable_rec *next;
55 char *name; /* Name */
56 int version; /* Record version */
57 char *type; /* "Grain", "Sugar", "Extract", "Dry Extract" or "Adjunct" */
58 char *notes; /* Notes */
59 float amount; /* Weight in KG */
60 float yield; /* Percent dry yield (fine grain) */
61 float color; /* The color of the item in Lovibond */
62 int add_after_boil; /* May be TRUE. */
63 char *origin; /* Country or place of origin */
64 char *supplier; /* Supplier of the grain/extract/sugar */
65 float coarse_fine_diff; /* Percent difference between the coarse grain yield and fine grain yield. */
66 float moisture; /* Percent moisture in the grain. */
67 float diastatic_power; /* The diastatic power of the grain */
68 float protein; /* The percent protein in the grain. */
69 float max_in_batch; /* The recommended maximum percentage */
70 int recommend_mash; /* TRUE if it is recommended to mash */
71 } fermentable_rec;
72
73 typedef struct _equipment_rec {
74 char *name; /* Name of the equipment profile */
75 int version; /* Version of the equipment record. */
76 float boil_size; /* The pre-boil volume used. */
77 float batch_size; /* The target volume of the batch. */
78 float tun_volume; /* Volume of the mash tun in liters. */
79 float tun_weight; /* Weight of the mash tun in kilograms. */
80 float tun_specific_heat; /* The specific heat of the mash tun. */
81 float top_up_water; /* The amount of top up water normally added. */
82 float trub_chiller_loss; /* The amount of wort normally lost. */
83 float evap_rate; /* Perc of wort lost to evaporation per hour. */
84 float boil_time; /* The normal amount of time one boils */
85 int calc_boil_volume; /* Flag denoting to calculate the boil size. */
86 float lauter_deadspace; /* Amount lost to the lauter tun. */
87 float top_up_kettle; /* Amount normally added to the boil */
88 float hop_utilization; /* Large batch hop utilization. */
89 char *notes; /* Notes associated with the equipment. */
90 } equipment_rec;
91
92 typedef struct _yeast_rec {
93 struct _yeast_rec *next;
94 char *name; /* Name of the yeast. */
95 int version; /* Version of the standard. */
96 char *type; /* “Ale”, “Lager”, “Wheat”, “Wine”, “Champagne” */
97 char *form; /* “Liquid”, “Dry”, “Slant” or “Culture” */
98 float amount; /* The amount of yeast, measured in liters. */
99 int amount_is_weight; /* TRUE if the amount measurement is a weight */
100 char *laboratory; /* The laboratory that produced the yeast. */
101 char *product_id; /* The manufacturer’s product ID label */
102 float min_temperature; /* The minimum recommended temperature */
103 float max_temperature; /* The maximum recommended temperature */
104 char *flocculation; /* “Low”, “Medium”, “High” or “Very High” */
105 float attenuation; /* Average attenuation for this yeast strain. */
106 char *notes; /* Notes on this yeast strain. */
107 char *best_for; /* Beerstyle this yeast is best suited for. */
108 int times_cultured; /* Number of times this yeast has been reused */
109 int max_reuse; /* Recommended maximum reuse times */
110 int add_to_secondary; /* Flag this yeast was added for a secondary */
111 } yeast_rec;
112
113 typedef struct _misc_rec {
114 struct _misc_rec *next;
115 char *name; /* Name of the misc item. */
116 int version; /* Version number of this element. */
117 char *type; /* “Spice”, “Fining”, “Water Agent”, “Herb”, “Flavor”, “Other” */
118 char *use; /* “Boil”, “Mash”, “Primary”, “Secondary”, “Bottling” */
119 float time; /* Time the misc was boiled, steeped, mashed, etc in minutes. */
120 float amount; /* Amount of item used. Liters or Weight */
121 int amount_is_weight; /* TRUE if amount is weight */
122 char *use_for; /* Desc. of what the ingredient is used for */
123 char *notes; /* Detailed notes on the item including usage. */
124 } misc_rec;
125
126 typedef struct _water_rec {
127 struct _water_rec *next;
128 char *name; /* Name of the water profile */
129 int version; /* Version of the water record. */
130 float amount; /* Volume of water to use in a recipe in liters */
131 float calcium; /* The amount of calcium (Ca) in ppm */
132 float bicarbonate; /* The amount of bicarbonate (HCO3) in ppm. */
133 float sulfate; /* The amount of Sulfate (SO4) in ppm. */
134 float chloride; /* The amount of Chloride (Cl) in ppm. */
135 float sodium; /* The amount of Sodium (Na) in ppm. */
136 float magnesium; /* The amount of Magnesium (Mg) in ppm. */
137 float ph; /* The PH of the water. */
138 char *notes; /* Notes about the water profile. */
139 } water_rec;
140
141 typedef struct _style_rec {
142 char *name; /* Name of the style profile */
143 char *category; /* Category that this style belongs to */
144 int version; /* Version of the style record. */
145 char *category_number; /* Number or identifier for this style category */
146 char *style_letter; /* The specific style number or subcategory */
147 char *style_guide; /* The name of the style guide */
148 char *type; /* “Lager”, “Ale”, “Mead”, “Wheat”, “Mixed” or “Cider” */
149 float og_min; /* Original gracity */
150 float og_max;
151 float fg_min; /* Final gravity */
152 float fg_max;
153 float ibu_min; /* Bitterness for this style as measured */
154 float ibu_max; /* in International Bitterness Units (IBUs) */
155 float color_min; /* The recommended color in SRM */
156 float color_max;
157 float carb_min; /* The recommended carbonation for this style */
158 float carb_max; /* in volumes of CO2 */
159 float abv_min; /* Alcohol by volume as a percentage. */
160 float abv_max;
161 char *notes; /* Description of the style, history */
162 char *profile; /* Flavor and aroma profile for this style */
163 char *ingredients; /* Suggested ingredients for this style */
164 char *examples; /* Example beers of this style. */
165 } style_rec;
166
167 typedef struct _mash_step {
168 struct _mash_step *next;
169 char *name; /* Name of this step */
170 int version; /* Record version */
171 char *type; /* “Infusion”, “Temperature” or “Decoction” */
172 float infuse_amount; /* Wateri vol. in liters to infuse in this step */
173 float infuse_temp; /* niet officieel - berekenen */
174 float step_temp; /* The target temperature for this step */
175 float end_temp; /* The final temperature you can expect */
176 float step_time; /* The number of minutes to spend */
177 float ramp_time; /* Time to achieve the desired step temperature */
178 float water_grain_ratio; /* niet officieel - berekenen */
179 float decotion_amt; /* niet officieel */
180 } mash_step;
181
182 typedef struct _mash_profile {
183 char *name; /* Name of mash method */
184 int version; /* Record version */
185 char *notes; /* Additional notes */
186 float grain_temp; /* The temperature of the grain */
187 mash_step *mash_steps; /* List of mash steps */
188 float tun_temp; /* Grain tun temperature */
189 float sparge_temp; /* Temperature of the sparge water */
190 float ph; /* PH of the sparge. */
191 float tun_weight; /* Weight of the mash tun in kilograms */
192 float tun_specific_heat; /* Specific heat of the tun material */
193 int equip_adjust; /* Adjust for tun heat loss */
194 } mash_profile;
195
196 typedef struct _brew_equipment {
197 char *name; /* Name of the equipment profile */
198 float boil_size; /* The pre-boil volume for this equipment setup */
199 float batch_size; /* The target volume of the batch */
200 float tun_volume; /* Volume of the mash tun in liters. */
201 float tun_weight; /* Weight of the mash tun in kilograms. */
202 float tun_specific_heat; /* The specific heat of the mash tun. */
203 float top_up_water; /* The amount of top up water b4 fermenting */
204 float trub_chiller_loss; /* Amount of wort lost during cooling */
205 float evap_rate; /* Perc of wort lost to evaporation per hour. */
206 float boil_time; /* The normal amount of boil time for this eq. */
207 int calc_boil_volume; /* Should the program calculate the boil size. */
208 float lauter_dead_space; /* Amount lost to the lauter tun. */
209 float top_up_kettle; /* Amount added to the boil kettle b4 the boil. */
210 float hop_utilization; /* Large batch hop utilization. */
211 char *notes; /* Notes for this equipment. */
212 } brew_equipment;
213
214 typedef struct _recipe_rec {
215 struct _recipe_rec *next;
216 int version; /* Current version is 1 */
217 char *name; /* Name of the recipe */
218 char *type; /* “Extract”, “Partial Mash” or “All Grain” */
219 style_rec *style; /* style record */
220 equipment_rec *equipment; /* equipemnt record */
221 char *brewer; /* Name of the brewer */
222 char *asst_brewer; /* Name of the assistent brewer */
223 float batch_size; /* Target size of the finished batch in liters. */
224 float boil_size; /* Starting size for the main boil in liters */
225 float boil_time; /* The total time to boil the wort in minutes. */
226 float efficiency; /* The percent brewhouse efficiency */
227 hop_rec *hops; /* hops */
228 fermentable_rec *fermentables; /* Fermentables list */
229 misc_rec *miscs; /* Misc ingredients */
230 yeast_rec *yeasts; /* Yeasts */
231 water_rec *waters; /* Water profiles */
232 mash_profile *mash; /* Mash profile */
233 char *notes; /* Notes associated with this recipe */
234 char *taste_notes; /* Tasting notes – may be multiline. */
235 float taste_rating; /* Number between zero and 50.0 (BJCP system) */
236 float og; /* The measured original specific gravity. */
237 float fg; /* The measured final gravity of the beer. */
238 int fermentation_stages; /* The number of fermentation stages used */
239 int primary_age; /* Time spent in the primary in days */
240 float primary_temp; /* Temp in Celsius for the primary fermentation */
241 int secondary_age; /* Time spent in the secondary in days. */
242 float secondary_temp; /* Temp in C for the secondary fermentation. */
243 int tertiary_age; /* Time spent in the third fermenter in days. */
244 float tertiary_temp; /* Temperature in the tertiary fermenter. */
245 int age; /* Time to age the beer in days after bottling. */
246 float age_temp; /* Temperature for aging after bottling. */
247 char *date; /* Date brewed in a easily recognizable format. */
248 float carbonation; /* Volume of CO2 used to carbonate this beer. */
249 int forced_carbonation; /* TRUE if forced carbonated using CO2 pressure */
250 char *priming_sugar_name; /* Text describing the priming agent. */
251 float carbonation_temp; /* Temp for either bottling/forced carbonation. */
252 float priming_sugar_equiv; /* Factor used to convert this priming agent */
253 float keg_priming_factor; /* Used 2 factor amount of sugar for containers */
254 } recipe_rec;
255
256
257 int parseBeerXML(char *);
258 void printBeerXML(void);
259
260
261 #endif
262

mercurial