# HG changeset patch # User Michiel Broek # Date 1655660549 -7200 # Node ID 2a97905cb63771f2d1dab3e6824479b263b63485 # Parent 8021e09ab6a39a52f3998fc4a3c40d3ac11fe1f0 Added hop co2 extract form. Added hop add at bottling needed for iso and tetra hop. diff -r 8021e09ab6a3 -r 2a97905cb637 src/EditHop.cpp --- a/src/EditHop.cpp Sun Jun 19 13:34:18 2022 +0200 +++ b/src/EditHop.cpp Sun Jun 19 19:42:29 2022 +0200 @@ -38,6 +38,7 @@ ui->formEdit->addItem(tr("Leaf")); ui->formEdit->addItem(tr("Leaf Wet")); /* Not in beerxml */ ui->formEdit->addItem(tr("Cryo")); /* Not in beerxml */ + ui->formEdit->addItem(tr("Extract")); /* CO2 extract */ if (id >= 0) { query.prepare("SELECT * FROM inventory_hops WHERE record = :recno"); diff -r 8021e09ab6a3 -r 2a97905cb637 src/EditProductExport.cpp --- a/src/EditProductExport.cpp Sun Jun 19 13:34:18 2022 +0200 +++ b/src/EditProductExport.cpp Sun Jun 19 19:42:29 2022 +0200 @@ -27,11 +27,11 @@ const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); const QStringList hop_types({ "Bittering", "Aroma", "Both" }); - const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet" }); - /* "Leaf Wet", "Cryo" */ + const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" }); + /* "Leaf Wet", "Cryo", "Extract" */ /* We use more hop forms then beerxml knows about, so we send known names */ /* instead of what we internally use. */ - const QStringList hop_use({ "Mash", "First wort", "Boil", "Aroma", "Whirlpool", "Dry hop" }); + const QStringList hop_use({ "Mash", "First wort", "Boil", "Aroma", "Whirlpool", "Dry hop", "Dry hop" }); // tetra == dry-hop :( const QStringList fermentable_type({ "Grain", "Sugar", "Extract", "Dry extract", "Adjunct" }); const QStringList fermentable_graintype({ "Base", "Roast", "Crystal", "Kilned", "Sour malt", "Special", "No malt" }); const QStringList yeast_type({ "Lager", "Ale", "Wheat", "Wine", "Champagne", "Other", "Other", "Other", "Other", "Other" }); @@ -429,8 +429,8 @@ const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); const QStringList fermentable_added({ "Maischen", "Koken", "Hoofd/nagisting", "Lageren", "Bottelen", "Fusten" }); - const QStringList hop_forms({ "Pellet", "Plug", "Bloemen", "Verse hop", "Cryo" }); - const QStringList hop_use({ "Maischen", "First wort", "Koken", "Vlamuit", "Whirlpool", "Drooghop" }); + const QStringList hop_forms({ "Pellet", "Plug", "Bloemen", "Verse hop", "Cryo", "Extract" }); + const QStringList hop_use({ "Maischen", "First wort", "Koken", "Vlamuit", "Whirlpool", "Drooghop", "Bottelen" }); const QStringList misc_type({ "Spice", "Herb", "Smaakstof", "Klaren", "Brouwzout", "Gist voeding", "Overig" }); const QStringList misc_use({ "Starter", "Maischen", "Koken", "Hoofdgisting", "Nagisting", "Bottelen" }); const QStringList yeast_form({ "Vloeibaar", "Droog", "Schuine buis", "Opkweek", "Ingevroren", "Flesbodem", "Gedroogd" }); diff -r 8021e09ab6a3 -r 2a97905cb637 src/EditProductTab4.cpp --- a/src/EditProductTab4.cpp Sun Jun 19 13:34:18 2022 +0200 +++ b/src/EditProductTab4.cpp Sun Jun 19 19:42:29 2022 +0200 @@ -642,6 +642,7 @@ useatEdit->addItem(tr("Aroma")); useatEdit->addItem(tr("Whirlpool")); useatEdit->addItem(tr("Dry hop")); + useatEdit->addItem(tr("Bottling")); useatEdit->setCurrentIndex(product->hops.at(product->hops_row).useat); hinstockEdit = new QCheckBox(dialog); diff -r 8021e09ab6a3 -r 2a97905cb637 src/EditRecipeExport.cpp --- a/src/EditRecipeExport.cpp Sun Jun 19 13:34:18 2022 +0200 +++ b/src/EditRecipeExport.cpp Sun Jun 19 19:42:29 2022 +0200 @@ -25,11 +25,11 @@ const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); const QStringList hop_types({ "Bittering", "Aroma", "Both" }); - const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet" }); - /* "Leaf Wet", "Cryo" */ + const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" }); + /* "Leaf Wet", "Cryo", "Extract" */ /* We use more hop forms then beerxml knows about, so we send known names */ /* instead of what we internally use. */ - const QStringList hop_use({ "Mash", "First wort", "Boil", "Aroma", "Whirlpool", "Dry hop" }); + const QStringList hop_use({ "Mash", "First wort", "Boil", "Aroma", "Whirlpool", "Dry hop", "Dry hop" }); const QStringList fermentable_type({ "Grain", "Sugar", "Extract", "Dry extract", "Adjunct" }); const QStringList fermentable_graintype({ "Base", "Roast", "Crystal", "Kilned", "Sour malt", "Special", "No malt" }); const QStringList yeast_type({ "Lager", "Ale", "Wheat", "Wine", "Champagne", "Other", "Other", "Other", "Other", "Other" }); @@ -446,8 +446,8 @@ const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); const QStringList fermentable_added({ "Maischen", "Koken", "Hoofd/nagisting", "Lageren", "Bottelen", "Fusten" }); - const QStringList hop_forms({ "Pellet", "Plug", "Bloemen", "Verse hop", "Cryo" }); - const QStringList hop_use({ "Maischen", "First wort", "Koken", "Vlamuit", "Whirlpool", "Drooghop" }); + const QStringList hop_forms({ "Pellet", "Plug", "Bloemen", "Verse hop", "Cryo", "Extract" }); + const QStringList hop_use({ "Maischen", "First wort", "Koken", "Vlamuit", "Whirlpool", "Drooghop", "Bottelen" }); const QStringList misc_type({ "Spice", "Herb", "Smaakstof", "Klaren", "Brouwzout", "Gist voeding", "Overig" }); const QStringList misc_use({ "Starter", "Maischen", "Koken", "Hoofdgisting", "Nagisting", "Bottelen" }); const QStringList yeast_form({ "Vloeibaar", "Droog", "Schuine buis", "Opkweek", "Ingevroren", "Flesbodem", "Gedroogd" }); diff -r 8021e09ab6a3 -r 2a97905cb637 src/EditRecipeTab3.cpp --- a/src/EditRecipeTab3.cpp Sun Jun 19 13:34:18 2022 +0200 +++ b/src/EditRecipeTab3.cpp Sun Jun 19 19:42:29 2022 +0200 @@ -660,6 +660,7 @@ useatEdit->addItem(tr("Aroma")); useatEdit->addItem(tr("Whirlpool")); useatEdit->addItem(tr("Dry hop")); + useatEdit->addItem(tr("Bottling")); useatEdit->setCurrentIndex(recipe->hops.at(recipe->hops_row).useat); hformEdit = new QComboBox(dialog); @@ -670,6 +671,7 @@ hformEdit->addItem(tr("Leaf")); hformEdit->addItem(tr("Wet leaf")); hformEdit->addItem(tr("Cryo")); + hformEdit->addItem(tr("Extract")); hformEdit->setCurrentIndex(recipe->hops.at(recipe->hops_row).form); hinstockEdit = new QCheckBox(dialog); diff -r 8021e09ab6a3 -r 2a97905cb637 src/Utils.cpp --- a/src/Utils.cpp Sun Jun 19 13:34:18 2022 +0200 +++ b/src/Utils.cpp Sun Jun 19 19:42:29 2022 +0200 @@ -373,7 +373,7 @@ double mass = Amount * 1000.0; double time = Boiltime; - if ((Use == HOP_USEAT_AROMA) || (Use == HOP_USEAT_WHIRLPOOL) || (Use == HOP_USEAT_DRY_HOP)) { + if ((Use == HOP_USEAT_AROMA) || (Use == HOP_USEAT_WHIRLPOOL) || (Use == HOP_USEAT_DRY_HOP) || (Use == HOP_USEAT_BOTTLING)) { fmoment = 0.0; } else if (Use == HOP_USEAT_MASH) { fmoment += my_factor_mashhop / 100.0; // Brouwhulp @@ -391,6 +391,8 @@ pfactor += my_factor_wethop / 100.0; // From https://github.com/chrisgilmerproj/brewday/blob/master/brew/constants.py } else if (Form == HOP_FORMS_CRYO) { pfactor += my_factor_cryohop / 100.0; + } else if (Form == HOP_FORMS_EXTRACT) { + // Nothing for now. } // Ideas from Zymurgy March-April 2018. These are not exact formulas! @@ -456,9 +458,9 @@ { double result; - if (use == 4 || use == 5) // Whirlpool or Dry-hop + if (use == HOP_USEAT_WHIRLPOOL || use == HOP_USEAT_DRY_HOP) return 0; - if (use == 1) { // First wort + if (use == HOP_USEAT_FWH) { result = 0.15; // assume 15% flavourcontribution for fwh } else if (bt > 50) { result = 0.10; // assume 10% flavourcontribution as a minimum @@ -475,9 +477,9 @@ { double result = 0.0; - if (use == 5) { // Dry hop + if (use == HOP_USEAT_DRY_HOP) { result = 1.33; - } else if (use == 4) { // Whirlpool + } else if (use == HOP_USEAT_WHIRLPOOL) { if (bt > 30) bt = 30; // Max 30 minutes result = 0.62 * bt / 30.0; @@ -485,9 +487,9 @@ result = 0.0; } else if (bt > 7.5) { result = 10.03 / (4 * sqrt(2 * 3.1416)) * exp(-0.5 * pow((bt - 7.5) / 4.0, 2.0)); - } else if (use == 2) { // Boil + } else if (use == HOP_USEAT_BOIL) { // Boil result = 1; - } else if (use == 3) { // Aroma + } else if (use == HOP_USEAT_AROMA) { // Aroma result = 1.2; } return (result * amount * 1000.0) / vol; diff -r 8021e09ab6a3 -r 2a97905cb637 src/global.cpp --- a/src/global.cpp Sun Jun 19 13:34:18 2022 +0200 +++ b/src/global.cpp Sun Jun 19 19:42:29 2022 +0200 @@ -100,7 +100,8 @@ QObject::tr("Plug"), QObject::tr("Leaf"), QObject::tr("Leaf wet"), - QObject::tr("Cryo") + QObject::tr("Cryo"), + QObject::tr("Extract") }); const QStringList hop_useat({ @@ -109,7 +110,8 @@ QObject::tr("Boil"), QObject::tr("Aroma"), QObject::tr("Whirlpool"), - QObject::tr("Dry hop") + QObject::tr("Dry hop"), + QObject::tr("Bottling") }); const QStringList misc_types({ diff -r 8021e09ab6a3 -r 2a97905cb637 src/global.h --- a/src/global.h Sun Jun 19 13:34:18 2022 +0200 +++ b/src/global.h Sun Jun 19 19:42:29 2022 +0200 @@ -732,7 +732,8 @@ HOP_FORMS_PLUG, HOP_FORMS_LEAF, HOP_FORMS_LEAF_WET, - HOP_FORMS_CRYO + HOP_FORMS_CRYO, + HOP_FORMS_EXTRACT }; extern const QStringList hop_forms; @@ -743,7 +744,8 @@ HOP_USEAT_BOIL, HOP_USEAT_AROMA, HOP_USEAT_WHIRLPOOL, - HOP_USEAT_DRY_HOP + HOP_USEAT_DRY_HOP, + HOP_USEAT_BOTTLING }; extern const QStringList hop_useat;