src/EditRecipeExport.cpp

changeset 336
e97f9e87d94b
parent 304
aa8d421bfc24
child 339
2f3cfb983fcc
equal deleted inserted replaced
335:c4b4a2879bb8 336:e97f9e87d94b
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 ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" });
25 const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" }); 24 const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" });
26 /* "Leaf Wet", "Cryo", "Extract" */ 25 /* "Leaf Wet", "Cryo", "Extract" */
27 /* 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 */
28 /* instead of what we internally use. */ 27 /* instead of what we internally use. */
29 28
71 xmlWriter->writeTextElement("EST_COLOR", QString::number(Utils::ebc_to_srm(recipe->est_color), 'f', 6)); 70 xmlWriter->writeTextElement("EST_COLOR", QString::number(Utils::ebc_to_srm(recipe->est_color), 'f', 6));
72 xmlWriter->writeTextElement("COLOR_METHOD", color_method[recipe->color_method]); 71 xmlWriter->writeTextElement("COLOR_METHOD", color_method[recipe->color_method]);
73 } 72 }
74 if (recipe->est_ibu > 0) { 73 if (recipe->est_ibu > 0) {
75 xmlWriter->writeTextElement("EST_IBU", QString::number(recipe->est_ibu, 'f', 1)); 74 xmlWriter->writeTextElement("EST_IBU", QString::number(recipe->est_ibu, 'f', 1));
76 xmlWriter->writeTextElement("IBU_METHOD", ibu_method[recipe->ibu_method]); 75 xmlWriter->writeTextElement("IBU_METHOD", g_ibu_method[recipe->ibu_method]);
77 } 76 }
78 77
79 xmlWriter->writeStartElement("STYLE"); 78 xmlWriter->writeStartElement("STYLE");
80 xmlWriter->writeTextElement("VERSION", "1"); 79 xmlWriter->writeTextElement("VERSION", "1");
81 xmlWriter->writeTextElement("NAME", recipe->st_name); 80 xmlWriter->writeTextElement("NAME", recipe->st_name);
435 434
436 435
437 void EditRecipe::toforumRecipe() 436 void EditRecipe::toforumRecipe()
438 { 437 {
439 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); 438 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" });
440 const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" });
441 439
442 QString memo = QString("[u][b]BMSapp v"); 440 QString memo = QString("[u][b]BMSapp v");
443 memo.append(VERSIONSTRING); // For some stupid reason this must be on it's own. 441 memo.append(VERSIONSTRING); // For some stupid reason this must be on it's own.
444 memo.append(" - Datum export: " + QDate::currentDate().toString("dd-MMM-yyyy") + "[/b][/u]\n\n\n"); 442 memo.append(" - Datum export: " + QDate::currentDate().toString("dd-MMM-yyyy") + "[/b][/u]\n\n\n");
445 memo.append("[u][b]Basis[/b][/u]\n[tabular]\n"); 443 memo.append("[u][b]Basis[/b][/u]\n[tabular]\n");
452 memo.append("[row][data]Brouwzaal rendement[/data][data]" + QString::number(recipe->efficiency, 'f', 1) + "%[/data][/row]\n"); 450 memo.append("[row][data]Brouwzaal rendement[/data][data]" + QString::number(recipe->efficiency, 'f', 1) + "%[/data][/row]\n");
453 memo.append("[row][data]Geschatte begin densiteit[/data][data]" + QString::number(recipe->est_og, 'f', 3) + " SG[/data][/row]\n"); 451 memo.append("[row][data]Geschatte begin densiteit[/data][data]" + QString::number(recipe->est_og, 'f', 3) + " SG[/data][/row]\n");
454 memo.append("[row][data]Geschatte eind densiteit[/data][data]" + QString::number(recipe->est_fg, 'f', 3) + " SG[/data][/row]\n"); 452 memo.append("[row][data]Geschatte eind densiteit[/data][data]" + QString::number(recipe->est_fg, 'f', 3) + " SG[/data][/row]\n");
455 memo.append("[row][data]Geschat alcohol[/data][data]" + QString::number(recipe->est_abv, 'f', 1) + "%[/data][/row]\n"); 453 memo.append("[row][data]Geschat alcohol[/data][data]" + QString::number(recipe->est_abv, 'f', 1) + "%[/data][/row]\n");
456 memo.append("[row][data]Kleur (" + color_method[recipe->color_method] + ")[/data][data]" + QString::number(recipe->est_color, 'f', 0) + " EBC[/data][/row]\n"); 454 memo.append("[row][data]Kleur (" + color_method[recipe->color_method] + ")[/data][data]" + QString::number(recipe->est_color, 'f', 0) + " EBC[/data][/row]\n");
457 memo.append("[row][data]Bitterheid (" + ibu_method[recipe->ibu_method] + ")[/data][data]" + QString::number(recipe->est_ibu, 'f', 1) + " IBU[/data][/row]\n"); 455 memo.append("[row][data]Bitterheid (" + QString(g_ibu_method[recipe->ibu_method]) + ")[/data][data]" + QString::number(recipe->est_ibu, 'f', 1) + " IBU[/data][/row]\n");
458 memo.append("[/tabular]\n\n"); 456 memo.append("[/tabular]\n\n");
459 457
460 memo.append("[u][b]Vergistbare ingrediƫnten[/b][/u]\n"); 458 memo.append("[u][b]Vergistbare ingrediƫnten[/b][/u]\n");
461 memo.append("[tabular]\n"); 459 memo.append("[tabular]\n");
462 memo.append("[head]Mout, granen en suikers[/head][head]EBC[/head][head]Gewicht kg[/head][head]%[/head][head]Gebruik tijdens[/head]\n"); 460 memo.append("[head]Mout, granen en suikers[/head][head]EBC[/head][head]Gewicht kg[/head][head]%[/head][head]Gebruik tijdens[/head]\n");

mercurial