src/EditProductExport.cpp

changeset 284
33bb98c33e6a
parent 283
242a68fa7186
child 300
2a97905cb637
--- a/src/EditProductExport.cpp	Mon Jun 13 16:47:52 2022 +0200
+++ b/src/EditProductExport.cpp	Mon Jun 13 17:34:51 2022 +0200
@@ -186,17 +186,17 @@
     for (int i = 0; i < product->yeasts.size(); i++) {
         xmlWriter->writeStartElement("YEAST");
         xmlWriter->writeTextElement("VERSION", "1");
-        xmlWriter->writeTextElement("NAME", product->yeasts.at(i).y_name);
-	xmlWriter->writeTextElement("TYPE", yeast_type[product->yeasts.at(i).y_type]);
-	xmlWriter->writeTextElement("FORM", yeast_form[product->yeasts.at(i).y_form]);
-	xmlWriter->writeTextElement("AMOUNT", QString::number(product->yeasts.at(i).y_amount, 'f', 5));
-	xmlWriter->writeTextElement("AMOUNT_IS_WEIGHT", (product->yeasts.at(i).y_form == 1) ? "TRUE":"FALSE");
-	xmlWriter->writeTextElement("LABORATORY", product->yeasts.at(i).y_laboratory);
-	xmlWriter->writeTextElement("PRODUCT_ID", product->yeasts.at(i).y_product_id);
-	xmlWriter->writeTextElement("MIN_TEMPERATURE", QString::number(product->yeasts.at(i).y_min_temperature, 'f', 1));
-	xmlWriter->writeTextElement("MAX_TEMPERATURE", QString::number(product->yeasts.at(i).y_max_temperature, 'f', 1));
-	xmlWriter->writeTextElement("ATTENUATION", QString::number(product->yeasts.at(i).y_attenuation, 'f', 1));
-	xmlWriter->writeTextElement("ADD_TO_SECONDARY", (product->yeasts.at(i).y_use == 0) ? "FALSE":"TRUE");
+        xmlWriter->writeTextElement("NAME", product->yeasts.at(i).name);
+	xmlWriter->writeTextElement("TYPE", yeast_type[product->yeasts.at(i).type]);
+	xmlWriter->writeTextElement("FORM", yeast_form[product->yeasts.at(i).form]);
+	xmlWriter->writeTextElement("AMOUNT", QString::number(product->yeasts.at(i).amount, 'f', 5));
+	xmlWriter->writeTextElement("AMOUNT_IS_WEIGHT", (product->yeasts.at(i).form == 1) ? "TRUE":"FALSE");
+	xmlWriter->writeTextElement("LABORATORY", product->yeasts.at(i).laboratory);
+	xmlWriter->writeTextElement("PRODUCT_ID", product->yeasts.at(i).product_id);
+	xmlWriter->writeTextElement("MIN_TEMPERATURE", QString::number(product->yeasts.at(i).min_temperature, 'f', 1));
+	xmlWriter->writeTextElement("MAX_TEMPERATURE", QString::number(product->yeasts.at(i).max_temperature, 'f', 1));
+	xmlWriter->writeTextElement("ATTENUATION", QString::number(product->yeasts.at(i).attenuation, 'f', 1));
+	xmlWriter->writeTextElement("ADD_TO_SECONDARY", (product->yeasts.at(i).use == 0) ? "FALSE":"TRUE");
 	xmlWriter->writeEndElement();
     }
     xmlWriter->writeEndElement();	// YEASTS
