156 |
156 |
157 double pabv = product->final_abv + (product->bottle_priming_amount * (1 / SFactor) * 0.47) / 7.907; |
157 double pabv = product->final_abv + (product->bottle_priming_amount * (1 / SFactor) * 0.47) / 7.907; |
158 double pvol = product->bottle_amount - (pabv * product->bottle_amount) / 100; |
158 double pvol = product->bottle_amount - (pabv * product->bottle_amount) / 100; |
159 talc = product->bottle_amount - pvol; |
159 talc = product->bottle_amount - pvol; |
160 tvol = pvol + product->bottle_priming_water; |
160 tvol = pvol + product->bottle_priming_water; |
161 ui->bottle_abvShow->setValue(talc / (tvol + talc) * 100); |
161 product->bottle_abv = talc / (tvol + talc) * 100; |
162 ui->bottle_barShow->setValue(GetPressure(product->bottle_carbonation, TSec, product->bottle_carbonation_temp)); |
162 product->bottle_bar = GetPressure(product->bottle_carbonation, TSec, product->bottle_carbonation_temp); |
|
163 ui->bottle_abvShow->setValue(product->bottle_abv); |
|
164 ui->bottle_barShow->setValue(product->bottle_bar); |
163 } |
165 } |
164 } |
166 } |
165 } |
167 } |
166 if (! found1) { |
168 if (! found1) { |
167 qDebug() << " no bottle priming"; |
169 qDebug() << " no bottle priming"; |
168 ui->bottle_sug_amountShow->setValue(0); |
170 ui->bottle_sug_amountShow->setValue(0); |
169 ui->bottle_sug_weightShow->setValue(0); |
171 ui->bottle_sug_weightShow->setValue(0); |
170 ui->bottle_abvShow->setValue(0); |
172 ui->bottle_abvShow->setValue(0); |
171 ui->bottle_barShow->setValue(0); |
173 ui->bottle_barShow->setValue(0); |
|
174 product->bottle_abv = 0; |
|
175 product->bottle_bar = 0; |
172 } |
176 } |
173 |
177 |
174 ui->keg_sugarLabel->setEnabled(! product->keg_forced_carb); |
178 ui->keg_sugarLabel->setEnabled(! product->keg_forced_carb); |
175 ui->keg_sugarEdit->setEnabled(! product->keg_forced_carb); |
179 ui->keg_sugarEdit->setEnabled(! product->keg_forced_carb); |
176 ui->keg_sug_weightLabel->setEnabled(! product->keg_forced_carb); |
180 ui->keg_sug_weightLabel->setEnabled(! product->keg_forced_carb); |
233 |
237 |
234 double pabv = product->final_abv + (product->keg_priming_amount * (1 / SFactor) * 0.47) / 7.907; |
238 double pabv = product->final_abv + (product->keg_priming_amount * (1 / SFactor) * 0.47) / 7.907; |
235 double pvol = product->keg_amount - (pabv * product->keg_amount) / 100; |
239 double pvol = product->keg_amount - (pabv * product->keg_amount) / 100; |
236 talc = product->keg_amount - pvol; |
240 talc = product->keg_amount - pvol; |
237 tvol = pvol + product->keg_priming_water; |
241 tvol = pvol + product->keg_priming_water; |
238 ui->keg_abvShow->setValue(talc / (tvol + talc) * 100); |
242 product->keg_abv = talc / (tvol + talc) * 100; |
239 ui->keg_barShow->setValue(GetPressure(product->keg_carbonation, TSec, product->keg_carbonation_temp)); |
243 product->keg_bar = GetPressure(product->keg_carbonation, TSec, product->keg_carbonation_temp); |
|
244 ui->keg_abvShow->setValue(product->keg_abv); |
|
245 ui->keg_barShow->setValue(product->keg_bar); |
240 } |
246 } |
241 } // if priming sugar. |
247 } // if priming sugar. |
242 if (! found1) { |
248 if (! found1) { |
243 qDebug() << " no keg priming"; |
249 qDebug() << " no keg priming"; |
244 ui->keg_sug_amountShow->setValue(0); |
250 ui->keg_sug_amountShow->setValue(0); |
245 ui->keg_sug_weightShow->setValue(0); |
251 ui->keg_sug_weightShow->setValue(0); |
246 ui->keg_abvShow->setValue(0); |
252 ui->keg_abvShow->setValue(0); |
|
253 product->keg_abv = 0; |
|
254 product->keg_bar = 0; |
247 } |
255 } |
248 } else { |
256 } else { |
249 /* |
257 /* |
250 * Forced carbonation |
258 * Forced carbonation |
251 */ |
259 */ |
252 ui->keg_abvShow->setValue(product->final_abv); |
260 ui->keg_abvShow->setValue(product->final_abv); |
|
261 product->keg_abv = product->final_abv; |
253 ui->keg_sug_amountShow->setValue(0); |
262 ui->keg_sug_amountShow->setValue(0); |
254 ui->keg_sug_weightShow->setValue(0); |
263 ui->keg_sug_weightShow->setValue(0); |
255 } |
264 } |
256 } // if keg_amount |
265 } // if keg_amount |
257 } |
266 } |