src/EditRecipeTab5.cpp

changeset 150
fd568cc1dd0e
parent 143
8414844c9f8b
child 152
58e4ce7dd217
--- a/src/EditRecipeTab5.cpp	Wed Apr 20 14:30:06 2022 +0200
+++ b/src/EditRecipeTab5.cpp	Wed Apr 20 22:48:20 2022 +0200
@@ -552,3 +552,19 @@
     emit refreshAll();
 }
 
+
+void EditRecipe::adjustYeasts(double factor)
+{
+    double amount;
+
+    if (recipe->yeasts.size() == 0)
+	return;
+
+    for (int i = 0; i < recipe->yeasts.size(); i++) {
+	if (recipe->yeasts.at(i).y_form == 1) { // Only adjust dry yeast
+	    amount = recipe->yeasts.at(i).y_amount * factor;
+	    recipe->yeasts[i].y_amount = amount;
+	}
+    }
+}
+

mercurial