src/EditRecipeExport.cpp

changeset 282
d1d208a857b0
parent 280
efc213beb605
child 283
242a68fa7186
--- a/src/EditRecipeExport.cpp	Mon Jun 13 12:26:27 2022 +0200
+++ b/src/EditRecipeExport.cpp	Mon Jun 13 15:47:16 2022 +0200
@@ -116,16 +116,16 @@
     for (int i = 0; i < recipe->hops.size(); i++) {
 	xmlWriter->writeStartElement("HOP");
 	xmlWriter->writeTextElement("VERSION", "1");
-	xmlWriter->writeTextElement("NAME", recipe->hops.at(i).h_name);
-	xmlWriter->writeTextElement("ALPHA", QString::number(recipe->hops.at(i).h_alpha, 'f', 1));
-	xmlWriter->writeTextElement("AMOUNT", QString::number(recipe->hops.at(i).h_amount, 'f', 4));
-	xmlWriter->writeTextElement("USE", hop_use[recipe->hops.at(i).h_useat]);
-	xmlWriter->writeTextElement("TIME", QString::number(recipe->hops.at(i).h_time, 'f', 0));
-	xmlWriter->writeTextElement("TYPE", hop_types[recipe->hops.at(i).h_type]);
-	xmlWriter->writeTextElement("FORM", hop_forms[recipe->hops.at(i).h_form]);
-	xmlWriter->writeTextElement("BETA", QString::number(recipe->hops.at(i).h_beta, 'f', 1));
-	xmlWriter->writeTextElement("HSI", QString::number(recipe->hops.at(i).h_hsi, 'f', 1));
-	xmlWriter->writeTextElement("ORIGIN", recipe->hops.at(i).h_origin);
+	xmlWriter->writeTextElement("NAME", recipe->hops.at(i).name);
+	xmlWriter->writeTextElement("ALPHA", QString::number(recipe->hops.at(i).alpha, 'f', 1));
+	xmlWriter->writeTextElement("AMOUNT", QString::number(recipe->hops.at(i).amount, 'f', 4));
+	xmlWriter->writeTextElement("USE", hop_use[recipe->hops.at(i).useat]);
+	xmlWriter->writeTextElement("TIME", QString::number(recipe->hops.at(i).time, 'f', 0));
+	xmlWriter->writeTextElement("TYPE", hop_types[recipe->hops.at(i).type]);
+	xmlWriter->writeTextElement("FORM", hop_forms[recipe->hops.at(i).form]);
+	xmlWriter->writeTextElement("BETA", QString::number(recipe->hops.at(i).beta, 'f', 1));
+	xmlWriter->writeTextElement("HSI", QString::number(recipe->hops.at(i).hsi, 'f', 1));
+	xmlWriter->writeTextElement("ORIGIN", recipe->hops.at(i).origin);
 	xmlWriter->writeEndElement();
     }
     xmlWriter->writeEndElement();	// HOPS
