src/EditProductExport.cpp

changeset 280
efc213beb605
parent 273
eb9b50a4bf35
child 282
d1d208a857b0
equal deleted inserted replaced
279:8540fd0166e7 280:efc213beb605
170 170
171 xmlWriter->writeStartElement("MISCS"); 171 xmlWriter->writeStartElement("MISCS");
172 for (int i = 0; i < product->miscs.size(); i++) { 172 for (int i = 0; i < product->miscs.size(); i++) {
173 xmlWriter->writeStartElement("MISC"); 173 xmlWriter->writeStartElement("MISC");
174 xmlWriter->writeTextElement("VERSION", "1"); 174 xmlWriter->writeTextElement("VERSION", "1");
175 xmlWriter->writeTextElement("NAME", product->miscs.at(i).m_name); 175 xmlWriter->writeTextElement("NAME", product->miscs.at(i).name);
176 xmlWriter->writeTextElement("TYPE", misc_type[product->miscs.at(i).m_type]); 176 xmlWriter->writeTextElement("TYPE", misc_type[product->miscs.at(i).type]);
177 xmlWriter->writeTextElement("AMOUNT", QString::number(product->miscs.at(i).m_amount, 'f', 5)); 177 xmlWriter->writeTextElement("AMOUNT", QString::number(product->miscs.at(i).amount, 'f', 5));
178 xmlWriter->writeTextElement("AMOUNT_IS_WEIGHT", product->miscs.at(i).m_amount_is_weight ? "TRUE":"FALSE"); 178 xmlWriter->writeTextElement("AMOUNT_IS_WEIGHT", product->miscs.at(i).amount_is_weight ? "TRUE":"FALSE");
179 xmlWriter->writeTextElement("USE", misc_use[product->miscs.at(i).m_use_use]); 179 xmlWriter->writeTextElement("USE", misc_use[product->miscs.at(i).use_use]);
180 xmlWriter->writeTextElement("TIME", QString::number(product->miscs.at(i).m_time, 'f', 0)); 180 xmlWriter->writeTextElement("TIME", QString::number(product->miscs.at(i).time, 'f', 0));
181 xmlWriter->writeEndElement(); 181 xmlWriter->writeEndElement();
182 } 182 }
183 xmlWriter->writeEndElement(); // MISCS 183 xmlWriter->writeEndElement(); // MISCS
184 184
185 xmlWriter->writeStartElement("YEASTS"); 185 xmlWriter->writeStartElement("YEASTS");
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");
493 memo.append("[head]Specerij, kruid, brouwzout[/head][head]Type grondstof[/head][head]Gebruik tijdens[/head][head]Hoeveel[/head]\n"); 493 memo.append("[head]Specerij, kruid, brouwzout[/head][head]Type grondstof[/head][head]Gebruik tijdens[/head][head]Hoeveel[/head]\n");
494 for (int i = 0; i < product->miscs.size(); i++) { 494 for (int i = 0; i < product->miscs.size(); i++) {
495 memo.append("[row][data]" + product->miscs.at(i).m_name + "[/data]"); 495 memo.append("[row][data]" + product->miscs.at(i).name + "[/data]");
496 memo.append("[data]" + misc_type[product->miscs.at(i).m_type] + "[/data]"); 496 memo.append("[data]" + misc_type[product->miscs.at(i).type] + "[/data]");
497 if (product->miscs.at(i).m_use_use == MISC_USES_BOIL) 497 if (product->miscs.at(i).use_use == MISC_USES_BOIL)
498 memo.append("[data]" + misc_use[product->miscs.at(i).m_use_use] + " " + QString::number(product->miscs.at(i).m_time) + " min[/data]"); 498 memo.append("[data]" + misc_use[product->miscs.at(i).use_use] + " " + QString::number(product->miscs.at(i).time) + " min[/data]");
499 else 499 else
500 memo.append("[data]" + misc_use[product->miscs.at(i).m_use_use] + "[/data]"); 500 memo.append("[data]" + misc_use[product->miscs.at(i).use_use] + "[/data]");
501 memo.append("[data]"+QString::number(product->miscs.at(i).m_amount * 1000, 'f', 2)+((product->miscs.at(i).m_amount_is_weight)?" gr":" ml")+"[/data][/row]\n"); 501 memo.append("[data]"+QString::number(product->miscs.at(i).amount * 1000, 'f', 2)+((product->miscs.at(i).amount_is_weight)?" gr":" ml")+"[/data][/row]\n");
502 } 502 }
503 memo.append("[/tabular]\n\n"); 503 memo.append("[/tabular]\n\n");
504 504
505 memo.append("[u][b]Gist[/b][/u]\n"); 505 memo.append("[u][b]Gist[/b][/u]\n");
506 memo.append("[tabular]\n"); 506 memo.append("[tabular]\n");
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].h_amount = round(sp->hops.at(j).h_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].m_amount = round(sp->miscs.at(j).m_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++) {
938 sp->yeasts[j].y_amount = round(sp->yeasts.at(j).y_amount * factor * 100000) / 100000; 938 sp->yeasts[j].y_amount = round(sp->yeasts.at(j).y_amount * factor * 100000) / 100000;
939 } 939 }
940 for (int j = 0; j < sp->mashs.size(); j++) { 940 for (int j = 0; j < sp->mashs.size(); j++) {
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].h_amount = round(sp->hops.at(j).h_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].m_amount = round(sp->miscs.at(j).m_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++) {
995 sp->yeasts[j].y_amount = round(sp->yeasts.at(j).y_amount * factor * 100000) / 100000; 995 sp->yeasts[j].y_amount = round(sp->yeasts.at(j).y_amount * factor * 100000) / 100000;
996 } 996 }
997 for (int j = 0; j < sp->mashs.size(); j++) { 997 for (int j = 0; j < sp->mashs.size(); j++) {

mercurial