src/EditProductTab12.cpp

Fri, 29 Jul 2022 13:12:26 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 29 Jul 2022 13:12:26 +0200
changeset 373
b02aca4e926c
parent 225
448e4187cada
permissions
-rw-r--r--

First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.

/**
 * EditProduct.cpp is part of bmsapp.
 *
 * Tab 12, taste notes.
 *
 * bmsapp is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * bmsapp is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

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();
}

mercurial