Skip to content

Commit

Permalink
Merge pull request #803 from matty0ung/dbFixes
Browse files Browse the repository at this point in the history
Fix wrongly-emitted error message
  • Loading branch information
matty0ung committed Jul 31, 2024
2 parents 0db2266 + c615056 commit f7380c4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/model/Recipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2822,8 +2822,15 @@ double Recipe::ibuFromHopAddition(RecipeAdditionHop const & hopAddition) {
Q_ASSERT(hopAddition.recipeId() == this->key());

double AArating = hopAddition.hop()->alpha_pct() / 100.0;
// .:TBD.JSON:. What to do if hopAddition is measured by volume?
if (hopAddition.amountIsWeight()) {
// .:TBD:. What to do if hopAddition is measured by volume?
//
// Per https://beersmith.com/blog/2016/08/31/using-hop-extracts-for-beer-brewing/, for CO2 Hop Extract, a first
// approximation would be 1 gram hop = 1 ml of hop extract.
//
// The same page suggests that, for Isomerized Hop Extract,
// IBU = (extract_vol_ml * alpha_content_pct * 1000) / (volume_beer_liters)
//
if (!hopAddition.amountIsWeight()) {
qCritical() << Q_FUNC_INFO << "Using Hop volume as weight - THIS IS PROBABLY WRONG!";
}
double grams = hopAddition.quantity() * 1000.0;
Expand Down

0 comments on commit f7380c4

Please sign in to comment.