# HG changeset patch # User Michiel Broek # Date 1653072213 -7200 # Node ID 448e4187cada0d26e89fd234434a514efa3a349d # Parent d369948a3eb54d55835d97b9a1486b5b0973ab75 Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing. diff -r d369948a3eb5 -r 448e4187cada src/EditProduct.cpp --- a/src/EditProduct.cpp Fri May 20 14:48:03 2022 +0200 +++ b/src/EditProduct.cpp Fri May 20 20:43:33 2022 +0200 @@ -1009,7 +1009,7 @@ ui->keg_forcedEdit->setChecked(product->keg_forced_carb); // Tab taste. - ui->taste_dateEdit->setText(product->taste_date.toString("dd MMM yyyy")); + ui->taste_dateEdit->setDate(product->taste_date); ui->taste_rateEdit->setValue(product->taste_rate); ui->taste_notesEdit->setPlainText(product->taste_notes); ui->taste_colorEdit->setText(product->taste_color); @@ -1170,6 +1170,18 @@ connect(ui->keg_forcedEdit, &QCheckBox::stateChanged, this, &EditProduct::kegs_forced_changed); /* All signals from tab Tasting */ + connect(ui->taste_dateEdit, &QDateEdit::dateChanged, this, &EditProduct::taste_date_changed); + connect(ui->taste_dateButton, SIGNAL(clicked()), this, SLOT(taste_date_button())); + connect(ui->taste_ackButton, SIGNAL(clicked()), this, SLOT(taste_date_ack())); + connect(ui->taste_rateEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::taste_rate_changed); + connect(ui->taste_colorEdit, &QLineEdit::textChanged, this, &EditProduct::taste_color_changed); + connect(ui->taste_transparencyEdit, &QLineEdit::textChanged, this, &EditProduct::taste_transparency_changed); + connect(ui->taste_headEdit, &QLineEdit::textChanged, this, &EditProduct::taste_head_changed); + connect(ui->taste_aromaEdit, &QLineEdit::textChanged, this, &EditProduct::taste_aroma_changed); + connect(ui->taste_tasteEdit, &QLineEdit::textChanged, this, &EditProduct::taste_taste_changed); + connect(ui->taste_mouthfeelEdit, &QLineEdit::textChanged, this, &EditProduct::taste_mouthfeel_changed); + connect(ui->taste_aftertasteEdit, &QLineEdit::textChanged, this, &EditProduct::taste_aftertaste_changed); + connect(ui->taste_notesEdit, SIGNAL(textChanged()), this, SLOT(taste_notes_changed())); setStage(); @@ -1820,6 +1832,7 @@ #include "EditProductTab9.cpp" #include "EditProductTab10.cpp" #include "EditProductTab11.cpp" +#include "EditProductTab12.cpp" #include "EditProductExport.cpp" diff -r d369948a3eb5 -r 448e4187cada src/EditProduct.h --- a/src/EditProduct.h Fri May 20 14:48:03 2022 +0200 +++ b/src/EditProduct.h Fri May 20 20:43:33 2022 +0200 @@ -214,6 +214,18 @@ void kegs_water_changed(double val); void kegs_forced_changed(bool val); void kegs_temp_changed(double val); + void taste_date_changed(QDate val); + void taste_date_button(); + void taste_date_ack(); + void taste_rate_changed(double val); + void taste_color_changed(QString val); + void taste_transparency_changed(QString val); + void taste_head_changed(QString val); + void taste_aroma_changed(QString val); + void taste_taste_changed(QString val); + void taste_mouthfeel_changed(QString val); + void taste_aftertaste_changed(QString val); + void taste_notes_changed(); /* Modified progress bars */ void ferment_perc_mash_valueChanged(int value); diff -r d369948a3eb5 -r 448e4187cada src/EditProductTab1.cpp --- a/src/EditProductTab1.cpp Fri May 20 14:48:03 2022 +0200 +++ b/src/EditProductTab1.cpp Fri May 20 20:43:33 2022 +0200 @@ -241,7 +241,20 @@ ui->efficiencyEdit->setButtonSymbols((stage > PROD_STAGE_WAIT) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); ui->est_ogEdit->setReadOnly(stage > PROD_STAGE_WAIT); ui->est_ogEdit->setButtonSymbols((stage > PROD_STAGE_WAIT) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); - // Block locked if stage <= PROD_STAGE_TASTE + if (stage > PROD_STAGE_PACKAGE) { + ui->ok_pmptLabel->hide(); + ui->ok_pmptIcon->hide(); + } else { + ui->ok_pmptLabel->show(); + ui->ok_pmptIcon->show(); + } + if (stage >= PROD_STAGE_READY) { + ui->lockedLabel->show(); + ui->lockedEdit->show(); + } else { + ui->lockedLabel->hide(); + ui->lockedEdit->hide(); + } /* Tab 2, equipment */ ui->tabWidget->setTabEnabled(1, stage < PROD_STAGE_BREW); @@ -537,10 +550,30 @@ ui->pack_ackButton->show(); } - /* Tab 12, tasting */ ui->tabWidget->setTabEnabled(11, stage > PROD_STAGE_PACKAGE); - + ui->taste_dateEdit->setEnabled(stage == PROD_STAGE_TASTE); + if (stage == PROD_STAGE_TASTE) { + ui->taste_dateEdit->setMinimumDate(product->package_date.addDays(41)); + ui->taste_dateEdit->setMaximumDate(QDate::currentDate()); + } + ui->taste_dateButton->setEnabled(stage == PROD_STAGE_TASTE); + ui->taste_colorEdit->setEnabled(stage == PROD_STAGE_TASTE); + ui->taste_transparencyEdit->setEnabled(stage == PROD_STAGE_TASTE); + ui->taste_headEdit->setEnabled(stage == PROD_STAGE_TASTE); + ui->taste_aromaEdit->setEnabled(stage == PROD_STAGE_TASTE); + ui->taste_tasteEdit->setEnabled(stage == PROD_STAGE_TASTE); + ui->taste_mouthfeelEdit->setEnabled(stage == PROD_STAGE_TASTE); + ui->taste_aftertasteEdit->setEnabled(stage == PROD_STAGE_TASTE); + ui->taste_notesEdit->setEnabled(stage == PROD_STAGE_TASTE); + ui->taste_rateEdit->setEnabled(stage == PROD_STAGE_TASTE); + if ((product->taste_color != "") && (product->taste_transparency != "") && (product->taste_head != "") && + (product->taste_aroma != "") && (product->taste_taste != "") && (product->taste_mouthfeel != "") && + (product->taste_aftertaste != "") && (product->taste_notes != "") && (product->taste_rate > 0) && + (product->taste_date.isValid())) + ui->taste_ackButton->show(); + else + ui->taste_ackButton->hide(); } diff -r d369948a3eb5 -r 448e4187cada src/EditProductTab12.cpp --- a/src/EditProductTab12.cpp Fri May 20 14:48:03 2022 +0200 +++ b/src/EditProductTab12.cpp Fri May 20 20:43:33 2022 +0200 @@ -17,4 +17,104 @@ * along with this program. If not, see . */ +void EditProduct::taste_date_changed(QDate val) +{ + product->taste_date = ui->taste_dateEdit->nullDate(); + is_changed(); + setStage(); +} + +void EditProduct::taste_date_button() +{ + ui->taste_dateEdit->setDate(QDate::currentDate()); +} + + +void EditProduct::taste_date_ack() +{ + int rc = QMessageBox::warning(this, tr("Confirm tasting"), tr("Confirm that the beer tasting is done and the results are filled in."), + QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + + if (rc == QMessageBox::No) + return; + + product->stage = PROD_STAGE_READY; + setStage(); + is_changed(); +} + + +void EditProduct::taste_rate_changed(double val) +{ + product->taste_rate = val; + is_changed(); + setStage(); +} + + +void EditProduct::taste_color_changed(QString val) +{ + product->taste_color = val; + is_changed(); + setStage(); +} + + +void EditProduct::taste_transparency_changed(QString val) +{ + product->taste_transparency = val; + is_changed(); + setStage(); +} + + +void EditProduct::taste_head_changed(QString val) +{ + product->taste_head = val; + is_changed(); + setStage(); +} + + +void EditProduct::taste_aroma_changed(QString val) +{ + product->taste_aroma = val; + is_changed(); + setStage(); +} + + +void EditProduct::taste_taste_changed(QString val) +{ + product->taste_taste = val; + is_changed(); + setStage(); +} + + +void EditProduct::taste_mouthfeel_changed(QString val) +{ + product->taste_mouthfeel = val; + is_changed(); + setStage(); +} + + +void EditProduct::taste_aftertaste_changed(QString val) +{ + product->taste_aftertaste = val; + is_changed(); + setStage(); +} + + +void EditProduct::taste_notes_changed() +{ + /* The text cannot be passed in a simple way :) */ + product->taste_notes = ui->taste_notesEdit->toPlainText(); + is_changed(); + setStage(); +} + + diff -r d369948a3eb5 -r 448e4187cada src/EditProductTab3.cpp --- a/src/EditProductTab3.cpp Fri May 20 14:48:03 2022 +0200 +++ b/src/EditProductTab3.cpp Fri May 20 20:43:33 2022 +0200 @@ -395,6 +395,7 @@ */ double svg = 0; double initcells = 0; + product->yeasts_ok = true; if (product->yeasts.size() > 0) { for (i = 0; i < product->yeasts.size(); i++) { if (product->yeasts.at(i).y_use == 0) { // Used in primary @@ -406,7 +407,6 @@ else initcells += (product->yeasts.at(i).y_cells / 1000000) * product->yeasts.at(i).y_amount * (product->starter_viability / 100); // TODO: brett or others in secondary. - product->yeasts_ok = true; if ((((product->inventory_reduced <= PROD_STAGE_PRIMARY) && (product->yeasts.at(i).y_use == 0)) || // Primary ((product->inventory_reduced <= PROD_STAGE_SECONDARY) && (product->yeasts.at(i).y_use == 1)) || // Secondary ((product->inventory_reduced <= PROD_STAGE_TERTIARY) && (product->yeasts.at(i).y_use == 2)) || // Tertiary diff -r d369948a3eb5 -r 448e4187cada ui/EditProduct.ui --- a/ui/EditProduct.ui Fri May 20 14:48:03 2022 +0200 +++ b/ui/EditProduct.ui Fri May 20 20:43:33 2022 +0200 @@ -158,6 +158,9 @@ 23 + + 64 + @@ -172,8 +175,8 @@ - 870 - 200 + 740 + 180 131 20 @@ -188,8 +191,8 @@ - 1010 - 200 + 880 + 180 61 21 @@ -1150,6 +1153,9 @@ 23 + + 32 + @@ -3699,6 +3705,9 @@ 23 + + 128 + @@ -8332,7 +8341,7 @@ - Edit the brewdate plan or start. + Edit the date the primary fermentation was done. dd-MM-yyyy @@ -8566,7 +8575,7 @@ - Edit the brewdate plan or start. + Edit the date the secondary fermentation was done. dd-MM-yyyy @@ -9309,6 +9318,9 @@ Could be the description of the infusion. + + 128 + @@ -10179,7 +10191,7 @@ - Edit the brewdate plan or start. + Edit the package date. dd-MM-yyyy @@ -10229,26 +10241,10 @@ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - 180 - 20 - 101 - 23 - - - - End of fermentation. Optional transfer to lagertank. - - - true - - - 290 + 310 20 28 22 @@ -10325,8 +10321,8 @@ - 490 - 50 + 10 + 80 161 20 @@ -10342,7 +10338,7 @@ 10 - 80 + 110 161 20 @@ -10359,36 +10355,45 @@ 180 50 - 311 + 481 23 + + 64 + 180 - 80 - 311 + 110 + 791 23 + + 256 + - 660 - 50 - 311 + 180 + 80 + 791 23 + + 256 + 10 - 110 + 140 161 20 @@ -10404,17 +10409,20 @@ 180 - 110 + 140 791 23 + + 256 + 10 - 140 + 170 161 20 @@ -10430,17 +10438,20 @@ 180 - 140 + 170 791 23 + + 256 + 10 - 170 + 200 161 20 @@ -10456,17 +10467,20 @@ 180 - 170 + 200 791 23 + + 256 + 10 - 200 + 230 161 20 @@ -10482,17 +10496,20 @@ 180 - 200 + 230 791 23 + + 256 + 10 - 230 + 260 161 20 @@ -10508,12 +10525,51 @@ 180 - 230 + 260 791 101 + + + + 180 + 20 + 111 + 24 + + + + Edit the tasting date. + + + dd-MM-yyyy + + + true + + + + + + 350 + 20 + 28 + 22 + + + + Set or clear date + + + ... + + + + :/icons/silk/accept.png:/icons/silk/accept.png + + @@ -10568,8 +10624,281 @@ quitButton + exportButton deleteButton + printButton saveButton + tabWidget + codeEdit + nameEdit + stageEdit + birthEdit + typeEdit + notesEdit + batch_sizeEdit + boil_timeEdit + boil_sizeEdit + splitatEdit + efficiencyEdit + lockedEdit + beerstyleEdit + st_guideEdit + st_nameEdit + st_groupEdit + st_typeEdit + st_catEdit + st_catnrEdit + est_ogEdit + est_fgEdit + est_abvEdit + est_colorEdit + color_methodEdit + est_carbEdit + est_ibuEdit + ibu_methodEdit + calEdit + eq_selectEdit + eq_nameEdit + eq_notesEdit + tun_volumeEdit + tun_materialEdit + mash_volumeEdit + mash_maxEdit + lauter_volumeEdit + lauter_deadspaceEdit + kettle_volumeEdit + eqboil_sizeEdit + evap_rateEdit + eqboil_timeEdit + topup_kettleEdit + hop_utilizationEdit + eqbatch_sizeEdit + eq_efficiencyEdit + trub_chillerlossEdit + topup_waterEdit + est_color2Edit + est_og2Edit + mash_kgEdit + addFermentable + fermentablesTable + est_ibu2Edit + addHop + hopsTable + miscsTable + addMisc + est_og4Edit + est_fg3Edit + est_abv2Edit + est_svgEdit + productionEdit + productionButton1 + productionButton2 + conditionShow + addYeast + yeastsTable + stmethodEdit + pitchrateEdit + pitchrateButton + startersgEdit + neededShow + starterTable + lo_gr_hlEdit + lo_sgEdit + hi_gr_hlEdit + hi_sgEdit + dry_pitchrateShow + dry_needShow + pitch_grShow + mash_nameEdit + mash_pickEdit + mash_volEdit + mash_timeEdit + addMash + mashsTable + w1_nameEdit + w1_volEdit + w1_caEdit + w1_mgEdit + w1_hco3Edit + w1_caco3Edit + w1_naEdit + w1_clEdit + w1_so4Edit + w1_phEdit + w2_nameEdit + w2_volEdit + w2_caEdit + w2_mgEdit + w2_hco3Edit + w2_caco3Edit + w2_naEdit + w2_clEdit + w2_so4Edit + w2_phEdit + wg_volEdit + wg_caEdit + wg_mgEdit + wg_hco3Edit + wg_caco3Edit + wg_naEdit + wg_clEdit + wg_so4Edit + wg_phEdit + wb_caEdit + wb_mgEdit + wb_hco3Edit + wb_caco3Edit + wb_naEdit + wb_clEdit + wb_so4Edit + wb_phEdit + wt_sourceEdit + wt_caEdit + wt_mgEdit + wt_hco3Edit + wt_caco3Edit + wt_naEdit + wt_clEdit + wt_so4Edit + bs_cacl2Edit + bs_caso4Edit + bs_mgso4Edit + bs_naclEdit + bs_mgcl2Edit + bs_nahco3Edit + bs_caco3Edit + mw_phEdit + mw_autoEdit + mw_acidPick + mw_acidpercEdit + mw_acidvolEdit + sp_volEdit + sp_tempEdit + sp_sourceEdit + sp_phEdit + sp_acidtypeEdit + sp_acidpercEdit + sp_acidvolEdit + buguEdit + so4clEdit + cur_so4clEdit + brew_startDate + brew_startButton1 + brew_startButton2 + brew_startTime + brew_endDate + brew_endButton1 + brew_endTime + brew_ackButton + brew_logButton + brew_mashphEdit + brew_mashphShow + brew_mashsgEdit + brew_mashsgShow + brew_masheffShow + brew_spargetempShow + brew_spargevolShow + brew_spargeestShow + brew_spargephEdit + brew_spargephShow + brew_preboilphEdit + brew_preboilsgEdit + brew_preboilsgShow + brew_preboilvolEdit + brew_preboilvolShow + brew_preboilButton + brew_preboileffShow + brew_aboilphEdit + brew_aboilsgEdit + brew_aboilsgShow + brew_aboilvolEdit + brew_aboilvolShow + brew_aboilButton + brew_aboileffShow + brew_cooltoEdit + brew_coolwithEdit + brew_cooltimeEdit + brew_whirlpool9Edit + brew_whirlpool7Edit + brew_whirlpool6Edit + brew_whirlpool2Edit + brew_trublossEdit + brew_topupwaterEdit + brew_tofermentEdit + brew_aerwithEdit + brew_aertimeEdit + brew_aerspeedEdit + brew_fermentsgShow + brew_fermentcolorShow + brew_fermentibuShow + prim_ogShow + prim_startCEdit + prim_maxCEdit + prim_endCEdit + prim_endsgEdit + prim_endsgButton + prim_enddateEdit + prim_enddateButton + prim_ackButton + prim_attShow + sec_tempEdit + sec_sgEdit + sec_sgButton + sec_enddateEdit + sec_enddateButton + sec_ackButton + sec_attShow + tert_tempEdit + tert_estsgShow + tert_sgEdit + tert_sgButton + tert_attShow + tert_abvShow + ferm_log1Button + ferm_log2Button + pack_dateEdit + pack_dateButton + pack_ackButton + pack_carbloShow + pack_carbhiShow + pack_volumeEdit + pack_phEdit + pack_abvShow + pack_addvolEdit + pack_addabvEdit + pack_finalabvShow + pack_notesEdit + bottle_volumeEdit + bottle_carbEdit + bottle_sugarEdit + bottle_sug_amountShow + bottle_sug_weightShow + bottle_sug_waterEdit + bottle_abvShow + bottle_barShow + bottle_tempEdit + keg_volumeEdit + keg_carbEdit + keg_sugarEdit + keg_sug_amountShow + keg_sug_weightShow + keg_sug_waterEdit + keg_forcedEdit + keg_abvShow + keg_barShow + keg_tempEdit + taste_dateEdit + taste_dateButton + taste_ackButton + taste_rateEdit + taste_colorEdit + taste_transparencyEdit + taste_headEdit + taste_aromaEdit + taste_tasteEdit + taste_aftertasteEdit + taste_mouthfeelEdit + taste_notesEdit