src/EditProductExport.cpp

changeset 282
d1d208a857b0
parent 280
efc213beb605
child 283
242a68fa7186
equal deleted inserted replaced
281:af3dac6ff6c3 282:d1d208a857b0
122 122
123 xmlWriter->writeStartElement("HOPS"); 123 xmlWriter->writeStartElement("HOPS");
124 for (int i = 0; i < product->hops.size(); i++) { 124 for (int i = 0; i < product->hops.size(); i++) {
125 xmlWriter->writeStartElement("HOP"); 125 xmlWriter->writeStartElement("HOP");
126 xmlWriter->writeTextElement("VERSION", "1"); 126 xmlWriter->writeTextElement("VERSION", "1");
127 xmlWriter->writeTextElement("NAME", product->hops.at(i).h_name); 127 xmlWriter->writeTextElement("NAME", product->hops.at(i).name);
128 xmlWriter->writeTextElement("ALPHA", QString::number(product->hops.at(i).h_alpha, 'f', 1)); 128 xmlWriter->writeTextElement("ALPHA", QString::number(product->hops.at(i).alpha, 'f', 1));
129 xmlWriter->writeTextElement("AMOUNT", QString::number(product->hops.at(i).h_amount, 'f', 4)); 129 xmlWriter->writeTextElement("AMOUNT", QString::number(product->hops.at(i).amount, 'f', 4));
130 xmlWriter->writeTextElement("USE", hop_use[product->hops.at(i).h_useat]); 130 xmlWriter->writeTextElement("USE", hop_use[product->hops.at(i).useat]);
131 xmlWriter->writeTextElement("TIME", QString::number(product->hops.at(i).h_time, 'f', 0)); 131 xmlWriter->writeTextElement("TIME", QString::number(product->hops.at(i).time, 'f', 0));
132 xmlWriter->writeTextElement("TYPE", hop_types[product->hops.at(i).h_type]); 132 xmlWriter->writeTextElement("TYPE", hop_types[product->hops.at(i).type]);
133 xmlWriter->writeTextElement("FORM", hop_forms[product->hops.at(i).h_form]); 133 xmlWriter->writeTextElement("FORM", hop_forms[product->hops.at(i).form]);
134 xmlWriter->writeTextElement("BETA", QString::number(product->hops.at(i).h_beta, 'f', 1)); 134 xmlWriter->writeTextElement("BETA", QString::number(product->hops.at(i).beta, 'f', 1));
135 xmlWriter->writeTextElement("HSI", QString::number(product->hops.at(i).h_hsi, 'f', 1)); 135 xmlWriter->writeTextElement("HSI", QString::number(product->hops.at(i).hsi, 'f', 1));
136 xmlWriter->writeTextElement("ORIGIN", product->hops.at(i).h_origin); 136 xmlWriter->writeTextElement("ORIGIN", product->hops.at(i).origin);
137 xmlWriter->writeEndElement(); 137 xmlWriter->writeEndElement();
138 } 138 }
139 xmlWriter->writeEndElement(); // HOPS 139 xmlWriter->writeEndElement(); // HOPS
140 140
141 xmlWriter->writeStartElement("FERMENTABLES"); 141 xmlWriter->writeStartElement("FERMENTABLES");
469 469
470 memo.append("[u][b]Hop[/b][/u]\n"); 470 memo.append("[u][b]Hop[/b][/u]\n");
471 memo.append("[tabular]\n"); 471 memo.append("[tabular]\n");
472 memo.append("[head]Hop[/head][head]Vorm[/head][head]Alpha[/head][head]IBU[/head][head]Gram[/head][head]Toevoegen moment[/head]\n"); 472 memo.append("[head]Hop[/head][head]Vorm[/head][head]Alpha[/head][head]IBU[/head][head]Gram[/head][head]Toevoegen moment[/head]\n");
473 for (int i = 0; i < product->hops.size(); i++) { 473 for (int i = 0; i < product->hops.size(); i++) {
474 double ibu = Utils::toIBU(product->hops.at(i).h_useat, product->hops.at(i).h_form, product->preboil_sg, product->batch_size, 474 double ibu = Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, product->batch_size,
475 product->hops.at(i).h_amount, product->hops.at(i).h_time, product->hops.at(i).h_alpha, product->ibu_method, 475 product->hops.at(i).amount, product->hops.at(i).time, product->hops.at(i).alpha, product->ibu_method,
476 product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time); 476 product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time);
477 memo.append("[row][data]" + product->hops.at(i).h_name + " (" + product->hops.at(i).h_origin + ")[/data]"); 477 memo.append("[row][data]" + product->hops.at(i).name + " (" + product->hops.at(i).origin + ")[/data]");
478 memo.append("[data]" + hop_forms[product->hops.at(i).h_form] + "[/data]"); 478 memo.append("[data]" + hop_forms[product->hops.at(i).form] + "[/data]");
479 memo.append("[data]" + QString::number(product->hops.at(i).h_alpha, 'f', 1) + "[/data]"); 479 memo.append("[data]" + QString::number(product->hops.at(i).alpha, 'f', 1) + "[/data]");
480 memo.append("[data]" + QString::number(ibu, 'f', 1) + "[/data]"); 480 memo.append("[data]" + QString::number(ibu, 'f', 1) + "[/data]");
481 memo.append("[data]" + QString::number(product->hops.at(i).h_amount * 1000, 'f', 2) + "[/data]"); 481 memo.append("[data]" + QString::number(product->hops.at(i).amount * 1000, 'f', 2) + "[/data]");
482 if (product->hops.at(i).h_useat == HOP_USEAT_BOIL || product->hops.at(i).h_useat == HOP_USEAT_WHIRLPOOL) 482 if (product->hops.at(i).useat == HOP_USEAT_BOIL || product->hops.at(i).useat == HOP_USEAT_WHIRLPOOL)
483 memo.append("[data]" + hop_use[product->hops.at(i).h_useat] + " " + QString::number(product->hops.at(i).h_time) + " minuten[/data][/row]\n"); 483 memo.append("[data]" + hop_use[product->hops.at(i).useat] + " " + QString::number(product->hops.at(i).time) + " minuten[/data][/row]\n");
484 else if (product->hops.at(i).h_useat == HOP_USEAT_DRY_HOP) 484 else if (product->hops.at(i).useat == HOP_USEAT_DRY_HOP)
485 memo.append("[data]" + hop_use[product->hops.at(i).h_useat] + " " + QString::number(product->hops.at(i).h_time / 1440) + " dagen[/data][/row]\n"); 485 memo.append("[data]" + hop_use[product->hops.at(i).useat] + " " + QString::number(product->hops.at(i).time / 1440) + " dagen[/data][/row]\n");
486 else 486 else
487 memo.append("[data]" + hop_use[product->hops.at(i).h_useat] + "[/data][/row]\n"); 487 memo.append("[data]" + hop_use[product->hops.at(i).useat] + "[/data][/row]\n");
488 } 488 }
489 memo.append("[/tabular]\n\n"); 489 memo.append("[/tabular]\n\n");
490 490
491 memo.append("[u][b]Diversen[/b][/u]\n"); 491 memo.append("[u][b]Diversen[/b][/u]\n");
492 memo.append("[tabular]\n"); 492 memo.append("[tabular]\n");
927 sp->prop_volume[3] = sp->prop_volume[3] * factor; 927 sp->prop_volume[3] = sp->prop_volume[3] * factor;
928 for (int j = 0; j < sp->fermentables.size(); j++) { 928 for (int j = 0; j < sp->fermentables.size(); j++) {
929 sp->fermentables[j].f_amount = round(sp->fermentables.at(j).f_amount * factor * 100000) / 100000; 929 sp->fermentables[j].f_amount = round(sp->fermentables.at(j).f_amount * factor * 100000) / 100000;
930 } 930 }
931 for (int j = 0; j < sp->hops.size(); j++) { 931 for (int j = 0; j < sp->hops.size(); j++) {
932 sp->hops[j].h_amount = round(sp->hops.at(j).h_amount * factor * 100000) / 100000; 932 sp->hops[j].amount = round(sp->hops.at(j).amount * factor * 100000) / 100000;
933 } 933 }
934 for (int j = 0; j < sp->miscs.size(); j++) { 934 for (int j = 0; j < sp->miscs.size(); j++) {
935 sp->miscs[j].amount = round(sp->miscs.at(j).amount * factor * 100000) / 100000; 935 sp->miscs[j].amount = round(sp->miscs.at(j).amount * factor * 100000) / 100000;
936 } 936 }
937 for (int j = 0; j < sp->yeasts.size(); j++) { 937 for (int j = 0; j < sp->yeasts.size(); j++) {
984 sp->prop_volume[3] = sp->prop_volume[3] * factor; 984 sp->prop_volume[3] = sp->prop_volume[3] * factor;
985 for (int j = 0; j < sp->fermentables.size(); j++) { 985 for (int j = 0; j < sp->fermentables.size(); j++) {
986 sp->fermentables[j].f_amount = round(sp->fermentables.at(j).f_amount * factor * 100000) / 100000; 986 sp->fermentables[j].f_amount = round(sp->fermentables.at(j).f_amount * factor * 100000) / 100000;
987 } 987 }
988 for (int j = 0; j < sp->hops.size(); j++) { 988 for (int j = 0; j < sp->hops.size(); j++) {
989 sp->hops[j].h_amount = round(sp->hops.at(j).h_amount * factor * 100000) / 100000; 989 sp->hops[j].amount = round(sp->hops.at(j).amount * factor * 100000) / 100000;
990 } 990 }
991 for (int j = 0; j < sp->miscs.size(); j++) { 991 for (int j = 0; j < sp->miscs.size(); j++) {
992 sp->miscs[j].amount = round(sp->miscs.at(j).amount * factor * 100000) / 100000; 992 sp->miscs[j].amount = round(sp->miscs.at(j).amount * factor * 100000) / 100000;
993 } 993 }
994 for (int j = 0; j < sp->yeasts.size(); j++) { 994 for (int j = 0; j < sp->yeasts.size(); j++) {

mercurial