@@ -506,16 +506,16 @@
     memo.append("[tabular]\n");
     memo.append("[head]Gistlab en code[/head][head]Omschrijving[/head][head]Gebruik[/head][head]Vorm[/head][head]Hoeveel[/head]\n");
     for (int i = 0; i < product->yeasts.size(); i++) {
-        memo.append("[row][data]" + product->yeasts.at(i).y_laboratory + " " + product->yeasts.at(i).y_product_id + "[/data]");
-        memo.append("[data]" + product->yeasts.at(i).y_name + "[/data]");
-        memo.append("[data]" + yeast_use[product->yeasts.at(i).y_use] + "[/data]");
-        memo.append("[data]" + yeast_form[product->yeasts.at(i).y_form] + "[/data]");
-        if (product->yeasts.at(i).y_form == YEAST_FORMS_LIQUID)
-            memo.append("[data]" + QString::number(product->yeasts.at(i).y_amount, 'f', 0) + " pak[/data][/row]\n");
-        else if (product->yeasts.at(i).y_form == YEAST_FORMS_DRY || product->yeasts.at(i).y_form == YEAST_FORMS_DRIED)
-            memo.append("[data]" + QString::number(product->yeasts.at(i).y_amount * 1000, 'f', 1) + " gr[/data][/row]\n");
+        memo.append("[row][data]" + product->yeasts.at(i).laboratory + " " + product->yeasts.at(i).product_id + "[/data]");
+        memo.append("[data]" + product->yeasts.at(i).name + "[/data]");
+        memo.append("[data]" + yeast_use[product->yeasts.at(i).use] + "[/data]");
+        memo.append("[data]" + yeast_form[product->yeasts.at(i).form] + "[/data]");
+        if (product->yeasts.at(i).form == YEAST_FORMS_LIQUID)
+            memo.append("[data]" + QString::number(product->yeasts.at(i).amount, 'f', 0) + " pak[/data][/row]\n");
+        else if (product->yeasts.at(i).form == YEAST_FORMS_DRY || product->yeasts.at(i).form == YEAST_FORMS_DRIED)
+            memo.append("[data]" + QString::number(product->yeasts.at(i).amount * 1000, 'f', 1) + " gr[/data][/row]\n");
         else
-            memo.append("[data]" + QString::number(product->yeasts.at(i).y_amount * 1000, 'f', 0) + " ml[/data][/row]\n");
+            memo.append("[data]" + QString::number(product->yeasts.at(i).amount * 1000, 'f', 0) + " ml[/data][/row]\n");
     }
     memo.append("[/tabular]\n");
     if (product->starter_enable) {
@@ -935,7 +935,7 @@
                 sp->miscs[j].amount = round(sp->miscs.at(j).amount * factor * 100000) / 100000;
             }
 	    for (int j = 0; j < sp->yeasts.size(); j++) {
-                sp->yeasts[j].y_amount = round(sp->yeasts.at(j).y_amount * factor * 100000) / 100000;
+                sp->yeasts[j].amount = round(sp->yeasts.at(j).amount * factor * 100000) / 100000;
             }
 	    for (int j = 0; j < sp->mashs.size(); j++) {
                 sp->mashs[j].step_volume = round(sp->mashs.at(j).step_volume * factor * 100) / 100;
@@ -992,7 +992,7 @@
                 sp->miscs[j].amount = round(sp->miscs.at(j).amount * factor * 100000) / 100000;
             }
             for (int j = 0; j < sp->yeasts.size(); j++) {
-                sp->yeasts[j].y_amount = round(sp->yeasts.at(j).y_amount * factor * 100000) / 100000;
+                sp->yeasts[j].amount = round(sp->yeasts.at(j).amount * factor * 100000) / 100000;
             }
             for (int j = 0; j < sp->mashs.size(); j++) {
                 sp->mashs[j].step_volume = round(sp->mashs.at(j).step_volume * factor * 100) / 100;
@@ -1029,14 +1029,14 @@
     beerxmlButton->setObjectName(QString::fromUtf8("beerxmlButton"));
     beerxmlButton->setGeometry(QRect(50, 20, 171, 21));
     beerxmlButton->setText(tr("Export to beerXML"));
-    QRadioButton *copy_productButton = new QRadioButton(dialog);
-    copy_productButton->setObjectName(QString::fromUtf8("copy_productButton"));
-    copy_productButton->setGeometry(QRect(50, 50, 171, 21));
-    copy_productButton->setText(tr("Copy to product"));
-    QRadioButton *copy_recipeButton = new QRadioButton(dialog);
-    copy_recipeButton->setObjectName(QString::fromUtf8("copy_recipeButton"));
-    copy_recipeButton->setGeometry(QRect(50, 80, 171, 21));
-    copy_recipeButton->setText(tr("Copy to recipe"));
+    QRadioButton *copproductButton = new QRadioButton(dialog);
+    copproductButton->setObjectName(QString::fromUtf8("copproductButton"));
+    copproductButton->setGeometry(QRect(50, 50, 171, 21));
+    copproductButton->setText(tr("Copy to product"));
+    QRadioButton *coprecipeButton = new QRadioButton(dialog);
+    coprecipeButton->setObjectName(QString::fromUtf8("coprecipeButton"));
+    coprecipeButton->setGeometry(QRect(50, 80, 171, 21));
+    coprecipeButton->setText(tr("Copy to recipe"));
     QRadioButton *toforumButton = new QRadioButton(dialog);
     toforumButton->setObjectName(QString::fromUtf8("toforumButton"));
     toforumButton->setGeometry(QRect(50, 110, 171, 21));
@@ -1056,9 +1056,9 @@
     if (dialog->result() == QDialog::Accepted) {
         if (beerxmlButton->isChecked())
 	    exportBeerXML();
-	if (copy_productButton->isChecked())
+	if (copproductButton->isChecked())
 	    copyProduct();
-	if (copy_recipeButton->isChecked())
+	if (coprecipeButton->isChecked())
 	    copyRecipe();
 	if (toforumButton->isChecked())
 	    toforumProduct();

mercurial