# HG changeset patch # User Michiel Broek # Date 1651244855 -7200 # Node ID 69a033e099a25ba77951b1ce9d22a0f1fbf25146 # Parent f1ed3a2a94e9d963bba1b68c382790dd1b004c6b Tab 2 equipent, all editfields placed. diff -r f1ed3a2a94e9 -r 69a033e099a2 src/EditProduct.cpp --- a/src/EditProduct.cpp Thu Apr 28 22:49:13 2022 +0200 +++ b/src/EditProduct.cpp Fri Apr 29 17:07:35 2022 +0200 @@ -61,13 +61,11 @@ query.prepare("SELECT name FROM inventory_waters ORDER BY record"); query.exec(); - query.first(); ui->w1_nameEdit->addItem(""); ui->w2_nameEdit->addItem(""); - for (int i = 0; i < query.size(); i++) { + while (query.next()) { ui->w1_nameEdit->addItem(query.value(0).toString()); ui->w2_nameEdit->addItem(query.value(0).toString()); - query.next(); } query.prepare("SELECT name FROM profile_water ORDER BY name"); @@ -84,13 +82,11 @@ ui->mash_pickEdit->addItem(query.value(0).toString()); } - ui->beerstyleEdit->addItem(""); // First add a dummy + ui->beerstyleEdit->addItem(product->st_name); // First add a dummy, the current style query.prepare("SELECT style_guide,style_letter,name FROM profile_styles ORDER BY style_guide,style_letter,name"); query.exec(); - query.first(); - for (int i = 0; i < query.size(); i++) { + while (query.next()) { ui->beerstyleEdit->addItem(query.value(0).toString()+" "+query.value(1).toString()+" "+query.value(2).toString()); - query.next(); } if (id >= 0) { @@ -566,8 +562,8 @@ qDebug() << "mashs" << product->mashs.size(); } else { - /* Set some defaults */ - product->locked = false; + /* New product, set some defaults */ + product->locked = product->log_brew = product->log_fermentation = product->log_ispindel = product->log_co2pressure = false; product->st_name = ""; product->st_letter = ""; product->st_guide = ""; @@ -580,14 +576,56 @@ product->st_color_min = 3; product->st_color_max = 100; product->st_carb_min = 1.0; product->st_carb_max = 4.5; product->st_abv_min = 1; product->st_abv_max = 15; - product->name = ""; + product->eq_name = product->eq_notes = product->name = product->code = ""; + product->eq_tun_specific_heat = 0.11; + product->eq_tun_material = 0; + product->eq_tun_volume = product->eq_tun_height = 20; + product->eq_tun_weight = 2; + product->eq_top_up_water = 0; + product->eq_trub_chiller_loss = 0.5; + product->eq_evap_rate = 1.8; + product->eq_calc_boil_volume = true; + product->eq_top_up_kettle = 0; + product->eq_hop_utilization = 100; + product->eq_lauter_volume = product->eq_lauter_height = product->eq_kettle_volume = product->eq_kettle_height = product->eq_mash_volume = 20; + product->eq_lauter_deadspace = 0.5; + product->eq_mash_max = 6; + product->eq_efficiency = 75; + product->birth = QDate::currentDate(); + product->stage = product->inventory_reduced = PROD_STAGE_PLAN; product->notes = ""; product->efficiency = 75; - product->batch_size = 20; - product->boil_time = 60; - product->boil_size = product->batch_size + (round(product->batch_size * product->boil_time / 60.0) / 10.0); + product->eq_batch_size = product->batch_size = 20; + product->eq_boil_time = product->boil_time = 60; + product->eq_boil_size = product->boil_size = product->batch_size + (round(product->batch_size * product->boil_time / 60.0) / 10.0); product->type = 2; product->est_og = product->est_fg = product->est_color = product->est_ibu = product->est_abv = 0; + product->brew_date_start = product->brew_date_end = QDateTime(); + product->brew_mash_ph = product->brew_mash_sg = product->brew_mash_efficiency = 0; + product->brew_sparge_temperature = product->brew_sparge_volume = product->brew_sparge_est = product->brew_sparge_ph = 0; + product->brew_preboil_volume = product->brew_preboil_sg = product->brew_preboil_ph = product->brew_preboil_efficiency = 0; + product->brew_aboil_volume = product->brew_aboil_sg = product->brew_aboil_ph = product->brew_aboil_efficiency = 0; + product->brew_cooling_method = product->brew_cooling_time = 0; + product->brew_cooling_to = 20; + product->brew_whirlpool9 = product->brew_whirlpool7 = product->brew_whirlpool6 = product->brew_whirlpool2 = 0; + product->brew_fermenter_volume = product->brew_fermenter_extrawater = product->brew_fermenter_tcloss = 0; + product->brew_aeration_time = product->brew_aeration_speed = product->brew_aeration_type = 0; + product->brew_fermenter_sg = product->brew_fermenter_ibu = product->brew_fermenter_color = 0; + product->og = product->fg = 0; + product->primary_start_temp = product->primary_max_temp = product->primary_end_temp = product->primary_end_sg = 0; + product->primary_end_date = product->secondary_end_date = QDate(); + product->secondary_temp = product->secondary_end_sg = product->tertiary_temp = 0; + product->package_date = QDate(); + product->package_volume = product->package_infuse_amount = product->package_infuse_abv = product->package_abv = product->package_ph = 0; + product->package_infuse_notes = ""; + product->bottle_amount = product->bottle_carbonation = product->bottle_priming_amount = product->bottle_carbonation_temp = 0; + product->keg_amount = product->keg_carbonation = product->keg_priming_amount = product->keg_priming_water = 0; + product->keg_carbonation_temp = product->keg_pressure = 0; + product->bottle_priming_water = product->keg_priming_sugar = 0; + product->taste_rate = 0; + product->taste_date = QDate(); + product->taste_notes = product->taste_color = product->taste_transparency = product->taste_head = ""; + product->taste_aroma = product->taste_taste = product->taste_mouthfeel = product->taste_aftertaste = ""; product->sparge_temp = 80; product->sparge_ph = 5.4; product->sparge_volume = 8; @@ -636,6 +674,14 @@ product->wa_acid_name = 0; product->wa_acid_perc = 80; product->wa_base_name = 0; + product->starter_enable = false; + product->starter_type = product->prop1_type = product->prop2_type = product->prop3_type = product->prop4_type = 0; + product->starter_viability = 100; + product->starter_sg = 1.037; + product->yeast_prod_date = QDate(); + product->yeast_pitchrate = product->prop1_volume = product->prop2_volume = product->prop3_volume = product->prop4_volume = 0; + product->divide_type = product->divide_parts = product->divide_part = 0; + product->divide_size = product->divide_factor = 0; } // Tab generic. @@ -647,12 +693,21 @@ ui->st_catnrEdit->setText(QString("%1").arg(product->st_category_number)); ui->st_typeEdit->setText(style_types[product->st_type]); ui->nameEdit->setText(product->name); + ui->codeEdit->setText(product->code); + ui->birthEdit->setText(product->birth.toString("dd MMM yyyy")); + ui->stageEdit->setText(prod_stages[product->stage]); ui->notesEdit->setPlainText(product->notes); ui->typeEdit->setCurrentIndex(product->type); ui->batch_sizeEdit->setValue(product->batch_size); ui->boil_sizeEdit->setValue(product->boil_size); ui->boil_timeEdit->setValue(product->boil_time); ui->efficiencyEdit->setValue(product->efficiency); + if (product->divide_type > 0) + ui->splitatEdit->setText(QString(tr("%1, part %2 of %3").arg(prod_split[product->divide_type]) + .arg(product->divide_part + 1) + .arg(product->divide_parts + 1))); + else + ui->splitatEdit->setText(prod_split[product->divide_type]); ui->est_ogEdit->setValue(product->est_og); ui->est_ogShow->setRange(product->st_og_min, product->st_og_max); ui->est_ogShow->setPrecision(3); @@ -687,6 +742,9 @@ ui->est_carbShow->setRange(product->st_carb_min, product->st_carb_max); ui->est_carbShow->setValue(product->est_carb); + // Tab equipment. + showEquipment(); + // Tab fermentables. ui->est_og2Edit->setValue(product->est_og); ui->est_color2Edit->setValue(product->est_color); @@ -808,6 +866,14 @@ ui->sp_acidpercEdit->setValue(product->sparge_acid_perc); ui->sp_acidvolEdit->setValue(product->sparge_acid_amount); + // Tab brewday. + + // Tab fermentation. + + // Tab packaging. + + // Tab taste. + // All signals from tab "Generic" connect(ui->lockedEdit, &QCheckBox::stateChanged, this, &EditProduct::is_changed); connect(ui->nameEdit, &QLineEdit::textChanged, this, &EditProduct::name_changed); diff -r f1ed3a2a94e9 -r 69a033e099a2 src/EditProduct.h --- a/src/EditProduct.h Thu Apr 28 22:49:13 2022 +0200 +++ b/src/EditProduct.h Fri Apr 29 17:07:35 2022 +0200 @@ -158,6 +158,7 @@ static bool misc_sort_test(const Miscs &D1, const Miscs &D2); static bool yeast_sort_test(const Yeasts &D1, const Yeasts &D2); void WindowTitle(); + void showEquipment(); void setLocked(bool val); void brewing_salt_sub(QString salt, double val); void set_brewing_salt(QString salt, double val); diff -r f1ed3a2a94e9 -r 69a033e099a2 src/EditProductTab2.cpp --- a/src/EditProductTab2.cpp Thu Apr 28 22:49:13 2022 +0200 +++ b/src/EditProductTab2.cpp Fri Apr 29 17:07:35 2022 +0200 @@ -18,3 +18,34 @@ */ +void EditProduct::showEquipment() +{ + ui->eq_nameEdit->setText(product->eq_name); + ui->eq_notesEdit->setPlainText(product->eq_notes); + + /* Mashing */ + ui->tun_volumeEdit->setValue(product->eq_tun_volume); + ui->tun_materialEdit->setText(tun_materials[product->eq_tun_material]); + ui->mash_volumeEdit->setValue(product->eq_mash_volume); + ui->mash_maxEdit->setValue(product->eq_mash_max); + + /* Lautering */ + ui->lauter_volumeEdit->setValue(product->eq_lauter_volume); + ui->lauter_deadspaceEdit->setValue(product->eq_lauter_deadspace); + + /* Boiling */ + ui->kettle_volumeEdit->setValue(product->eq_kettle_volume); + ui->eqboil_sizeEdit->setValue(product->eq_boil_size); + ui->evap_rateEdit->setValue(product->eq_evap_rate); + ui->eqboil_timeEdit->setValue(product->eq_boil_time); + ui->topup_kettleEdit->setValue(product->eq_top_up_kettle); + ui->hop_utilizationEdit->setValue(product->eq_hop_utilization); + ui->eqbatch_sizeEdit->setValue(product->eq_batch_size); + ui->efficiencyEdit->setValue(product->eq_efficiency); + + /* Chilling */ + ui->trub_chillerlossEdit->setValue(product->eq_trub_chiller_loss); + ui->topup_waterEdit->setValue(product->eq_top_up_water); +} + + diff -r f1ed3a2a94e9 -r 69a033e099a2 src/global.cpp --- a/src/global.cpp Thu Apr 28 22:49:13 2022 +0200 +++ b/src/global.cpp Fri Apr 29 17:07:35 2022 +0200 @@ -171,3 +171,10 @@ QObject::tr("Decoction") }); +const QStringList tun_materials({ + QObject::tr("Stainless Steel"), + QObject::tr("Aluminium"), + QObject::tr("Plastics"), + QObject::tr("Copper") +}); + diff -r f1ed3a2a94e9 -r 69a033e099a2 src/global.h --- a/src/global.h Thu Apr 28 22:49:13 2022 +0200 +++ b/src/global.h Fri Apr 29 17:07:35 2022 +0200 @@ -584,5 +584,6 @@ extern const QStringList yeast_use; extern const QStringList starters; extern const QStringList step_types; +extern const QStringList tun_materials; #endif diff -r f1ed3a2a94e9 -r 69a033e099a2 ui/EditProduct.ui --- a/ui/EditProduct.ui Thu Apr 28 22:49:13 2022 +0200 +++ b/ui/EditProduct.ui Fri Apr 29 17:07:35 2022 +0200 @@ -120,7 +120,7 @@ - 0 + 370 10 131 20 @@ -137,7 +137,7 @@ 0 - 100 + 70 131 20 @@ -152,9 +152,9 @@ - 140 + 510 10 - 591 + 551 23 @@ -163,17 +163,17 @@ 140 - 100 - 881 - 51 + 70 + 921 + 71 - 740 - 10 + 870 + 180 131 20 @@ -188,8 +188,8 @@ - 880 - 10 + 1010 + 180 61 21 @@ -201,8 +201,8 @@ - 0 - 160 + 740 + 40 131 20 @@ -217,8 +217,8 @@ - 140 - 160 + 880 + 40 181 23 @@ -228,7 +228,7 @@ 370 - 160 + 180 131 20 @@ -244,7 +244,7 @@ 370 - 190 + 150 131 20 @@ -260,7 +260,7 @@ 0 - 190 + 150 131 20 @@ -276,7 +276,7 @@ 740 - 190 + 150 131 20 @@ -292,7 +292,7 @@ 510 - 160 + 180 101 24 @@ -317,7 +317,7 @@ 510 - 190 + 150 101 24 @@ -342,7 +342,7 @@ 140 - 190 + 150 101 24 @@ -370,7 +370,7 @@ 880 - 190 + 150 87 24 @@ -385,7 +385,7 @@ QAbstractSpinBox::NoButtons - true + false L @@ -492,11 +492,14 @@ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + true + QAbstractSpinBox::NoButtons - true + false 3 @@ -890,7 +893,7 @@ - 500 + 130 20 226 23 @@ -909,17 +912,7 @@ true - - - - - 500 - 50 - 226 - 23 - - - + true @@ -935,6 +928,9 @@ true + + true + @@ -968,28 +964,12 @@ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - 360 - 50 - 131 - 20 - - - - Style name: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 360 + 10 20 - 131 + 111 20 @@ -1028,6 +1008,9 @@ true + + true + @@ -1057,6 +1040,9 @@ true + + true + @@ -1086,13 +1072,48 @@ true + + true + + + + + + 500 + 50 + 226 + 23 + + + + true + + + true + + + + + + 380 + 50 + 111 + 20 + + + + Style name: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + 0 - 40 + 10 131 20 @@ -1108,7 +1129,7 @@ 0 - 70 + 180 131 20 @@ -1124,46 +1145,23 @@ 140 - 40 + 10 181 23 - - - - 370 - 70 - 131 - 20 - - - - Split part: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - 140 - 70 - 101 + 180 + 226 23 - - - - - 510 - 70 - 101 - 23 - + + true @@ -1176,7 +1174,7 @@ - Plan start: + Brew plan start: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -1191,18 +1189,21 @@ 23 + + true + - 740 + 0 40 131 20 - Plan start: + Brew fase: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -1211,18 +1212,21 @@ - 880 + 140 40 101 23 + + true + - 740 - 160 + 620 + 180 131 20 @@ -1243,6 +1247,918 @@ Equipment + + + + 150 + 20 + 181 + 23 + + + + + + + 10 + 20 + 131 + 20 + + + + Equipment select: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 480 + 20 + 281 + 23 + + + + true + + + + + + 340 + 20 + 131 + 20 + + + + Equipment name: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 50 + 131 + 20 + + + + Remarks: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 150 + 50 + 901 + 91 + + + + + + + 10 + 160 + 291 + 151 + + + + Mashing + + + + + 10 + 80 + 121 + 20 + + + + Mash water: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 80 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 140 + 110 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + Kg + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 110 + 121 + 20 + + + + Max malts: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 20 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 20 + 121 + 20 + + + + Tun volume: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 50 + 121 + 20 + + + + Tun material: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 50 + 141 + 23 + + + + true + + + + + + + 10 + 320 + 291 + 91 + + + + Lautering + + + + + 140 + 50 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 50 + 121 + 20 + + + + Lauter deadspace: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 20 + 121 + 20 + + + + Lauter volume: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 20 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + + 820 + 160 + 291 + 91 + + + + Chilling + + + + + 10 + 20 + 121 + 20 + + + + Trub chiller loss: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 20 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 50 + 121 + 20 + + + + Top up water: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 50 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + + 420 + 160 + 291 + 271 + + + + Boiling + + + + + 10 + 20 + 121 + 20 + + + + Kettle volume: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 20 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 50 + 121 + 20 + + + + Boil size: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 50 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 80 + 121 + 20 + + + + Evaporation / hour: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 80 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 2 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 110 + 121 + 20 + + + + Boil time: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 110 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + min + + + 0 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 140 + 121 + 20 + + + + Top up kettle: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 140 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 170 + 121 + 20 + + + + Hop utilization: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 170 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + % + + + 0 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 200 + 121 + 20 + + + + Batch size: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 200 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 10 + 230 + 121 + 20 + + + + Efficiency: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 230 + 87 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + % + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + +