--- a/src/EditProductTab4.cpp Tue Jul 26 19:46:44 2022 +0200 +++ b/src/EditProductTab4.cpp Fri Jul 29 13:12:26 2022 +0200 @@ -104,10 +104,10 @@ item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->hopsTable->setItem(i, 6, item); - double ibu = Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, product->batch_size, + double ibu = Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, product->est_og3, product->batch_size, product->hops.at(i).amount, product->hops.at(i).time, product->hops.at(i).alpha, product->ibu_method, product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time, - product->brew_cooling_method, 0, 0); + product->brew_cooling_method, 0, 0, product->hops.at(i).utilisation, product->hops.at(i).bu_factor); item = new QTableWidgetItem(QString("%1").arg(ibu, 2, 'f', 1, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->hopsTable->setItem(i, 7, item); @@ -256,19 +256,21 @@ product->hops_ok = true; for (int i = 0; i < product->hops.size(); i++) { - ibus += Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, + ibus += Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, product->est_og3, product->batch_size, product->hops.at(i).amount, product->hops.at(i).time, product->hops.at(i).alpha, product->ibu_method, product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time, - product->brew_cooling_method, 0, 0); - ferm_ibus += Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, + product->brew_cooling_method, 0, 0, product->hops.at(i).utilisation, product->hops.at(i).bu_factor); + ferm_ibus += Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, product->est_og3, product->brew_fermenter_volume + product->brew_fermenter_tcloss, product->hops.at(i).amount, product->hops.at(i).time, product->hops.at(i).alpha, product->ibu_method, product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time, - product->brew_cooling_method, 0, 0); + product->brew_cooling_method, 0, 0, product->hops.at(i).utilisation, product->hops.at(i).bu_factor); - hop_flavour += Utils::hopFlavourContribution(product->hops.at(i).time, product->batch_size, product->hops.at(i).useat, product->hops.at(i).amount); - hop_aroma += Utils::hopAromaContribution(product->hops.at(i).time, product->batch_size, product->hops.at(i).useat, product->hops.at(i).amount); + hop_flavour += Utils::hopFlavourContribution(product->hops.at(i).time, product->batch_size, product->hops.at(i).useat, + product->hops.at(i).amount, product->hops.at(i).form); + hop_aroma += Utils::hopAromaContribution(product->hops.at(i).time, product->batch_size, product->hops.at(i).useat, + product->hops.at(i).amount, product->hops.at(i).form); if ((((product->inventory_reduced <= PROD_STAGE_BREW) && (product->hops.at(i).useat <= HOP_USEAT_WHIRLPOOL)) || ((product->inventory_reduced <= PROD_STAGE_PACKAGE) && (product->hops.at(i).useat == HOP_USEAT_DRY_HOP))) && (product->hops.at(i).inventory < product->hops.at(i).amount)) @@ -360,11 +362,12 @@ item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->hopsTable->setItem(product->hops_row, 8, item); - double ibu = Utils::toIBU(product->hops.at(product->hops_row).useat, product->hops.at(product->hops_row).form, product->preboil_sg, + double ibu = Utils::toIBU(product->hops.at(product->hops_row).useat, product->hops.at(product->hops_row).form, product->preboil_sg, product->est_og3, product->batch_size, product->hops.at(product->hops_row).amount, product->hops.at(product->hops_row).time, product->hops.at(product->hops_row).alpha, product->ibu_method, product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time, - product->brew_cooling_method, 0, 0); + product->brew_cooling_method, 0, 0, + product->hops.at(product->hops_row).utilisation, product->hops.at(product->hops_row).bu_factor); ibuEdit->setValue(ibu); item = new QTableWidgetItem(QString("%1").arg(ibu, 2, 'f', 1, '0')); @@ -395,11 +398,12 @@ item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->hopsTable->setItem(product->hops_row, 6, item); - double ibu = Utils::toIBU(product->hops.at(product->hops_row).useat, product->hops.at(product->hops_row).form, product->preboil_sg, + double ibu = Utils::toIBU(product->hops.at(product->hops_row).useat, product->hops.at(product->hops_row).form, product->preboil_sg, product->est_og3, product->batch_size, product->hops.at(product->hops_row).amount, product->hops.at(product->hops_row).time, product->hops.at(product->hops_row).alpha, product->ibu_method, product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time, - product->brew_cooling_method, 0, 0); + product->brew_cooling_method, 0, 0, + product->hops.at(product->hops_row).utilisation, product->hops.at(product->hops_row).bu_factor); ibuEdit->setValue(ibu); item = new QTableWidgetItem(QString("%1").arg(ibu, 2, 'f', 1, '0')); @@ -461,11 +465,12 @@ hnameEdit->setText(product->hops.at(product->hops_row).name); horiginEdit->setText(product->hops.at(product->hops_row).origin); - double ibu = Utils::toIBU(product->hops.at(product->hops_row).useat, product->hops.at(product->hops_row).form, product->preboil_sg, + double ibu = Utils::toIBU(product->hops.at(product->hops_row).useat, product->hops.at(product->hops_row).form, product->preboil_sg, product->est_og3, product->batch_size, product->hops.at(product->hops_row).amount, product->hops.at(product->hops_row).time, product->hops.at(product->hops_row).alpha, product->ibu_method, product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time, - product->brew_cooling_method, 0, 0); + product->brew_cooling_method, 0, 0, + product->hops.at(product->hops_row).utilisation, product->hops.at(product->hops_row).bu_factor); ibuEdit->setValue(ibu); ui->hopsTable->setItem(product->hops_row, 0, new QTableWidgetItem(product->hops.at(product->hops_row).origin)); @@ -686,11 +691,12 @@ ibuEdit->setReadOnly(true); ibuEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); ibuEdit->setDecimals(1); - double ibu = Utils::toIBU(product->hops.at(product->hops_row).useat, product->hops.at(product->hops_row).form, product->preboil_sg, + double ibu = Utils::toIBU(product->hops.at(product->hops_row).useat, product->hops.at(product->hops_row).form, product->preboil_sg, product->est_og3, product->batch_size, product->hops.at(product->hops_row).amount, product->hops.at(product->hops_row).time, product->hops.at(product->hops_row).alpha, product->ibu_method, product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time, - product->brew_cooling_method, 0, 0); + product->brew_cooling_method, 0, 0, + product->hops.at(product->hops_row).utilisation, product->hops.at(product->hops_row).bu_factor); ibuEdit->setValue(ibu); hop_instock_changed(true);