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