19 |
19 |
20 |
20 |
21 void EditRecipe::exportBeerXML() |
21 void EditRecipe::exportBeerXML() |
22 { |
22 { |
23 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); |
23 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); |
24 const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" }); |
24 const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet", "Pellet" }); |
25 /* "Leaf Wet", "Cryo", "Extract" */ |
25 /* "Leaf Wet", "Cryo", "CO2 extract", "Iso extract" */ |
26 /* We use more hop forms then beerxml knows about, so we send known names */ |
26 /* We use more hop forms then beerxml knows about, so we send known names */ |
27 /* instead of what we internally use. */ |
27 /* instead of what we internally use. */ |
28 |
28 |
29 /* Note: Whirlpool hop is Aroma + time. Hop at flame-off is Aroma with time = 0. BeerXML is really stupid designed. */ |
29 /* Note: Whirlpool hop is Aroma + time. Hop at flame-off is Aroma with time = 0. BeerXML is really stupid designed. */ |
30 /* flame-off vv vv whirlpool hop */ |
30 /* flame-off vv vv whirlpool hop */ |
117 xmlWriter->writeTextElement("TYPE", g_hop_types[recipe->hops.at(i).type]); |
117 xmlWriter->writeTextElement("TYPE", g_hop_types[recipe->hops.at(i).type]); |
118 xmlWriter->writeTextElement("FORM", hop_forms[recipe->hops.at(i).form]); |
118 xmlWriter->writeTextElement("FORM", hop_forms[recipe->hops.at(i).form]); |
119 xmlWriter->writeTextElement("BETA", QString::number(recipe->hops.at(i).beta, 'f', 1)); |
119 xmlWriter->writeTextElement("BETA", QString::number(recipe->hops.at(i).beta, 'f', 1)); |
120 xmlWriter->writeTextElement("HSI", QString::number(recipe->hops.at(i).hsi, 'f', 1)); |
120 xmlWriter->writeTextElement("HSI", QString::number(recipe->hops.at(i).hsi, 'f', 1)); |
121 xmlWriter->writeTextElement("ORIGIN", recipe->hops.at(i).origin); |
121 xmlWriter->writeTextElement("ORIGIN", recipe->hops.at(i).origin); |
|
122 xmlWriter->writeTextElement("BMS_FORM", g_hop_forms[recipe->hops.at(i).form]); |
|
123 xmlWriter->writeTextElement("BMS_UTILISATION", QString::number(recipe->hops.at(i).utilisation, 'f', 4)); |
|
124 xmlWriter->writeTextElement("BMS_BU_FACTOR", QString::number(recipe->hops.at(i).bu_factor, 'f', 1)); |
122 xmlWriter->writeEndElement(); |
125 xmlWriter->writeEndElement(); |
123 } |
126 } |
124 xmlWriter->writeEndElement(); // HOPS |
127 xmlWriter->writeEndElement(); // HOPS |
125 |
128 |
126 xmlWriter->writeStartElement("FERMENTABLES"); |
129 xmlWriter->writeStartElement("FERMENTABLES"); |