@@ -281,7 +281,7 @@
 
 void EditRecipe::copyProduct()
 {
-    Product *p = new Product;
+    Product *p = new Product();
 
     p->record = -1;
     p->name = recipe->name + QString(" [duplicate]");
@@ -289,7 +289,7 @@
     p->birth = QDate::currentDate();
     p->stage = p->inventory_reduced = PROD_STAGE_PLAN;
     p->notes = recipe->notes;
-    p->log_brew = p->log_fermentation = p->log_ispindel = p->log_co2pressure = p->locked = false;
+//    p->log_brew = p->log_fermentation = p->log_ispindel = p->log_co2pressure = p->locked = false;
 
     p->st_name = recipe->st_name;
     p->st_letter = recipe->st_letter;
@@ -313,14 +313,14 @@
     p->eq_name = QString("Not yet set");
     p->eq_notes = QString("");
     p->eq_tun_specific_heat = 0.11;
-    p->eq_tun_material = 0;
+//    p->eq_tun_material = 0;
     p->eq_tun_volume = p->eq_tun_height = 20;
     p->eq_tun_weight = 2;
-    p->eq_top_up_water = 0;
+//    p->eq_top_up_water = 0;
     p->eq_trub_chiller_loss = 0.5;
     p->eq_evap_rate = 1.8;
     p->eq_calc_boil_volume = true;
-    p->eq_top_up_kettle = 0;
+//    p->eq_top_up_kettle = 0;
     p->eq_hop_utilization = 100;
     p->eq_lauter_volume = p->eq_lauter_height = p->eq_kettle_volume = p->eq_kettle_height = p->eq_mash_volume = 20;
     p->eq_lauter_deadspace = 0.5;
@@ -339,30 +339,30 @@
     p->est_abv = recipe->est_abv;
 
     p->brew_date_start = p->brew_date_end = QDateTime();
-    p->brew_mash_ph = p->brew_mash_sg = p->brew_mash_efficiency = 0;
-    p->brew_sparge_temperature = p->brew_sparge_volume = p->brew_sparge_est = p->brew_sparge_ph = 0;
-    p->brew_preboil_volume = p->brew_preboil_sg = p->brew_preboil_ph = p->brew_preboil_efficiency = 0;
-    p->brew_aboil_volume = p->brew_aboil_sg = p->brew_aboil_ph = p->brew_aboil_efficiency = 0;
-    p->brew_cooling_method = p->brew_cooling_time = 0;
+//    p->brew_mash_ph = p->brew_mash_sg = p->brew_mash_efficiency = 0;
+//    p->brew_sparge_temperature = p->brew_sparge_volume = p->brew_sparge_est = p->brew_sparge_ph = 0;
+//    p->brew_preboil_volume = p->brew_preboil_sg = p->brew_preboil_ph = p->brew_preboil_efficiency = 0;
+ //   p->brew_aboil_volume = p->brew_aboil_sg = p->brew_aboil_ph = p->brew_aboil_efficiency = 0;
+ //   p->brew_cooling_method = p->brew_cooling_time = 0;
     p->brew_cooling_to = 20;
-    p->brew_whirlpool9 = p->brew_whirlpool7 = p->brew_whirlpool6 = p->brew_whirlpool2 = 0;
-    p->brew_fermenter_volume = p->brew_fermenter_extrawater = p->brew_fermenter_tcloss = 0;
-    p->brew_aeration_time = p->brew_aeration_speed = p->brew_aeration_type = 0;
-    p->brew_fermenter_sg = p->brew_fermenter_ibu = p->brew_fermenter_color = 0;
+//    p->brew_whirlpool9 = p->brew_whirlpool7 = p->brew_whirlpool6 = p->brew_whirlpool2 = 0;
+//    p->brew_fermenter_volume = p->brew_fermenter_extrawater = p->brew_fermenter_tcloss = 0;
+//    p->brew_aeration_time = p->brew_aeration_speed = p->brew_aeration_type = 0;
+//    p->brew_fermenter_sg = p->brew_fermenter_ibu = p->brew_fermenter_color = 0;
 
-    p->og = p->fg = 0;
-    p->primary_start_temp = p->primary_max_temp = p->primary_end_temp = p->primary_end_sg = 0;
+//    p->og = p->fg = 0;
+//    p->primary_start_temp = p->primary_max_temp = p->primary_end_temp = p->primary_end_sg = 0;
     p->primary_end_date = p->secondary_end_date = QDate();
-    p->secondary_temp = p->secondary_end_sg = p->tertiary_temp = 0;
+//    p->secondary_temp = p->secondary_end_sg = p->tertiary_temp = 0;
     p->package_date = QDate();
-    p->package_volume = p->package_infuse_amount = p->package_infuse_abv = p->package_abv = p->package_ph = 0;
+//    p->package_volume = p->package_infuse_amount = p->package_infuse_abv = p->package_abv = p->package_ph = 0;
     p->package_infuse_notes = "";
-    p->bottle_amount = p->bottle_carbonation = p->bottle_priming_amount = p->bottle_carbonation_temp = 0;
-    p->keg_amount = p->keg_carbonation = p->keg_priming_amount = p->keg_carbonation_temp = 0;
-    p->keg_pressure = 0;
-    p->bottle_priming_water = p->keg_priming_water = 0;
-    p->bottle_priming_sugar = p->keg_priming_sugar = 0;
-    p->taste_rate = 0;
+//    p->bottle_amount = p->bottle_carbonation = p->bottle_priming_amount = p->bottle_carbonation_temp = 0;
+//    p->keg_amount = p->keg_carbonation = p->keg_priming_amount = p->keg_carbonation_temp = 0;
+//    p->keg_pressure = 0;
+//    p->bottle_priming_water = p->keg_priming_water = 0;
+//    p->bottle_priming_sugar = p->keg_priming_sugar = 0;
+//    p->taste_rate = 0;
     p->taste_date = QDate();
     p->taste_notes = p->taste_color = p->taste_transparency = p->taste_head = "";
     p->taste_aroma = p->taste_taste = p->taste_mouthfeel = p->taste_aftertaste = "";
@@ -416,13 +416,13 @@
     p->wa_base_name = recipe->wa_base_name;
 
     p->starter_enable = false;
-    p->starter_type = p->prop_type[0] = p->prop_type[1] = p->prop_type[2] = p->prop_type[3] = 0;
+//    p->starter_type = p->prop_type[0] = p->prop_type[1] = p->prop_type[2] = p->prop_type[3] = 0;
     p->starter_viability = 100;
     p->starter_sg = 1.037;
     p->yeast_prod_date = QDate();
-    p->yeast_pitchrate = p->prop_volume[0] = p->prop_volume[1] = p->prop_volume[2] = p->prop_volume[3] = 0;
-    p->divide_type = p->divide_parts = p->divide_part = 0;
-    p->divide_size = 0;
+//    p->yeast_pitchrate = p->prop_volume[0] = p->prop_volume[1] = p->prop_volume[2] = p->prop_volume[3] = 0;
+//    p->divide_type = p->divide_parts = p->divide_part = 0;
+//    p->divide_size = 0;
     p->divide_factor = 1;
 
     p->fermentables = recipe->fermentables;
@@ -488,20 +488,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 < recipe->hops.size(); i++) {
-	double ibu = Utils::toIBU(recipe->hops.at(i).h_useat, recipe->hops.at(i).h_form, recipe->preboil_sg, recipe->batch_size,
-			recipe->hops.at(i).h_amount, recipe->hops.at(i).h_time, recipe->hops.at(i).h_alpha, recipe->ibu_method,
-			0, recipe->hops.at(i).h_time, 0, recipe->boil_time);
-	memo.append("[row][data]" + recipe->hops.at(i).h_name + " (" + recipe->hops.at(i).h_origin + ")[/data]");
-	memo.append("[data]" + hop_forms[recipe->hops.at(i).h_form] + "[/data]");
-	memo.append("[data]" + QString::number(recipe->hops.at(i).h_alpha, 'f', 1) + "[/data]");
+	double ibu = Utils::toIBU(recipe->hops.at(i).useat, recipe->hops.at(i).form, recipe->preboil_sg, recipe->batch_size,
+			recipe->hops.at(i).amount, recipe->hops.at(i).time, recipe->hops.at(i).alpha, recipe->ibu_method,
+			0, recipe->hops.at(i).time, 0, recipe->boil_time);
+	memo.append("[row][data]" + recipe->hops.at(i).name + " (" + recipe->hops.at(i).origin + ")[/data]");
+	memo.append("[data]" + hop_forms[recipe->hops.at(i).form] + "[/data]");
+	memo.append("[data]" + QString::number(recipe->hops.at(i).alpha, 'f', 1) + "[/data]");
 	memo.append("[data]" + QString::number(ibu, 'f', 1) + "[/data]");
-	memo.append("[data]" + QString::number(recipe->hops.at(i).h_amount * 1000, 'f', 2) + "[/data]");
-	if (recipe->hops.at(i).h_useat == HOP_USEAT_BOIL || recipe->hops.at(i).h_useat == HOP_USEAT_WHIRLPOOL)
-	    memo.append("[data]" + hop_use[recipe->hops.at(i).h_useat] + " " + QString::number(recipe->hops.at(i).h_time) + " minuten[/data][/row]\n");
-	else if (recipe->hops.at(i).h_useat == HOP_USEAT_DRY_HOP)
-	    memo.append("[data]" + hop_use[recipe->hops.at(i).h_useat] + " " + QString::number(recipe->hops.at(i).h_time / 1440) + " dagen[/data][/row]\n");
+	memo.append("[data]" + QString::number(recipe->hops.at(i).amount * 1000, 'f', 2) + "[/data]");
+	if (recipe->hops.at(i).useat == HOP_USEAT_BOIL || recipe->hops.at(i).useat == HOP_USEAT_WHIRLPOOL)
+	    memo.append("[data]" + hop_use[recipe->hops.at(i).useat] + " " + QString::number(recipe->hops.at(i).time) + " minuten[/data][/row]\n");
+	else if (recipe->hops.at(i).useat == HOP_USEAT_DRY_HOP)
+	    memo.append("[data]" + hop_use[recipe->hops.at(i).useat] + " " + QString::number(recipe->hops.at(i).time / 1440) + " dagen[/data][/row]\n");
 	else
-	    memo.append("[data]" + hop_use[recipe->hops.at(i).h_useat] + "[/data][/row]\n");
+	    memo.append("[data]" + hop_use[recipe->hops.at(i).useat] + "[/data][/row]\n");
     }
     memo.append("[/tabular]\n\n");
 

mercurial