728 ui->st_catnrEdit->setText(QString("%1").arg(product->st_category_number)); |
728 ui->st_catnrEdit->setText(QString("%1").arg(product->st_category_number)); |
729 ui->st_typeEdit->setText(style_types[product->st_type]); |
729 ui->st_typeEdit->setText(style_types[product->st_type]); |
730 ui->nameEdit->setText(product->name); |
730 ui->nameEdit->setText(product->name); |
731 ui->codeEdit->setText(product->code); |
731 ui->codeEdit->setText(product->code); |
732 ui->birthEdit->setText(product->birth.toString("dd MMM yyyy")); |
732 ui->birthEdit->setText(product->birth.toString("dd MMM yyyy")); |
733 ui->stageEdit->setText(prod_stages[product->stage]); |
|
734 ui->notesEdit->setPlainText(product->notes); |
733 ui->notesEdit->setPlainText(product->notes); |
735 ui->typeEdit->setCurrentIndex(product->type); |
734 ui->typeEdit->setCurrentIndex(product->type); |
736 ui->batch_sizeEdit->setValue(product->batch_size); |
735 ui->batch_sizeEdit->setValue(product->batch_size); |
737 ui->boil_sizeEdit->setValue(product->boil_size); |
736 ui->boil_sizeEdit->setValue(product->boil_size); |
738 ui->boil_timeEdit->setValue(product->boil_time); |
737 ui->boil_timeEdit->setValue(product->boil_time); |
907 ui->brew_mashphEdit->setValue(product->brew_mash_ph); |
906 ui->brew_mashphEdit->setValue(product->brew_mash_ph); |
908 ui->brew_mashphShow->setValue(product->mash_ph); |
907 ui->brew_mashphShow->setValue(product->mash_ph); |
909 ui->brew_mashsgEdit->setValue(product->brew_mash_sg); |
908 ui->brew_mashsgEdit->setValue(product->brew_mash_sg); |
910 ui->brew_mashsgShow->setValue(0); |
909 ui->brew_mashsgShow->setValue(0); |
911 ui->brew_masheffShow->setValue(product->brew_mash_efficiency); |
910 ui->brew_masheffShow->setValue(product->brew_mash_efficiency); |
912 |
|
913 ui->brew_spargetempShow->setValue(product->sparge_temp); |
911 ui->brew_spargetempShow->setValue(product->sparge_temp); |
914 ui->brew_spargevolShow->setValue(product->sparge_volume); |
912 ui->brew_spargevolShow->setValue(product->sparge_volume); |
915 ui->brew_spargeestShow->setValue(product->brew_sparge_est); |
913 ui->brew_spargeestShow->setValue(product->brew_sparge_est); |
916 ui->brew_spargephEdit->setValue(product->brew_sparge_ph); |
914 ui->brew_spargephEdit->setValue(product->brew_sparge_ph); |
|
915 |
|
916 ui->brew_boilBox->setTitle(tr("Boiling %1 minutes").arg(product->boil_time)); |
|
917 ui->brew_preboilphEdit->setValue(product->brew_preboil_ph); |
|
918 ui->brew_preboilsgEdit->setValue(product->brew_preboil_sg); |
|
919 ui->brew_preboilvolEdit->setValue(product->brew_preboil_volume); |
|
920 ui->brew_preboilvolShow->setValue(product->boil_size * 1.04); |
|
921 ui->brew_preboileffShow->setValue(product->brew_preboil_efficiency); |
|
922 ui->brew_aboilphEdit->setValue(product->brew_aboil_ph); |
|
923 ui->brew_aboilsgEdit->setValue(product->brew_aboil_sg); |
|
924 ui->brew_aboilvolEdit->setValue(product->brew_aboil_volume); |
|
925 ui->brew_aboilvolShow->setValue(product->batch_size * 1.04); |
|
926 ui->brew_aboileffShow->setValue(product->brew_aboil_efficiency); |
917 |
927 |
918 // Tab fermentation. |
928 // Tab fermentation. |
919 |
929 |
920 // Tab packaging. |
930 // Tab packaging. |
921 |
931 |
982 connect(ui->w2_volEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::w2_volume_changed); |
992 connect(ui->w2_volEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::w2_volume_changed); |
983 connect(ui->sp_sourceEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::sp_source_changed); |
993 connect(ui->sp_sourceEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::sp_source_changed); |
984 connect(ui->sp_acidtypeEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::sp_type_changed); |
994 connect(ui->sp_acidtypeEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::sp_type_changed); |
985 connect(ui->sp_phEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_ph_changed); |
995 connect(ui->sp_phEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_ph_changed); |
986 |
996 |
987 setLocked(product->locked); |
997 setStage(); |
988 |
998 |
989 ui->saveButton->setEnabled(false); |
999 ui->saveButton->setEnabled(false); |
990 ui->deleteButton->setEnabled((id >= 0 && ! product->locked) ? true:false); |
1000 ui->deleteButton->setEnabled((id >= 0 && ! product->locked) ? true:false); |
991 |
1001 |
992 emit refreshAll(); |
1002 emit refreshAll(); |
1255 query.bindValue(":brew_cooling_to", round(product->brew_cooling_to * 10) / 10); |
1265 query.bindValue(":brew_cooling_to", round(product->brew_cooling_to * 10) / 10); |
1256 query.bindValue(":brew_whirlpool9", round(product->brew_whirlpool9)); |
1266 query.bindValue(":brew_whirlpool9", round(product->brew_whirlpool9)); |
1257 query.bindValue(":brew_whirlpool7", round(product->brew_whirlpool7)); |
1267 query.bindValue(":brew_whirlpool7", round(product->brew_whirlpool7)); |
1258 query.bindValue(":brew_whirlpool6", round(product->brew_whirlpool6)); |
1268 query.bindValue(":brew_whirlpool6", round(product->brew_whirlpool6)); |
1259 query.bindValue(":brew_whirlpool2", round(product->brew_whirlpool2)); |
1269 query.bindValue(":brew_whirlpool2", round(product->brew_whirlpool2)); |
1260 query.bindValue(":brew_fermenter_volume", round(product->brew_aboil_efficiency * 10) / 10); |
1270 query.bindValue(":brew_fermenter_volume", round(product->brew_fermenter_volume * 10) / 10); |
1261 query.bindValue(":brew_fermenter_extrawater", round(product->brew_aboil_efficiency * 10) / 10); |
1271 query.bindValue(":brew_fermenter_extrawater", round(product->brew_fermenter_extrawater * 10) / 10); |
1262 query.bindValue(":brew_fermenter_tcloss", round(product->brew_aboil_efficiency * 10) / 10); |
1272 query.bindValue(":brew_fermenter_tcloss", round(product->brew_fermenter_tcloss * 10) / 10); |
1263 query.bindValue(":brew_aeration_time", round(product->brew_aeration_time)); |
1273 query.bindValue(":brew_aeration_time", round(product->brew_aeration_time)); |
1264 query.bindValue(":brew_aeration_speed", round(product->brew_aboil_efficiency * 10) / 10); |
1274 query.bindValue(":brew_aeration_speed", round(product->brew_aeration_speed * 10) / 10); |
1265 query.bindValue(":brew_aeration_type", product->brew_aeration_type); |
1275 query.bindValue(":brew_aeration_type", product->brew_aeration_type); |
1266 query.bindValue(":brew_fermenter_sg", round(product->brew_aboil_efficiency * 1000) / 1000); |
1276 query.bindValue(":brew_fermenter_sg", round(product->brew_fermenter_sg * 1000) / 1000); |
1267 query.bindValue(":brew_fermenter_ibu", round(product->brew_aboil_efficiency * 10) / 10); |
1277 query.bindValue(":brew_fermenter_ibu", round(product->brew_fermenter_ibu * 10) / 10); |
1268 query.bindValue(":brew_fermenter_color", round(product->brew_aboil_efficiency * 10) / 10); |
1278 query.bindValue(":brew_fermenter_color", round(product->brew_fermenter_color * 10) / 10); |
1269 query.bindValue(":brew_date_end", product->brew_date_end); |
1279 query.bindValue(":brew_date_end", product->brew_date_end); |
1270 query.bindValue(":og", round(product->og * 1000) / 1000); |
1280 query.bindValue(":og", round(product->og * 1000) / 1000); |
1271 query.bindValue(":fg", round(product->fg * 1000) / 1000); |
1281 query.bindValue(":fg", round(product->fg * 1000) / 1000); |
1272 query.bindValue(":primary_start_temp", round(product->primary_start_temp * 10) / 10); |
1282 query.bindValue(":primary_start_temp", round(product->primary_start_temp * 10) / 10); |
1273 query.bindValue(":primary_max_temp", round(product->primary_max_temp * 10) / 10); |
1283 query.bindValue(":primary_max_temp", round(product->primary_max_temp * 10) / 10); |