src/EditProductExport.cpp

changeset 302
2e8462219332
parent 301
fe6346211b5b
child 304
aa8d421bfc24
equal deleted inserted replaced
301:fe6346211b5b 302:2e8462219332
20 20
21 void EditProduct::exportBeerXML() 21 void EditProduct::exportBeerXML()
22 { 22 {
23 qDebug() << "export"; 23 qDebug() << "export";
24 24
25 const QStringList styletype({ "Lager", "Ale", "Mead", "Wheat", "Mixed", "Cider" });
26 const QStringList producttypes({ "Extract", "Partial Mash", "All Grain" });
27 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); 25 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" });
28 const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); 26 const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" });
29 const QStringList hop_types({ "Bittering", "Aroma", "Both" });
30 const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" }); 27 const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" });
31 /* "Leaf Wet", "Cryo", "Extract" */ 28 /* "Leaf Wet", "Cryo", "Extract" */
32 /* We use more hop forms then beerxml knows about, so we send known names */ 29 /* We use more hop forms then beerxml knows about, so we send known names */
33 /* instead of what we internally use. */ 30 /* instead of what we internally use. */
34 const QStringList hop_use({ "Mash", "First wort", "Boil", "Aroma", "Whirlpool", "Dry hop", "Dry hop" }); // tetra == dry-hop :( 31 const QStringList hop_use({ "Mash", "First wort", "Boil", "Aroma", "Whirlpool", "Dry hop", "Dry hop" }); // tetra == dry-hop :(
35 const QStringList fermentable_type({ "Grain", "Sugar", "Extract", "Dry extract", "Adjunct" });
36 const QStringList fermentable_graintype({ "Base", "Roast", "Crystal", "Kilned", "Sour malt", "Special", "No malt" });
37 const QStringList yeast_type({ "Lager", "Ale", "Wheat", "Wine", "Champagne", "Other", "Other", "Other", "Other", "Other" }); 32 const QStringList yeast_type({ "Lager", "Ale", "Wheat", "Wine", "Champagne", "Other", "Other", "Other", "Other", "Other" });
38 const QStringList yeast_form({ "Liquid", "Dry", "Slant", "Culture", "Frozen", "Bottle", "Dry" }); 33 const QStringList yeast_form({ "Liquid", "Dry", "Slant", "Culture", "Frozen", "Bottle", "Dry" });
39 const QStringList yeast_use({ "Primary", "Secondary", "Tertiary", "Bottle" });
40 const QStringList misc_type({ "Spice", "Herb", "Flavor", "Fining", "Water agent", "Yeast nutrient", "Other" });
41 const QStringList misc_use({ "Starter", "Mash", "Boil", "Primary", "Secondary", "Bottling" });
42 const QStringList step_type({ "Infusion", "Temperature", "Decoction" });
43 34
44 QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), 35 QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),
45 QDir::homePath() + "/" + product->code + " " + product->name + ".xml", tr("Files (*.xml)")); 36 QDir::homePath() + "/" + product->code + " " + product->name + ".xml", tr("Files (*.xml)"));
46 if (fileName == 0) { 37 if (fileName == 0) {
47 QMessageBox::warning(this, tr("Save File"), tr("No XML file selected.")); 38 QMessageBox::warning(this, tr("Save File"), tr("No XML file selected."));
63 */ 54 */
64 xmlWriter->writeTextElement("VERSION", "1"); 55 xmlWriter->writeTextElement("VERSION", "1");
65 xmlWriter->writeTextElement("NAME", product->name); 56 xmlWriter->writeTextElement("NAME", product->name);
66 if (product->notes != "") 57 if (product->notes != "")
67 xmlWriter->writeTextElement("NOTES", product->notes); 58 xmlWriter->writeTextElement("NOTES", product->notes);
68 xmlWriter->writeTextElement("TYPE", producttypes[product->type]); 59 xmlWriter->writeTextElement("TYPE", g_recipe_types[product->type]);
69 xmlWriter->writeTextElement("BREWER", "Anonymous"); 60 xmlWriter->writeTextElement("BREWER", "Anonymous");
70 xmlWriter->writeTextElement("BATCH_SIZE", QString::number(product->batch_size, 'f', 4)); 61 xmlWriter->writeTextElement("BATCH_SIZE", QString::number(product->batch_size, 'f', 4));
71 xmlWriter->writeTextElement("BOIL_SIZE", QString::number(product->boil_size, 'f', 4)); 62 xmlWriter->writeTextElement("BOIL_SIZE", QString::number(product->boil_size, 'f', 4));
72 xmlWriter->writeTextElement("BOIL_TIME", QString::number(product->boil_time, 'f', 3)); 63 xmlWriter->writeTextElement("BOIL_TIME", QString::number(product->boil_time, 'f', 3));
73 xmlWriter->writeTextElement("EFFICIENCY", QString::number(product->efficiency, 'f', 4)); 64 xmlWriter->writeTextElement("EFFICIENCY", QString::number(product->efficiency, 'f', 4));
94 xmlWriter->writeTextElement("NAME", product->st_name); 85 xmlWriter->writeTextElement("NAME", product->st_name);
95 xmlWriter->writeTextElement("CATEGORY", product->st_category); 86 xmlWriter->writeTextElement("CATEGORY", product->st_category);
96 xmlWriter->writeTextElement("CATEGORY_NUMBER", QString::number(product->st_category_number, 'f', 0)); 87 xmlWriter->writeTextElement("CATEGORY_NUMBER", QString::number(product->st_category_number, 'f', 0));
97 xmlWriter->writeTextElement("STYLE_LETTER", product->st_letter); 88 xmlWriter->writeTextElement("STYLE_LETTER", product->st_letter);
98 xmlWriter->writeTextElement("STYLE_GUIDE", product->st_guide); 89 xmlWriter->writeTextElement("STYLE_GUIDE", product->st_guide);
99 xmlWriter->writeTextElement("TYPE", styletype[product->st_type]); 90 xmlWriter->writeTextElement("TYPE", g_style_types[product->st_type]);
100 xmlWriter->writeTextElement("OG_MIN", QString::number(product->st_og_min, 'f', 3)); 91 xmlWriter->writeTextElement("OG_MIN", QString::number(product->st_og_min, 'f', 3));
101 xmlWriter->writeTextElement("OG_MAX", QString::number(product->st_og_max, 'f', 3)); 92 xmlWriter->writeTextElement("OG_MAX", QString::number(product->st_og_max, 'f', 3));
102 xmlWriter->writeTextElement("FG_MIN", QString::number(product->st_fg_min, 'f', 3)); 93 xmlWriter->writeTextElement("FG_MIN", QString::number(product->st_fg_min, 'f', 3));
103 xmlWriter->writeTextElement("FG_MAX", QString::number(product->st_fg_max, 'f', 3)); 94 xmlWriter->writeTextElement("FG_MAX", QString::number(product->st_fg_max, 'f', 3));
104 xmlWriter->writeTextElement("IBU_MIN", QString::number(product->st_ibu_min, 'f', 0)); 95 xmlWriter->writeTextElement("IBU_MIN", QString::number(product->st_ibu_min, 'f', 0));
127 xmlWriter->writeTextElement("NAME", product->hops.at(i).name); 118 xmlWriter->writeTextElement("NAME", product->hops.at(i).name);
128 xmlWriter->writeTextElement("ALPHA", QString::number(product->hops.at(i).alpha, 'f', 1)); 119 xmlWriter->writeTextElement("ALPHA", QString::number(product->hops.at(i).alpha, 'f', 1));
129 xmlWriter->writeTextElement("AMOUNT", QString::number(product->hops.at(i).amount, 'f', 4)); 120 xmlWriter->writeTextElement("AMOUNT", QString::number(product->hops.at(i).amount, 'f', 4));
130 xmlWriter->writeTextElement("USE", hop_use[product->hops.at(i).useat]); 121 xmlWriter->writeTextElement("USE", hop_use[product->hops.at(i).useat]);
131 xmlWriter->writeTextElement("TIME", QString::number(product->hops.at(i).time, 'f', 0)); 122 xmlWriter->writeTextElement("TIME", QString::number(product->hops.at(i).time, 'f', 0));
132 xmlWriter->writeTextElement("TYPE", hop_types[product->hops.at(i).type]); 123 xmlWriter->writeTextElement("TYPE", g_hop_types[product->hops.at(i).type]);
133 xmlWriter->writeTextElement("FORM", hop_forms[product->hops.at(i).form]); 124 xmlWriter->writeTextElement("FORM", hop_forms[product->hops.at(i).form]);
134 xmlWriter->writeTextElement("BETA", QString::number(product->hops.at(i).beta, 'f', 1)); 125 xmlWriter->writeTextElement("BETA", QString::number(product->hops.at(i).beta, 'f', 1));
135 xmlWriter->writeTextElement("HSI", QString::number(product->hops.at(i).hsi, 'f', 1)); 126 xmlWriter->writeTextElement("HSI", QString::number(product->hops.at(i).hsi, 'f', 1));
136 xmlWriter->writeTextElement("ORIGIN", product->hops.at(i).origin); 127 xmlWriter->writeTextElement("ORIGIN", product->hops.at(i).origin);
137 xmlWriter->writeEndElement(); 128 xmlWriter->writeEndElement();
142 for (int i = 0; i < product->fermentables.size(); i++) { 133 for (int i = 0; i < product->fermentables.size(); i++) {
143 if (product->fermentables.at(i).added < FERMENTABLE_ADDED_BOTTLE) { 134 if (product->fermentables.at(i).added < FERMENTABLE_ADDED_BOTTLE) {
144 xmlWriter->writeStartElement("FERMENTABLE"); 135 xmlWriter->writeStartElement("FERMENTABLE");
145 xmlWriter->writeTextElement("VERSION", "1"); 136 xmlWriter->writeTextElement("VERSION", "1");
146 xmlWriter->writeTextElement("NAME", product->fermentables.at(i).name); 137 xmlWriter->writeTextElement("NAME", product->fermentables.at(i).name);
147 xmlWriter->writeTextElement("TYPE", fermentable_type[product->fermentables.at(i).type]); 138 xmlWriter->writeTextElement("TYPE", g_fermentable_types[product->fermentables.at(i).type]);
148 xmlWriter->writeTextElement("AMOUNT", QString::number(product->fermentables.at(i).amount, 'f', 4)); 139 xmlWriter->writeTextElement("AMOUNT", QString::number(product->fermentables.at(i).amount, 'f', 4));
149 xmlWriter->writeTextElement("YIELD", QString::number(product->fermentables.at(i).yield, 'f', 1)); 140 xmlWriter->writeTextElement("YIELD", QString::number(product->fermentables.at(i).yield, 'f', 1));
150 xmlWriter->writeTextElement("COLOR", QString::number(Utils::ebc_to_srm(product->fermentables.at(i).color), 'f', 1)); 141 xmlWriter->writeTextElement("COLOR", QString::number(Utils::ebc_to_srm(product->fermentables.at(i).color), 'f', 1));
151 xmlWriter->writeTextElement("ADD_AFTER_BOIL", product->fermentables.at(i).add_after_boil ? "TRUE":"FALSE"); 142 xmlWriter->writeTextElement("ADD_AFTER_BOIL", product->fermentables.at(i).add_after_boil ? "TRUE":"FALSE");
152 xmlWriter->writeTextElement("ORIGIN", product->fermentables.at(i).origin); 143 xmlWriter->writeTextElement("ORIGIN", product->fermentables.at(i).origin);
160 if (product->fermentables.at(i).protein) 151 if (product->fermentables.at(i).protein)
161 xmlWriter->writeTextElement("PROTEIN", QString::number(product->fermentables.at(i).protein, 'f', 4)); 152 xmlWriter->writeTextElement("PROTEIN", QString::number(product->fermentables.at(i).protein, 'f', 4));
162 if (product->fermentables.at(i).max_in_batch) 153 if (product->fermentables.at(i).max_in_batch)
163 xmlWriter->writeTextElement("MAX_IN_BATCH", QString::number(product->fermentables.at(i).max_in_batch, 'f', 1)); 154 xmlWriter->writeTextElement("MAX_IN_BATCH", QString::number(product->fermentables.at(i).max_in_batch, 'f', 1));
164 xmlWriter->writeTextElement("RECOMMEND_MASH", product->fermentables.at(i).recommend_mash ? "TRUE":"FALSE"); 155 xmlWriter->writeTextElement("RECOMMEND_MASH", product->fermentables.at(i).recommend_mash ? "TRUE":"FALSE");
165 xmlWriter->writeTextElement("GRAINTYPE", fermentable_graintype[product->fermentables.at(i).graintype]); 156 xmlWriter->writeTextElement("GRAINTYPE", g_fermentable_graintypes[product->fermentables.at(i).graintype]);
166 xmlWriter->writeEndElement(); 157 xmlWriter->writeEndElement();
167 } 158 }
168 } 159 }
169 xmlWriter->writeEndElement(); // FERMENTABLES 160 xmlWriter->writeEndElement(); // FERMENTABLES
170 161
171 xmlWriter->writeStartElement("MISCS"); 162 xmlWriter->writeStartElement("MISCS");
172 for (int i = 0; i < product->miscs.size(); i++) { 163 for (int i = 0; i < product->miscs.size(); i++) {
173 xmlWriter->writeStartElement("MISC"); 164 xmlWriter->writeStartElement("MISC");
174 xmlWriter->writeTextElement("VERSION", "1"); 165 xmlWriter->writeTextElement("VERSION", "1");
175 xmlWriter->writeTextElement("NAME", product->miscs.at(i).name); 166 xmlWriter->writeTextElement("NAME", product->miscs.at(i).name);
176 xmlWriter->writeTextElement("TYPE", misc_type[product->miscs.at(i).type]); 167 xmlWriter->writeTextElement("TYPE", g_misc_types[product->miscs.at(i).type]);
177 xmlWriter->writeTextElement("AMOUNT", QString::number(product->miscs.at(i).amount, 'f', 5)); 168 xmlWriter->writeTextElement("AMOUNT", QString::number(product->miscs.at(i).amount, 'f', 5));
178 xmlWriter->writeTextElement("AMOUNT_IS_WEIGHT", product->miscs.at(i).amount_is_weight ? "TRUE":"FALSE"); 169 xmlWriter->writeTextElement("AMOUNT_IS_WEIGHT", product->miscs.at(i).amount_is_weight ? "TRUE":"FALSE");
179 xmlWriter->writeTextElement("USE", misc_use[product->miscs.at(i).use_use]); 170 xmlWriter->writeTextElement("USE", g_misc_uses[product->miscs.at(i).use_use]);
180 xmlWriter->writeTextElement("TIME", QString::number(product->miscs.at(i).time, 'f', 0)); 171 xmlWriter->writeTextElement("TIME", QString::number(product->miscs.at(i).time, 'f', 0));
181 xmlWriter->writeEndElement(); 172 xmlWriter->writeEndElement();
182 } 173 }
183 xmlWriter->writeEndElement(); // MISCS 174 xmlWriter->writeEndElement(); // MISCS
184 175
243 xmlWriter->writeStartElement("MASH_STEPS"); 234 xmlWriter->writeStartElement("MASH_STEPS");
244 for (int i = 0; i < product->mashs.size(); i++) { 235 for (int i = 0; i < product->mashs.size(); i++) {
245 xmlWriter->writeStartElement("MASH_STEP"); 236 xmlWriter->writeStartElement("MASH_STEP");
246 xmlWriter->writeTextElement("VERSION", "1"); 237 xmlWriter->writeTextElement("VERSION", "1");
247 xmlWriter->writeTextElement("NAME", product->mashs.at(i).step_name); 238 xmlWriter->writeTextElement("NAME", product->mashs.at(i).step_name);
248 xmlWriter->writeTextElement("TYPE", step_type[product->mashs.at(i).step_type]); 239 xmlWriter->writeTextElement("TYPE", g_step_types[product->mashs.at(i).step_type]);
249 if (product->mashs.at(i).step_type == 0) { 240 if (product->mashs.at(i).step_type == 0) {
250 xmlWriter->writeTextElement("INFUSE_AMOUNT", QString::number(product->mashs.at(i).step_infuse_amount, 'f', 3)); 241 xmlWriter->writeTextElement("INFUSE_AMOUNT", QString::number(product->mashs.at(i).step_infuse_amount, 'f', 3));
251 xmlWriter->writeTextElement("INFUSE_TEMP", QString::number(product->mashs.at(i).step_infuse_temp, 'f', 3)); 242 xmlWriter->writeTextElement("INFUSE_TEMP", QString::number(product->mashs.at(i).step_infuse_temp, 'f', 3));
252 } 243 }
253 if (product->mashs.at(i).step_type == 2) { 244 if (product->mashs.at(i).step_type == 2) {
423 } 414 }
424 415
425 416
426 void EditProduct::toforumProduct() 417 void EditProduct::toforumProduct()
427 { 418 {
428 const QStringList recipetypes({ "Extract", "Partial Mash", "All Grain" });
429 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); 419 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" });
430 const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); 420 const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" });
431 const QStringList fermentable_added({ "Maischen", "Koken", "Hoofd/nagisting", "Lageren", "Bottelen", "Fusten" });
432 const QStringList hop_forms({ "Pellet", "Plug", "Bloemen", "Verse hop", "Cryo", "Extract" });
433 const QStringList hop_use({ "Maischen", "First wort", "Koken", "Vlamuit", "Whirlpool", "Drooghop", "Bottelen" });
434 const QStringList misc_type({ "Spice", "Herb", "Smaakstof", "Klaren", "Brouwzout", "Gist voeding", "Overig" });
435 const QStringList misc_use({ "Starter", "Maischen", "Koken", "Hoofdgisting", "Nagisting", "Bottelen" });
436 const QStringList yeast_form({ "Vloeibaar", "Droog", "Schuine buis", "Opkweek", "Ingevroren", "Flesbodem", "Gedroogd" });
437 const QStringList yeast_use({ "Hoofdgisting", "Nagisting", "Lageren", "Bottelen", "Fusten" });
438 const QStringList step_type({ "Infusie", "Verwarmen", "Decoctie" });
439 421
440 QString memo = QString("[u][b]BMSapp v"); 422 QString memo = QString("[u][b]BMSapp v");
441 memo.append(VERSIONSTRING); // For some stupid reason this must be on it's own. 423 memo.append(VERSIONSTRING); // For some stupid reason this must be on it's own.
442 memo.append(" - Datum export: " + QDate::currentDate().toString("dd-MMM-yyyy") + "[/b][/u]\n\n\n"); 424 memo.append(" - Datum export: " + QDate::currentDate().toString("dd-MMM-yyyy") + "[/b][/u]\n\n\n");
443 memo.append("[u][b]Basis[/b][/u]\n[tabular]\n"); 425 memo.append("[u][b]Basis[/b][/u]\n[tabular]\n");
444 memo.append("[head]Omschrijving[/head][head]Waarde[/head]\n"); 426 memo.append("[head]Omschrijving[/head][head]Waarde[/head]\n");
445 memo.append("[row][data]Bier naam[/data][data]" + product->name + "[/data][/row]\n"); 427 memo.append("[row][data]Bier naam[/data][data]" + product->name + "[/data][/row]\n");
446 memo.append("[row][data]Bier stijl[/data][data]" + product->st_name + "[/data][/row]\n"); 428 memo.append("[row][data]Bier stijl[/data][data]" + product->st_name + "[/data][/row]\n");
447 memo.append("[row][data]Recept type[/data][data]" + recipetypes[product->type] + "[/data][/row]\n"); 429 memo.append("[row][data]Recept type[/data][data]" + QCoreApplication::translate("RecipeType", g_recipe_types[product->type]) + "[/data][/row]\n");
448 memo.append("[row][data]Batch grootte[/data][data]" + QString::number(product->batch_size, 'f', 1) + " L[/data][/row]\n"); 430 memo.append("[row][data]Batch grootte[/data][data]" + QString::number(product->batch_size, 'f', 1) + " L[/data][/row]\n");
449 memo.append("[row][data]Kooktijd[/data][data]" + QString::number(product->boil_time, 'f', 0) + " minuten[/data][/row]\n"); 431 memo.append("[row][data]Kooktijd[/data][data]" + QString::number(product->boil_time, 'f', 0) + " minuten[/data][/row]\n");
450 memo.append("[row][data]Brouwzaal rendement[/data][data]" + QString::number(product->efficiency, 'f', 1) + "%[/data][/row]\n"); 432 memo.append("[row][data]Brouwzaal rendement[/data][data]" + QString::number(product->efficiency, 'f', 1) + "%[/data][/row]\n");
451 memo.append("[row][data]Geschatte begin densiteit[/data][data]" + QString::number(product->est_og, 'f', 3) + " SG[/data][/row]\n"); 433 memo.append("[row][data]Geschatte begin densiteit[/data][data]" + QString::number(product->est_og, 'f', 3) + " SG[/data][/row]\n");
452 memo.append("[row][data]Geschatte eind densiteit[/data][data]" + QString::number(product->est_fg, 'f', 3) + " SG[/data][/row]\n"); 434 memo.append("[row][data]Geschatte eind densiteit[/data][data]" + QString::number(product->est_fg, 'f', 3) + " SG[/data][/row]\n");
461 for (int i = 0; i < product->fermentables.size(); i++) { 443 for (int i = 0; i < product->fermentables.size(); i++) {
462 memo.append("[row][data]" + product->fermentables.at(i).name + " (" + product->fermentables.at(i).supplier + ")[/data]"); 444 memo.append("[row][data]" + product->fermentables.at(i).name + " (" + product->fermentables.at(i).supplier + ")[/data]");
463 memo.append("[data]" + QString::number(product->fermentables.at(i).color) + "[/data]"); 445 memo.append("[data]" + QString::number(product->fermentables.at(i).color) + "[/data]");
464 memo.append("[data]" + QString::number(product->fermentables.at(i).amount, 'f', 3) + "[/data]"); 446 memo.append("[data]" + QString::number(product->fermentables.at(i).amount, 'f', 3) + "[/data]");
465 memo.append("[data]" + QString::number(product->fermentables.at(i).percentage, 'f', 1) + "[/data]"); 447 memo.append("[data]" + QString::number(product->fermentables.at(i).percentage, 'f', 1) + "[/data]");
466 memo.append("[data]" + fermentable_added[product->fermentables.at(i).added] + "[/data][/row]\n"); 448 memo.append("[data]" + QCoreApplication::translate("FermentableAdded", g_fermentable_added[product->fermentables.at(i).added]) + "[/data][/row]\n");
467 } 449 }
468 memo.append("[/tabular]\n\n"); 450 memo.append("[/tabular]\n\n");
469 451
470 memo.append("[u][b]Hop[/b][/u]\n"); 452 memo.append("[u][b]Hop[/b][/u]\n");
471 memo.append("[tabular]\n"); 453 memo.append("[tabular]\n");
473 for (int i = 0; i < product->hops.size(); i++) { 455 for (int i = 0; i < product->hops.size(); i++) {
474 double ibu = Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, product->batch_size, 456 double ibu = Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, product->batch_size,
475 product->hops.at(i).amount, product->hops.at(i).time, product->hops.at(i).alpha, product->ibu_method, 457 product->hops.at(i).amount, product->hops.at(i).time, product->hops.at(i).alpha, product->ibu_method,
476 product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time); 458 product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time);
477 memo.append("[row][data]" + product->hops.at(i).name + " (" + product->hops.at(i).origin + ")[/data]"); 459 memo.append("[row][data]" + product->hops.at(i).name + " (" + product->hops.at(i).origin + ")[/data]");
478 memo.append("[data]" + hop_forms[product->hops.at(i).form] + "[/data]"); 460 memo.append("[data]" + QCoreApplication::translate("HopForm", g_hop_forms[product->hops.at(i).form]) + "[/data]");
479 memo.append("[data]" + QString::number(product->hops.at(i).alpha, 'f', 1) + "[/data]"); 461 memo.append("[data]" + QString::number(product->hops.at(i).alpha, 'f', 1) + "[/data]");
480 memo.append("[data]" + QString::number(ibu, 'f', 1) + "[/data]"); 462 memo.append("[data]" + QString::number(ibu, 'f', 1) + "[/data]");
481 memo.append("[data]" + QString::number(product->hops.at(i).amount * 1000, 'f', 2) + "[/data]"); 463 memo.append("[data]" + QString::number(product->hops.at(i).amount * 1000, 'f', 2) + "[/data]");
482 if (product->hops.at(i).useat == HOP_USEAT_BOIL || product->hops.at(i).useat == HOP_USEAT_WHIRLPOOL) 464 if (product->hops.at(i).useat == HOP_USEAT_BOIL || product->hops.at(i).useat == HOP_USEAT_WHIRLPOOL)
483 memo.append("[data]" + hop_use[product->hops.at(i).useat] + " " + QString::number(product->hops.at(i).time) + " minuten[/data][/row]\n"); 465 memo.append("[data]" + QCoreApplication::translate("HopUse", g_hop_useat[product->hops.at(i).useat]) + " " + QString::number(product->hops.at(i).time) + " minuten[/data][/row]\n");
484 else if (product->hops.at(i).useat == HOP_USEAT_DRY_HOP) 466 else if (product->hops.at(i).useat == HOP_USEAT_DRY_HOP)
485 memo.append("[data]" + hop_use[product->hops.at(i).useat] + " " + QString::number(product->hops.at(i).time / 1440) + " dagen[/data][/row]\n"); 467 memo.append("[data]" + QCoreApplication::translate("HopUse", g_hop_useat[product->hops.at(i).useat]) + " " + QString::number(product->hops.at(i).time / 1440) + " dagen[/data][/row]\n");
486 else 468 else
487 memo.append("[data]" + hop_use[product->hops.at(i).useat] + "[/data][/row]\n"); 469 memo.append("[data]" + QCoreApplication::translate("HopUse", g_hop_useat[product->hops.at(i).useat]) + "[/data][/row]\n");
488 } 470 }
489 memo.append("[/tabular]\n\n"); 471 memo.append("[/tabular]\n\n");
490 472
491 memo.append("[u][b]Diversen[/b][/u]\n"); 473 memo.append("[u][b]Diversen[/b][/u]\n");
492 memo.append("[tabular]\n"); 474 memo.append("[tabular]\n");
493 memo.append("[head]Specerij, kruid, brouwzout[/head][head]Type grondstof[/head][head]Gebruik tijdens[/head][head]Hoeveel[/head]\n"); 475 memo.append("[head]Specerij, kruid, brouwzout[/head][head]Type grondstof[/head][head]Gebruik tijdens[/head][head]Hoeveel[/head]\n");
494 for (int i = 0; i < product->miscs.size(); i++) { 476 for (int i = 0; i < product->miscs.size(); i++) {
495 memo.append("[row][data]" + product->miscs.at(i).name + "[/data]"); 477 memo.append("[row][data]" + product->miscs.at(i).name + "[/data]");
496 memo.append("[data]" + misc_type[product->miscs.at(i).type] + "[/data]"); 478 memo.append("[data]" + QCoreApplication::translate("MiscType", g_misc_types[product->miscs.at(i).type]) + "[/data]");
497 if (product->miscs.at(i).use_use == MISC_USES_BOIL) 479 if (product->miscs.at(i).use_use == MISC_USES_BOIL)
498 memo.append("[data]" + misc_use[product->miscs.at(i).use_use] + " " + QString::number(product->miscs.at(i).time) + " min[/data]"); 480 memo.append("[data]" + QCoreApplication::translate("MiscUse", g_misc_uses[product->miscs.at(i).use_use]) + " " + QString::number(product->miscs.at(i).time) + " min[/data]");
499 else 481 else
500 memo.append("[data]" + misc_use[product->miscs.at(i).use_use] + "[/data]"); 482 memo.append("[data]" + QCoreApplication::translate("MiscUse", g_misc_uses[product->miscs.at(i).use_use]) + "[/data]");
501 memo.append("[data]"+QString::number(product->miscs.at(i).amount * 1000, 'f', 2)+((product->miscs.at(i).amount_is_weight)?" gr":" ml")+"[/data][/row]\n"); 483 memo.append("[data]"+QString::number(product->miscs.at(i).amount * 1000, 'f', 2)+((product->miscs.at(i).amount_is_weight)?" gr":" ml")+"[/data][/row]\n");
502 } 484 }
503 memo.append("[/tabular]\n\n"); 485 memo.append("[/tabular]\n\n");
504 486
505 memo.append("[u][b]Gist[/b][/u]\n"); 487 memo.append("[u][b]Gist[/b][/u]\n");
506 memo.append("[tabular]\n"); 488 memo.append("[tabular]\n");
507 memo.append("[head]Gistlab en code[/head][head]Omschrijving[/head][head]Gebruik[/head][head]Vorm[/head][head]Hoeveel[/head]\n"); 489 memo.append("[head]Gistlab en code[/head][head]Omschrijving[/head][head]Gebruik[/head][head]Vorm[/head][head]Hoeveel[/head]\n");
508 for (int i = 0; i < product->yeasts.size(); i++) { 490 for (int i = 0; i < product->yeasts.size(); i++) {
509 memo.append("[row][data]" + product->yeasts.at(i).laboratory + " " + product->yeasts.at(i).product_id + "[/data]"); 491 memo.append("[row][data]" + product->yeasts.at(i).laboratory + " " + product->yeasts.at(i).product_id + "[/data]");
510 memo.append("[data]" + product->yeasts.at(i).name + "[/data]"); 492 memo.append("[data]" + product->yeasts.at(i).name + "[/data]");
511 memo.append("[data]" + yeast_use[product->yeasts.at(i).use] + "[/data]"); 493 memo.append("[data]" + QCoreApplication::translate("YeastUse", g_yeast_use[product->yeasts.at(i).use]) + "[/data]");
512 memo.append("[data]" + yeast_form[product->yeasts.at(i).form] + "[/data]"); 494 memo.append("[data]" + QCoreApplication::translate("YeastForm", g_yeast_forms[product->yeasts.at(i).form]) + "[/data]");
513 if (product->yeasts.at(i).form == YEAST_FORMS_LIQUID) 495 if (product->yeasts.at(i).form == YEAST_FORMS_LIQUID)
514 memo.append("[data]" + QString::number(product->yeasts.at(i).amount, 'f', 0) + " pak[/data][/row]\n"); 496 memo.append("[data]" + QString::number(product->yeasts.at(i).amount, 'f', 0) + " pak[/data][/row]\n");
515 else if (product->yeasts.at(i).form == YEAST_FORMS_DRY || product->yeasts.at(i).form == YEAST_FORMS_DRIED) 497 else if (product->yeasts.at(i).form == YEAST_FORMS_DRY || product->yeasts.at(i).form == YEAST_FORMS_DRIED)
516 memo.append("[data]" + QString::number(product->yeasts.at(i).amount * 1000, 'f', 1) + " gr[/data][/row]\n"); 498 memo.append("[data]" + QString::number(product->yeasts.at(i).amount * 1000, 'f', 1) + " gr[/data][/row]\n");
517 else 499 else
532 memo.append("[tabular]\n"); 514 memo.append("[tabular]\n");
533 memo.append("[head]Maisch stap[/head][head]Stap type[/head][head]Temperatuur[/head][head]Rust tijd[/head][head]Opwarm tijd[/head]\n"); 515 memo.append("[head]Maisch stap[/head][head]Stap type[/head][head]Temperatuur[/head][head]Rust tijd[/head][head]Opwarm tijd[/head]\n");
534 for (int i = 0; i < product->mashs.size(); i++) { 516 for (int i = 0; i < product->mashs.size(); i++) {
535 memo.append("[row][data]" + product->mashs.at(i).step_name + "[/data]"); 517 memo.append("[row][data]" + product->mashs.at(i).step_name + "[/data]");
536 if (product->mashs.at(i).step_type != 1) 518 if (product->mashs.at(i).step_type != 1)
537 memo.append("[data]" + step_type[product->mashs.at(i).step_type]+" "+QString::number(product->mashs.at(i).step_infuse_amount, 'f', 1) + " L[/data]"); 519 memo.append("[data]" + QCoreApplication::translate("StepType", g_step_types[product->mashs.at(i).step_type])+" "+QString::number(product->mashs.at(i).step_infuse_amount, 'f', 1) + " L[/data]");
538 else 520 else
539 memo.append("[data]" + step_type[product->mashs.at(i).step_type] + "[/data]"); 521 memo.append("[data]" + QCoreApplication::translate("StepType", g_step_types[product->mashs.at(i).step_type]) + "[/data]");
540 memo.append("[data]" + QString::number(product->mashs.at(i).step_temp, 'f', 1) + " °C[/data]"); 522 memo.append("[data]" + QString::number(product->mashs.at(i).step_temp, 'f', 1) + " °C[/data]");
541 memo.append("[data]" + QString::number(product->mashs.at(i).step_time, 'f', 0) + " min[/data]"); 523 memo.append("[data]" + QString::number(product->mashs.at(i).step_time, 'f', 0) + " min[/data]");
542 memo.append("[data]" + QString::number(product->mashs.at(i).ramp_time, 'f', 0) + " min[/data][/row]\n"); 524 memo.append("[data]" + QString::number(product->mashs.at(i).ramp_time, 'f', 0) + " min[/data][/row]\n");
543 } 525 }
544 memo.append("[/tabular]\n\n"); 526 memo.append("[/tabular]\n\n");

mercurial