src/EditRecipeTab3.cpp

changeset 150
fd568cc1dd0e
parent 139
f947c6988e91
child 151
b5b2483f3a3f
equal deleted inserted replaced
149:d73719fa2ebb 150:fd568cc1dd0e
200 hop_aroma = round(hop_aroma * 1000.0 / 6.0) / 10; 200 hop_aroma = round(hop_aroma * 1000.0 / 6.0) / 10;
201 if (hop_flavour > 100) 201 if (hop_flavour > 100)
202 hop_flavour = 100; 202 hop_flavour = 100;
203 if (hop_aroma > 100) 203 if (hop_aroma > 100)
204 hop_aroma = 100; 204 hop_aroma = 100;
205 qDebug() << "ibu" << recipe->est_ibu << ibus << "flavour" << hop_flavour << "aroma" << hop_aroma; 205 qDebug() << "ibu" << recipe->est_ibu << ibus << "flavour" << hop_flavour << "aroma" << hop_aroma << "method" << recipe->ibu_method;
206 206
207 recipe->est_ibu = ibus; 207 recipe->est_ibu = ibus;
208 ui->est_ibuEdit->setValue(recipe->est_ibu); 208 ui->est_ibuEdit->setValue(recipe->est_ibu);
209 ui->est_ibu2Edit->setValue(recipe->est_ibu); 209 ui->est_ibu2Edit->setValue(recipe->est_ibu);
210 ui->hop_tasteShow->setValue(hop_flavour); 210 ui->hop_tasteShow->setValue(hop_flavour);
630 630
631 emit refreshAll(); 631 emit refreshAll();
632 } 632 }
633 633
634 634
635 void EditRecipe::adjustHops(double factor)
636 {
637 double amount;
638
639 if (recipe->hops.size() == 0)
640 return;
641
642 for (int i = 0; i < recipe->hops.size(); i++) {
643 amount = recipe->hops.at(i).h_amount * factor;
644 recipe->hops[i].h_amount = amount;
645 }
646 }
647
648

mercurial