src/EditProductExport.cpp

changeset 336
e97f9e87d94b
parent 304
aa8d421bfc24
child 339
2f3cfb983fcc
equal deleted inserted replaced
335:c4b4a2879bb8 336:e97f9e87d94b
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 ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" });
27 const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" }); 26 const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" });
28 /* "Leaf Wet", "Cryo", "Extract" */ 27 /* "Leaf Wet", "Cryo", "Extract" */
29 /* 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 */
30 /* instead of what we internally use. */ 29 /* instead of what we internally use. */
31 30
77 xmlWriter->writeTextElement("EST_COLOR", QString::number(Utils::ebc_to_srm(product->est_color), 'f', 6)); 76 xmlWriter->writeTextElement("EST_COLOR", QString::number(Utils::ebc_to_srm(product->est_color), 'f', 6));
78 xmlWriter->writeTextElement("COLOR_METHOD", color_method[product->color_method]); 77 xmlWriter->writeTextElement("COLOR_METHOD", color_method[product->color_method]);
79 } 78 }
80 if (product->est_ibu > 0) { 79 if (product->est_ibu > 0) {
81 xmlWriter->writeTextElement("EST_IBU", QString::number(product->est_ibu, 'f', 1)); 80 xmlWriter->writeTextElement("EST_IBU", QString::number(product->est_ibu, 'f', 1));
82 xmlWriter->writeTextElement("IBU_METHOD", ibu_method[product->ibu_method]); 81 xmlWriter->writeTextElement("IBU_METHOD", g_ibu_method[product->ibu_method]);
83 } 82 }
84 xmlWriter->writeTextElement("BMS_COOLING_TO", QString::number(product->brew_cooling_to, 'f', 1)); 83 xmlWriter->writeTextElement("BMS_COOLING_TO", QString::number(product->brew_cooling_to, 'f', 1));
85 84
86 xmlWriter->writeStartElement("STYLE"); 85 xmlWriter->writeStartElement("STYLE");
87 xmlWriter->writeTextElement("VERSION", "1"); 86 xmlWriter->writeTextElement("VERSION", "1");
418 417
419 418
420 void EditProduct::toforumProduct() 419 void EditProduct::toforumProduct()
421 { 420 {
422 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); 421 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" });
423 const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" });
424 422
425 QString memo = QString("[u][b]BMSapp v"); 423 QString memo = QString("[u][b]BMSapp v");
426 memo.append(VERSIONSTRING); // For some stupid reason this must be on it's own. 424 memo.append(VERSIONSTRING); // For some stupid reason this must be on it's own.
427 memo.append(" - Datum export: " + QDate::currentDate().toString("dd-MMM-yyyy") + "[/b][/u]\n\n\n"); 425 memo.append(" - Datum export: " + QDate::currentDate().toString("dd-MMM-yyyy") + "[/b][/u]\n\n\n");
428 memo.append("[u][b]Basis[/b][/u]\n[tabular]\n"); 426 memo.append("[u][b]Basis[/b][/u]\n[tabular]\n");
435 memo.append("[row][data]Brouwzaal rendement[/data][data]" + QString::number(product->efficiency, 'f', 1) + "%[/data][/row]\n"); 433 memo.append("[row][data]Brouwzaal rendement[/data][data]" + QString::number(product->efficiency, 'f', 1) + "%[/data][/row]\n");
436 memo.append("[row][data]Geschatte begin densiteit[/data][data]" + QString::number(product->est_og, 'f', 3) + " SG[/data][/row]\n"); 434 memo.append("[row][data]Geschatte begin densiteit[/data][data]" + QString::number(product->est_og, 'f', 3) + " SG[/data][/row]\n");
437 memo.append("[row][data]Geschatte eind densiteit[/data][data]" + QString::number(product->est_fg, 'f', 3) + " SG[/data][/row]\n"); 435 memo.append("[row][data]Geschatte eind densiteit[/data][data]" + QString::number(product->est_fg, 'f', 3) + " SG[/data][/row]\n");
438 memo.append("[row][data]Geschat alcohol[/data][data]" + QString::number(product->est_abv, 'f', 1) + "%[/data][/row]\n"); 436 memo.append("[row][data]Geschat alcohol[/data][data]" + QString::number(product->est_abv, 'f', 1) + "%[/data][/row]\n");
439 memo.append("[row][data]Kleur (" + color_method[product->color_method] + ")[/data][data]" + QString::number(product->est_color, 'f', 0) + " EBC[/data][/row]\n"); 437 memo.append("[row][data]Kleur (" + color_method[product->color_method] + ")[/data][data]" + QString::number(product->est_color, 'f', 0) + " EBC[/data][/row]\n");
440 memo.append("[row][data]Bitterheid (" + ibu_method[product->ibu_method] + ")[/data][data]" + QString::number(product->est_ibu, 'f', 1) + " IBU[/data][/row]\n"); 438 memo.append("[row][data]Bitterheid (" + QString(g_ibu_method[product->ibu_method]) + ")[/data][data]" + QString::number(product->est_ibu, 'f', 1) + " IBU[/data][/row]\n");
441 memo.append("[/tabular]\n\n"); 439 memo.append("[/tabular]\n\n");
442 440
443 memo.append("[u][b]Vergistbare ingrediƫnten[/b][/u]\n"); 441 memo.append("[u][b]Vergistbare ingrediƫnten[/b][/u]\n");
444 memo.append("[tabular]\n"); 442 memo.append("[tabular]\n");
445 memo.append("[head]Mout, granen en suikers[/head][head]EBC[/head][head]Gewicht kg[/head][head]%[/head][head]Gebruik tijdens[/head]\n"); 443 memo.append("[head]Mout, granen en suikers[/head][head]EBC[/head][head]Gewicht kg[/head][head]%[/head][head]Gebruik tijdens[/head]\n");

mercurial