src/EditProduct.cpp

changeset 181
14a1f7bca79b
parent 179
512f492358e3
child 182
545d31130844
equal deleted inserted replaced
180:bbf0f06a5e72 181:14a1f7bca79b
247 product->batch_size = query.value("batch_size").toDouble(); 247 product->batch_size = query.value("batch_size").toDouble();
248 product->boil_size = query.value("boil_size").toDouble(); 248 product->boil_size = query.value("boil_size").toDouble();
249 product->boil_time = query.value("boil_time").toDouble(); 249 product->boil_time = query.value("boil_time").toDouble();
250 product->efficiency = query.value("efficiency").toDouble(); 250 product->efficiency = query.value("efficiency").toDouble();
251 product->est_og = query.value("est_og").toDouble(); 251 product->est_og = query.value("est_og").toDouble();
252 product->est_og3 = query.value("est_og3").toDouble();
252 product->est_fg = query.value("est_fg").toDouble(); 253 product->est_fg = query.value("est_fg").toDouble();
253 product->est_abv = query.value("est_abv").toDouble(); 254 product->est_abv = query.value("est_abv").toDouble();
254 product->est_color = query.value("est_color").toDouble(); 255 product->est_color = query.value("est_color").toDouble();
255 product->color_method = query.value("color_method").toInt(); 256 product->color_method = query.value("color_method").toInt();
256 product->est_ibu = query.value("est_ibu").toDouble(); 257 product->est_ibu = query.value("est_ibu").toDouble();
631 product->efficiency = 75; 632 product->efficiency = 75;
632 product->eq_batch_size = product->batch_size = 20; 633 product->eq_batch_size = product->batch_size = 20;
633 product->eq_boil_time = product->boil_time = 60; 634 product->eq_boil_time = product->boil_time = 60;
634 product->eq_boil_size = product->boil_size = product->batch_size + (round(product->batch_size * product->boil_time / 60.0) / 10.0); 635 product->eq_boil_size = product->boil_size = product->batch_size + (round(product->batch_size * product->boil_time / 60.0) / 10.0);
635 product->type = 2; 636 product->type = 2;
636 product->est_og = product->est_fg = product->est_color = product->est_ibu = product->est_abv = 0; 637 product->est_og = product->est_og3 = product->est_fg = product->est_color = product->est_ibu = product->est_abv = 0;
637 product->brew_date_start = product->brew_date_end = QDateTime(); 638 product->brew_date_start = product->brew_date_end = QDateTime();
638 product->brew_mash_ph = product->brew_mash_sg = product->brew_mash_efficiency = 0; 639 product->brew_mash_ph = product->brew_mash_sg = product->brew_mash_efficiency = 0;
639 product->brew_sparge_temperature = product->brew_sparge_volume = product->brew_sparge_est = product->brew_sparge_ph = 0; 640 product->brew_sparge_temperature = product->brew_sparge_volume = product->brew_sparge_est = product->brew_sparge_ph = 0;
640 product->brew_preboil_volume = product->brew_preboil_sg = product->brew_preboil_ph = product->brew_preboil_efficiency = 0; 641 product->brew_preboil_volume = product->brew_preboil_sg = product->brew_preboil_ph = product->brew_preboil_efficiency = 0;
641 product->brew_aboil_volume = product->brew_aboil_sg = product->brew_aboil_ph = product->brew_aboil_efficiency = 0; 642 product->brew_aboil_volume = product->brew_aboil_sg = product->brew_aboil_ph = product->brew_aboil_efficiency = 0;
786 787
787 // Tab hops. 788 // Tab hops.
788 ui->est_ibu2Edit->setValue(product->est_ibu); 789 ui->est_ibu2Edit->setValue(product->est_ibu);
789 790
790 // Tab yeasts. 791 // Tab yeasts.
791 ui->est_og3Edit->setValue(product->est_og); 792 ui->est_og4Edit->setValue(product->est_og);
792 ui->est_fg3Edit->setValue(product->est_fg); 793 ui->est_fg3Edit->setValue(product->est_fg);
793 ui->est_abv2Edit->setValue(product->est_abv); 794 ui->est_abv2Edit->setValue(product->est_abv);
794 795
795 // Tab mashs. 796 // Tab mashs.
796 ui->mash_nameEdit->setText(product->mash_name); 797 ui->mash_nameEdit->setText(product->mash_name);
1039 return; 1040 return;
1040 } 1041 }
1041 1042
1042 if (this->textIsChanged) { 1043 if (this->textIsChanged) {
1043 if (this->recno == -1) { 1044 if (this->recno == -1) {
1044 query.prepare("INSERT INTO products SET locked=:locked, st_name=:st_name, st_letter=:st_letter, " 1045 query.prepare("INSERT INTO products SET "
1046 "name=:name, code=:code, birth=:birth, stage=:stage, notes=:notes, log_brew=:log_brew, "
1047 "log_fermentation=:log_fermentation, log_ispindel=:log_ispindel, log_co2pressure=:log_co2pressure, "
1048 "inventory_reduced=:inventory_reduced, locked=:locked, "
1049 "eq_name=:eq_name, eq_boil_size=:eq_boil_size, eq_efficiency=:eq_efficiency, "
1050 "eq_batch_size=:eq_batch_size, eq_tun_volume=:eq_tun_volume, eq_tun_weight=:eq_tun_weight, "
1051 "eq_tun_specific_heat=:eq_tun_specific_heat, eq_tun_material=:eq_tun_material, eq_tun_height=:eq_tun_height, "
1052 "eq_top_up_water=:eq_top_up_water, eq_trub_chiller_loss=:eq_chiller_loss, eq_evap_rate=:eq_evap_rate, "
1053 "eq_boil_time=:eq_boil_time, eq_calc_boil_volume=:eq_calcboil, eq_top_up_kettle=:eq_top_up_kettle, "
1054 "eq_hop_utilization=:eq_hopfactor, eq_notes=:eq_notes, eq_lauter_volume=:eq_lauter_volume, "
1055 "eq_lauter_height=:eq_lauter_height, eq_lauter_deadspace=:eq_lauter_deadspace, eq_kettle_volume=:eq_kettle_volume, "
1056 "eq_kettle_height=:eq_kettle_height, eq_mash_volume=:eq_mash_volume, eq_mash_max=:eq_mash_max, "
1057 "brew_date_start=:brew_date_start, brew_mash_ph=:brew_mash_ph, brew_mash_sg=:brew_mash_sg, "
1058 "brew_mash_efficiency=:brew_mash_efficiency, brew_sparge_temperature=:brew_sparge_temperature, "
1059 "brew_sparge_volume=:brew_sparge_volume, brew_sparge_est=:brew_sparge_est, brew_sparge_ph=:brew_sparge_ph, "
1060 "brew_preboil_volume=:brew_preboil_volume, brew_preboil_sg=:brew_preboil_sg, brew_preboil_ph=:brew_preboil_ph, "
1061 "brew_preboil_efficiency=:brew_preboil_efficiency, brew_aboil_volume=:brew_aboil_volume, "
1062 "brew_aboil_sg=:brew_aboil_sg, brew_aboil_ph:=brew_aboil_ph, brew_aboil_efficiency=:brew_aboil_efficiency, "
1063 "brew_cooling_method=:brew_cooling_method, brew_cooling_time=:brew_cooling_time, brew_cooling_to=:brew_cooling_to, "
1064 "brew_whirlpool9=:brew_whirlpool9, brew_whirlpool7=:brew_whirlpool7, brew_whirlpool6=:brew_whirlpool6, "
1065 "brew_whirlpool2=:brew_whirlpool2, brew_fermenter_volume=:brew_fermenter_volume, "
1066 "brew_fermenter_extrawater=:brew_fermenter_extrawater, brew_fermenter_tcloss=:brew_fermenter_tcloss, "
1067 "brew_aeration_time=:brew_aeration_time, brew_aeration_speed=:brew_aeration_speed, "
1068 "brew_aeration_type=:brew_aeration_type, brew_fermenter_sg=:brew_fermenter_sg, brew_fermenter_ibu=:brew_fermenter_ibu, "
1069 "brew_fermenter_color=:brew_fermenter_color, brew_date_end=:brew_date_end, "
1070 "og=:og, fg=:fg, primary_start_temp=:primary_start_temp, primary_max_temp=:primary_max_temp, "
1071 "primary_end_temp=:primary_end_temp, primary_end_sg=:primary_end_sg, primary_end_date=:primary_end_date, "
1072 "secondary_temp=:secondary_temp, secondary_end_sg=:secondary_end_sg, secondary_end_date=:secondary_end_date, "
1073 "tertiary_temp=:tertiary_temp, package_date=:package_date, package_volume=:package_volume, "
1074 "package_infuse_amount=:package_infuse_amount, package_infuse_abv=:package_infuse_abv, "
1075 "package_infuse_notes=:package_infuse_notes, package_abv=:package_abv, package_ph=:package_ph, "
1076 "bottle_amount=:bottle_amount, bottle_carbonation=:bottle_carbonation, bottle_priming_sugar=:bottle_priming_sugar, "
1077 "bottle_priming_amount=:bottle_priming_amount, bottle_priming_water=:bottle_priming_water, "
1078 "bottle_carbonation_temp=:bottle_carbonation_temp, keg_amount=:keg_amount, keg_carbonation=:keg_carbonation, "
1079 "keg_priming_sugar=:keg_priming_sugar, keg_priming_amount=:keg_priming_amount, keg_priming_water=:keg_priming_water, "
1080 "keg_carbonation_temp=:keg_carbonation_temp, keg_forced_carb=:keg_forced_carb, keg_pressure=:keg_pressure, "
1081 "taste_notes=:taste_notes, taste_rate=:taste_rate, taste_date=:taste_date, taste_color=:taste_color, "
1082 "taste_transparency=:taste_transparency, taste_head=:taste_head, taste_aroma=:taste_aroma, "
1083 "taste_taste=:taste_taste, taste_mouthfeel=:taste_mouthfeel, taste_aftertaste=:taste_aftertaste, "
1084 "st_name=:st_name, st_letter=:st_letter, "
1045 "st_guide=:st_guide, st_category=:st_category, st_category_number=:st_catnr, st_type=:st_type, " 1085 "st_guide=:st_guide, st_category=:st_category, st_category_number=:st_catnr, st_type=:st_type, "
1046 "st_og_min=:st_og_min, st_og_max=:st_og_max, st_fg_min=:st_fg_min, st_fg_max=:st_fg_max, " 1086 "st_og_min=:st_og_min, st_og_max=:st_og_max, st_fg_min=:st_fg_min, st_fg_max=:st_fg_max, "
1047 "st_ibu_min=:st_ibu_min, st_ibu_max=:st_ibu_max, st_color_min=:st_color_min, st_color_max=:st_color_max, " 1087 "st_ibu_min=:st_ibu_min, st_ibu_max=:st_ibu_max, st_color_min=:st_color_min, st_color_max=:st_color_max, "
1048 "st_carb_min=:st_carb_min, st_carb_max=:st_carb_max, st_abv_min=:st_abv_min, st_abv_max=:st_abv_max, " 1088 "st_carb_min=:st_carb_min, st_carb_max=:st_carb_max, st_abv_min=:st_abv_min, st_abv_max=:st_abv_max, "
1049 "name=:name, notes=:notes, type=:type, batch_size=:batch_size, boil_size=:boil_size, " 1089 "type=:type, batch_size=:batch_size, boil_size=:boil_size, "
1050 "boil_time=:boil_time, efficiency=:efficiency, est_og=:est_og, est_fg=:est_fg, est_abv=:est_abv, " 1090 "boil_time=:boil_time, efficiency=:efficiency, est_og=:est_og, est_og3=:est_og3, est_fg=:est_fg, est_abv=:est_abv, "
1051 "est_color=:est_color, color_method=:color_method, est_ibu=:est_ibu, ibu_method=:ibu_method, " 1091 "est_color=:est_color, color_method=:color_method, est_ibu=:est_ibu, ibu_method=:ibu_method, "
1052 "est_carb=:est_carb, sparge_temp=:sparge_temp, sparge_ph=:sparge_ph, " 1092 "est_carb=:est_carb, sparge_temp=:sparge_temp, sparge_ph=:sparge_ph, "
1053 "sparge_volume=:sparge_volume, sparge_source=:sparge_source, sparge_acid_type=:sparge_acid_type, " 1093 "sparge_volume=:sparge_volume, sparge_source=:sparge_source, sparge_acid_type=:sparge_acid_type, "
1054 "sparge_acid_perc=:sparge_acid_perc, sparge_acid_amount=:sparge_acid_amount, mash_ph=:mash_ph, " 1094 "sparge_acid_perc=:sparge_acid_perc, sparge_acid_amount=:sparge_acid_amount, mash_ph=:mash_ph, "
1055 "mash_name=:mash_name, calc_acid=:calc_acid, " 1095 "mash_name=:mash_name, calc_acid=:calc_acid, "
1063 "wg_chloride=:wg_chloride, wg_sodium=:wg_sodium, wg_magnesium=:wg_magnesium, " 1103 "wg_chloride=:wg_chloride, wg_sodium=:wg_sodium, wg_magnesium=:wg_magnesium, "
1064 "wg_total_alkalinity=:wg_total_alkalinity, wg_ph=:wg_ph, " 1104 "wg_total_alkalinity=:wg_total_alkalinity, wg_ph=:wg_ph, "
1065 "wb_calcium=:wb_calcium, wb_sulfate=:wb_sulfate, wb_chloride=:wb_chloride, wb_sodium=:wb_sodium, " 1105 "wb_calcium=:wb_calcium, wb_sulfate=:wb_sulfate, wb_chloride=:wb_chloride, wb_sodium=:wb_sodium, "
1066 "wb_magnesium=:wb_magnesium, wb_total_alkalinity=:wb_total_alkalinity, wb_ph=:wb_ph, " 1106 "wb_magnesium=:wb_magnesium, wb_total_alkalinity=:wb_total_alkalinity, wb_ph=:wb_ph, "
1067 "wa_acid_name=:wa_acid_name, wa_acid_perc=:wa_acid_perc, wa_base_name=:wa_base_name, " 1107 "wa_acid_name=:wa_acid_name, wa_acid_perc=:wa_acid_perc, wa_base_name=:wa_base_name, "
1108 "starter_enable=:starter_enable, starter_type=:starter_type, starter_sg=:starter_sg, "
1109 "starter_viability=:starter_viability, yeast_prod_date=:yeast_prod_date, yeast_pitchrate=:yeast_pitchrate, "
1110 "prop1_type=:prop1_type, prop1_volume=:prop1_volume, prop2_type=:prop2_type, prop2_volume=:prop2_volume, "
1111 "prop3_type=:prop3_type, prop3_volume=:prop3_volume, prop4_type=:prop4_type, prop4_volume=:prop4_volume, "
1112 "divide_type=:divide_type, divide_size=:divide_size, divide_factor=:divide_factor, "
1113 "divide_parts=:divide_parts, divide_part=:divide_part, "
1068 "json_fermentables=:json_fermentables, json_hops=:json_hops, json_miscs=:json_miscs, " 1114 "json_fermentables=:json_fermentables, json_hops=:json_hops, json_miscs=:json_miscs, "
1069 "json_yeasts=:json_yeasts, json_mashs=:json_mashs, uuid=:uuid"); 1115 "json_yeasts=:json_yeasts, json_mashs=:json_mashs, uuid=:uuid");
1070 } else { 1116 } else {
1071 query.prepare("UPDATE products SET locked=:locked, st_name=:st_name, st_letter=:st_letter, " 1117 query.prepare("UPDATE products SET "
1118 "name=:name, code=:code, birth=:birth, stage=:stage, notes=:notes, log_brew=:log_brew, "
1119 "log_fermentation=:log_fermentation, log_ispindel=:log_ispindel, log_co2pressure=:log_co2pressure, "
1120 "inventory_reduced=:inventory_reduced, locked=:locked, "
1121 "eq_name=:eq_name, eq_boil_size=:eq_boil_size, eq_efficiency=:eq_efficiency, "
1122 "eq_batch_size=:eq_batch_size, eq_tun_volume=:eq_tun_volume, eq_tun_weight=:eq_tun_weight, "
1123 "eq_tun_specific_heat=:eq_tun_specific_heat, eq_tun_material=:eq_tun_material, eq_tun_height=:eq_tun_height, "
1124 "eq_top_up_water=:eq_top_up_water, eq_trub_chiller_loss=:eq_chiller_loss, eq_evap_rate=:eq_evap_rate, "
1125 "eq_boil_time=:eq_boil_time, eq_calc_boil_volume=:eq_calcboil, eq_top_up_kettle=:eq_top_up_kettle, "
1126 "eq_hop_utilization=:eq_hopfactor, eq_notes=:eq_notes, eq_lauter_volume=:eq_lauter_volume, "
1127 "eq_lauter_height=:eq_lauter_height, eq_lauter_deadspace=:eq_lauter_deadspace, eq_kettle_volume=:eq_kettle_volume, "
1128 "eq_kettle_height=:eq_kettle_height, eq_mash_volume=:eq_mash_volume, eq_mash_max=:eq_mash_max, "
1129 "brew_date_start=:brew_date_start, brew_mash_ph=:brew_mash_ph, brew_mash_sg=:brew_mash_sg, "
1130 "brew_mash_efficiency=:brew_mash_efficiency, brew_sparge_temperature=:brew_sparge_temperature, "
1131 "brew_sparge_volume=:brew_sparge_volume, brew_sparge_est=:brew_sparge_est, brew_sparge_ph=:brew_sparge_ph, "
1132 "brew_preboil_volume=:brew_preboil_volume, brew_preboil_sg=:brew_preboil_sg, brew_preboil_ph=:brew_preboil_ph, "
1133 "brew_preboil_efficiency=:brew_preboil_efficiency, brew_aboil_volume=:brew_aboil_volume, "
1134 "brew_aboil_sg=:brew_aboil_sg, brew_aboil_ph:=brew_aboil_ph, brew_aboil_efficiency=:brew_aboil_efficiency, "
1135 "brew_cooling_method=:brew_cooling_method, brew_cooling_time=:brew_cooling_time, brew_cooling_to=:brew_cooling_to, "
1136 "brew_whirlpool9=:brew_whirlpool9, brew_whirlpool7=:brew_whirlpool7, brew_whirlpool6=:brew_whirlpool6, "
1137 "brew_whirlpool2=:brew_whirlpool2, brew_fermenter_volume=:brew_fermenter_volume, "
1138 "brew_fermenter_extrawater=:brew_fermenter_extrawater, brew_fermenter_tcloss=:brew_fermenter_tcloss, "
1139 "brew_aeration_time=:brew_aeration_time, brew_aeration_speed=:brew_aeration_speed, "
1140 "brew_aeration_type=:brew_aeration_type, brew_fermenter_sg=:brew_fermenter_sg, brew_fermenter_ibu=:brew_fermenter_ibu, "
1141 "brew_fermenter_color=:brew_fermenter_color, brew_date_end=:brew_date_end, "
1142 "og=:og, fg=:fg, primary_start_temp=:primary_start_temp, primary_max_temp=:primary_max_temp, "
1143 "primary_end_temp=:primary_end_temp, primary_end_sg=:primary_end_sg, primary_end_date=:primary_end_date, "
1144 "secondary_temp=:secondary_temp, secondary_end_sg=:secondary_end_sg, secondary_end_date=:secondary_end_date, "
1145 "tertiary_temp=:tertiary_temp, package_date=:package_date, package_volume=:package_volume, "
1146 "package_infuse_amount=:package_infuse_amount, package_infuse_abv=:package_infuse_abv, "
1147 "package_infuse_notes=:package_infuse_notes, package_abv=:package_abv, package_ph=:package_ph, "
1148 "bottle_amount=:bottle_amount, bottle_carbonation=:bottle_carbonation, bottle_priming_sugar=:bottle_priming_sugar, "
1149 "bottle_priming_amount=:bottle_priming_amount, bottle_priming_water=:bottle_priming_water, "
1150 "bottle_carbonation_temp=:bottle_carbonation_temp, keg_amount=:keg_amount, keg_carbonation=:keg_carbonation, "
1151 "keg_priming_sugar=:keg_priming_sugar, keg_priming_amount=:keg_priming_amount, keg_priming_water=:keg_priming_water, "
1152 "keg_carbonation_temp=:keg_carbonation_temp, keg_forced_carb=:keg_forced_carb, keg_pressure=:keg_pressure, "
1153 "taste_notes=:taste_notes, taste_rate=:taste_rate, taste_date=:taste_date, taste_color=:taste_color, "
1154 "taste_transparency=:taste_transparency, taste_head=:taste_head, taste_aroma=:taste_aroma, "
1155 "taste_taste=:taste_taste, taste_mouthfeel=:taste_mouthfeel, taste_aftertaste=:taste_aftertaste, "
1156 "st_name=:st_name, st_letter=:st_letter, "
1072 "st_guide=:st_guide, st_category=:st_category, st_category_number=:st_catnr, st_type=:st_type, " 1157 "st_guide=:st_guide, st_category=:st_category, st_category_number=:st_catnr, st_type=:st_type, "
1073 "st_og_min=:st_og_min, st_og_max=:st_og_max, st_fg_min=:st_fg_min, st_fg_max=:st_fg_max, " 1158 "st_og_min=:st_og_min, st_og_max=:st_og_max, st_fg_min=:st_fg_min, st_fg_max=:st_fg_max, "
1074 "st_ibu_min=:st_ibu_min, st_ibu_max=:st_ibu_max, st_color_min=:st_color_min, st_color_max=:st_color_max, " 1159 "st_ibu_min=:st_ibu_min, st_ibu_max=:st_ibu_max, st_color_min=:st_color_min, st_color_max=:st_color_max, "
1075 "st_carb_min=:st_carb_min, st_carb_max=:st_carb_max, st_abv_min=:st_abv_min, st_abv_max=:st_abv_max, " 1160 "st_carb_min=:st_carb_min, st_carb_max=:st_carb_max, st_abv_min=:st_abv_min, st_abv_max=:st_abv_max, "
1076 "name=:name, notes=:notes, type=:type, batch_size=:batch_size, boil_size=:boil_size, " 1161 "type=:type, batch_size=:batch_size, boil_size=:boil_size, "
1077 "boil_time=:boil_time, efficiency=:efficiency, est_og=:est_og, est_fg=:est_fg, est_abv=:est_abv, " 1162 "boil_time=:boil_time, efficiency=:efficiency, est_og=:est_og, est_og3=:est_og3, est_fg=:est_fg, est_abv=:est_abv, "
1078 "est_color=:est_color, color_method=:color_method, est_ibu=:est_ibu, ibu_method=:ibu_method, " 1163 "est_color=:est_color, color_method=:color_method, est_ibu=:est_ibu, ibu_method=:ibu_method, "
1079 "est_carb=:est_carb, sparge_temp=:sparge_temp, sparge_ph=:sparge_ph, " 1164 "est_carb=:est_carb, sparge_temp=:sparge_temp, sparge_ph=:sparge_ph, "
1080 "sparge_volume=:sparge_volume, sparge_source=:sparge_source, sparge_acid_type=:sparge_acid_type, " 1165 "sparge_volume=:sparge_volume, sparge_source=:sparge_source, sparge_acid_type=:sparge_acid_type, "
1081 "sparge_acid_perc=:sparge_acid_perc, sparge_acid_amount=:sparge_acid_amount, mash_ph=:mash_ph, " 1166 "sparge_acid_perc=:sparge_acid_perc, sparge_acid_amount=:sparge_acid_amount, mash_ph=:mash_ph, "
1082 "mash_name=:mash_name, calc_acid=:calc_acid, " 1167 "mash_name=:mash_name, calc_acid=:calc_acid, "
1090 "wg_chloride=:wg_chloride, wg_sodium=:wg_sodium, wg_magnesium=:wg_magnesium, " 1175 "wg_chloride=:wg_chloride, wg_sodium=:wg_sodium, wg_magnesium=:wg_magnesium, "
1091 "wg_total_alkalinity=:wg_total_alkalinity, wg_ph=:wg_ph, " 1176 "wg_total_alkalinity=:wg_total_alkalinity, wg_ph=:wg_ph, "
1092 "wb_calcium=:wb_calcium, wb_sulfate=:wb_sulfate, wb_chloride=:wb_chloride, wb_sodium=:wb_sodium, " 1177 "wb_calcium=:wb_calcium, wb_sulfate=:wb_sulfate, wb_chloride=:wb_chloride, wb_sodium=:wb_sodium, "
1093 "wb_magnesium=:wb_magnesium, wb_total_alkalinity=:wb_total_alkalinity, wb_ph=:wb_ph, " 1178 "wb_magnesium=:wb_magnesium, wb_total_alkalinity=:wb_total_alkalinity, wb_ph=:wb_ph, "
1094 "wa_acid_name=:wa_acid_name, wa_acid_perc=:wa_acid_perc, wa_base_name=:wa_base_name, " 1179 "wa_acid_name=:wa_acid_name, wa_acid_perc=:wa_acid_perc, wa_base_name=:wa_base_name, "
1180 "starter_enable=:starter_enable, starter_type=:starter_type, starter_sg=:starter_sg, "
1181 "starter_viability=:starter_viability, yeast_prod_date=:yeast_prod_date, yeast_pitchrate=:yeast_pitchrate, "
1182 "prop1_type=:prop1_type, prop1_volume=:prop1_volume, prop2_type=:prop2_type, prop2_volume=:prop2_volume, "
1183 "prop3_type=:prop3_type, prop3_volume=:prop3_volume, prop4_type=:prop4_type, prop4_volume=:prop4_volume, "
1184 "divide_type=:divide_type, divide_size=:divide_size, divide_factor=:divide_factor, "
1185 "divide_parts=:divide_parts, divide_part=:divide_part, "
1095 "json_fermentables=:json_fermentables, json_hops=:json_hops, json_miscs=:json_miscs, " 1186 "json_fermentables=:json_fermentables, json_hops=:json_hops, json_miscs=:json_miscs, "
1096 "json_yeasts=:json_yeasts, json_mashs=:json_mashs WHERE record = :recno"); 1187 "json_yeasts=:json_yeasts, json_mashs=:json_mashs WHERE record = :recno");
1097 } 1188 }
1189
1190 query.bindValue(":name", product->name);
1191 query.bindValue(":code", product->code);
1192 query.bindValue(":birth", product->birth);
1193 query.bindValue(":stage", product->stage);
1194 query.bindValue(":notes", product->notes);
1195 query.bindValue(":log_brew", product->log_brew ? 1:0);
1196 query.bindValue(":log_fermentation", product->log_fermentation ? 1:0);
1197 query.bindValue(":log_ispindel", product->log_ispindel ? 1:0);
1198 query.bindValue(":log_co2pressure", product->log_co2pressure ? 1:0);
1199 query.bindValue(":inventory_reduced", product->inventory_reduced);
1098 query.bindValue(":locked", product->locked ? 1:0); 1200 query.bindValue(":locked", product->locked ? 1:0);
1201 query.bindValue(":eq_name", product->eq_name);
1202 query.bindValue(":eq_boil_size", round(product->eq_boil_size * 10) / 10);
1203 query.bindValue(":eq_batch_size", round(product->eq_batch_size * 100) / 100);
1204 query.bindValue(":eq_tun_volume", round(product->eq_tun_volume * 10) / 10);
1205 query.bindValue(":eq_tun_weight", round(product->eq_tun_weight * 10) / 10);
1206 query.bindValue(":eq_tun_specific_heat", round(product->eq_tun_specific_heat * 1000) / 1000);
1207 query.bindValue(":eq_tun_material", product->eq_tun_material);
1208 query.bindValue(":eq_tun_height", round(product->eq_tun_height * 1000) / 1000);
1209 query.bindValue(":eq_top_up_water", round(product->eq_top_up_water * 10) / 10);
1210 query.bindValue(":eq_chiller_loss", round(product->eq_trub_chiller_loss * 10) / 10);
1211 query.bindValue(":eq_evap_rate", round(product->eq_evap_rate * 100) / 100);
1212 query.bindValue(":eq_boil_time", round(product->eq_boil_time));
1213 query.bindValue(":eq_calcboil", product->eq_calc_boil_volume ? 1:0);
1214 query.bindValue(":eq_top_up_kettle", round(product->eq_top_up_kettle * 10) / 10);
1215 query.bindValue(":eq_hopfactor", round(product->eq_hop_utilization));
1216 query.bindValue(":eq_notes", product->eq_notes);
1217 query.bindValue(":eq_lauter_volume", round(product->eq_lauter_volume * 10) / 10);
1218 query.bindValue(":eq_lauter_height", round(product->eq_lauter_height * 1000) / 1000);
1219 query.bindValue(":eq_lauter_deadspace", round(product->eq_lauter_deadspace * 10) / 10);
1220 query.bindValue(":eq_kettle_volume", round(product->eq_kettle_volume * 10) / 10);
1221 query.bindValue(":eq_kettle_height", round(product->eq_kettle_height * 1000) / 1000);
1222 query.bindValue(":eq_mash_volume", round(product->eq_mash_volume * 10) / 10);
1223 query.bindValue(":eq_mash_max", round(product->eq_mash_max * 10) / 10);
1224 query.bindValue(":eq_efficiency", round(product->eq_efficiency * 10) / 10);
1225 query.bindValue(":brew_date_start", product->brew_date_start);
1226 query.bindValue(":brew_mash_ph", round(product->brew_mash_ph * 100) / 100);
1227 query.bindValue(":brew_mash_sg", round(product->brew_mash_sg * 1000) / 1000);
1228 query.bindValue(":brew_mash_efficiency", round(product->brew_mash_efficiency * 10) / 10);
1229 query.bindValue(":brew_sparge_temperature", round(product->brew_sparge_temperature * 10) / 10);
1230 query.bindValue(":brew_sparge_volume", round(product->brew_sparge_volume * 10) / 10);
1231 query.bindValue(":brew_sparge_est", round(product->brew_sparge_est * 10) / 10);
1232 query.bindValue(":brew_sparge_ph", round(product->brew_sparge_ph * 100) / 100);
1233 query.bindValue(":brew_preboil_volume", round(product->brew_preboil_volume * 10) / 10);
1234 query.bindValue(":brew_preboil_sg", round(product->brew_preboil_sg * 1000) / 1000);
1235 query.bindValue(":brew_preboil_ph", round(product->brew_preboil_ph * 100) / 100);
1236 query.bindValue(":brew_preboil_efficiency", round(product->brew_preboil_efficiency * 10) / 10);
1237 query.bindValue(":brew_aboil_volume", round(product->brew_aboil_volume * 10) / 10);
1238 query.bindValue(":brew_aboil_sg", round(product->brew_aboil_sg * 1000) / 1000);
1239 query.bindValue(":brew_aboil_ph", round(product->brew_aboil_ph * 100) / 100);
1240 query.bindValue(":brew_aboil_efficiency", round(product->brew_aboil_efficiency * 10) / 10);
1241 query.bindValue(":brew_cooling_method", product->brew_cooling_method);
1242 query.bindValue(":brew_cooling_time", round(product->brew_cooling_time * 10) / 10);
1243 query.bindValue(":brew_cooling_to", round(product->brew_cooling_to * 10) / 10);
1244 query.bindValue(":brew_whirlpool9", round(product->brew_whirlpool9));
1245 query.bindValue(":brew_whirlpool7", round(product->brew_whirlpool7));
1246 query.bindValue(":brew_whirlpool6", round(product->brew_whirlpool6));
1247 query.bindValue(":brew_whirlpool2", round(product->brew_whirlpool2));
1248 query.bindValue(":brew_fermenter_volume", round(product->brew_aboil_efficiency * 10) / 10);
1249 query.bindValue(":brew_fermenter_extrawater", round(product->brew_aboil_efficiency * 10) / 10);
1250 query.bindValue(":brew_fermenter_tcloss", round(product->brew_aboil_efficiency * 10) / 10);
1251 query.bindValue(":brew_aeration_time", round(product->brew_aeration_time));
1252 query.bindValue(":brew_aeration_speed", round(product->brew_aboil_efficiency * 10) / 10);
1253 query.bindValue(":brew_aeration_type", product->brew_aeration_type);
1254 query.bindValue(":brew_fermenter_sg", round(product->brew_aboil_efficiency * 1000) / 1000);
1255 query.bindValue(":brew_fermenter_ibu", round(product->brew_aboil_efficiency * 10) / 10);
1256 query.bindValue(":brew_fermenter_color", round(product->brew_aboil_efficiency * 10) / 10);
1257 query.bindValue(":brew_date_end", product->brew_date_end);
1258 query.bindValue(":og", round(product->og * 1000) / 1000);
1259 query.bindValue(":fg", round(product->fg * 1000) / 1000);
1260 query.bindValue(":primary_start_temp", round(product->primary_start_temp * 10) / 10);
1261 query.bindValue(":primary_max_temp", round(product->primary_max_temp * 10) / 10);
1262 query.bindValue(":primary_end_temp", round(product->primary_end_temp * 10) / 10);
1263 query.bindValue(":primary_end_sg", round(product->primary_end_sg * 1000) / 1000);
1264 query.bindValue(":primary_end_date", product->primary_end_date);
1265 query.bindValue(":secondary_temp", round(product->secondary_temp * 10) / 10);
1266 query.bindValue(":secondary_end_sg", round(product->secondary_end_sg * 1000) / 1000);
1267 query.bindValue(":secondary_end_date", product->secondary_end_date);
1268 query.bindValue(":tertiary_temp", round(product->tertiary_temp * 10) / 10);
1269 query.bindValue(":package_date", product->package_date);
1270 query.bindValue(":package_volume", round(product->package_volume * 10) / 10);
1271 query.bindValue(":package_infuse_amount", round(product->package_infuse_amount * 10) / 10);
1272 query.bindValue(":package_infuse_abv", round(product->package_infuse_abv * 100) / 100);
1273 query.bindValue(":package_infuse_notes", product->package_infuse_notes);
1274 query.bindValue(":package_abv", round(product->package_abv * 100) / 100);
1275 query.bindValue(":package_ph", round(product->package_ph * 100) / 100);
1276 query.bindValue(":bottle_amount", round(product->bottle_amount * 10) / 10);
1277 query.bindValue(":bottle_carbonation", round(product->bottle_carbonation * 100) / 100);
1278 query.bindValue(":bottle_priming_sugar", product->bottle_priming_sugar);
1279 query.bindValue(":bottle_priming_amount", round(product->bottle_priming_amount * 10) / 10);
1280 query.bindValue(":bottle_priming_water", round(product->bottle_priming_water * 1000) / 1000);
1281 query.bindValue(":bottle_carbonation_temp", round(product->bottle_carbonation_temp * 10) / 10);
1282 query.bindValue(":keg_amount", round(product->keg_amount * 10) / 10);
1283 query.bindValue(":keg_carbonation", round(product->keg_carbonation * 100) / 100);
1284 query.bindValue(":keg_priming_sugar", product->keg_priming_sugar);
1285 query.bindValue(":keg_priming_amount", round(product->keg_priming_amount * 10) / 10);
1286 query.bindValue(":keg_priming_water", round(product->keg_priming_water * 1000) / 1000);
1287 query.bindValue(":keg_carbonation_temp", round(product->keg_carbonation_temp * 10) / 10);
1288 query.bindValue(":keg_forced_carb", product->keg_forced_carb ? 1:0);
1289 query.bindValue(":keg_pressure", round(product->keg_pressure * 10) / 10);
1290 query.bindValue(":taste_notes", product->taste_notes);
1291 query.bindValue(":taste_rate", round(product->taste_rate * 10) / 10);
1292 query.bindValue(":taste_date", product->taste_date);
1293 query.bindValue(":taste_color", product->taste_color);
1294 query.bindValue(":taste_transparency", product->taste_transparency);
1295 query.bindValue(":taste_head", product->taste_head);
1296 query.bindValue(":taste_aroma", product->taste_aroma);
1297 query.bindValue(":taste_taste", product->taste_taste);
1298 query.bindValue(":taste_mouthfeel", product->taste_mouthfeel);
1299 query.bindValue(":taste_aftertaste", product->taste_aftertaste);
1099 query.bindValue(":st_name", product->st_name); 1300 query.bindValue(":st_name", product->st_name);
1100 query.bindValue(":st_letter", product->st_letter); 1301 query.bindValue(":st_letter", product->st_letter);
1101 query.bindValue(":st_guide", product->st_guide); 1302 query.bindValue(":st_guide", product->st_guide);
1102 query.bindValue(":st_category", product->st_category); 1303 query.bindValue(":st_category", product->st_category);
1103 query.bindValue(":st_catnr", product->st_category_number); 1304 query.bindValue(":st_catnr", product->st_category_number);
1112 query.bindValue(":st_color_max", round(product->st_color_max * 10) / 10); 1313 query.bindValue(":st_color_max", round(product->st_color_max * 10) / 10);
1113 query.bindValue(":st_carb_min", round(product->st_carb_min * 10) / 10); 1314 query.bindValue(":st_carb_min", round(product->st_carb_min * 10) / 10);
1114 query.bindValue(":st_carb_max", round(product->st_carb_max * 10) / 10); 1315 query.bindValue(":st_carb_max", round(product->st_carb_max * 10) / 10);
1115 query.bindValue(":st_abv_min", round(product->st_abv_min * 10) / 10); 1316 query.bindValue(":st_abv_min", round(product->st_abv_min * 10) / 10);
1116 query.bindValue(":st_abv_max", round(product->st_abv_max * 10) / 10); 1317 query.bindValue(":st_abv_max", round(product->st_abv_max * 10) / 10);
1117 query.bindValue(":name", product->name);
1118 query.bindValue(":notes", product->notes);
1119 query.bindValue(":type", product->type); 1318 query.bindValue(":type", product->type);
1120 query.bindValue(":batch_size", round(product->batch_size * 10) / 10); 1319 query.bindValue(":batch_size", round(product->batch_size * 10) / 10);
1121 query.bindValue(":boil_size", round(product->boil_size * 10) / 10); 1320 query.bindValue(":boil_size", round(product->boil_size * 10) / 10);
1122 query.bindValue(":boil_time", round(product->boil_time * 10) / 10); 1321 query.bindValue(":boil_time", round(product->boil_time * 10) / 10);
1123 query.bindValue(":efficiency", round(product->efficiency * 10) / 10); 1322 query.bindValue(":efficiency", round(product->efficiency * 10) / 10);
1124 query.bindValue(":est_og", round(product->est_og * 1000) / 1000); 1323 query.bindValue(":est_og", round(product->est_og * 1000) / 1000);
1324 query.bindValue(":est_og3", round(product->est_og3 * 1000) / 1000);
1125 query.bindValue(":est_fg", round(product->est_fg * 1000) / 1000); 1325 query.bindValue(":est_fg", round(product->est_fg * 1000) / 1000);
1126 query.bindValue(":est_abv", round(product->est_abv * 10) / 10); 1326 query.bindValue(":est_abv", round(product->est_abv * 10) / 10);
1127 query.bindValue(":est_color", round(product->est_color * 10) / 10); 1327 query.bindValue(":est_color", round(product->est_color * 10) / 10);
1128 query.bindValue(":color_method", product->color_method); 1328 query.bindValue(":color_method", product->color_method);
1129 query.bindValue(":est_ibu", round(product->est_ibu * 10) / 10); 1329 query.bindValue(":est_ibu", round(product->est_ibu * 10) / 10);
1175 query.bindValue(":wb_total_alkalinity", round(product->wb_total_alkalinity * 100000) / 100000); 1375 query.bindValue(":wb_total_alkalinity", round(product->wb_total_alkalinity * 100000) / 100000);
1176 query.bindValue(":wb_ph", round(product->wb_ph * 100) / 100); 1376 query.bindValue(":wb_ph", round(product->wb_ph * 100) / 100);
1177 query.bindValue(":wa_acid_name", product->wa_acid_name); 1377 query.bindValue(":wa_acid_name", product->wa_acid_name);
1178 query.bindValue(":wa_acid_perc", round(product->wa_acid_perc * 10) / 10); 1378 query.bindValue(":wa_acid_perc", round(product->wa_acid_perc * 10) / 10);
1179 query.bindValue(":wa_base_name", product->wa_base_name); 1379 query.bindValue(":wa_base_name", product->wa_base_name);
1380 query.bindValue(":starter_enable", product->starter_enable ? 1:0);
1381 query.bindValue(":starter_type", product->starter_type);
1382 query.bindValue(":starter_sg", round(product->starter_sg * 1000) / 1000);
1383 query.bindValue(":starter_viability", product->starter_viability);
1384 query.bindValue(":yeast_prod_date", product->yeast_prod_date);
1385 query.bindValue(":yeast_pitchrate", round(product->yeast_pitchrate * 1000) / 1000);
1386 query.bindValue(":prop1_type", product->prop1_type);
1387 query.bindValue(":prop1_volume", round(product->prop1_volume * 1000) / 1000);
1388 query.bindValue(":prop2_type", product->prop2_type);
1389 query.bindValue(":prop2_volume", round(product->prop2_volume * 1000) / 1000);
1390 query.bindValue(":prop3_type", product->prop3_type);
1391 query.bindValue(":prop3_volume", round(product->prop3_volume * 1000) / 1000);
1392 query.bindValue(":prop4_type", product->prop4_type);
1393 query.bindValue(":prop4_volume", round(product->prop4_volume * 1000) / 1000);
1394 query.bindValue(":divide_type", product->divide_type);
1395 query.bindValue(":divide_size", round(product->divide_size * 10) / 10);
1396 query.bindValue(":divide_factor", round(product->divide_factor * 100) / 100);
1397 query.bindValue(":divide_parts", product->divide_parts);
1398 query.bindValue(":divide_part", product->divide_part);
1180 1399
1181 if (product->fermentables.size() == 0) { 1400 if (product->fermentables.size() == 0) {
1182 query.bindValue(":json_fermentables", "[]"); 1401 query.bindValue(":json_fermentables", "[]");
1183 } else { 1402 } else {
1184 QJsonArray array; 1403 QJsonArray array;

mercurial