src/EditProductExport.cpp

changeset 282
d1d208a857b0
parent 280
efc213beb605
child 283
242a68fa7186
--- a/src/EditProductExport.cpp	Mon Jun 13 12:26:27 2022 +0200
+++ b/src/EditProductExport.cpp	Mon Jun 13 15:47:16 2022 +0200
@@ -124,16 +124,16 @@
     for (int i = 0; i < product->hops.size(); i++) {
 	xmlWriter->writeStartElement("HOP");
 	xmlWriter->writeTextElement("VERSION", "1");
-	xmlWriter->writeTextElement("NAME", product->hops.at(i).h_name);
-	xmlWriter->writeTextElement("ALPHA", QString::number(product->hops.at(i).h_alpha, 'f', 1));
-	xmlWriter->writeTextElement("AMOUNT", QString::number(product->hops.at(i).h_amount, 'f', 4));
-	xmlWriter->writeTextElement("USE", hop_use[product->hops.at(i).h_useat]);
-	xmlWriter->writeTextElement("TIME", QString::number(product->hops.at(i).h_time, 'f', 0));
-	xmlWriter->writeTextElement("TYPE", hop_types[product->hops.at(i).h_type]);
-	xmlWriter->writeTextElement("FORM", hop_forms[product->hops.at(i).h_form]);
-	xmlWriter->writeTextElement("BETA", QString::number(product->hops.at(i).h_beta, 'f', 1));
-	xmlWriter->writeTextElement("HSI", QString::number(product->hops.at(i).h_hsi, 'f', 1));
-	xmlWriter->writeTextElement("ORIGIN", product->hops.at(i).h_origin);
+	xmlWriter->writeTextElement("NAME", product->hops.at(i).name);
+	xmlWriter->writeTextElement("ALPHA", QString::number(product->hops.at(i).alpha, 'f', 1));
+	xmlWriter->writeTextElement("AMOUNT", QString::number(product->hops.at(i).amount, 'f', 4));
+	xmlWriter->writeTextElement("USE", hop_use[product->hops.at(i).useat]);
+	xmlWriter->writeTextElement("TIME", QString::number(product->hops.at(i).time, 'f', 0));
+	xmlWriter->writeTextElement("TYPE", hop_types[product->hops.at(i).type]);
+	xmlWriter->writeTextElement("FORM", hop_forms[product->hops.at(i).form]);
+	xmlWriter->writeTextElement("BETA", QString::number(product->hops.at(i).beta, 'f', 1));
+	xmlWriter->writeTextElement("HSI", QString::number(product->hops.at(i).hsi, 'f', 1));
+	xmlWriter->writeTextElement("ORIGIN", product->hops.at(i).origin);
 	xmlWriter->writeEndElement();
     }
     xmlWriter->writeEndElement();	// HOPS
@@ -471,20 +471,20 @@
     memo.append("[tabular]\n");
     memo.append("[head]Hop[/head][head]Vorm[/head][head]Alpha[/head][head]IBU[/head][head]Gram[/head][head]Toevoegen moment[/head]\n");
     for (int i = 0; i < product->hops.size(); i++) {
-        double ibu = Utils::toIBU(product->hops.at(i).h_useat, product->hops.at(i).h_form, product->preboil_sg, product->batch_size,
-                        product->hops.at(i).h_amount, product->hops.at(i).h_time, product->hops.at(i).h_alpha, product->ibu_method,
+        double ibu = Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, product->batch_size,
+                        product->hops.at(i).amount, product->hops.at(i).time, product->hops.at(i).alpha, product->ibu_method,
                         product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time);
-        memo.append("[row][data]" + product->hops.at(i).h_name + " (" + product->hops.at(i).h_origin + ")[/data]");
-        memo.append("[data]" + hop_forms[product->hops.at(i).h_form] + "[/data]");
-        memo.append("[data]" + QString::number(product->hops.at(i).h_alpha, 'f', 1) + "[/data]");
+        memo.append("[row][data]" + product->hops.at(i).name + " (" + product->hops.at(i).origin + ")[/data]");
+        memo.append("[data]" + hop_forms[product->hops.at(i).form] + "[/data]");
+        memo.append("[data]" + QString::number(product->hops.at(i).alpha, 'f', 1) + "[/data]");
         memo.append("[data]" + QString::number(ibu, 'f', 1) + "[/data]");
-        memo.append("[data]" + QString::number(product->hops.at(i).h_amount * 1000, 'f', 2) + "[/data]");
-        if (product->hops.at(i).h_useat == HOP_USEAT_BOIL || product->hops.at(i).h_useat == HOP_USEAT_WHIRLPOOL)
-            memo.append("[data]" + hop_use[product->hops.at(i).h_useat] + " " + QString::number(product->hops.at(i).h_time) + " minuten[/data][/row]\n");
-        else if (product->hops.at(i).h_useat == HOP_USEAT_DRY_HOP)
-            memo.append("[data]" + hop_use[product->hops.at(i).h_useat] + " " + QString::number(product->hops.at(i).h_time / 1440) + " dagen[/data][/row]\n");
+        memo.append("[data]" + QString::number(product->hops.at(i).amount * 1000, 'f', 2) + "[/data]");
+        if (product->hops.at(i).useat == HOP_USEAT_BOIL || product->hops.at(i).useat == HOP_USEAT_WHIRLPOOL)
+            memo.append("[data]" + hop_use[product->hops.at(i).useat] + " " + QString::number(product->hops.at(i).time) + " minuten[/data][/row]\n");
+        else if (product->hops.at(i).useat == HOP_USEAT_DRY_HOP)
+            memo.append("[data]" + hop_use[product->hops.at(i).useat] + " " + QString::number(product->hops.at(i).time / 1440) + " dagen[/data][/row]\n");
         else
-            memo.append("[data]" + hop_use[product->hops.at(i).h_useat] + "[/data][/row]\n");
+            memo.append("[data]" + hop_use[product->hops.at(i).useat] + "[/data][/row]\n");
     }
     memo.append("[/tabular]\n\n");
 
@@ -929,7 +929,7 @@
 		sp->fermentables[j].f_amount = round(sp->fermentables.at(j).f_amount * factor * 100000) / 100000;
 	    }
 	    for (int j = 0; j < sp->hops.size(); j++) {
-		sp->hops[j].h_amount = round(sp->hops.at(j).h_amount * factor * 100000) / 100000;
+		sp->hops[j].amount = round(sp->hops.at(j).amount * factor * 100000) / 100000;
 	    }
 	    for (int j = 0; j < sp->miscs.size(); j++) {
                 sp->miscs[j].amount = round(sp->miscs.at(j).amount * factor * 100000) / 100000;
@@ -986,7 +986,7 @@
                 sp->fermentables[j].f_amount = round(sp->fermentables.at(j).f_amount * factor * 100000) / 100000;
             }
             for (int j = 0; j < sp->hops.size(); j++) {
-                sp->hops[j].h_amount = round(sp->hops.at(j).h_amount * factor * 100000) / 100000;
+                sp->hops[j].amount = round(sp->hops.at(j).amount * factor * 100000) / 100000;
             }
             for (int j = 0; j < sp->miscs.size(); j++) {
                 sp->miscs[j].amount = round(sp->miscs.at(j).amount * factor * 100000) / 100000;

mercurial