src/EditProductTab1.cpp

changeset 397
877420a13815
parent 395
7212b980a527
child 403
2ed66e586a52
equal deleted inserted replaced
396:c9a1d85c1487 397:877420a13815
38 * Real Extract (RE) 38 * Real Extract (RE)
39 */ 39 */
40 double re = ((0.1808 * ((Utils::sg_to_plato(product->st_og_min) + Utils::sg_to_plato(product->st_og_max)) / 2)) + 40 double re = ((0.1808 * ((Utils::sg_to_plato(product->st_og_min) + Utils::sg_to_plato(product->st_og_max)) / 2)) +
41 (0.8192 * ((Utils::sg_to_plato(fg_min) + Utils::sg_to_plato(product->st_fg_max)) / 2))); 41 (0.8192 * ((Utils::sg_to_plato(fg_min) + Utils::sg_to_plato(product->st_fg_max)) / 2)));
42 42
43 /* BU:RE */ 43 /*
44 * BU:RE
45 * Divide over average RE gives the best ranges.
46 */
44 double bure_min = product->st_ibu_min / re; 47 double bure_min = product->st_ibu_min / re;
45 double bure_max = product->st_ibu_max / re; 48 double bure_max = product->st_ibu_max / re;
46 ui->est_bufguShow->setRange(bure_min, bure_max); 49 ui->est_bufguShow->setRange(bure_min, bure_max);
47
48 qDebug() << "BU:RE" << bure_min << bure_max;
49 } 50 }
50 51
51 52
52 void EditProduct::code_changed(QString code) 53 void EditProduct::code_changed(QString code)
53 { 54 {
114 115
115 ui->est_ogShow->setRange(query.value(7).toDouble(), query.value(8).toDouble()); 116 ui->est_ogShow->setRange(query.value(7).toDouble(), query.value(8).toDouble());
116 ui->est_fgShow->setRange(query.value(9).toDouble(), query.value(10).toDouble()); 117 ui->est_fgShow->setRange(query.value(9).toDouble(), query.value(10).toDouble());
117 ui->est_ibuShow->setRange(query.value(11).toDouble(), query.value(12).toDouble()); 118 ui->est_ibuShow->setRange(query.value(11).toDouble(), query.value(12).toDouble());
118 ui->est_colorShow->setRange(query.value(13).toDouble(), query.value(14).toDouble()); 119 ui->est_colorShow->setRange(query.value(13).toDouble(), query.value(14).toDouble());
119 ui->est_carbShow->setRange(query.value(15).toDouble(), query.value(16).toDouble()); 120 ui->est_bottle_co2Show->setRange(query.value(15).toDouble(), query.value(16).toDouble());
121 ui->est_kegs_co2Show->setRange(query.value(15).toDouble(), query.value(16).toDouble());
120 ui->est_abvShow->setRange(query.value(17).toDouble(), query.value(18).toDouble()); 122 ui->est_abvShow->setRange(query.value(17).toDouble(), query.value(18).toDouble());
121 123
122 calcStyle(); 124 calcStyle();
123 is_changed(); 125 is_changed();
124 } 126 }
327 ui->w2_nameEdit->setDisabled(stage > PROD_STAGE_BREW); 329 ui->w2_nameEdit->setDisabled(stage > PROD_STAGE_BREW);
328 ui->mw_acidPick->setDisabled(stage > PROD_STAGE_BREW); 330 ui->mw_acidPick->setDisabled(stage > PROD_STAGE_BREW);
329 ui->sp_acidtypeEdit->setDisabled(stage > PROD_STAGE_BREW); 331 ui->sp_acidtypeEdit->setDisabled(stage > PROD_STAGE_BREW);
330 ui->w2_volEdit->setReadOnly(stage > PROD_STAGE_BREW); 332 ui->w2_volEdit->setReadOnly(stage > PROD_STAGE_BREW);
331 ui->w2_volEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); 333 ui->w2_volEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
332 //ui->sp_tempEdit->setReadOnly(stage > PROD_STAGE_BREW);
333 //ui->sp_tempEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
334 ui->sp_volEdit->setReadOnly(stage > PROD_STAGE_BREW); 334 ui->sp_volEdit->setReadOnly(stage > PROD_STAGE_BREW);
335 ui->sp_volEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); 335 ui->sp_volEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
336 ui->bs_cacl2Edit->setReadOnly(stage > PROD_STAGE_BREW); 336 ui->bs_cacl2Edit->setReadOnly(stage > PROD_STAGE_BREW);
337 ui->bs_cacl2Edit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); 337 ui->bs_cacl2Edit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
338 ui->bs_caso4Edit->setReadOnly(stage > PROD_STAGE_BREW); 338 ui->bs_caso4Edit->setReadOnly(stage > PROD_STAGE_BREW);

mercurial