184 |
184 |
185 xmlWriter->writeStartElement("YEASTS"); |
185 xmlWriter->writeStartElement("YEASTS"); |
186 for (int i = 0; i < product->yeasts.size(); i++) { |
186 for (int i = 0; i < product->yeasts.size(); i++) { |
187 xmlWriter->writeStartElement("YEAST"); |
187 xmlWriter->writeStartElement("YEAST"); |
188 xmlWriter->writeTextElement("VERSION", "1"); |
188 xmlWriter->writeTextElement("VERSION", "1"); |
189 xmlWriter->writeTextElement("NAME", product->yeasts.at(i).y_name); |
189 xmlWriter->writeTextElement("NAME", product->yeasts.at(i).name); |
190 xmlWriter->writeTextElement("TYPE", yeast_type[product->yeasts.at(i).y_type]); |
190 xmlWriter->writeTextElement("TYPE", yeast_type[product->yeasts.at(i).type]); |
191 xmlWriter->writeTextElement("FORM", yeast_form[product->yeasts.at(i).y_form]); |
191 xmlWriter->writeTextElement("FORM", yeast_form[product->yeasts.at(i).form]); |
192 xmlWriter->writeTextElement("AMOUNT", QString::number(product->yeasts.at(i).y_amount, 'f', 5)); |
192 xmlWriter->writeTextElement("AMOUNT", QString::number(product->yeasts.at(i).amount, 'f', 5)); |
193 xmlWriter->writeTextElement("AMOUNT_IS_WEIGHT", (product->yeasts.at(i).y_form == 1) ? "TRUE":"FALSE"); |
193 xmlWriter->writeTextElement("AMOUNT_IS_WEIGHT", (product->yeasts.at(i).form == 1) ? "TRUE":"FALSE"); |
194 xmlWriter->writeTextElement("LABORATORY", product->yeasts.at(i).y_laboratory); |
194 xmlWriter->writeTextElement("LABORATORY", product->yeasts.at(i).laboratory); |
195 xmlWriter->writeTextElement("PRODUCT_ID", product->yeasts.at(i).y_product_id); |
195 xmlWriter->writeTextElement("PRODUCT_ID", product->yeasts.at(i).product_id); |
196 xmlWriter->writeTextElement("MIN_TEMPERATURE", QString::number(product->yeasts.at(i).y_min_temperature, 'f', 1)); |
196 xmlWriter->writeTextElement("MIN_TEMPERATURE", QString::number(product->yeasts.at(i).min_temperature, 'f', 1)); |
197 xmlWriter->writeTextElement("MAX_TEMPERATURE", QString::number(product->yeasts.at(i).y_max_temperature, 'f', 1)); |
197 xmlWriter->writeTextElement("MAX_TEMPERATURE", QString::number(product->yeasts.at(i).max_temperature, 'f', 1)); |
198 xmlWriter->writeTextElement("ATTENUATION", QString::number(product->yeasts.at(i).y_attenuation, 'f', 1)); |
198 xmlWriter->writeTextElement("ATTENUATION", QString::number(product->yeasts.at(i).attenuation, 'f', 1)); |
199 xmlWriter->writeTextElement("ADD_TO_SECONDARY", (product->yeasts.at(i).y_use == 0) ? "FALSE":"TRUE"); |
199 xmlWriter->writeTextElement("ADD_TO_SECONDARY", (product->yeasts.at(i).use == 0) ? "FALSE":"TRUE"); |
200 xmlWriter->writeEndElement(); |
200 xmlWriter->writeEndElement(); |
201 } |
201 } |
202 xmlWriter->writeEndElement(); // YEASTS |
202 xmlWriter->writeEndElement(); // YEASTS |
203 |
203 |
204 xmlWriter->writeStartElement("WATERS"); |
204 xmlWriter->writeStartElement("WATERS"); |
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"); |
507 memo.append("[head]Gistlab en code[/head][head]Omschrijving[/head][head]Gebruik[/head][head]Vorm[/head][head]Hoeveel[/head]\n"); |
507 memo.append("[head]Gistlab en code[/head][head]Omschrijving[/head][head]Gebruik[/head][head]Vorm[/head][head]Hoeveel[/head]\n"); |
508 for (int i = 0; i < product->yeasts.size(); i++) { |
508 for (int i = 0; i < product->yeasts.size(); i++) { |
509 memo.append("[row][data]" + product->yeasts.at(i).y_laboratory + " " + product->yeasts.at(i).y_product_id + "[/data]"); |
509 memo.append("[row][data]" + product->yeasts.at(i).laboratory + " " + product->yeasts.at(i).product_id + "[/data]"); |
510 memo.append("[data]" + product->yeasts.at(i).y_name + "[/data]"); |
510 memo.append("[data]" + product->yeasts.at(i).name + "[/data]"); |
511 memo.append("[data]" + yeast_use[product->yeasts.at(i).y_use] + "[/data]"); |
511 memo.append("[data]" + yeast_use[product->yeasts.at(i).use] + "[/data]"); |
512 memo.append("[data]" + yeast_form[product->yeasts.at(i).y_form] + "[/data]"); |
512 memo.append("[data]" + yeast_form[product->yeasts.at(i).form] + "[/data]"); |
513 if (product->yeasts.at(i).y_form == YEAST_FORMS_LIQUID) |
513 if (product->yeasts.at(i).form == YEAST_FORMS_LIQUID) |
514 memo.append("[data]" + QString::number(product->yeasts.at(i).y_amount, 'f', 0) + " pak[/data][/row]\n"); |
514 memo.append("[data]" + QString::number(product->yeasts.at(i).amount, 'f', 0) + " pak[/data][/row]\n"); |
515 else if (product->yeasts.at(i).y_form == YEAST_FORMS_DRY || product->yeasts.at(i).y_form == YEAST_FORMS_DRIED) |
515 else if (product->yeasts.at(i).form == YEAST_FORMS_DRY || product->yeasts.at(i).form == YEAST_FORMS_DRIED) |
516 memo.append("[data]" + QString::number(product->yeasts.at(i).y_amount * 1000, 'f', 1) + " gr[/data][/row]\n"); |
516 memo.append("[data]" + QString::number(product->yeasts.at(i).amount * 1000, 'f', 1) + " gr[/data][/row]\n"); |
517 else |
517 else |
518 memo.append("[data]" + QString::number(product->yeasts.at(i).y_amount * 1000, 'f', 0) + " ml[/data][/row]\n"); |
518 memo.append("[data]" + QString::number(product->yeasts.at(i).amount * 1000, 'f', 0) + " ml[/data][/row]\n"); |
519 } |
519 } |
520 memo.append("[/tabular]\n"); |
520 memo.append("[/tabular]\n"); |
521 if (product->starter_enable) { |
521 if (product->starter_enable) { |
522 double sv = 0; |
522 double sv = 0; |
523 for (int i = 0; i < 4; i++) { |
523 for (int i = 0; i < 4; i++) { |
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++) { |
938 sp->yeasts[j].y_amount = round(sp->yeasts.at(j).y_amount * factor * 100000) / 100000; |
938 sp->yeasts[j].amount = round(sp->yeasts.at(j).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++) { |
941 sp->mashs[j].step_volume = round(sp->mashs.at(j).step_volume * factor * 100) / 100; |
941 sp->mashs[j].step_volume = round(sp->mashs.at(j).step_volume * factor * 100) / 100; |
942 sp->mashs[j].step_infuse_amount = round(sp->mashs.at(j).step_infuse_amount * factor * 100) / 100; |
942 sp->mashs[j].step_infuse_amount = round(sp->mashs.at(j).step_infuse_amount * factor * 100) / 100; |
943 } |
943 } |
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++) { |
995 sp->yeasts[j].y_amount = round(sp->yeasts.at(j).y_amount * factor * 100000) / 100000; |
995 sp->yeasts[j].amount = round(sp->yeasts.at(j).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++) { |
998 sp->mashs[j].step_volume = round(sp->mashs.at(j).step_volume * factor * 100) / 100; |
998 sp->mashs[j].step_volume = round(sp->mashs.at(j).step_volume * factor * 100) / 100; |
999 sp->mashs[j].step_infuse_amount = round(sp->mashs.at(j).step_infuse_amount * factor * 100) / 100; |
999 sp->mashs[j].step_infuse_amount = round(sp->mashs.at(j).step_infuse_amount * factor * 100) / 100; |
1000 } |
1000 } |
1027 |
1027 |
1028 QRadioButton *beerxmlButton = new QRadioButton(dialog); |
1028 QRadioButton *beerxmlButton = new QRadioButton(dialog); |
1029 beerxmlButton->setObjectName(QString::fromUtf8("beerxmlButton")); |
1029 beerxmlButton->setObjectName(QString::fromUtf8("beerxmlButton")); |
1030 beerxmlButton->setGeometry(QRect(50, 20, 171, 21)); |
1030 beerxmlButton->setGeometry(QRect(50, 20, 171, 21)); |
1031 beerxmlButton->setText(tr("Export to beerXML")); |
1031 beerxmlButton->setText(tr("Export to beerXML")); |
1032 QRadioButton *copy_productButton = new QRadioButton(dialog); |
1032 QRadioButton *copproductButton = new QRadioButton(dialog); |
1033 copy_productButton->setObjectName(QString::fromUtf8("copy_productButton")); |
1033 copproductButton->setObjectName(QString::fromUtf8("copproductButton")); |
1034 copy_productButton->setGeometry(QRect(50, 50, 171, 21)); |
1034 copproductButton->setGeometry(QRect(50, 50, 171, 21)); |
1035 copy_productButton->setText(tr("Copy to product")); |
1035 copproductButton->setText(tr("Copy to product")); |
1036 QRadioButton *copy_recipeButton = new QRadioButton(dialog); |
1036 QRadioButton *coprecipeButton = new QRadioButton(dialog); |
1037 copy_recipeButton->setObjectName(QString::fromUtf8("copy_recipeButton")); |
1037 coprecipeButton->setObjectName(QString::fromUtf8("coprecipeButton")); |
1038 copy_recipeButton->setGeometry(QRect(50, 80, 171, 21)); |
1038 coprecipeButton->setGeometry(QRect(50, 80, 171, 21)); |
1039 copy_recipeButton->setText(tr("Copy to recipe")); |
1039 coprecipeButton->setText(tr("Copy to recipe")); |
1040 QRadioButton *toforumButton = new QRadioButton(dialog); |
1040 QRadioButton *toforumButton = new QRadioButton(dialog); |
1041 toforumButton->setObjectName(QString::fromUtf8("toforumButton")); |
1041 toforumButton->setObjectName(QString::fromUtf8("toforumButton")); |
1042 toforumButton->setGeometry(QRect(50, 110, 171, 21)); |
1042 toforumButton->setGeometry(QRect(50, 110, 171, 21)); |
1043 toforumButton->setText(tr("Export to forum")); |
1043 toforumButton->setText(tr("Export to forum")); |
1044 QRadioButton *splitButton = new QRadioButton(dialog); |
1044 QRadioButton *splitButton = new QRadioButton(dialog); |
1054 dialog->setModal(true); |
1054 dialog->setModal(true); |
1055 dialog->exec(); |
1055 dialog->exec(); |
1056 if (dialog->result() == QDialog::Accepted) { |
1056 if (dialog->result() == QDialog::Accepted) { |
1057 if (beerxmlButton->isChecked()) |
1057 if (beerxmlButton->isChecked()) |
1058 exportBeerXML(); |
1058 exportBeerXML(); |
1059 if (copy_productButton->isChecked()) |
1059 if (copproductButton->isChecked()) |
1060 copyProduct(); |
1060 copyProduct(); |
1061 if (copy_recipeButton->isChecked()) |
1061 if (coprecipeButton->isChecked()) |
1062 copyRecipe(); |
1062 copyRecipe(); |
1063 if (toforumButton->isChecked()) |
1063 if (toforumButton->isChecked()) |
1064 toforumProduct(); |
1064 toforumProduct(); |
1065 if (splitButton->isChecked()) |
1065 if (splitButton->isChecked()) |
1066 splitProduct(); |
1066 splitProduct(); |