Thu, 12 Oct 2023 14:19:46 +0200
Version 0.3.44. Moved iSpindel Plato calculation from the php script to bmsd. This uses calibration data in the mon_ispindels table. Setup of this data will be done by the bmsapp applications. Default settings are stored in MySQL. From now on you don't need to store calibration data in the iSpindel.
741 | 1 | /***************************************************************************** |
842
897bf2a43253
Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents:
841
diff
changeset
|
2 | * Copyright (C) 2018-2023 |
111
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * Michiel Broek <mbroek at mbse dot eu> |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * This file is part of BMS |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * This is free software; you can redistribute it and/or modify it |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * under the terms of the GNU General Public License as published by the |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * Free Software Foundation; either version 2, or (at your option) any |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * later version. |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * BrewCloud is distributed in the hope that it will be useful, but |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | * General Public License for more details. |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | * |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | * along with ThermFerm; see the file COPYING. If not, write to the Free |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | *****************************************************************************/ |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | |
752
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
24 | function block_fermentable(stage, added) { |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
25 | if (stage > 5 && added < 4) // After fermentation and added before packaging |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
26 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
27 | if (stage > 3 && added < 3) // After primary and added before sec/tert |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
28 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
29 | if (stage > 2 && added < 2) // After boil and added during mash or boil |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
30 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
31 | return false; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
32 | } |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
33 | |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
34 | function block_hop(stage, useat) |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
35 | { |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
36 | if (stage > 2 && useat < 5) |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
37 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
38 | return false; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
39 | } |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
40 | |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
41 | function block_misc(stage, use_use) { |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
42 | if (stage > 5 && use_use < 5) |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
43 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
44 | if (stage > 3 && use_use < 4) |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
45 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
46 | if (stage > 2 && use_use < 3) |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
47 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
48 | if (stage > 1 && use_use < 1) |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
49 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
50 | return false; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
51 | } |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
52 | |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
53 | function block_yeast(stage, use) { |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
54 | if (stage > 3 && use < 1) |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
55 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
56 | if (stage > 4 && use < 2) |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
57 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
58 | if (stage > 5 && use < 3) |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
59 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
60 | if (stage > 6 && use < 4) |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
61 | return true; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
62 | return false; |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
63 | } |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
64 | |
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
65 | |
478 | 66 | $(document).ready(function() { |
67 | ||
68 | var i, | |
69 | to_100 = false, // Fermentables adjust to 100% | |
70 | preboil_sg = 0, | |
71 | aboil_sg = 0, | |
72 | est_mash_sg = 0, | |
73 | psugar = 0, // Percentage real sugars | |
74 | pcara = 0, // Percentage cara/crystal malts | |
75 | svg = 77, // Default attenuation | |
76 | mashkg = 0, // Malt in mash weight | |
77 | initcells = 0, // Initial yeast cell count | |
78 | ||
79 | ok_fermentables = 1, // Fermentables are in stock | |
80 | ok_hops = 1, // Hops are in stock | |
81 | ok_miscs = 1, // Miscs are in stock | |
82 | ok_yeasts = 1, // Yeasts are in stock | |
83 | ok_waters = 1, // Waters are in stock | |
84 | ||
643
9ac2fb6b1311
Added failsave starting calcWater() when the main data is not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
642
diff
changeset
|
85 | data_loaded = 0; |
642
9d1af81b20ef
Limit debug ProtoDeficit error messages. If the need for a yeast starter changes, make sure the screen is updated. Another set of extra debug logs. Fixed try yeast starter. Several dropdown lists changed the action from change to select. This should fix te too early calculations while the data was not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
641
diff
changeset
|
86 | error_count = 0; |
646
2246d830a42a
Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents:
644
diff
changeset
|
87 | k_cm = 0; |
2246d830a42a
Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents:
644
diff
changeset
|
88 | k_vol = 0; |
2246d830a42a
Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents:
644
diff
changeset
|
89 | k_what = 0; |
642
9d1af81b20ef
Limit debug ProtoDeficit error messages. If the need for a yeast starter changes, make sure the screen is updated. Another set of extra debug logs. Fixed try yeast starter. Several dropdown lists changed the action from change to select. This should fix te too early calculations while the data was not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
641
diff
changeset
|
90 | |
478 | 91 | hop_flavour = 0, |
92 | hop_aroma = 0, | |
93 | mash_infuse = 0, | |
94 | last_acid = '', | |
95 | ||
96 | MMCa = 40.048, | |
97 | MMMg = 24.305, | |
98 | MMNa = 22.98976928, | |
99 | MMCl = 35.453, | |
100 | MMSO4 = 96.0626, | |
101 | MMHCO3 = 61.01684, | |
102 | MMCaSO4 = 172.171, | |
103 | MMCaCl2 = 147.015, | |
104 | MMCaCO3 = 100.087, | |
759 | 105 | MMMgCl2 = 95.211, /* Since 27-06-2021 */ |
478 | 106 | MMMgSO4 = 246.475, |
107 | MMNaHCO3 = 84.007, | |
108 | MMNa2CO3 = 105.996, | |
109 | MMNaCl = 58.443, | |
110 | MMCaOH2 = 74.06268, | |
111 | ||
112 | fermentableRow = 0, | |
113 | fermentableData = {}, | |
114 | fermentableInit = 1, | |
115 | hopRow = 0, | |
116 | hopData = {}, | |
117 | miscRow = 0, | |
118 | miscData = {}, | |
119 | yeastRow = 0, | |
120 | yeastData = {}, | |
121 | mashRow = 0, | |
122 | mashData = {}, | |
123 | Ka1 = 0.0000004445, | |
124 | Ka2 = 0.0000000000468, | |
125 | dataRecord = {}, | |
126 | url = 'includes/db_product.php', | |
484
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
127 | MaltVolume = 0.87, // l/kg 0.688 volgens internetbronnen, gemeten 0.874 l/kg, na enige tijd maischen 0,715 l/kg (A3 Otten). |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
128 | SpecificHeatWater = 1.0, |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
129 | SpecificHeatMalt = 0.399, //cal/g.°C |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
130 | SlakingHeat = 10.318, //cal/g.°C |
478 | 131 | |
132 | // Prepare the data | |
133 | source = { | |
134 | datatype: 'json', | |
135 | cache: false, | |
638
736c8d29bc87
Binding the data earlier to try to prevent a race condition.
Michiel Broek <mbroek@mbse.eu>
parents:
637
diff
changeset
|
136 | async: true, |
478 | 137 | datafields: [ |
138 | // From prod_main | |
139 | { name: 'record', type: 'number' }, | |
140 | { name: 'uuid', type: 'string' }, | |
141 | { name: 'name', type: 'string' }, | |
142 | { name: 'code', type: 'string' }, | |
143 | { name: 'birth', type: 'string' }, | |
144 | { name: 'stage', type: 'int' }, | |
145 | { name: 'notes', type: 'string' }, | |
146 | { name: 'log_brew', type: 'int' }, | |
147 | { name: 'log_fermentation', type: 'int' }, | |
602
10b61aacb1c1
New products field log_ispindel. Add check for ispindel log to crontasks.php Added log_ispindel to prod_edit, pprod_divide, prod_new and prod_duplicate. Renamed some log_fermentation vergisting names into klimaatkast.
Michiel Broek <mbroek@mbse.eu>
parents:
586
diff
changeset
|
148 | { name: 'log_ispindel', type: 'int' }, |
615
9034e65b0d7a
Added CO2 carbonation log to the products database. Added button in the packaging tab.
Michiel Broek <mbroek@mbse.eu>
parents:
613
diff
changeset
|
149 | { name: 'log_co2pressure', type: 'int' }, |
478 | 150 | { name: 'inventory_reduced', type: 'int' }, |
151 | { name: 'locked', type: 'int' }, | |
152 | { name: 'eq_name', type: 'string' }, | |
153 | { name: 'eq_boil_size', type: 'float' }, | |
154 | { name: 'eq_batch_size', type: 'float' }, | |
155 | { name: 'eq_tun_volume', type: 'float' }, | |
156 | { name: 'eq_tun_weight', type: 'float' }, | |
157 | { name: 'eq_tun_specific_heat', type: 'float' }, | |
158 | { name: 'eq_tun_material', type: 'int' }, | |
159 | { name: 'eq_tun_height', type: 'float' }, | |
160 | { name: 'eq_top_up_water', type: 'float' }, | |
842
897bf2a43253
Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents:
841
diff
changeset
|
161 | { name: 'eq_trub_loss', type: 'float' }, |
478 | 162 | { name: 'eq_evap_rate', type: 'float' }, |
163 | { name: 'eq_boil_time', type: 'float' }, | |
841
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
164 | { name: 'xeq_calc_boil_volume', type: 'int' }, |
478 | 165 | { name: 'eq_top_up_kettle', type: 'float' }, |
166 | { name: 'eq_notes', type: 'string' }, | |
841
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
167 | { name: 'xeq_lauter_volume', type: 'float' }, |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
168 | { name: 'xeq_lauter_height', type: 'float' }, |
478 | 169 | { name: 'eq_lauter_deadspace', type: 'float' }, |
170 | { name: 'eq_kettle_volume', type: 'float' }, | |
171 | { name: 'eq_kettle_height', type: 'float' }, | |
172 | { name: 'eq_mash_volume', type: 'float' }, | |
173 | { name: 'eq_mash_max', type: 'float' }, | |
174 | { name: 'eq_efficiency', type: 'float' }, | |
841
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
175 | { name: 'eq_chiller_type', type: 'int' }, |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
176 | { name: 'eq_chiller_to79', type: 'float' }, |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
177 | { name: 'eq_chiller_volume', type: 'float' }, |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
178 | { name: 'eq_chiller_lpm', type: 'float' }, |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
179 | { name: 'eq_chiller_loss', type: 'float' }, |
478 | 180 | { name: 'brew_date_start', type: 'string' }, |
181 | { name: 'brew_mash_ph', type: 'float' }, | |
182 | { name: 'brew_mash_sg', type: 'float' }, | |
183 | { name: 'brew_mash_efficiency', type: 'float' }, | |
184 | { name: 'brew_sparge_est', type: 'float' }, | |
185 | { name: 'brew_sparge_ph', type: 'float' }, | |
186 | { name: 'brew_preboil_volume', type: 'float' }, | |
187 | { name: 'brew_preboil_sg', type: 'float' }, | |
188 | { name: 'brew_preboil_ph', type: 'float' }, | |
189 | { name: 'brew_preboil_efficiency', type: 'float' }, | |
190 | { name: 'brew_aboil_volume', type: 'float' }, | |
191 | { name: 'brew_aboil_sg', type: 'float' }, | |
192 | { name: 'brew_aboil_ph', type: 'float' }, | |
193 | { name: 'brew_aboil_efficiency', type: 'float' }, | |
194 | { name: 'brew_cooling_method', type: 'int' }, | |
195 | { name: 'brew_cooling_time', type: 'float' }, | |
196 | { name: 'brew_cooling_to', type: 'float' }, | |
197 | { name: 'brew_whirlpool9', type: 'float' }, | |
198 | { name: 'brew_whirlpool7', type: 'float' }, | |
199 | { name: 'brew_whirlpool6', type: 'float' }, | |
200 | { name: 'brew_whirlpool2', type: 'float' }, | |
201 | { name: 'brew_fermenter_volume', type: 'float' }, | |
202 | { name: 'brew_fermenter_extrawater', type: 'float' }, | |
203 | { name: 'brew_fermenter_tcloss', type: 'float' }, | |
204 | { name: 'brew_aeration_time', type: 'float' }, | |
205 | { name: 'brew_aeration_speed', type: 'float' }, | |
206 | { name: 'brew_aeration_type', type: 'int' }, | |
207 | { name: 'brew_fermenter_sg', type: 'float' }, | |
208 | { name: 'brew_fermenter_ibu', type: 'float' }, | |
209 | { name: 'brew_fermenter_color', type: 'float' }, | |
210 | { name: 'brew_date_end', type: 'string' }, | |
211 | { name: 'og', type: 'float' }, | |
212 | { name: 'fg', type: 'float' }, | |
213 | { name: 'primary_start_temp', type: 'float' }, | |
214 | { name: 'primary_max_temp', type: 'float' }, | |
215 | { name: 'primary_end_temp', type: 'float' }, | |
216 | { name: 'primary_end_sg', type: 'float' }, | |
217 | { name: 'primary_end_date', type: 'string' }, | |
218 | { name: 'secondary_temp', type: 'float' }, | |
219 | { name: 'secondary_end_sg', type: 'float' }, | |
220 | { name: 'secondary_end_date', type: 'string' }, | |
221 | { name: 'tertiary_temp', type: 'float' }, | |
222 | { name: 'package_date', type: 'string' }, | |
223 | { name: 'package_volume', type: 'float' }, | |
224 | { name: 'package_infuse_amount', type: 'float' }, | |
225 | { name: 'package_infuse_abv', type: 'float' }, | |
226 | { name: 'package_infuse_notes', type: 'string' }, | |
227 | { name: 'package_abv', type: 'float' }, | |
228 | { name: 'package_ph', type: 'float' }, | |
229 | { name: 'bottle_amount', type: 'float' }, | |
230 | { name: 'bottle_carbonation', type: 'float' }, | |
231 | { name: 'bottle_priming_water', type: 'float' }, | |
232 | { name: 'bottle_priming_amount', type: 'float' }, | |
233 | { name: 'bottle_carbonation_temp', type: 'float' }, | |
234 | { name: 'keg_amount', type: 'float' }, | |
235 | { name: 'keg_carbonation', type: 'float' }, | |
236 | { name: 'keg_priming_water', type: 'float' }, | |
237 | { name: 'keg_priming_amount', type: 'float' }, | |
238 | { name: 'keg_carbonation_temp', type: 'float' }, | |
239 | { name: 'keg_forced_carb', type: 'int' }, | |
240 | { name: 'keg_pressure', type: 'float' }, | |
241 | { name: 'taste_notes', type: 'string' }, | |
242 | { name: 'taste_rate', type: 'float' }, | |
243 | { name: 'taste_date', type: 'string' }, | |
244 | { name: 'taste_color', type: 'string' }, | |
245 | { name: 'taste_transparency', type: 'string' }, | |
246 | { name: 'taste_head', type: 'string' }, | |
247 | { name: 'taste_aroma', type: 'string' }, | |
248 | { name: 'taste_taste', type: 'string' }, | |
249 | { name: 'taste_mouthfeel', type: 'string' }, | |
250 | { name: 'taste_aftertaste', type: 'string' }, | |
251 | { name: 'st_name', type: 'string' }, | |
252 | { name: 'st_letter', type: 'string' }, | |
253 | { name: 'st_guide', type: 'string' }, | |
254 | { name: 'st_category', type: 'string' }, | |
706
12f9316de113
Less logging in the db_product interface. Fixed some empty default values that bugged the newer php and mariadb versions.
Michiel Broek <mbroek@mbse.eu>
parents:
697
diff
changeset
|
255 | { name: 'st_category_number', type: 'int' }, |
478 | 256 | { name: 'st_type', type: 'int' }, |
257 | { name: 'st_og_min', type: 'float' }, | |
258 | { name: 'st_og_max', type: 'float' }, | |
259 | { name: 'st_fg_min', type: 'float' }, | |
260 | { name: 'st_fg_max', type: 'float' }, | |
261 | { name: 'st_ibu_min', type: 'float' }, | |
262 | { name: 'st_ibu_max', type: 'float' }, | |
263 | { name: 'st_color_min', type: 'float' }, | |
264 | { name: 'st_color_max', type: 'float' }, | |
265 | { name: 'st_carb_min', type: 'float' }, | |
266 | { name: 'st_carb_max', type: 'float' }, | |
267 | { name: 'st_abv_min', type: 'float' }, | |
268 | { name: 'st_abv_max', type: 'float' }, | |
269 | { name: 'type', type: 'int' }, | |
270 | { name: 'batch_size', type: 'float' }, | |
271 | { name: 'boil_size', type: 'float' }, | |
272 | { name: 'boil_time', type: 'float' }, | |
273 | { name: 'efficiency', type: 'float' }, | |
274 | { name: 'est_og', type: 'float' }, | |
616
2cbf21bb9bdc
Added est_og3 field in the products database so that the checklist can use it.
Michiel Broek <mbroek@mbse.eu>
parents:
615
diff
changeset
|
275 | { name: 'est_og3', type: 'float' }, |
478 | 276 | { name: 'est_fg', type: 'float' }, |
277 | { name: 'est_abv', type: 'float' }, | |
278 | { name: 'est_color', type: 'float' }, | |
279 | { name: 'color_method', type: 'int' }, | |
280 | { name: 'est_ibu', type: 'float' }, | |
281 | { name: 'ibu_method', type: 'int' }, | |
282 | { name: 'est_carb', type: 'float' }, | |
283 | { name: 'sparge_temp', type: 'float' }, | |
284 | { name: 'sparge_ph', type: 'float' }, | |
285 | { name: 'sparge_volume', type: 'float' }, | |
286 | { name: 'sparge_source', type: 'int' }, | |
287 | { name: 'sparge_acid_type', type: 'int' }, | |
288 | { name: 'sparge_acid_perc', type: 'float' }, | |
289 | { name: 'sparge_acid_amount', type: 'float' }, | |
290 | { name: 'mash_ph', type: 'float' }, | |
291 | { name: 'mash_name', type: 'string' }, | |
292 | { name: 'calc_acid', type: 'int' }, | |
293 | { name: 'w1_name', type: 'string' }, | |
294 | { name: 'w1_amount', type: 'float' }, | |
295 | { name: 'w1_calcium', type: 'float' }, | |
296 | { name: 'w1_sulfate', type: 'float' }, | |
297 | { name: 'w1_chloride', type: 'float' }, | |
298 | { name: 'w1_sodium', type: 'float' }, | |
299 | { name: 'w1_magnesium', type: 'float' }, | |
300 | { name: 'w1_total_alkalinity', type: 'float' }, | |
301 | { name: 'w1_ph', type: 'float' }, | |
302 | { name: 'w1_cost', type: 'float' }, | |
303 | { name: 'w2_name', type: 'string' }, | |
304 | { name: 'w2_amount', type: 'float' }, | |
305 | { name: 'w2_calcium', type: 'float' }, | |
306 | { name: 'w2_sulfate', type: 'float' }, | |
307 | { name: 'w2_chloride', type: 'float' }, | |
308 | { name: 'w2_sodium', type: 'float' }, | |
309 | { name: 'w2_magnesium', type: 'float' }, | |
310 | { name: 'w2_total_alkalinity', type: 'float' }, | |
311 | { name: 'w2_ph', type: 'float' }, | |
312 | { name: 'w2_cost', type: 'float' }, | |
313 | { name: 'wg_amount', type: 'float' }, | |
314 | { name: 'wg_calcium', type: 'float' }, | |
315 | { name: 'wg_sulfate', type: 'float' }, | |
316 | { name: 'wg_chloride', type: 'float' }, | |
317 | { name: 'wg_sodium', type: 'float' }, | |
318 | { name: 'wg_magnesium', type: 'float' }, | |
319 | { name: 'wg_total_alkalinity', type: 'float' }, | |
320 | { name: 'wg_ph', type: 'float' }, | |
321 | { name: 'wb_calcium', type: 'float' }, | |
322 | { name: 'wb_sulfate', type: 'float' }, | |
323 | { name: 'wb_chloride', type: 'float' }, | |
324 | { name: 'wb_sodium', type: 'float' }, | |
325 | { name: 'wb_magnesium', type: 'float' }, | |
326 | { name: 'wb_total_alkalinity', type: 'float' }, | |
327 | { name: 'wb_ph', type: 'float' }, | |
328 | { name: 'wa_acid_name', type: 'int' }, | |
329 | { name: 'wa_acid_perc', type: 'int' }, | |
330 | { name: 'wa_base_name', type: 'int' }, | |
331 | { name: 'starter_enable', type: 'int' }, | |
332 | { name: 'starter_type', type: 'int' }, | |
333 | { name: 'starter_sg', type: 'float' }, | |
334 | { name: 'starter_viability', type: 'int' }, | |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
335 | { name: 'yeast_prod_date', type: 'string' }, |
697
367ae7ff52f0
Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents:
669
diff
changeset
|
336 | { name: 'yeast_pitchrate', type: 'float' }, |
478 | 337 | { name: 'prop1_type', type: 'int' }, |
338 | { name: 'prop1_volume', type: 'float' }, | |
339 | { name: 'prop2_type', type: 'int' }, | |
340 | { name: 'prop2_volume', type: 'float' }, | |
341 | { name: 'prop3_type', type: 'int' }, | |
342 | { name: 'prop3_volume', type: 'float' }, | |
343 | { name: 'prop4_type', type: 'int' }, | |
344 | { name: 'prop4_volume', type: 'float' }, | |
497
0fe366d953ab
Prepare screens for product divide batch.
Michiel Broek <mbroek@mbse.eu>
parents:
495
diff
changeset
|
345 | { name: 'divide_type', type: 'int' }, |
0fe366d953ab
Prepare screens for product divide batch.
Michiel Broek <mbroek@mbse.eu>
parents:
495
diff
changeset
|
346 | { name: 'divide_size', type: 'float' }, |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
347 | { name: 'divide_factor', type: 'float' }, |
497
0fe366d953ab
Prepare screens for product divide batch.
Michiel Broek <mbroek@mbse.eu>
parents:
495
diff
changeset
|
348 | { name: 'divide_parts', type: 'int' }, |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
349 | { name: 'divide_part', type: 'int' }, |
774
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
772
diff
changeset
|
350 | { name: 'fermentables', type: 'string' }, |
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
772
diff
changeset
|
351 | { name: 'hops', type: 'string' }, |
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
772
diff
changeset
|
352 | { name: 'miscs', type: 'string' }, |
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
772
diff
changeset
|
353 | { name: 'yeasts', type: 'string' }, |
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
772
diff
changeset
|
354 | { name: 'mashs', type: 'string' } |
478 | 355 | ], |
356 | id: 'record', | |
357 | url: url + '?record=' + my_record | |
358 | }, | |
359 | ||
360 | // Load data and select one record. | |
361 | dataAdapter = new $.jqx.dataAdapter(source, { | |
362 | loadComplete: function() { | |
758
e6814bed4cb1
Moved NaHCO3 and CaCO3 from the base additions to the water agent salts.
Michiel Broek <mbroek@mbse.eu>
parents:
757
diff
changeset
|
363 | dataRecord = dataAdapter.records[0]; |
478 | 364 | // Hidden record uuid |
365 | $('#name').val(dataRecord.name); | |
366 | $('#code').val(dataRecord.code); | |
367 | $('#birth').val(dataRecord.birth); | |
368 | $('#stage').val(StageData[dataRecord.stage].nl); | |
369 | $('#notes').val(dataRecord.notes); | |
370 | $('#locked').val(dataRecord.locked); | |
371 | $('#eq_name').val(dataRecord.eq_name); | |
372 | $('#eq_notes').val(dataRecord.eq_notes); | |
373 | $('#eq_boil_size').val(dataRecord.eq_boil_size); | |
374 | $('#eq_batch_size').val(dataRecord.eq_batch_size); | |
375 | $('#eq_tun_volume').val(dataRecord.eq_tun_volume); | |
376 | $('#eq_top_up_water').val(dataRecord.eq_top_up_water); | |
842
897bf2a43253
Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents:
841
diff
changeset
|
377 | $('#eq_trub_loss').val(dataRecord.eq_trub_loss); |
478 | 378 | $('#eq_evap_rate').val(dataRecord.eq_evap_rate); |
379 | $('#eq_boil_time').val(dataRecord.eq_boil_time); | |
380 | $('#eq_top_up_kettle').val(dataRecord.eq_top_up_kettle); | |
841
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
381 | // $('#eq_lauter_volume').val(dataRecord.eq_lauter_volume); |
478 | 382 | $('#eq_lauter_deadspace').val(dataRecord.eq_lauter_deadspace); |
383 | $('#eq_kettle_volume').val(dataRecord.eq_kettle_volume); | |
384 | $('#eq_mash_volume').val(dataRecord.eq_mash_volume); | |
385 | $('#eq_mash_max').val(dataRecord.eq_mash_max); | |
386 | $('#eq_efficiency').val(dataRecord.eq_efficiency); | |
841
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
387 | $('#eq_chiller_type').val(CoolingTypeData[dataRecord.eq_chiller_type].nl); |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
388 | $('#eq_chiller_to79').val(dataRecord.eq_chiller_to79); |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
389 | $('#eq_chiller_volume').val(dataRecord.eq_chiller_volume); |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
390 | $('#eq_chiller_lpm').val(dataRecord.eq_chiller_lpm); |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
391 | $('#eq_chiller_loss').val(dataRecord.eq_chiller_loss); |
842
897bf2a43253
Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents:
841
diff
changeset
|
392 | $('#eq_fermenter_volume').val((dataRecord.eq_batch_size / 1.04) - dataRecord.eq_trub_loss - dataRecord.eq_chiller_loss ); |
478 | 393 | // Brewdate |
394 | $('#brew_date_start').val(dataRecord.brew_date_start); | |
395 | $('#brew_mash_ph').val(dataRecord.brew_mash_ph); | |
396 | $('#brew_mash_sg').val(dataRecord.brew_mash_sg); | |
397 | $('#brew_mash_efficiency').val(dataRecord.brew_mash_efficiency); | |
398 | // Header Spoelen en filteren | |
399 | $('#brew_sparge_temperature').val(dataRecord.sparge_temp); | |
400 | $('#brew_sparge_volume').val(dataRecord.sparge_volume); | |
401 | $('#brew_sparge_est').val(dataRecord.brew_sparge_est); | |
402 | $('#brew_sparge_ph').val(dataRecord.brew_sparge_ph); | |
403 | // Header Beluchten | |
826
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
404 | $('#brew_aeration_type').val(AerationTypeData[dataRecord.brew_aeration_type].nl); |
478 | 405 | $('#brew_aeration_time').val(dataRecord.brew_aeration_time); |
406 | $('#brew_aeration_speed').val(dataRecord.brew_aeration_speed); | |
407 | ||
408 | $('#brew_preboil_ph').val(dataRecord.brew_preboil_ph); | |
409 | $('#brew_preboil_sg').val(dataRecord.brew_preboil_sg); | |
410 | $('#brew_preboil_volume').val(dataRecord.brew_preboil_volume); | |
411 | $('#brew_preboil_efficiency').val(dataRecord.brew_preboil_efficiency); | |
412 | // Header Koelen en whirlpoolen | |
413 | $('#brew_whirlpool9').val(dataRecord.brew_whirlpool9); | |
414 | $('#brew_whirlpool7').val(dataRecord.brew_whirlpool7); | |
415 | $('#brew_whirlpool6').val(dataRecord.brew_whirlpool6); | |
416 | $('#brew_whirlpool2').val(dataRecord.brew_whirlpool2); | |
417 | // Header Naar gistvat | |
418 | $('#brew_fermenter_volume').val(dataRecord.brew_fermenter_volume); | |
419 | $('#brew_fermenter_sg').val(dataRecord.brew_fermenter_sg); | |
420 | $('#brew_fermenter_sg2').val(dataRecord.brew_fermenter_sg); | |
421 | $('#brew_fermenter_ibu').val(dataRecord.brew_fermenter_ibu); | |
422 | $('#brew_fermenter_color').val(dataRecord.brew_fermenter_color); | |
423 | $('#brew_fermenter_extrawater').val(dataRecord.brew_fermenter_extrawater); | |
424 | $('#brew_fermenter_tcloss').val(dataRecord.brew_fermenter_tcloss); | |
425 | ||
426 | $('#brew_aboil_ph').val(dataRecord.brew_aboil_ph); | |
427 | $('#brew_aboil_sg').val(dataRecord.brew_aboil_sg); | |
428 | $('#brew_aboil_volume').val(dataRecord.brew_aboil_volume); | |
429 | $('#brew_aboil_efficiency').val(dataRecord.brew_aboil_efficiency); | |
430 | // Header Koelen en whirlpoolen | |
431 | $('#brew_cooling_to').val(dataRecord.brew_cooling_to); | |
826
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
432 | $('#brew_cooling_method').val(CoolingTypeData[dataRecord.brew_cooling_method].nl); |
478 | 433 | $('#brew_cooling_time').val(dataRecord.brew_cooling_time); |
434 | // Niks | |
435 | $('#brew_date_end').val(dataRecord.brew_date_end); | |
436 | $('#og').val(dataRecord.og); | |
437 | $('#fg').val(dataRecord.fg); | |
438 | $('#primary_start_temp').val(dataRecord.primary_start_temp); | |
439 | $('#primary_max_temp').val(dataRecord.primary_max_temp); | |
440 | $('#primary_end_temp').val(dataRecord.primary_end_temp); | |
441 | $('#primary_end_sg').val(dataRecord.primary_end_sg); | |
442 | $('#primary_end_date').val(dataRecord.primary_end_date); | |
443 | $('#secondary_temp').val(dataRecord.secondary_temp); | |
444 | $('#secondary_end_sg').val(dataRecord.secondary_end_sg); | |
445 | $('#secondary_end_date').val(dataRecord.secondary_end_date); | |
446 | $('#tertiary_temp').val(dataRecord.tertiary_temp); | |
447 | $('#package_date').val(dataRecord.package_date); | |
448 | $('#package_volume').val(dataRecord.package_volume); | |
449 | $('#package_infuse_amount').val(dataRecord.package_infuse_amount); | |
450 | $('#package_infuse_abv').val(dataRecord.package_infuse_abv); | |
451 | $('#package_infuse_notes').val(dataRecord.package_infuse_notes); | |
452 | $('#package_abv').val(dataRecord.package_abv); | |
453 | $('#package_ph').val(dataRecord.package_ph); | |
454 | $('#bottle_amount').val(dataRecord.bottle_amount); | |
455 | $('#bottle_carbonation').val(dataRecord.bottle_carbonation); | |
456 | $('#bottle_priming_water').val(dataRecord.bottle_priming_water); | |
457 | $('#bottle_priming_amount').val(dataRecord.bottle_priming_amount); | |
458 | $('#bottle_carbonation_temp').val(dataRecord.bottle_carbonation_temp); | |
459 | $('#keg_amount').val(dataRecord.keg_amount); | |
460 | $('#keg_carbonation').val(dataRecord.keg_carbonation); | |
461 | $('#keg_priming_water').val(dataRecord.keg_priming_water); | |
462 | $('#keg_priming_amount').val(dataRecord.keg_priming_amount); | |
463 | $('#keg_carbonation_temp').val(dataRecord.keg_carbonation_temp); | |
464 | $('#keg_forced_carb').val(dataRecord.keg_forced_carb); | |
465 | $('#keg_pressure').val(dataRecord.keg_pressure); | |
466 | $('#taste_notes').val(dataRecord.taste_notes); | |
467 | $('#taste_rate').val(dataRecord.taste_rate); | |
468 | $('#taste_date').val(dataRecord.taste_date); | |
469 | $('#taste_color').val(dataRecord.taste_color); | |
470 | $('#taste_transparency').val(dataRecord.taste_transparency); | |
471 | $('#taste_head').val(dataRecord.taste_head); | |
472 | $('#taste_aroma').val(dataRecord.taste_aroma); | |
473 | $('#taste_taste').val(dataRecord.taste_taste); | |
474 | $('#taste_mouthfeel').val(dataRecord.taste_mouthfeel); | |
475 | $('#taste_aftertaste').val(dataRecord.taste_aftertaste); | |
476 | ||
477 | // Recipe | |
478 | $('#st_name').val(dataRecord.st_name); | |
479 | $('#st_letter').val(dataRecord.st_letter); | |
480 | $('#st_guide').val(dataRecord.st_guide); | |
481 | $('#st_category').val(dataRecord.st_category); | |
482 | $('#st_category_number').val(dataRecord.st_category_number); | |
483 | $('#st_type').val(StyleTypeData[dataRecord.st_type].nl); | |
484 | $('#st_og_min').val(dataRecord.st_og_min); | |
485 | $('#st_og_max').val(dataRecord.st_og_max); | |
486 | $('#st_fg_min').val(dataRecord.st_fg_min); | |
487 | $('#st_fg_max').val(dataRecord.st_fg_max); | |
488 | $('#st_abv_min').val(dataRecord.st_abv_min); | |
489 | $('#st_abv_max').val(dataRecord.st_abv_max); | |
490 | $('#st_color_min').val(dataRecord.st_color_min); | |
491 | $('#st_color_max').val(dataRecord.st_color_max); | |
492 | $('#st_ibu_min').val(dataRecord.st_ibu_min); | |
493 | $('#st_ibu_max').val(dataRecord.st_ibu_max); | |
494 | $('#st_carb_min').val(dataRecord.st_carb_min); | |
495 | $('#st_carb_min2').val(dataRecord.st_carb_min); | |
496 | $('#st_carb_max').val(dataRecord.st_carb_max); | |
497 | $('#st_carb_max2').val(dataRecord.st_carb_max); | |
818
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
498 | $('#type').val(RecipeTypeData[dataRecord.type].nl); |
478 | 499 | $('#batch_size').val(dataRecord.batch_size); |
500 | $('#est_a_vol').val(dataRecord.batch_size * 1.04); | |
501 | $('#boil_size').val(dataRecord.boil_size); | |
502 | $('#est_pre_vol').val(dataRecord.boil_size * 1.04); | |
503 | $('#boil_time').val(dataRecord.boil_time); | |
504 | $('#efficiency').val(dataRecord.efficiency); | |
505 | $('#est_og').val(dataRecord.est_og); | |
506 | $('#est_og2').val(dataRecord.est_og); | |
616
2cbf21bb9bdc
Added est_og3 field in the products database so that the checklist can use it.
Michiel Broek <mbroek@mbse.eu>
parents:
615
diff
changeset
|
507 | $('#est_og3').val(dataRecord.est_og3); |
478 | 508 | $('#est_fg').val(dataRecord.est_fg); |
509 | $('#est_fg2').val(dataRecord.est_fg); | |
510 | $('#est_fg3').val(dataRecord.est_fg); | |
511 | $('#est_color').val(dataRecord.est_color); | |
512 | $('#est_color2').val(dataRecord.est_color); | |
513 | $('#est_abv').val(dataRecord.est_abv); | |
818
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
514 | $('#color_method').val(ColorMethodData[dataRecord.color_method].nl); |
478 | 515 | $('#est_ibu').val(dataRecord.est_ibu); |
516 | $('#est_ibu2').val(dataRecord.est_ibu); | |
818
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
517 | $('#ibu_method').val(IBUmethodData[dataRecord.ibu_method].nl); |
478 | 518 | $('#est_carb').val(dataRecord.est_carb); |
519 | $('#mash_name').val(dataRecord.mash_name); | |
520 | $('#mash_ph').val(dataRecord.mash_ph); | |
521 | $('#sparge_temp').val(dataRecord.sparge_temp); | |
522 | $('#sparge_ph').val(dataRecord.sparge_ph); | |
523 | $('#sparge_volume').val(dataRecord.sparge_volume); | |
524 | $('#sparge_source').val(dataRecord.sparge_source); | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
525 | $('#sparge_acid_type').val(AcidTypeData[dataRecord.sparge_acid_type].nl); |
478 | 526 | $('#sparge_acid_perc').val(dataRecord.sparge_acid_perc); |
527 | $('#sparge_acid_amount').val(dataRecord.sparge_acid_amount * 1000); | |
528 | $('#calc_acid').val(dataRecord.calc_acid); | |
529 | $('#w1_name').val(dataRecord.w1_name); | |
530 | $('#w1_amount').val(dataRecord.w1_amount); | |
531 | $('#w1_calcium').val(dataRecord.w1_calcium); | |
532 | $('#w1_sulfate').val(dataRecord.w1_sulfate); | |
533 | $('#w1_chloride').val(dataRecord.w1_chloride); | |
534 | $('#w1_sodium').val(dataRecord.w1_sodium); | |
535 | $('#w1_magnesium').val(dataRecord.w1_magnesium); | |
536 | $('#w1_total_alkalinity').val(dataRecord.w1_total_alkalinity); | |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
537 | $('#w1_bicarbonate').val(dataRecord.w1_total_alkalinity * 1.22); |
478 | 538 | $('#w1_ph').val(dataRecord.w1_ph); |
539 | $('#w1_cost').val(dataRecord.w1_cost); | |
540 | $('#w2_name').val(dataRecord.w2_name); | |
541 | $('#w2_amount').val(dataRecord.w2_amount); | |
542 | $('#w2_calcium').val(dataRecord.w2_calcium); | |
543 | $('#w2_sulfate').val(dataRecord.w2_sulfate); | |
544 | $('#w2_chloride').val(dataRecord.w2_chloride); | |
545 | $('#w2_sodium').val(dataRecord.w2_sodium); | |
546 | $('#w2_magnesium').val(dataRecord.w2_magnesium); | |
547 | $('#w2_total_alkalinity').val(dataRecord.w2_total_alkalinity); | |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
548 | $('#w2_bicarbonate').val(dataRecord.w2_total_alkalinity * 1.22); |
478 | 549 | $('#w2_ph').val(dataRecord.w2_ph); |
550 | $('#w2_cost').val(dataRecord.w2_cost); | |
551 | $('#wg_amount').val(dataRecord.wg_amount); | |
552 | $('#wg_calcium').val(dataRecord.wg_calcium); | |
553 | $('#wg_sulfate').val(dataRecord.wg_sulfate); | |
554 | $('#wg_chloride').val(dataRecord.wg_chloride); | |
555 | $('#wg_sodium').val(dataRecord.wg_sodium); | |
556 | $('#wg_magnesium').val(dataRecord.wg_magnesium); | |
557 | $('#wg_total_alkalinity').val(dataRecord.wg_total_alkalinity); | |
558 | $('#wg_ph').val(dataRecord.wg_ph); | |
559 | $('#wb_calcium').val(dataRecord.wb_calcium); | |
560 | $('#wb_sulfate').val(dataRecord.wb_sulfate); | |
561 | $('#wb_chloride').val(dataRecord.wb_chloride); | |
562 | $('#wb_sodium').val(dataRecord.wb_sodium); | |
563 | $('#wb_magnesium').val(dataRecord.wb_magnesium); | |
564 | $('#wb_total_alkalinity').val(dataRecord.wb_total_alkalinity); | |
565 | $('#wb_ph').val(dataRecord.wb_ph); | |
566 | $('#wa_acid_name').val(dataRecord.wa_acid_name); | |
567 | $('#wa_acid_perc').val(dataRecord.wa_acid_perc); | |
823 | 568 | $('#starter_type').val(StarterTypeData[dataRecord.starter_type].nl); |
478 | 569 | $('#starter_sg').val(dataRecord.starter_sg); |
570 | $('#starter_viability').val(dataRecord.starter_viability); | |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
571 | $('#yeast_prod_date').val(dataRecord.yeast_prod_date); |
697
367ae7ff52f0
Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents:
669
diff
changeset
|
572 | $('#yeast_pitchrate').val(dataRecord.yeast_pitchrate); |
823 | 573 | $('#prop1_type').val(StarterTypeData[dataRecord.prop1_type].nl); |
478 | 574 | $('#prop1_volume').val(dataRecord.prop1_volume); |
823 | 575 | $('#prop2_type').val(StarterTypeData[dataRecord.prop2_type].nl); |
478 | 576 | $('#prop2_volume').val(dataRecord.prop2_volume); |
823 | 577 | $('#prop3_type').val(StarterTypeData[dataRecord.prop3_type].nl); |
478 | 578 | $('#prop3_volume').val(dataRecord.prop3_volume); |
823 | 579 | $('#prop4_type').val(StarterTypeData[dataRecord.prop4_type].nl); |
478 | 580 | $('#prop4_volume').val(dataRecord.prop4_volume); |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
497
diff
changeset
|
581 | $('#divide_type').val(SplitData[dataRecord.divide_type].nl); |
545
f71079a45f5c
More screen improvements. Updated the design README.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
582 | if (dataRecord.divide_type > 0) |
f71079a45f5c
More screen improvements. Updated the design README.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
583 | $('#divide_batch').val((dataRecord.divide_part + 1) + ' van ' + (dataRecord.divide_parts + 1)); |
f71079a45f5c
More screen improvements. Updated the design README.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
584 | else |
f71079a45f5c
More screen improvements. Updated the design README.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
585 | $('#divide_batch').val('n.v.t.'); |
497
0fe366d953ab
Prepare screens for product divide batch.
Michiel Broek <mbroek@mbse.eu>
parents:
495
diff
changeset
|
586 | // hidden divide_size |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
587 | // hidden divide_factor |
544
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
542
diff
changeset
|
588 | // hidden divide_parts |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
589 | // hidden divide_part |
478 | 590 | editFermentable(dataRecord); |
591 | editHop(dataRecord); | |
592 | editMisc(dataRecord); | |
593 | editYeast(dataRecord); | |
594 | editMash(dataRecord); | |
595 | calcStage(); | |
596 | $('#jqxTabs').jqxTabs('select', 2); | |
643
9ac2fb6b1311
Added failsave starting calcWater() when the main data is not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
642
diff
changeset
|
597 | data_loaded = 1; |
478 | 598 | }, |
640 | 599 | loadError: function(jqXHR, status, error) { |
639 | 600 | console.log('main data load error: ' + status + ' ' + error); |
478 | 601 | } |
602 | }); | |
603 | ||
604 | // Inline fermentables editor | |
605 | var editFermentable = function(data) { | |
606 | var fermentableSource = { | |
607 | localdata: data.fermentables, | |
608 | datafields: [ | |
609 | { name: 'f_name', type: 'string' }, | |
610 | { name: 'f_origin', type: 'string' }, | |
611 | { name: 'f_supplier', type: 'string' }, | |
612 | { name: 'f_amount', type: 'float' }, | |
613 | { name: 'f_cost', type: 'float' }, | |
614 | { name: 'f_type', type: 'int' }, | |
615 | { name: 'f_yield', type: 'float' }, | |
616 | { name: 'f_color', type: 'float' }, | |
617 | { name: 'f_coarse_fine_diff', type: 'float' }, | |
618 | { name: 'f_moisture', type: 'float' }, | |
619 | { name: 'f_diastatic_power', type: 'float' }, | |
620 | { name: 'f_protein', type: 'float' }, | |
621 | { name: 'f_max_in_batch', type: 'float' }, | |
622 | { name: 'f_graintype', type: 'int' }, | |
623 | { name: 'f_added', type: 'int' }, | |
624 | { name: 'f_dissolved_protein', type: 'float' }, | |
625 | { name: 'f_recommend_mash', type: 'int' }, | |
626 | { name: 'f_add_after_boil', type: 'int' }, | |
627 | { name: 'f_adjust_to_total_100', type: 'int' }, | |
628 | { name: 'f_percentage', type: 'float' }, | |
629 | { name: 'f_di_ph', type: 'float' }, | |
630 | { name: 'f_acid_to_ph_57', type: 'float' }, | |
631 | { name: 'f_inventory', type: 'float' }, | |
632 | { name: 'f_avail', type: 'int' } | |
633 | ], | |
634 | }, | |
635 | fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); | |
636 | ||
637 | $('#fermentableGrid').jqxGrid({ | |
638 | width: 1240, | |
639 | height: 470, | |
640 | source: fermentableAdapter, | |
641 | theme: theme, | |
820 | 642 | editable: false, |
772
f9d266eb0ec6
In product editor calculate fermentables before the first IBU calculation. In recipe editor changed to the new water calculations like in the product editor.
Michiel Broek <mbroek@mbse.eu>
parents:
769
diff
changeset
|
643 | ready: function() { calcFermentables(); $('#jqxTabs').jqxTabs('next'); }, |
478 | 644 | columns: [ |
820 | 645 | { text: 'Vergistbaar ingrediënt', datafield: 'f_name' }, |
646 | { text: 'Leverancier', datafield: 'f_supplier', width: 180 }, | |
647 | { text: 'Kleur', datafield: 'f_color', width: 90, align: 'right', | |
478 | 648 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { |
820 | 649 | return '<span style="margin: 4px; margin-top: 6px; float: right;">' + dataAdapter.formatNumber(value, 'f0') + ' EBC</span>'; |
478 | 650 | } |
651 | }, | |
652 | { text: 'Type', width: 100, datafield: 'f_type', | |
653 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
654 | return '<span style="margin: 3px; margin-top: 6px; float: left;">' + FermentableTypeData[value].nl + '</span>'; | |
655 | } | |
656 | }, | |
657 | { text: 'Moment', width: 110, datafield: 'f_added', | |
658 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
659 | return '<span style="margin: 3px; margin-top: 6px; float: left;">' + AddedData[value].nl + '</span>'; | |
660 | } | |
661 | }, | |
662 | { text: 'Maxinbatch', datafield: 'f_max_in_batch', hidden: true }, | |
663 | { text: 'Opbrengst', datafield: 'f_yield', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, | |
820 | 664 | { text: 'Gewicht Kg', datafield: 'f_amount', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, |
665 | { text: 'Voorraad Kg', datafield: 'f_inventory', width: 110, align: 'right', | |
478 | 666 | cellsrenderer: function(row, columnfield, value, defaulthtml, columnproperties, rowdata) { |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
667 | var color = (value < rowdata.f_amount) ? '#ff4040':'#ffffff'; |
752
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
668 | if (block_fermentable(dataRecord.inventory_reduced, rowdata.f_added) == false) { |
478 | 669 | return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + fermentableAdapter.formatNumber(value, 'f3') + '</span>'; |
670 | } else { | |
671 | return '<span></span>'; | |
672 | } | |
673 | } | |
674 | }, | |
675 | { text: 'Procent', datafield: 'f_percentage', width: 90, align: 'right', | |
676 | cellsrenderer: function(row, columnfield, value, defaulthtml, columnproperties, rowdata) { | |
677 | if (rowdata.f_added >= 4) | |
678 | return '<span></span>'; | |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
679 | var color = (value > rowdata.f_max_in_batch) ? '#ff4040':'#ffffff'; |
478 | 680 | return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + fermentableAdapter.formatNumber(value, 'p1') + '</span>'; |
681 | } | |
682 | }, | |
683 | { text: '100%', datafield: 'f_adjust_to_total_100', width: 70, align: 'center', cellsalign: 'center', | |
684 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
685 | if (value == 0) | |
686 | return '<span></span>'; | |
687 | return '<span><img style="float:left; margin-left:25px; margin-top:4px;" src="images/dialog-ok-apply.png"></span>'; | |
688 | } | |
689 | } | |
690 | ] | |
691 | }); | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
518
diff
changeset
|
692 | }; |
478 | 693 | |
694 | // Inline hops editor | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
518
diff
changeset
|
695 | var editHop = function(data) { |
478 | 696 | var hopSource = { |
697 | localdata: data.hops, | |
698 | datafields: [ | |
699 | { name: 'h_name', type: 'string' }, | |
700 | { name: 'h_origin', type: 'string' }, | |
701 | { name: 'h_amount', type: 'float' }, | |
702 | { name: 'h_cost', type: 'float' }, | |
703 | { name: 'h_type', type: 'int' }, | |
704 | { name: 'h_form', type: 'int' }, | |
705 | { name: 'h_useat', type: 'int' }, | |
538
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
706 | { name: 'h_time', type: 'int' }, |
478 | 707 | { name: 'h_alpha', type: 'float' }, |
708 | { name: 'h_beta', type: 'float' }, | |
709 | { name: 'h_hsi', type: 'float' }, | |
710 | { name: 'h_humulene', type: 'float' }, | |
711 | { name: 'h_caryophyllene', type: 'float' }, | |
712 | { name: 'h_cohumulone', type: 'float' }, | |
713 | { name: 'h_myrcene', type: 'float' }, | |
714 | { name: 'h_total_oil', type: 'float' }, | |
715 | { name: 'h_inventory', type: 'float' }, | |
821 | 716 | { name: 'h_avail', type: 'int' }, |
717 | { name: 'h_utilisation', type: 'float' }, | |
718 | { name: 'h_bu_factor', type: 'float' } | |
478 | 719 | ], |
720 | }, | |
721 | hopAdapter = new $.jqx.dataAdapter(hopSource); | |
722 | ||
723 | $('#hopGrid').jqxGrid({ | |
724 | width: 1240, | |
725 | height: 560, | |
726 | source: hopAdapter, | |
727 | theme: theme, | |
821 | 728 | editable: false, |
648 | 729 | ready: function() { $('#jqxTabs').jqxTabs('next'); }, |
478 | 730 | columns: [ |
821 | 731 | { text: 'Hop', datafield: 'h_name' }, |
732 | { text: 'Origin', width: 180, datafield: 'h_origin' }, | |
478 | 733 | { text: 'Type', width: 90, datafield: 'h_type', |
734 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
735 | return '<span style="margin: 4px; margin-top: 6px; float: left;">' + HopTypeData[value].nl + '</span>'; | |
736 | } | |
737 | }, | |
821 | 738 | { text: 'Vorm', width: 110, datafield: 'h_form', |
478 | 739 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { |
740 | return '<span style="margin: 4px; margin-top: 6px; float: left;">' + HopFormData[value].nl + '</span>'; | |
741 | } | |
742 | }, | |
743 | { text: 'Alpha', datafield: 'h_alpha', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, | |
744 | { text: 'Gebruik', width: 110, datafield: 'h_useat', | |
745 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
746 | return '<span style="margin: 4px; margin-top: 6px; float: left;">' + HopUseData[value].nl + '</span>'; | |
747 | } | |
748 | }, | |
749 | { text: 'Tijdsduur', datafield: 'h_time', width: 90, align: 'right', | |
750 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
751 | var duration = ''; | |
752 | if ((rowdata.h_useat == 2) || (rowdata.h_useat == 4)) // Boil, Whirlpool | |
753 | duration = dataAdapter.formatNumber(value, 'f0') + ' min.'; | |
754 | else if (rowdata.h_useat == 5) // Dry hop | |
755 | duration = dataAdapter.formatNumber(value / 1440, 'f0') + ' dagen'; | |
756 | return '<span style="margin: 4px; margin-top: 6px; float: right;">' + duration + '</span>'; | |
757 | } | |
758 | }, | |
759 | { text: 'IBU', datafield: 'ibu', width: 80, align: 'right', | |
760 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
772
f9d266eb0ec6
In product editor calculate fermentables before the first IBU calculation. In recipe editor changed to the new water calculations like in the product editor.
Michiel Broek <mbroek@mbse.eu>
parents:
769
diff
changeset
|
761 | var ibu = toIBU(rowdata.h_useat, rowdata.h_form, preboil_sg, parseFloat(dataRecord.batch_size), |
821 | 762 | parseFloat(rowdata.h_amount), parseFloat(rowdata.h_time), parseFloat(rowdata.h_alpha), dataRecord.ibu_method, |
538
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
763 | dataRecord.brew_whirlpool9, dataRecord.brew_whirlpool7, dataRecord.brew_whirlpool6); |
478 | 764 | return '<span style="margin: 4px; margin-top: 6px; float: right;">' + dataAdapter.formatNumber(ibu, 'f1') + '</span>'; |
765 | } | |
766 | }, | |
767 | { text: 'Gewicht', datafield: 'h_amount', width: 110, align: 'right', | |
768 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
769 | var amount = dataAdapter.formatNumber(value, 'f1') + ' kg'; | |
770 | if (value < 1) | |
771 | amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gr'; | |
772 | return '<span style="margin: 4px; margin-top: 6px; float: right;">' + amount + '</span>'; | |
773 | } | |
774 | }, | |
775 | { text: 'Voorraad', datafield: 'h_inventory', width: 110, align: 'right', | |
776 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
752
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
777 | if (block_hop(dataRecord.inventory_reduced, rowdata.h_useat) == false) { |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
778 | var amount = dataAdapter.formatNumber(value, 'f1') + ' kg', |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
779 | color = (value < rowdata.h_amount) ? '#ff4040':'#ffffff'; |
478 | 780 | if (value < 1) |
781 | amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gr'; | |
782 | return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + amount + '</span>'; | |
783 | } else { | |
784 | return '<span></span>'; | |
785 | } | |
786 | } | |
787 | } | |
788 | ] | |
789 | }); | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
518
diff
changeset
|
790 | }; |
478 | 791 | |
792 | // Inline miscs editor | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
518
diff
changeset
|
793 | var editMisc = function(data) { |
478 | 794 | var miscSource = { |
795 | localdata: data.miscs, | |
796 | datafields: [ | |
797 | { name: 'm_name', type: 'string' }, | |
798 | { name: 'm_amount', type: 'float' }, | |
799 | { name: 'm_cost', type: 'float' }, | |
800 | { name: 'm_type', type: 'int' }, | |
801 | { name: 'm_use_use', type: 'int' }, | |
802 | { name: 'm_time', type: 'float' }, | |
803 | { name: 'm_amount_is_weight', type: 'int' }, | |
804 | { name: 'm_inventory', type: 'float' }, | |
805 | { name: 'm_avail', type: 'int' } | |
806 | ], | |
807 | }, | |
808 | miscAdapter = new $.jqx.dataAdapter(miscSource, { | |
809 | beforeLoadComplete: function(records) { | |
810 | var row, i, data = new Array(); | |
811 | for (i = 0; i < records.length; i++) { | |
812 | row = records[i]; | |
813 | data.push(row); | |
814 | // Initial set water agent values. | |
822 | 815 | if (row.m_use_use == 1) { // Mash |
816 | switch (row.m_name) { | |
817 | case 'CaCl2': | |
818 | $('#wa_cacl2').val(row.m_amount * 1000); | |
819 | break; | |
820 | case 'CaSO4': | |
821 | $('#wa_caso4').val(row.m_amount * 1000); | |
822 | break; | |
823 | case 'MgSO4': | |
824 | $('#wa_mgso4').val(row.m_amount * 1000); | |
825 | break; | |
826 | case 'NaCl': | |
827 | $('#wa_nacl').val(row.m_amount * 1000); | |
828 | break; | |
829 | case 'MgCl2': | |
830 | $('#wa_mgcl2').val(row.m_amount * 1000); | |
831 | break; | |
832 | case 'NaHCO3': | |
833 | $('#wa_nahco3').val(row.m_amount * 1000); | |
834 | break; | |
835 | case 'CaCO3': | |
836 | $('#wa_caco3').val(row.m_amount * 1000); | |
837 | break; | |
838 | case 'Melkzuur': | |
839 | $('#wa_acid_name').val(AcidTypeData[0].nl); | |
840 | $('#wa_acid').val(row.m_amount * 1000); | |
841 | $('#wa_acid_perc').val(AcidTypeData[0].AcidPrc); | |
842 | last_acid = 'Melkzuur'; | |
843 | break; | |
844 | case 'Zoutzuur': | |
845 | $('#wa_acid_name').val(AcidTypeData[1].nl); | |
846 | $('#wa_acid').val(row.m_amount * 1000); | |
847 | $('#wa_acid_perc').val(AcidTypeData[1].AcidPrc); | |
848 | last_acid = 'Zoutzuur'; | |
849 | break; | |
850 | case 'Fosforzuur': | |
851 | $('#wa_acid_name').val(AcidTypeData[2].nl); | |
852 | $('#wa_acid').val(row.m_amount * 1000); | |
853 | $('#wa_acid_perc').val(AcidTypeData[2].AcidPrc); | |
854 | last_acid = 'Fosforzuur'; | |
855 | break; | |
856 | case 'Zwavelzuur': | |
857 | $('#wa_acid_name').val(AcidTypeData[3].nl); | |
858 | $('#wa_acid').val(row.m_amount * 1000); | |
859 | $('#wa_acid_perc').val(AcidTypeData[3].AcidPrc); | |
860 | last_acid = 'Zwavelzuur'; | |
861 | break; | |
862 | } | |
863 | } | |
864 | if (row.m_use_use == 6) { // Sparge | |
865 | switch (row.m_name) { | |
866 | case 'CaCl2': | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
867 | $('#ss_cacl2').val(row.m_amount * 1000); |
822 | 868 | break; |
869 | case 'CaSO4': | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
870 | $('#ss_caso4').val(row.m_amount * 1000); |
822 | 871 | break; |
872 | case 'MgSO4': | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
873 | $('#ss_mgso4').val(row.m_amount * 1000); |
822 | 874 | break; |
875 | case 'NaCl': | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
876 | $('#ss_nacl').val(row.m_amount * 1000); |
822 | 877 | break; |
878 | case 'MgCl2': | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
879 | $('#ss_mgcl2').val(row.m_amount * 1000); |
822 | 880 | break; |
881 | } | |
478 | 882 | } |
883 | } | |
884 | return data; | |
885 | }, | |
641 | 886 | loadError: function(jqXHR, status, error) { console.log('miscs load error ' + status + ' ' + error); }, |
478 | 887 | }); |
888 | $('#miscGrid').jqxGrid({ | |
889 | width: 1240, | |
890 | height: 575, | |
891 | source: miscAdapter, | |
892 | theme: theme, | |
822 | 893 | editable: false, |
648 | 894 | ready: function() { $('#jqxTabs').jqxTabs('next'); }, |
478 | 895 | columns: [ |
896 | { text: 'Ingredient', datafield: 'm_name' }, | |
897 | { text: 'Type', width: 140, datafield: 'm_type', | |
898 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
899 | return '<span style="margin: 3px; margin-top: 6px; float: left;">' + MiscTypeData[value].nl + '</span>'; | |
900 | } | |
901 | }, | |
902 | { text: 'Gebruik', width: 140, datafield: 'm_use_use', | |
903 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
904 | return '<span style="margin: 3px; margin-top: 6px; float: left;">' + MiscUseData[value].nl + '</span>'; | |
905 | } | |
906 | }, | |
907 | { text: 'Tijd', datafield: 'm_time', width: 90, align: 'right', | |
908 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
909 | var duration = ''; | |
910 | if (rowdata.m_use_use == 2) // Boil | |
911 | duration = dataAdapter.formatNumber(value, 'f0') + ' min.'; | |
912 | else if ((rowdata.m_use_use == 3) || (rowdata.m_use_use == 4)) // Primary or Secondary | |
913 | duration = dataAdapter.formatNumber(value / 1440, 'f0') + ' dagen'; | |
914 | return '<span style="margin: 4px; margin-top: 6px; float: right;">' + duration + '</span>'; | |
915 | } | |
916 | }, | |
917 | { text: 'Hoeveel', datafield: 'm_amount', width: 110, align: 'right', | |
918 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
919 | var vstr = rowdata.m_amount_is_weight ? 'gr' : 'ml'; | |
920 | return '<span style="margin: 4px; margin-top: 6px; float: right;">' + dataAdapter.formatNumber(value * 1000, 'f2') + ' ' + vstr + '</span>'; | |
921 | } | |
922 | }, | |
923 | { text: 'Voorraad', datafield: 'm_inventory', width: 110, align: 'right', | |
924 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
752
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
925 | if (block_misc(dataRecord.inventory_reduced, rowdata.m_use_use) == false) { |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
926 | var vstr = rowdata.m_amount_is_weight ? 'gr' : 'ml', |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
927 | color = (value < rowdata.m_amount) ? '#ff4040':'#ffffff', |
478 | 928 | amount = dataAdapter.formatNumber(value * 1000, 'f2') + ' ' + vstr; |
929 | return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + amount + '</span>'; | |
930 | } else { | |
931 | return '<span></span>'; | |
932 | } | |
933 | } | |
934 | } | |
935 | ] | |
936 | }); | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
518
diff
changeset
|
937 | }; |
478 | 938 | |
939 | // Inline yeasts editor | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
518
diff
changeset
|
940 | var editYeast = function(data) { |
478 | 941 | var yeastSource = { |
942 | localdata: data.yeasts, | |
943 | datafields: [ | |
944 | { name: 'y_name', type: 'string' }, | |
945 | { name: 'y_laboratory', type: 'string' }, | |
946 | { name: 'y_product_id', type: 'string' }, | |
947 | { name: 'y_amount', type: 'float' }, | |
948 | { name: 'y_cost', type: 'float' }, | |
949 | { name: 'y_type', type: 'int' }, | |
950 | { name: 'y_form', type: 'int' }, | |
951 | { name: 'y_flocculation', type: 'int' }, | |
952 | { name: 'y_min_temperature', type: 'float' }, | |
953 | { name: 'y_max_temperature', type: 'float' }, | |
954 | { name: 'y_attenuation', type: 'float' }, | |
955 | { name: 'y_use', type: 'int' }, | |
956 | { name: 'y_cells', type: 'float' }, | |
957 | { name: 'y_tolerance', type: 'float' }, | |
958 | { name: 'y_inventory', type: 'float' }, | |
554
c62ff53cfc3d
Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents:
552
diff
changeset
|
959 | { name: 'y_sta1', type: 'int' }, |
c62ff53cfc3d
Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents:
552
diff
changeset
|
960 | { name: 'y_bacteria', type: 'int' }, |
c62ff53cfc3d
Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents:
552
diff
changeset
|
961 | { name: 'y_harvest_top', type: 'int' }, |
c62ff53cfc3d
Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents:
552
diff
changeset
|
962 | { name: 'y_harvest_time', type: 'int' }, |
c62ff53cfc3d
Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents:
552
diff
changeset
|
963 | { name: 'y_pitch_temperature', type: 'float' }, |
c62ff53cfc3d
Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents:
552
diff
changeset
|
964 | { name: 'y_pofpos', type: 'int' }, |
c62ff53cfc3d
Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents:
552
diff
changeset
|
965 | { name: 'y_zymocide', type: 'int' }, |
726
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
966 | { name: 'y_gr_hl_lo', type: 'int' }, |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
967 | { name: 'y_sg_lo', type: 'float' }, |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
968 | { name: 'y_gr_hl_hi', type: 'int' }, |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
969 | { name: 'y_sg_hi', type: 'float' }, |
478 | 970 | { name: 'y_avail', type: 'int' } |
971 | ], | |
972 | }, | |
973 | yeastAdapter = new $.jqx.dataAdapter(yeastSource); | |
974 | ||
975 | $('#yeastGrid').jqxGrid({ | |
976 | width: 1240, | |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
977 | height: 325, |
478 | 978 | source: yeastAdapter, |
979 | theme: theme, | |
823 | 980 | editable: false, |
648 | 981 | ready: function() { $('#jqxTabs').jqxTabs('next'); }, |
478 | 982 | columns: [ |
983 | { text: 'Gist', datafield: 'y_name' }, | |
984 | { text: 'Laboratorium', width: 150, datafield: 'y_laboratory' }, | |
985 | { text: 'Code', width: 90, datafield: 'y_product_id' }, | |
986 | { text: 'Soort', width: 100, datafield: 'y_form', | |
987 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
988 | return '<span style="margin: 4px; margin-top: 6px; float: left;">' + YeastFormData[value].nl + '</span>'; | |
989 | } | |
990 | }, | |
991 | { text: 'Min. °C', width: 70, align: 'right', cellsalign: 'right', datafield: 'y_min_temperature' }, | |
992 | { text: 'Max. °C', width: 70, align: 'right', cellsalign: 'right', datafield: 'y_max_temperature' }, | |
993 | { text: 'Tol. %', width: 60, align: 'right', cellsalign: 'right', datafield: 'y_tolerance', | |
994 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
995 | var amount = '', color = (dataRecord.est_abv > value) ? '#ff4040':'#ffffff'; |
478 | 996 | if (value > 0) { |
997 | amount = dataAdapter.formatNumber(value, 'f1'); | |
998 | } | |
999 | return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + amount + '</span>'; | |
1000 | } | |
1001 | }, | |
1002 | { text: 'Attn. %', width: 70, align: 'right', cellsalign: 'right', datafield: 'y_attenuation', cellsformat: 'f1' }, | |
1003 | { text: 'Voor', width: 120, datafield: 'y_use', | |
1004 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
1005 | return '<span style="margin: 4px; margin-top: 6px; float: left;">' + YeastUseData[value].nl + '</span>'; | |
1006 | } | |
1007 | }, | |
1008 | { text: 'Hoeveel', datafield: 'y_amount', width: 90, align: 'right', | |
1009 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
1010 | var amount = dataAdapter.formatNumber(value * 1000, 'f0') + ' ml'; | |
1011 | if (rowdata.y_form == 0) // Liquid | |
1012 | amount = dataAdapter.formatNumber(value, 'f0') + ' pk'; | |
515
9d771385a8a0
Added dried yeast form. Pitch rate for Kveik initially set at 0.25. Dried Kveik cells set to 9000000000 cells/gram.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
1013 | else if (rowdata.y_form == 1 || rowdata.y_form == 6) // Dry |
478 | 1014 | amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gr'; |
1015 | return '<span style="margin: 4px; margin-top: 6px; float: right;">' + amount + '</span>'; | |
1016 | } | |
1017 | }, | |
1018 | { text: 'Voorraad', datafield: 'y_inventory', width: 90, align: 'right', | |
1019 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { | |
1020 | var color, amount; | |
752
f68e3bbc1ada
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
Michiel Broek <mbroek@mbse.eu>
parents:
751
diff
changeset
|
1021 | if (block_yeast(dataRecord.inventory_reduced, rowdata.y_use) == false) { |
478 | 1022 | color = '#ffffff'; |
1023 | if (value < rowdata.y_amount) | |
1024 | color = '#ff4040'; | |
1025 | amount = dataAdapter.formatNumber(value * 1000, 'f0') + ' ml'; | |
1026 | if (rowdata.y_form == 0) // Liquid | |
1027 | amount = dataAdapter.formatNumber(value, 'f0') + ' pk'; | |
515
9d771385a8a0
Added dried yeast form. Pitch rate for Kveik initially set at 0.25. Dried Kveik cells set to 9000000000 cells/gram.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
1028 | else if (rowdata.y_form == 1 || rowdata.y_form == 6) // Dry |
478 | 1029 | amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gr'; |
1030 | return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + amount + '</span>'; | |
1031 | } else { | |
1032 | return '<span></span>'; | |
1033 | } | |
1034 | } | |
1035 | } | |
1036 | ] | |
1037 | }); | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
518
diff
changeset
|
1038 | }; |
478 | 1039 | |
1040 | // inline mash editor | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
518
diff
changeset
|
1041 | var editMash = function(data) { |
478 | 1042 | var mashSource = { |
1043 | localdata: data.mashs, | |
1044 | datafields: [ | |
1045 | { name: 'step_name', type: 'string' }, | |
1046 | { name: 'step_type', type: 'int' }, | |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1047 | { name: 'step_volume', type: 'float' }, |
478 | 1048 | { name: 'step_infuse_amount', type: 'float' }, |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1049 | { name: 'step_infuse_temp', type: 'float' }, |
478 | 1050 | { name: 'step_temp', type: 'float' }, |
1051 | { name: 'step_time', type: 'float' }, | |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1052 | { name: 'step_wg_ratio', type: 'float' }, |
478 | 1053 | { name: 'ramp_time', type: 'float' }, |
738
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1054 | { name: 'end_temp', type: 'float' }, |
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1055 | { name: 'step_ph', type: 'float' }, |
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1056 | { name: 'step_sg', type: 'float' } |
478 | 1057 | ], |
1058 | }, | |
774
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
772
diff
changeset
|
1059 | mashAdapter = new $.jqx.dataAdapter(mashSource); |
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
772
diff
changeset
|
1060 | |
478 | 1061 | $('#mashGrid').jqxGrid({ |
1062 | width: 1240, | |
1063 | height: 400, | |
1064 | source: mashAdapter, | |
1065 | theme: theme, | |
1066 | selectionmode: 'singlerow', | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
1067 | editable: false, |
478 | 1068 | ready: function() { |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1069 | /* Calculate the whole recipe */ |
641 | 1070 | console.log('ready mashs, start calculations'); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
1071 | /* calcFermentables() must be first and is done by the grid load. Here it is too late. */ |
478 | 1072 | calcMash(); |
789
e6e696add0b3
Fixed some mess in water calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
784
diff
changeset
|
1073 | calcWater(); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
1074 | calcIBUs(); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
1075 | whirlpoolHops(); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
1076 | calcMiscs(); |
826
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
1077 | calcViability(); |
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
1078 | calcYeast(); |
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
1079 | kookTijd(); |
828
aa0a9b1a2dd7
The fermentation tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
827
diff
changeset
|
1080 | calcFermentation(); |
829 | 1081 | calcCarbonation(); |
827 | 1082 | $('#FLog').jqxButton({ disabled: (dataRecord.log_fermentation) ? false : true}); |
1083 | $('#ILog').jqxButton({ disabled: (dataRecord.log_ispindel) ? false : true}); | |
1084 | $('#CLog').jqxButton({ disabled: (dataRecord.log_co2pressure) ? false : true}); | |
641 | 1085 | console.log('calculations ready'); |
478 | 1086 | $('#jqxLoader').jqxLoader('close'); |
1087 | $('#jqxTabs').jqxTabs('first'); | |
1088 | }, | |
1089 | columns: [ | |
1090 | { text: 'Stap naam', datafield: 'step_name' }, | |
738
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1091 | { text: 'Stap type', datafield: 'step_type', width: 150, |
478 | 1092 | cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { |
1093 | return '<span style="margin: 4px; margin-top: 6px; float: left;">' + MashStepTypeData[value].nl + '</span>'; | |
1094 | } | |
1095 | }, | |
738
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1096 | { text: 'Start °C', datafield: 'step_temp', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1097 | { text: 'Eind °C', datafield: 'end_temp', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1098 | { text: 'Rust min.', datafield: 'step_time', width: 80, align: 'right', cellsalign: 'right' }, |
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1099 | { text: 'Stap min.', datafield: 'ramp_time', width: 80, align: 'right', cellsalign: 'right' }, |
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1100 | { text: 'Inf/dec L.', datafield: 'step_infuse_amount', width: 80, align: 'right', |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1101 | cellsrenderer: function(row, columnfield, value, defaulthtml, columnproperties, rowdata) { |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1102 | if (rowdata.step_type == 1) |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1103 | return '<span></span>'; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1104 | var color = '#ffffff'; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1105 | var mvol = mashkg * MaltVolume; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1106 | if ((rowdata.step_wg_ratio * mashkg + mvol) > dataRecord.eq_tun_volume) |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1107 | color = '#ff4040'; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1108 | return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + dataAdapter.formatNumber(value, 'f1') + '</span>'; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1109 | } |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1110 | }, |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1111 | { text: 'Inf/dec °C', datafield: 'step_infuse_temp', width: 90, align: 'right', |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1112 | cellsrenderer: function(row, columnfield, value, defaulthtml, columnproperties, rowdata) { |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1113 | if (rowdata.step_type == 1) |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1114 | return '<span></span>'; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1115 | return '<span style="margin: 4px; margin-top: 6px; float: right;">' + dataAdapter.formatNumber(value, 'f2') + '</span>'; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1116 | } |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1117 | }, |
738
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1118 | { text: 'L/Kg.', datafield: 'step_wg_ratio', width: 80, align: 'right', |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1119 | cellsrenderer: function(row, columnfield, value, defaulthtml, columnproperties, rowdata) { |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1120 | var color = '#ffffff'; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1121 | if (value < 2.0 || value > 6.0) |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1122 | color = '#ff4040'; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1123 | return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + dataAdapter.formatNumber(value, 'f2') + '</span>'; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1124 | } |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1125 | }, |
738
11e6bd8d8107
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
Michiel Broek <mbroek@mbse.eu>
parents:
726
diff
changeset
|
1126 | { text: 'pH', datafield: 'step_ph', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'f2' }, |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
1127 | { text: 'SG', datafield: 'step_sg', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f3' } |
478 | 1128 | ] |
1129 | }); | |
1130 | }; | |
1131 | ||
1132 | /* | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
1133 | * Remove the top menu so that we MUST use the button to leave the editor. |
478 | 1134 | */ |
1135 | $('#jqxMenu').jqxMenu('destroy'); | |
1136 | console.log('record:' + my_record + ' return:' + my_return + ' theme:' + theme); | |
557 | 1137 | $('#jqxLoader').jqxLoader({ width: 250, height: 150, isModal: true, text: 'Laden product ...', theme: theme }); |
640 | 1138 | $('#jqxLoader').jqxLoader('open'); |
478 | 1139 | |
638
736c8d29bc87
Binding the data earlier to try to prevent a race condition.
Michiel Broek <mbroek@mbse.eu>
parents:
637
diff
changeset
|
1140 | /* Moved to before all functions */ |
736c8d29bc87
Binding the data earlier to try to prevent a race condition.
Michiel Broek <mbroek@mbse.eu>
parents:
637
diff
changeset
|
1141 | dataAdapter.dataBind(); |
736c8d29bc87
Binding the data earlier to try to prevent a race condition.
Michiel Broek <mbroek@mbse.eu>
parents:
637
diff
changeset
|
1142 | |
478 | 1143 | /* |
1144 | * Generic functions | |
1145 | */ | |
658
945d5eba869a
Implemented no-boil products.
Michiel Broek <mbroek@mbse.eu>
parents:
655
diff
changeset
|
1146 | function kookTijd() { |
945d5eba869a
Implemented no-boil products.
Michiel Broek <mbroek@mbse.eu>
parents:
655
diff
changeset
|
1147 | if (dataRecord.boil_time) { |
945d5eba869a
Implemented no-boil products.
Michiel Broek <mbroek@mbse.eu>
parents:
655
diff
changeset
|
1148 | $('#brew_pmpt_koken').html('Koken ' + dataRecord.boil_time + ' minuten'); |
945d5eba869a
Implemented no-boil products.
Michiel Broek <mbroek@mbse.eu>
parents:
655
diff
changeset
|
1149 | } else { |
945d5eba869a
Implemented no-boil products.
Michiel Broek <mbroek@mbse.eu>
parents:
655
diff
changeset
|
1150 | $('#brew_pmpt_koken').html('Koken "no-boil"'); |
945d5eba869a
Implemented no-boil products.
Michiel Broek <mbroek@mbse.eu>
parents:
655
diff
changeset
|
1151 | } |
945d5eba869a
Implemented no-boil products.
Michiel Broek <mbroek@mbse.eu>
parents:
655
diff
changeset
|
1152 | } |
945d5eba869a
Implemented no-boil products.
Michiel Broek <mbroek@mbse.eu>
parents:
655
diff
changeset
|
1153 | |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1154 | function infusionVol(step_infused, step_mashkg, infuse_temp, step_temp, last_temp) { |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1155 | var a = last_temp * (dataRecord.eq_tun_weight * dataRecord.eq_tun_specific_heat + step_infused * SpecificHeatWater + step_mashkg * SpecificHeatMalt); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1156 | var b = step_temp * (dataRecord.eq_tun_weight * dataRecord.eq_tun_specific_heat + step_infused * SpecificHeatWater + step_mashkg * SpecificHeatMalt); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1157 | var vol = Round(((b - a) / ((infuse_temp - step_temp) * SpecificHeatWater)), 2); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1158 | return vol; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1159 | } |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1160 | |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1161 | function decoctionVol(step_volume, step_temp, prev_temp) { |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1162 | var a = (dataRecord.eq_tun_weight * dataRecord.eq_tun_specific_heat + step_volume * SpecificHeatWater) * (step_temp - prev_temp); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1163 | var b = SpecificHeatWater * (99 - step_temp); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1164 | var vol = 0; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1165 | if (b > 0) |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1166 | vol = Round(a / b, 6); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1167 | return vol; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1168 | } |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1169 | |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1170 | function calcViability() { |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1171 | var vpm = 1.00; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1172 | var max = 100; |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1173 | var rowscount = dataRecord.yeasts.length; |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1174 | if (rowscount) { |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1175 | for (i = 0; i < rowscount; i++) { |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1176 | row = dataRecord.yeasts[i]; |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1177 | if (row.y_use == 0) { |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1178 | if (row.y_form == 0) { // Liquid |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1179 | vpm = 0.80; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1180 | max = 97; |
623
4aee10bcb94e
Better yeast viability for PurePitch yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
622
diff
changeset
|
1181 | if (row.y_laboratory == 'White Labs') { // PurePitch |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1182 | vpm = 0.95; |
623
4aee10bcb94e
Better yeast viability for PurePitch yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
622
diff
changeset
|
1183 | max = 100; |
4aee10bcb94e
Better yeast viability for PurePitch yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
622
diff
changeset
|
1184 | } |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1185 | } else if (row.y_form == 1) { // dry yeast |
726
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1186 | vpm = 0.998; |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1187 | max = 100; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1188 | } else if (row.y_form == 6) { // Dried kveik |
618
2712082437b0
Setting the dried Kveik viability to 8% per month.
Michiel Broek <mbroek@mbse.eu>
parents:
617
diff
changeset
|
1189 | vpm = 0.92; |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1190 | max = 100; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1191 | } else { // Slant, Culture, Frozen, Bottle |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1192 | vpm = 0.99; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1193 | max = 97; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1194 | } |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1195 | } |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1196 | } |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1197 | } |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1198 | var base = max; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1199 | var days = 0; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1200 | |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1201 | if (parseFloat($('#yeast_prod_date').val()) > 2000) { |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1202 | console.log('calculate viability'); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1203 | var d = new Date(); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1204 | var date2 = $('#yeast_prod_date').val(); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1205 | date2 = date2.split('-'); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1206 | // Now we convert the array to a Date object |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1207 | var date1 = new Date(d.getFullYear(), d.getMonth(), d.getDate()); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1208 | date2 = new Date(date2[0], date2[1] - 1, date2[2]); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1209 | var diff = parseInt(date1.getTime()) - parseInt(date2.getTime()); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1210 | days = Math.floor(diff/1000/60/60/24); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1211 | |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1212 | var degrade = 1 - ((1 - vpm) / 30.41); // viability degradation per day. |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1213 | for (i = 0; i < days; i++) { |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1214 | base = base * degrade; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1215 | } |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1216 | if (base > max) { |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1217 | base = max; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1218 | } |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1219 | base = Math.round(base); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1220 | } |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1221 | console.log('age:' + days + ' max:' + max + ' vpm:' + vpm + ' base:' + base); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1222 | |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1223 | if (dataRecord.starter_viability != base) { |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1224 | dataRecord.starter_viability = base; |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1225 | $('#starter_viability').val(dataRecord.starter_viability); |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1226 | } |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1227 | } |
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1228 | |
478 | 1229 | function calcSupplies() { |
1230 | if (dataRecord.inventory_reduced > 6) { | |
1231 | $('#ok_pmpt').hide(); | |
1232 | return; | |
1233 | } | |
1234 | if (ok_fermentables && ok_hops && ok_miscs && ok_yeasts && ok_waters) | |
1235 | $('#ok_supplies').html("<img src='images/dialog-ok-apply.png'>"); | |
1236 | else | |
1237 | $('#ok_supplies').html("<img src='images/dialog-error.png'>"); | |
1238 | } | |
1239 | ||
1240 | /* | |
1241 | * All calculations that depend on changes in the fermentables, | |
1242 | * volumes and equipments. | |
1243 | */ | |
1244 | function calcFermentables() { | |
1245 | ||
1246 | var sugarsf = 0, // fermentable sugars mash + boil | |
1247 | sugarsm = 0, // fermentable sugars in mash | |
1248 | vol = 0, // Volume sugars after boil | |
1249 | addedS = 0, // Added sugars after boil | |
1250 | addedmass = 0, // Added mass after boil | |
1251 | mvol = 0, // mash volume | |
824
26ffc2fb0eaf
Fixed calculation of estimated fg and use the same method as in bmsapp.
Michiel Broek <mbroek@mbse.eu>
parents:
823
diff
changeset
|
1252 | infuse = 0, // mash infuse volume |
478 | 1253 | colort = 0, // Colors srm * vol totals |
1254 | colorh = 0, // Colors ebc * vol * kt | |
1255 | colorn = 0, // Colors ebc * pt * pct | |
1256 | my_100 = false, | |
1257 | mashtime = 0, // Total mash time | |
1258 | mashtemp = 0, // Average mash temperature | |
1259 | bv = 0.925, // Bierverlies rendement | |
1260 | sr = 0.95, // Mash en spoel rendement | |
1261 | lintner = 0, // Total recipe lintner | |
1262 | i, row, rows, org, timem, aboil_volume, spoelw, ogx, topw, s = 0, d, v, x, | |
1263 | sug, alc, pt, cw, color, scolor, fig; | |
1264 | ||
1265 | /* Init global variables */ | |
1266 | psugar = 0; | |
1267 | pcara = 0; | |
1268 | mashkg = 0; | |
1269 | ok_fermentables = 1; // All is in stock. | |
1270 | ok_yeasts = 1; | |
1271 | ||
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1272 | if (dataRecord.mashs.length) { |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1273 | for (i = 0; i < dataRecord.mashs.length; i++) { |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1274 | row = dataRecord.mashs[i]; |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1275 | if (parseFloat(row.step_type) == 0) // Infusion |
478 | 1276 | mvol += parseFloat(row.step_infuse_amount); |
824
26ffc2fb0eaf
Fixed calculation of estimated fg and use the same method as in bmsapp.
Michiel Broek <mbroek@mbse.eu>
parents:
823
diff
changeset
|
1277 | if (row.step_temp <= 75 && row.step_temp >= 60) { // Ignore mashout |
26ffc2fb0eaf
Fixed calculation of estimated fg and use the same method as in bmsapp.
Michiel Broek <mbroek@mbse.eu>
parents:
823
diff
changeset
|
1278 | timem = row.step_time; |
26ffc2fb0eaf
Fixed calculation of estimated fg and use the same method as in bmsapp.
Michiel Broek <mbroek@mbse.eu>
parents:
823
diff
changeset
|
1279 | if (i > 0) |
26ffc2fb0eaf
Fixed calculation of estimated fg and use the same method as in bmsapp.
Michiel Broek <mbroek@mbse.eu>
parents:
823
diff
changeset
|
1280 | timem += row.ramp_time; |
478 | 1281 | mashtime += timem; |
1282 | mashtemp += timem * row.step_temp; | |
1283 | } | |
1284 | } | |
824
26ffc2fb0eaf
Fixed calculation of estimated fg and use the same method as in bmsapp.
Michiel Broek <mbroek@mbse.eu>
parents:
823
diff
changeset
|
1285 | infuse = mvol; |
478 | 1286 | mashtemp = Round(mashtemp / mashtime, 2); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1287 | } else { |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1288 | console.log("calcFermentables() no mash steps"); |
478 | 1289 | } |
1290 | ||
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1291 | if (! dataRecord.fermentables.length) { |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1292 | console.log("calcFermentables() no fermentables"); |
478 | 1293 | return; // grid not yet loaded. |
1294 | } | |
1295 | ||
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1296 | for (i = 0; i < dataRecord.fermentables.length; i++) { |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1297 | row = dataRecord.fermentables[i]; |
478 | 1298 | if (row.f_adjust_to_total_100) |
1299 | my_100 = true; | |
1300 | if (row.f_type == 1 && row.f_added < 4) // Sugar | |
1301 | psugar += row.f_percentage; | |
1302 | if (row.f_graintype == 2 && row.f_added < 4) // Crystal | |
1303 | pcara += row.f_percentage; | |
1304 | d = row.f_amount * (row.f_yield / 100) * (1 - row.f_moisture / 100); | |
1305 | if (row.f_added == 0) { // Mash | |
1306 | if (mvol > 0) { // Only if mash already known. | |
1307 | mvol += row.f_amount * row.f_moisture / 100; | |
1308 | s += d; | |
1309 | } | |
1310 | d = parseFloat(dataRecord.efficiency) / 100 * d; | |
1311 | sugarsm += d; | |
1312 | mashkg += parseFloat(row.f_amount); | |
1313 | } | |
1314 | if (row.f_added == 0 || row.f_added == 1) // Mash or Boil | |
1315 | sugarsf += d; | |
1316 | if (row.f_added == 2 || row.f_added == 3) { // Fermentation or lagering | |
1317 | x = (row.f_yield / 100) * (1 - row.f_moisture / 100); | |
1318 | addedS += row.f_amount * x; | |
1319 | addedmass += row.f_amount; | |
1320 | vol += (x * sugardensity + (1 - x) * 1) * row.f_amount; | |
1321 | } | |
1322 | if (row.f_added < 4) { | |
1323 | colort += row.f_amount * ebc_to_srm(row.f_color); | |
1324 | colorh += row.f_amount * row.f_color * get_kt(row.f_color); | |
1325 | colorn += (row.f_percentage / 100) * row.f_color; // For 8.6 Pt wort. | |
1326 | } | |
1327 | if (fermentableInit) { | |
1328 | if (row.f_added == 4) { | |
1329 | $('#bottle_priming_total').val(row.f_amount * 1000); // Prevent clearing | |
829 | 1330 | $('#bottle_priming_sugar').val(row.f_name); |
478 | 1331 | } |
1332 | if (row.f_added == 5) { | |
1333 | $('#keg_priming_total').val(row.f_amount * 1000); | |
829 | 1334 | $('#keg_priming_sugar').val(row.f_name); |
478 | 1335 | } |
1336 | } | |
1337 | // Check supplies. | |
1338 | if ((((dataRecord.inventory_reduced <= 2) && (row.f_added <= 1)) || // Mash or boil | |
1339 | ((dataRecord.inventory_reduced <= 3) && (row.f_added == 2)) || // Primary | |
1340 | ((dataRecord.inventory_reduced <= 5) && (row.f_added == 3)) || // Secondary or Tertiary | |
1341 | ((dataRecord.inventory_reduced <= 6) && (row.f_added == 4)) || // Bottle | |
1342 | ((dataRecord.inventory_reduced <= 6) && (row.f_added == 5))) && row.f_inventory < row.f_amount) { | |
1343 | ok_fermentables = 0; | |
1344 | } | |
1345 | if (row.f_added == 0 && (row.f_type == 0 || row.f_type == 4) && row.f_color < 50) { // Mash and Grain/Adjunct and Color < 50 | |
1346 | lintner += row.f_diastatic_power * row.f_amount; | |
1347 | } | |
1348 | } | |
1349 | fermentableInit = 0; | |
1350 | $('#ferm_lintner').val(Math.round(parseFloat(lintner / mashkg))); | |
1351 | $('#mash_kg').val(mashkg); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1352 | console.log('calcFermentables() supplies:' + ok_fermentables + ' moutsuiker:' + Round(sugarsm, 3) + '/' + Round(sugarsf, 3)); |
478 | 1353 | to_100 = my_100; |
1354 | ||
1355 | if (mvol > 0) { | |
1356 | v = s / sugardensity + mvol; | |
1357 | s = 1000 * s / (v * 10); //deg. Plato | |
1358 | est_mash_sg = Round(plato_to_sg(s), 5); | |
1359 | $('#est_mash_sg').val(est_mash_sg); | |
1360 | } | |
1361 | ||
1362 | // Estimate total recipe OG. | |
1363 | dataRecord.est_og = estimate_sg(sugarsf + addedS, parseFloat(dataRecord.batch_size)); | |
1364 | $('#est_og').val(dataRecord.est_og); | |
1365 | $('#est_og2').val(dataRecord.est_og); | |
1366 | org = dataRecord.est_og; | |
1367 | ||
1368 | // Estimate SG in kettle after boil | |
1369 | aboil_sg = estimate_sg(sugarsf, parseFloat(dataRecord.batch_size)); | |
1370 | $('#est_og3').val(aboil_sg); | |
1371 | ||
1372 | // Estimate SG in kettle before boil | |
1373 | preboil_sg = estimate_sg(sugarsm, parseFloat(dataRecord.boil_size)); | |
1374 | $('#est_pre_sg').val(preboil_sg); | |
1375 | ||
1376 | // Recalculate volumes. | |
1377 | aboil_volume = parseFloat(dataRecord.batch_size); | |
1378 | if (dataRecord.brew_aboil_volume > 0) | |
1379 | aboil_volume = dataRecord.brew_aboil_volume / 1.04; // volume @ 20 degrees | |
1380 | if (dataRecord.brew_fermenter_tcloss == 0) { | |
842
897bf2a43253
Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents:
841
diff
changeset
|
1381 | dataRecord.brew_fermenter_tcloss = dataRecord.eq_trub_loss; |
478 | 1382 | $('#brew_fermenter_tcloss').val(dataRecord.brew_fermenter_tcloss); |
1383 | } | |
1384 | dataRecord.brew_fermenter_volume = aboil_volume - dataRecord.brew_fermenter_tcloss + dataRecord.brew_fermenter_extrawater; | |
1385 | $('#brew_fermenter_volume').val(dataRecord.brew_fermenter_volume); | |
1386 | // Calculate SG in fermenter | |
1387 | ogx = dataRecord.brew_aboil_sg; | |
1388 | if (ogx < 1.002) | |
1389 | ogx = aboil_sg; | |
1390 | topw = dataRecord.brew_fermenter_extrawater; | |
1391 | ||
1392 | if (dataRecord.brew_fermenter_volume > 0) { | |
1393 | sug = sg_to_plato(ogx) * dataRecord.brew_fermenter_volume * ogx / 100; //kg of sugar in | |
1394 | sug += addedS; //kg | |
1395 | ||
1396 | if ((dataRecord.brew_fermenter_volume * ogx + addedmass) > 0) { | |
1397 | pt = 100 * sug / (dataRecord.brew_fermenter_volume * ogx + addedmass + topw); | |
577
b4bfed3684d0
In production archive lists show always the OG from the brew fermenter SG. Possible fix for the not used og field in the database.
Michiel Broek <mbroek@mbse.eu>
parents:
564
diff
changeset
|
1398 | dataRecord.og = dataRecord.brew_fermenter_sg = Round(plato_to_sg(pt), 4); |
478 | 1399 | $('#brew_fermenter_sg').val(dataRecord.brew_fermenter_sg); |
1400 | // color | |
1401 | if (dataRecord.color_method == 4) { | |
1402 | dataRecord.brew_fermenter_color = Math.round(((pt / 8.6) * colorn) + (dataRecord.boil_time / 60)); | |
1403 | } else if (dataRecord.color_method == 3) { | |
1404 | dataRecord.brew_fermenter_color = Math.round((4.46 * bv * sr) / (aboil_volume + topw) * colorh); | |
1405 | } else { | |
1406 | cw = colort / (aboil_volume + topw) * 8.34436; | |
1407 | dataRecord.brew_fermenter_color = kw_to_ebc(dataRecord.color_method, cw); | |
1408 | } | |
1409 | $('#brew_fermenter_color').val(dataRecord.brew_fermenter_color); | |
1410 | scolor = ebc_to_color(dataRecord.brew_fermenter_color); | |
1411 | $('#bcolorf').show(); | |
1412 | document.getElementById('bcolorf').style.background = scolor; | |
1413 | } | |
1414 | } else { | |
1415 | // Negative volume | |
1416 | dataRecord.brew_fermenter_sg = dataRecord.brew_fermenter_color = 0; | |
1417 | $('#brew_fermenter_sg').val(0); | |
1418 | $('#brew_fermenter_color').val(0); | |
1419 | $('#bcolorf').hide(); | |
1420 | } | |
1421 | ||
1422 | // Color of the wort | |
1423 | if (dataRecord.color_method == 4) { | |
1424 | color = Math.round(((sg_to_plato(dataRecord.est_og) / 8.6) * colorn) + (dataRecord.boil_time / 60)); | |
1425 | } else if (dataRecord.color_method == 3) { // Hans Halberstadt | |
1426 | color = Math.round((4.46 * bv * sr) / parseFloat(dataRecord.batch_size) * colorh); | |
1427 | } else { | |
1428 | cw = colort / parseFloat(dataRecord.batch_size) * 8.34436; | |
1429 | color = kw_to_ebc(dataRecord.color_method, cw); | |
1430 | } | |
1431 | dataRecord.est_color = color; | |
1432 | $('#est_color').val(color); | |
1433 | $('#est_color2').val(color); | |
1434 | scolor = ebc_to_color(color); | |
1435 | document.getElementById('bcolor').style.background = scolor; | |
1436 | document.getElementById('bcolor2').style.background = scolor; | |
1437 | ||
1438 | // Progress bars | |
1439 | pmalts = mashkg / dataRecord.eq_mash_max * 100; | |
1440 | $('#perc_malts').jqxProgressBar('val', pmalts); | |
1441 | $('#perc_sugars').jqxProgressBar('val', psugar); | |
1442 | $('#perc_cara').jqxProgressBar('val', pcara); | |
1443 | calcStage(); | |
1444 | ||
1445 | // Calculate estimated svg. | |
1446 | svg = 0; // default. | |
1447 | initcells = 0; | |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1448 | for (i = 0; i < dataRecord.yeasts.length; i++) { |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1449 | row = dataRecord.yeasts[i]; |
478 | 1450 | if (row.y_use == 0) { // Primary |
1451 | if (parseFloat(row.y_attenuation) > svg) | |
1452 | svg = parseFloat(row.y_attenuation); // Take the highest if multiple yeasts. | |
1453 | if (row.y_form == 0) | |
1454 | initcells += (parseFloat(row.y_cells) / 1000000000) * parseFloat(row.y_amount) * (dataRecord.starter_viability / 100); | |
1455 | else | |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1456 | initcells += (parseFloat(row.y_cells) / 1000000) * parseFloat(row.y_amount) * (dataRecord.starter_viability / 100); |
478 | 1457 | } |
1458 | // TODO: brett in secondary ?? | |
1459 | if ((((dataRecord.inventory_reduced <= 3) && (row.y_use == 0)) || // Primary | |
1460 | ((dataRecord.inventory_reduced <= 4) && (row.y_use == 1)) || // Secondary | |
1461 | ((dataRecord.inventory_reduced <= 5) && (row.y_use == 2)) || // Tertiary | |
1462 | ((dataRecord.inventory_reduced <= 6) && (row.y_use == 3))) && // Bottle | |
1463 | (row.y_inventory < row.y_amount)) { | |
1464 | ok_yeasts = 0; | |
1465 | } | |
1466 | } | |
1467 | calcSupplies(); | |
1468 | if (svg == 0) | |
1469 | svg = 77; | |
824
26ffc2fb0eaf
Fixed calculation of estimated fg and use the same method as in bmsapp.
Michiel Broek <mbroek@mbse.eu>
parents:
823
diff
changeset
|
1470 | if ((mashkg > 0) && (infuse > 0) && (mashtime > 0) && (mashtemp > 0)) { |
26ffc2fb0eaf
Fixed calculation of estimated fg and use the same method as in bmsapp.
Michiel Broek <mbroek@mbse.eu>
parents:
823
diff
changeset
|
1471 | dataRecord.est_fg = estimate_fg(psugar, pcara, infuse / mashkg, mashtime, mashtemp, svg, dataRecord.est_og); |
478 | 1472 | } else { |
1473 | dataRecord.est_fg = estimate_fg(psugar, pcara, 0, 0, 0, svg, dataRecord.est_og); | |
1474 | } | |
1475 | $('#est_fg').val(dataRecord.est_fg); | |
1476 | $('#est_fg2').val(dataRecord.est_fg); | |
1477 | $('#est_fg3').val(dataRecord.est_fg); | |
1478 | fig = dataRecord.est_fg; | |
1479 | ||
1480 | dataRecord.est_abv = abvol(dataRecord.est_og, dataRecord.est_fg); | |
1481 | $('#est_abv').val(dataRecord.est_abv); | |
1482 | $('#est_abv2').val(dataRecord.est_abv); | |
1483 | ||
1484 | // Calculate the final svg if available use the real value. | |
1485 | if ((dataRecord.stage >= 6) && (dataRecord.fg > 0.990) && (dataRecord.fg < dataRecord.brew_fermenter_sg)) { | |
655
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
651
diff
changeset
|
1486 | svg = calc_svg(dataRecord.brew_fermenter_sg, dataRecord.fg); |
478 | 1487 | org = dataRecord.brew_fermenter_sg; |
1488 | fig = dataRecord.fg; | |
1489 | } | |
1490 | ||
1491 | $('#yeast_cells').val(initcells); | |
1492 | $('#need_cells').val(getNeededYeastCells()); | |
1493 | ||
1494 | // Calculate the calories in kcal/l (from brouwhulp) | |
1495 | alc = 1881.22 * fig * (org - fig) / (1.775 - org); | |
1496 | sug = 3550 * fig * (0.1808 * org + 0.8192 * fig - 1.0004); | |
1497 | $('#kcal').val(Math.round((alc + sug) / (12 * 0.0295735296))); | |
1498 | }; | |
1499 | ||
1500 | function calcMash() { | |
1501 | ||
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1502 | var h, m, infused = 0, mashtime = 0, mashvol = 0, vol, i, j, n, a, b, row, temp; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1503 | var lasttemp = 18.0; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1504 | var graintemp = 18.0; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1505 | var tuntemp = 18.0; |
484
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1506 | |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1507 | if (dataRecord.mashs.length && (mashkg > 0)) { |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1508 | console.log('calcMash()'); |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1509 | for (i = 0; i < dataRecord.mashs.length; i++) { |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1510 | row = dataRecord.mashs[i]; |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1511 | if (row.step_type == 0) { // Infusion |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1512 | if (i == 0) { |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1513 | // First mash step, temperature from the mashtun and malt. |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1514 | n = 20; // tun is preheated. |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1515 | tuntemp = row.step_temp; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1516 | for (j = 0; j < n; j++) { |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1517 | a = mashkg * graintemp * SpecificHeatMalt + dataRecord.eq_tun_weight * tuntemp * dataRecord.eq_tun_specific_heat; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1518 | b = row.step_temp * (dataRecord.eq_tun_weight * dataRecord.eq_tun_specific_heat + row.step_infuse_amount * SpecificHeatWater + mashkg * SpecificHeatMalt) - SlakingHeat * mashkg; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1519 | if (row.step_infuse_amount > 0) { |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1520 | temp = (b - a) / (row.step_infuse_amount * SpecificHeatWater); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1521 | } else { |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1522 | temp = 99; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1523 | } |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1524 | tuntemp += (temp - tuntemp) / 2; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1525 | row.step_infuse_temp = Round(temp, 6); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1526 | } |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1527 | //console.log('init infuse temp: ' + row.step_infuse_temp); |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1528 | } else { |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1529 | // Calculate amount of infusion water. |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1530 | row.step_infuse_amount = infusionVol(infused, mashkg, row.step_infuse_temp, row.step_temp, lasttemp); |
774
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
772
diff
changeset
|
1531 | //console.log('vol: ' + row.step_infuse_amount + ' temp: ' + row.step_infuse_temp); |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1532 | } |
774
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
772
diff
changeset
|
1533 | infused += parseFloat(row.step_infuse_amount); |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1534 | } else if (row.step_type == 1) { // Temperature |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1535 | if (i > 0) |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1536 | row.step_infuse_amount = 0; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1537 | row.step_infuse_temp = 0; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1538 | } else if (row.step_type == 2) { // Decoction |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1539 | row.step_infuse_amount = decoctionVol(infused, row.step_temp, lasttemp); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1540 | row.step_infuse_temp = 99; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1541 | } |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1542 | row.step_volume = infused; |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1543 | //console.log(i + ' type: ' + row.step_type + ' volume: ' + row.step_infuse_amount + ' temp: ' + row.step_infuse_temp); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1544 | lasttemp = row.step_temp; |
484
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1545 | mashtime += row.step_time + row.ramp_time; |
667
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1546 | row.step_wg_ratio = Round(infused / mashkg, 6); |
1246550451ca
Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
1547 | $('#mashGrid').jqxGrid('updaterow', i, row); |
484
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1548 | } |
478 | 1549 | } |
789
e6e696add0b3
Fixed some mess in water calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
784
diff
changeset
|
1550 | if ((dataRecord.w1_amount + dataRecord.w2_amount) == 0) { |
e6e696add0b3
Fixed some mess in water calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
784
diff
changeset
|
1551 | dataRecord.w1_amount = infused; |
e6e696add0b3
Fixed some mess in water calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
784
diff
changeset
|
1552 | $('#w1_amount').val(infused); |
e6e696add0b3
Fixed some mess in water calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
784
diff
changeset
|
1553 | console.log("calcMash() fixed water 1 to " + infused); |
e6e696add0b3
Fixed some mess in water calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
784
diff
changeset
|
1554 | } |
774
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
772
diff
changeset
|
1555 | mashvol = Round(mashkg * MaltVolume + infused, 6); |
484
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1556 | $('#est_mashvol').val(mashvol); |
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1557 | h = Math.floor(mashtime / 60); |
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1558 | m = Math.floor(mashtime - (h * 60)); |
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1559 | if (h < 10) |
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1560 | h = '0' + h; |
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1561 | if (m < 10) |
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1562 | m = '0' + m; |
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
1563 | $('#est_mashtime').val(h + ':' + m); |
783
006078146107
Moved the sparge water estimate formula to the calcMash() function.
Michiel Broek <mbroek@mbse.eu>
parents:
774
diff
changeset
|
1564 | // Estimated needed sparge water corrected for the temperature. |
006078146107
Moved the sparge water estimate formula to the calcMash() function.
Michiel Broek <mbroek@mbse.eu>
parents:
774
diff
changeset
|
1565 | spoelw = Round((dataRecord.boil_size - infused + (mashkg * my_grain_absorbtion) + dataRecord.eq_lauter_deadspace) * 1.03, 6); |
006078146107
Moved the sparge water estimate formula to the calcMash() function.
Michiel Broek <mbroek@mbse.eu>
parents:
774
diff
changeset
|
1566 | $('#brew_sparge_est').val(spoelw); |
478 | 1567 | } |
1568 | ||
1569 | function getNeededYeastCells() { | |
1570 | ||
1571 | var plato, volume, sg = dataRecord.brew_fermenter_sg; | |
1572 | if (sg <= 1.0001 && dataRecord.fg > 1.000) | |
1573 | sg = dataRecord.fg; | |
1574 | else if (sg <= 1.0001) | |
1575 | sg = dataRecord.est_og; | |
1576 | plato = sg_to_plato(sg); | |
1577 | ||
1578 | volume = dataRecord.brew_fermenter_volume; | |
1579 | if (volume <= 0) | |
842
897bf2a43253
Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents:
841
diff
changeset
|
1580 | volume = dataRecord.batch_size - dataRecord.eq_trub_loss; |
478 | 1581 | |
697
367ae7ff52f0
Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents:
669
diff
changeset
|
1582 | return dataRecord.yeast_pitchrate * volume * plato; |
478 | 1583 | } |
1584 | ||
1585 | function hopFlavourContribution(bt, vol, use, amount) { | |
1586 | var result; | |
1587 | ||
538
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
1588 | if (use == 4 || use == 5) // Whirlpool or Dry-hop |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
1589 | return 0; |
478 | 1590 | if (use == 1) { // First wort |
1591 | result = 0.15; // assume 15% flavourcontribution for fwh | |
1592 | } else if (bt > 50) { | |
1593 | result = 0.10; // assume 10% flavourcontribution as a minimum | |
1594 | } else { | |
1595 | result = 15.25 / (6 * Math.sqrt(2 * Math.PI)) * Math.exp(-0.5 * Math.pow((bt - 21) / 6, 2)); | |
1596 | if (result < 0.10) | |
1597 | result = 0.10; // assume 10% flavourcontribution as a minimum | |
1598 | } | |
1599 | return (result * amount * 1000) / vol; | |
1600 | } | |
1601 | ||
1602 | function hopAromaContribution(bt, vol, use, amount) { | |
1603 | var result = 0; | |
1604 | ||
538
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
1605 | if (use == 5) { // Dry hop |
478 | 1606 | result = 1.33; |
538
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
1607 | } else if (use == 4) { // Whirlpool |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
1608 | if (bt > 30) |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
1609 | bt = 30; // Max 30 minutes |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
1610 | result = 0.62 * bt / 30; |
478 | 1611 | } else if (bt > 20) { |
1612 | result = 0; | |
1613 | } else if (bt > 7.5) { | |
1614 | result = 10.03 / (4 * Math.sqrt(2 * Math.PI)) * Math.exp(-0.5 * Math.pow((bt - 7.5) / 4, 2)); | |
1615 | } else if (use == 2) { // Boil | |
1616 | result = 1; | |
1617 | } else if (use == 3) { // Aroma | |
1618 | result = 1.2; | |
1619 | } | |
538
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
1620 | return (result * amount * 1000) / vol; |
478 | 1621 | } |
1622 | ||
1623 | function calcIBUs() { | |
1624 | var total_ibus = 0, ferm_ibus = 0, rows = {}, i, row; | |
1625 | hop_aroma = hop_flavour = 0; | |
1626 | if (!(rows = $('#hopGrid').jqxGrid('getrows'))) { | |
1627 | return; | |
1628 | } | |
1629 | ok_hops = 1; | |
1630 | for (i = 0; i < rows.length; i++) { | |
1631 | row = rows[i]; | |
1632 | total_ibus += toIBU(row.h_useat, row.h_form, preboil_sg, parseFloat(dataRecord.batch_size), | |
559
10cc2400b5d5
Backported extra yeast fields and the SO4:Cl ratio changes into the recipes editor.
Michiel Broek <mbroek@mbse.eu>
parents:
557
diff
changeset
|
1633 | parseFloat(row.h_amount), parseFloat(row.h_time), parseFloat(row.h_alpha), dataRecord.ibu_method, |
10cc2400b5d5
Backported extra yeast fields and the SO4:Cl ratio changes into the recipes editor.
Michiel Broek <mbroek@mbse.eu>
parents:
557
diff
changeset
|
1634 | dataRecord.brew_whirlpool9, dataRecord.brew_whirlpool7, dataRecord.brew_whirlpool6); |
478 | 1635 | ferm_ibus += toIBU(row.h_useat, row.h_form, preboil_sg, |
559
10cc2400b5d5
Backported extra yeast fields and the SO4:Cl ratio changes into the recipes editor.
Michiel Broek <mbroek@mbse.eu>
parents:
557
diff
changeset
|
1636 | parseFloat(dataRecord.brew_fermenter_volume) + parseFloat(dataRecord.brew_fermenter_tcloss), |
10cc2400b5d5
Backported extra yeast fields and the SO4:Cl ratio changes into the recipes editor.
Michiel Broek <mbroek@mbse.eu>
parents:
557
diff
changeset
|
1637 | parseFloat(row.h_amount), parseFloat(row.h_time), parseFloat(row.h_alpha), dataRecord.ibu_method, |
10cc2400b5d5
Backported extra yeast fields and the SO4:Cl ratio changes into the recipes editor.
Michiel Broek <mbroek@mbse.eu>
parents:
557
diff
changeset
|
1638 | dataRecord.brew_whirlpool9, dataRecord.brew_whirlpool7, dataRecord.brew_whirlpool6); |
10cc2400b5d5
Backported extra yeast fields and the SO4:Cl ratio changes into the recipes editor.
Michiel Broek <mbroek@mbse.eu>
parents:
557
diff
changeset
|
1639 | hop_flavour += hopFlavourContribution(parseFloat(row.h_time), parseFloat(dataRecord.batch_size), row.h_useat, parseFloat(row.h_amount)); |
10cc2400b5d5
Backported extra yeast fields and the SO4:Cl ratio changes into the recipes editor.
Michiel Broek <mbroek@mbse.eu>
parents:
557
diff
changeset
|
1640 | hop_aroma += hopAromaContribution(parseFloat(row.h_time), parseFloat(dataRecord.batch_size), row.h_useat, parseFloat(row.h_amount)); |
478 | 1641 | if ((((dataRecord.inventory_reduced <= 2) && (row.h_useat <= 4)) || // Mash, FW, Boil, Aroma, Whirlpool |
1642 | ((dataRecord.inventory_reduced <= 6) && (row.h_useat == 5))) && // Dry-hop | |
1643 | (row.h_inventory < row.h_amount)) | |
1644 | ok_hops = 0; | |
1645 | } | |
557 | 1646 | total_ibus = Round(total_ibus, 1); |
1647 | ferm_ibus = Round(ferm_ibus, 1); | |
1648 | hop_flavour = Round(hop_flavour * 100 / 5, 1); | |
1649 | hop_aroma = Round(hop_aroma * 100 / 6, 1); | |
478 | 1650 | if (hop_flavour > 100) |
1651 | hop_flavour = 100; | |
1652 | if (hop_aroma > 100) | |
1653 | hop_aroma = 100; | |
1654 | console.log('calcIBUs(): ' + total_ibus + ' flavour: ' + hop_flavour + ' aroma: ' + hop_aroma + | |
1655 | ' fermenter:' + ferm_ibus + ' supplies:' + ok_hops); | |
1656 | dataRecord.est_ibu = total_ibus; | |
1657 | $('#est_ibu').val(total_ibus); | |
1658 | $('#est_ibu2').val(total_ibus); | |
1659 | $('#hop_flavour').jqxProgressBar('val', hop_flavour); | |
1660 | $('#hop_aroma').jqxProgressBar('val', hop_aroma); | |
1661 | $('#brew_fermenter_ibu').val(ferm_ibus); | |
1662 | calcStage(); | |
1663 | calcSupplies(); | |
1664 | }; | |
1665 | ||
1666 | /* | |
1667 | * http://braukaiser.com/blog/blog/2012/11/03/estimating-yeast-growth/ | |
1668 | * | |
1669 | * stype: 0=stirred, 1=shaken, 2=simple | |
1670 | * totcells: initial cells | |
1671 | * egrams: gram extract | |
1672 | */ | |
1673 | function getGrowthRate(stype, totcells, egrams) { | |
1674 | ||
1675 | /* Cells per grams extract (B/g) */ | |
1676 | var cpe = totcells / egrams; | |
1677 | ||
1678 | if (cpe > 3.5) | |
1679 | return 0; // no growth | |
1680 | if (stype == 2) | |
1681 | return 0.4; // simple starter | |
1682 | if (stype == 1) | |
1683 | return 0.62; // shaken starter | |
1684 | if (cpe <= 1.4) // stirred starter | |
1685 | return 1.4; | |
1686 | return 2.33 - (.67 * cpe); | |
1687 | }; | |
1688 | ||
1689 | function calcStep(svol, stype, start) { | |
1690 | ||
1691 | var gperpoint = 2.72715, //number of grams of extract per point of starter gravity per liter | |
1692 | prate = start / svol * 1000, | |
1693 | irate = Round(prate, 1), | |
1694 | egrams = (dataRecord.starter_sg - 1) * svol * gperpoint, | |
1695 | grate = getGrowthRate(stype, start, egrams), | |
1696 | ncells = Round(egrams * grate, 1), | |
1697 | totcells = parseFloat(ncells) + start; | |
1698 | ||
1699 | return { | |
1700 | svol: svol, | |
1701 | irate: irate, | |
1702 | prate: Round(prate, 1), | |
1703 | ncells: ncells, | |
1704 | totcells: totcells, | |
1705 | growf: Round(ncells / start, 2) | |
1706 | }; | |
1707 | } | |
1708 | ||
649
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1709 | function killstep2() { |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1710 | |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1711 | dataRecord.prop2_volume = 0; |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1712 | $('#prop2_volume').val(0); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1713 | $('#prop2_tcells').val(0); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1714 | $('#prop2_type,#prop2_volume,#prop2_irate,#prop2_ncells,#prop2_tcells,#prop2_growf').hide(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1715 | $('#r2_pmpt').show(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1716 | } |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1717 | |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1718 | function killstep3() { |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1719 | |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1720 | dataRecord.prop3_volume = 0; |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1721 | $('#prop3_volume').val(0); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1722 | $('#prop3_tcells').val(0); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1723 | $('#prop3_type,#prop3_volume,#prop3_irate,#prop3_ncells,#prop3_tcells,#prop3_growf').hide(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1724 | $('#r3_pmpt').show(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1725 | } |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1726 | |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1727 | function killstep4() { |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1728 | |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1729 | dataRecord.prop4_volume = 0; |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1730 | $('#prop4_volume').val(0); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1731 | $('#prop4_tcells').val(0); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1732 | $('#prop4_type,#prop4_volume,#prop4_irate,#prop4_ncells,#prop4_tcells,#prop4_growf').hide(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1733 | $('#r4_pmpt').show(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1734 | } |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1735 | |
478 | 1736 | /* |
1737 | * Calculate all starter steps. | |
1738 | * stype: final starter type: 0 = stirred, 1 = shaked, 2 = simple. | |
1739 | * start: initial cells in billions | |
1740 | * needed: needed cells in billions | |
1741 | * | |
1742 | * result: all values updated. | |
1743 | */ | |
1744 | function calcSteps(stype, start, needed) { | |
1745 | ||
1746 | var uvols = [20, 40, 60, 80, 100, 150, 200, 250, 375, 500, 625, 750, 875, 1000, 1250, 1500, 2000, 2500, 3000, 4000, 5000], | |
1747 | mvols = uvols.length, svol = 0, lasti = 0, result = {}, i; | |
1748 | ||
1749 | /* | |
1750 | * If no values are set, auto calculate the starter. | |
1751 | */ | |
1752 | if ((parseFloat($('#prop1_volume').jqxNumberInput('decimal')) + parseFloat($('#prop2_volume').jqxNumberInput('decimal')) + | |
1753 | parseFloat($('#prop3_volume').jqxNumberInput('decimal')) + parseFloat($('#prop4_volume').jqxNumberInput('decimal'))) == 0) { | |
1754 | // clear by default | |
1755 | for (i = 1; i < 5; i++) { | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1756 | $('#prop' + i + '_type,#prop' + i + '_volume,#prop' + i + '_irate,#prop' + i + '_ncells,#prop' + i + '_tcells,#prop' + i + '_growf').hide(); |
478 | 1757 | $('#r' + i + '_pmpt').show(); |
1758 | $('#prop' + i + '_type').val(stype); | |
1759 | $('#prop' + i + '_volume').val(0); | |
1760 | } | |
1761 | if (start > needed) { | |
1762 | return; // no starter needed | |
1763 | } | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1764 | $('#prop1_type,#prop1_volume,#prop1_irate,#prop1_ncells,#prop1_tcells,#prop1_growf').show(); |
478 | 1765 | $('#r1_pmpt').hide(); |
1766 | for (i = lasti; i <= mvols; i++) { | |
1767 | lasti = i; | |
1768 | svol = uvols[lasti]; | |
1769 | result = calcStep(svol, stype, start); | |
1770 | if (result.irate < 25) { | |
1771 | // inocculation rate too low, backup one step and break out. | |
1772 | lasti = i - 1; | |
1773 | svol = uvols[lasti]; | |
1774 | result = calcStep(svol, stype, start); | |
1775 | break; | |
1776 | } | |
1777 | if (result.totcells > needed || i == mvols) { // hit the target or loops done | |
1778 | break; | |
1779 | } | |
1780 | } | |
1781 | $('#prop1_volume').val(result.svol / 1000); // to liters | |
1782 | $('#prop1_irate').val(result.prate); | |
1783 | $('#prop1_ncells').val(result.ncells); | |
1784 | $('#prop1_tcells').val(result.totcells); | |
1785 | $('#prop1_growf').val(result.growf); | |
1786 | if (result.totcells > needed) | |
1787 | return; // hit the target | |
1788 | ||
1789 | // second stage | |
1790 | $('#r2_pmpt').hide(); | |
1791 | $('#prop2_type').val(stype); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1792 | $('#prop2_type,#prop2_volume,#prop2_irate,#prop2_ncells,#prop2_tcells,#prop2_growf').show(); |
478 | 1793 | for (i = lasti; i <= mvols; i++) { |
1794 | lasti = i; | |
1795 | svol = uvols[lasti]; | |
1796 | result = calcStep(svol, stype, $('#prop1_tcells').val()); | |
1797 | if (result.irate < 25) { | |
1798 | lasti = i - 1; | |
1799 | svol = uvols[lasti]; | |
1800 | result = calcStep(svol, stype, $('#prop1_tcells').val()); | |
1801 | break; | |
1802 | } | |
1803 | if (result.totcells > needed || i == mvols) { // hit the target or loops done | |
1804 | break; | |
1805 | } | |
1806 | } | |
1807 | $('#prop2_volume').val(result.svol / 1000); // to liters | |
1808 | $('#prop2_irate').val(result.prate); | |
1809 | $('#prop2_ncells').val(result.ncells); | |
1810 | $('#prop2_tcells').val(result.totcells); | |
1811 | $('#prop2_growf').val(result.growf); | |
1812 | if (result.totcells > needed) | |
1813 | return; // hit the target | |
1814 | ||
1815 | // third stage | |
1816 | $('#r3_pmpt').hide(); | |
1817 | $('#prop3_type').val(stype); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1818 | $('#prop3_type,#prop3_volume,#prop3_irate,#prop3_ncells,#prop3_tcells,#prop3_growf').show(); |
478 | 1819 | for (i = lasti; i <= mvols; i++) { |
1820 | lasti = i; | |
1821 | svol = uvols[lasti]; | |
1822 | result = calcStep(svol, stype, $('#prop2_tcells').val()); | |
1823 | if (result.irate < 25) { | |
1824 | lasti = i - 1; | |
1825 | svol = uvols[lasti]; | |
1826 | result = calcStep(svol, stype, $('#prop2_tcells').val()); | |
1827 | break; | |
1828 | } | |
1829 | if (result.totcells > needed || i == mvols) { // hit the target or loops done | |
1830 | break; | |
1831 | } | |
1832 | } | |
1833 | $('#prop3_volume').val(result.svol / 1000); // to liters | |
1834 | $('#prop3_irate').val(result.prate); | |
1835 | $('#prop3_ncells').val(result.ncells); | |
1836 | $('#prop3_tcells').val(result.totcells); | |
1837 | $('#prop3_growf').val(result.growf); | |
1838 | if (result.totcells > needed) | |
1839 | return; // hit the target | |
1840 | ||
1841 | // fourth stage | |
1842 | $('#r4_pmpt').hide(); | |
1843 | $('#prop4_type').val(stype); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1844 | $('#prop4_type,#prop4_volume,#prop4_irate,#prop4_ncells,#prop4_tcells,#prop4_growf').show(); |
478 | 1845 | for (i = lasti; i <= mvols; i++) { |
1846 | lasti = i; | |
1847 | svol = uvols[lasti]; | |
1848 | result = calcStep(svol, stype, $('#prop3_tcells').val()); | |
1849 | if (result.totcells > needed || i == mvols) { // hit the target or loops done | |
1850 | $('#prop4_volume').val(result.svol / 1000); // to liters | |
1851 | $('#prop4_irate').val(result.prate); | |
1852 | $('#prop4_ncells').val(result.ncells); | |
1853 | $('#prop4_tcells').val(result.totcells); | |
1854 | $('#prop4_growf').val(result.growf); | |
1855 | return; | |
1856 | } | |
1857 | } | |
1858 | } else { | |
1859 | // recalculate | |
1860 | if (dataRecord.prop1_volume > 0) { | |
1861 | $('#r1_pmpt').hide(); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1862 | $('#prop1_type,#prop1_volume,#prop1_irate,#prop1_ncells,#prop1_tcells,#prop1_growf').show(); |
478 | 1863 | result = calcStep($('#prop1_volume').val() * 1000, dataRecord.prop1_type, start); |
1864 | $('#prop1_irate').val(result.prate); | |
1865 | $('#prop1_ncells').val(result.ncells); | |
1866 | $('#prop1_tcells').val(result.totcells); | |
1867 | $('#prop1_growf').val(result.growf); | |
649
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1868 | if (result.totcells > needed) { |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1869 | killstep2(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1870 | killstep3(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1871 | killstep4(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1872 | } else if (dataRecord.prop2_volume == 0) { |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1873 | dataRecord.prop2_volume = dataRecord.prop1_volume; /* Extra step needed, start with the same size */ |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1874 | dataRecord.prop2_type = dataRecord.prop1_type; |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1875 | $('#prop2_volume').val(dataRecord.prop2_volume); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1876 | $('#prop2_type').val(dataRecord.prop2_type); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1877 | } |
478 | 1878 | } |
1879 | if (dataRecord.prop2_volume > 0) { | |
1880 | $('#r2_pmpt').hide(); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1881 | $('#prop2_type,#prop2_volume,#prop2_irate,#prop2_ncells,#prop2_tcells,#prop2_growf').show(); |
478 | 1882 | result = calcStep($('#prop2_volume').val() * 1000, dataRecord.prop2_type, $('#prop1_tcells').val()); |
1883 | $('#prop2_irate').val(result.prate); | |
1884 | $('#prop2_ncells').val(result.ncells); | |
1885 | $('#prop2_tcells').val(result.totcells); | |
1886 | $('#prop2_growf').val(result.growf); | |
649
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1887 | if (result.totcells > needed) { |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1888 | killstep3(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1889 | killstep4(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1890 | } else if (dataRecord.prop3_volume == 0) { |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1891 | dataRecord.prop3_volume = dataRecord.prop2_volume; /* Extra step needed, start with the same size */ |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1892 | dataRecord.prop3_type = dataRecord.prop2_type; |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1893 | $('#prop3_volume').val(dataRecord.prop3_volume); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1894 | $('#prop3_type').val(dataRecord.prop3_type); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1895 | } |
478 | 1896 | } |
1897 | if (dataRecord.prop3_volume > 0) { | |
1898 | $('#r3_pmpt').hide(); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1899 | $('#prop3_type,#prop3_volume,#prop3_irate,#prop3_ncells,#prop3_tcells,#prop3_growf').show(); |
478 | 1900 | result = calcStep($('#prop3_volume').val() * 1000, dataRecord.prop3_type, $('#prop2_tcells').val()); |
1901 | $('#prop3_irate').val(result.prate); | |
1902 | $('#prop3_ncells').val(result.ncells); | |
1903 | $('#prop3_tcells').val(result.totcells); | |
1904 | $('#prop3_growf').val(result.growf); | |
649
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1905 | if (result.totcells > needed) { |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1906 | killstep4(); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1907 | } else if (dataRecord.prop4_volume == 0) { |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1908 | dataRecord.prop4_volume = dataRecord.prop3_volume; /* Extra step needed, start with the same size */ |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1909 | dataRecord.prop4_type = dataRecord.prop3_type; |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1910 | $('#prop4_volume').val(dataRecord.prop4_volume); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1911 | $('#prop4_type').val(dataRecord.prop4_type); |
52053730f6e1
Yeast starter now automatic adds or removes step lines as they are needed.
Michiel Broek <mbroek@mbse.eu>
parents:
648
diff
changeset
|
1912 | } |
478 | 1913 | } |
1914 | if (dataRecord.prop4_volume > 0) { | |
1915 | $('#r4_pmpt').hide(); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
1916 | $('#prop4_type,#prop4_volume,#prop4_irate,#prop4_ncells,#prop4_tcells,#prop4_growf').show(); |
478 | 1917 | result = calcStep($('#prop4_volume').val() * 1000, dataRecord.prop4_type, $('#prop3_tcells').val()); |
1918 | $('#prop4_irate').val(result.prate); | |
1919 | $('#prop4_ncells').val(result.ncells); | |
1920 | $('#prop4_tcells').val(result.totcells); | |
1921 | $('#prop4_growf').val(result.growf); | |
1922 | } | |
1923 | } | |
1924 | } | |
1925 | ||
1926 | function calcYeast() { | |
1927 | ||
1928 | // Calculate needed cells. | |
1929 | var plato, volume, rows, rowscount, row, i, needed, use_cells, sg = dataRecord.brew_fermenter_sg; | |
726
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1930 | |
478 | 1931 | if (sg <= 1.0001 && dataRecord.fg > 1.000) |
1932 | sg = dataRecord.fg; | |
1933 | else if (sg <= 1.0001) | |
1934 | sg = dataRecord.est_og; | |
1935 | plato = sg_to_plato(sg); | |
1936 | ||
1937 | volume = dataRecord.brew_fermenter_volume; | |
1938 | if (volume > 0) { | |
1939 | if (dataRecord.brew_fermenter_extrawater > 0) | |
1940 | volume += dataRecord.brew_fermenter_extrawater; | |
1941 | } else { | |
842
897bf2a43253
Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents:
841
diff
changeset
|
1942 | volume = dataRecord.batch_size - dataRecord.eq_trub_loss; |
478 | 1943 | } |
1944 | ||
1945 | // Also in calcFermentables() | |
1946 | $('#yeast_cells').val(initcells); | |
1947 | ||
1948 | if (!(rows = $('#yeastGrid').jqxGrid('getrows'))) { | |
1949 | return; // grid not yet loaded. | |
1950 | } | |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1951 | rowscount = dataRecord.yeasts.length; |
478 | 1952 | if (rowscount == 0) |
1953 | return; // no yeast in recipe | |
1954 | ||
726
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1955 | $('.primary_dry').hide(); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1956 | $('.primary_liquid').hide(); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1957 | |
620
5dae36a2d5be
Automatic starter enable/disable
Michiel Broek <mbroek@mbse.eu>
parents:
619
diff
changeset
|
1958 | var maybe_starter = 0; |
697
367ae7ff52f0
Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents:
669
diff
changeset
|
1959 | var pitchrate = 0.75; // Yeast pitch rate default |
478 | 1960 | for (i = 0; i < rowscount; i++) { |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1961 | row = dataRecord.yeasts[i]; |
478 | 1962 | if (row.y_use == 0) { // primary |
726
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1963 | if (row.y_form == 1) { |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1964 | // Dry yeast |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1965 | $('.primary_dry').show(); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1966 | console.log('dry yeast: ' + row.y_gr_hl_lo + '@' + row.y_sg_lo + ' ' + row.y_gr_hl_hi + '@' + row.y_sg_hi); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1967 | // Build the formule with the yeast parameters. |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1968 | // Based on https://www.lallemandbrewing.com/en/canada/brewers-corner/brewing-tools/pitching-rate-calculator/ |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1969 | var og = row.y_sg_lo; |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1970 | var f1 = row.y_gr_hl_lo / 100; |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1971 | var f2 = Round(f1 / 5, 6); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1972 | // After a lot of try and error, study, the best thing to increase the pitch amount is actually |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1973 | // use this simple formula by Lallemand. This is about the same as sugar weight increment in the wort. |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1974 | var multiplier = (sg <= og) ? f1 : (f1 + f2 * (sg - og) / 0.008); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1975 | console.log('sg: ' + sg + ' og: ' + og + ' f1: ' + f1 + ' f2: ' + f2 + ' multiplier: ' + multiplier); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1976 | // dataRecord.starter_viability |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1977 | var yeast_grams = Round(volume * multiplier * (100 / dataRecord.starter_viability), 2); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1978 | $('#yeast_grams').val(yeast_grams); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1979 | var yeast_gr_hl = Round(yeast_grams / (volume * 0.01), 2); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1980 | $('#yeast_gr_hl').val(yeast_gr_hl); |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
1981 | //console.log('need ' + yeast_grams + ' grams, gr/hl: ' + yeast_gr_hl); |
726
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1982 | |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
1983 | } else { |
726
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1984 | // Liquid yeast |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1985 | $('.primary_liquid').show(); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1986 | // pitchrate see https://www.brewersfriend.com/yeast-pitch-rate-and-starter-calculator/ |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1987 | // and http://braukaiser.com/blog/blog/2012/11/03/estimating-yeast-growth/ |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1988 | if (row.y_type == 0) { // lager yeast |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1989 | pitchrate = 1.5; |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1990 | if (dataRecord.est_og > 1.060) |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1991 | pitchrate = 2.0; |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1992 | } else if (row.y_type == 6) { // Kveik |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1993 | pitchrate = 0.075; |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1994 | } else { |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1995 | pitchrate = 0.75; |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1996 | if (dataRecord.est_og > 1.060) |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1997 | pitchrate = 1.0; |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1998 | } |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
1999 | if (dataRecord.yeast_pitchrate < 0.01) { |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
2000 | dataRecord.yeast_pitchrate = pitchrate; |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
2001 | $('#yeast_pitchrate').val(pitchrate); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
2002 | } |
620
5dae36a2d5be
Automatic starter enable/disable
Michiel Broek <mbroek@mbse.eu>
parents:
619
diff
changeset
|
2003 | maybe_starter = 1; |
5dae36a2d5be
Automatic starter enable/disable
Michiel Broek <mbroek@mbse.eu>
parents:
619
diff
changeset
|
2004 | } |
478 | 2005 | } |
2006 | } | |
620
5dae36a2d5be
Automatic starter enable/disable
Michiel Broek <mbroek@mbse.eu>
parents:
619
diff
changeset
|
2007 | |
697
367ae7ff52f0
Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents:
669
diff
changeset
|
2008 | needed = Round(dataRecord.yeast_pitchrate * volume * plato, 1); |
478 | 2009 | $('#need_cells').val(needed); |
2010 | use_cells = initcells; | |
620
5dae36a2d5be
Automatic starter enable/disable
Michiel Broek <mbroek@mbse.eu>
parents:
619
diff
changeset
|
2011 | if (needed <= initcells) |
5dae36a2d5be
Automatic starter enable/disable
Michiel Broek <mbroek@mbse.eu>
parents:
619
diff
changeset
|
2012 | maybe_starter = 0; |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
2013 | //console.log('calcYeast() pitchrate:' + dataRecord.yeast_pitchrate + ' start:' + initcells + ' needed:' + needed + ' volume:' + volume + ' maybe_starter:' + maybe_starter); |
620
5dae36a2d5be
Automatic starter enable/disable
Michiel Broek <mbroek@mbse.eu>
parents:
619
diff
changeset
|
2014 | |
5dae36a2d5be
Automatic starter enable/disable
Michiel Broek <mbroek@mbse.eu>
parents:
619
diff
changeset
|
2015 | if (maybe_starter != dataRecord.starter_enable) { |
5dae36a2d5be
Automatic starter enable/disable
Michiel Broek <mbroek@mbse.eu>
parents:
619
diff
changeset
|
2016 | dataRecord.starter_enable = maybe_starter; |
5dae36a2d5be
Automatic starter enable/disable
Michiel Broek <mbroek@mbse.eu>
parents:
619
diff
changeset
|
2017 | } |
826
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
2018 | if (maybe_starter) |
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
2019 | $('#propagator').show(); |
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
2020 | else |
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
2021 | $('#propagator').hide(); |
478 | 2022 | |
2023 | if (dataRecord.starter_enable) { | |
823 | 2024 | |
478 | 2025 | calcSteps(dataRecord.starter_type, initcells, needed); |
2026 | ||
2027 | for (i = 1; i < 5; i++) { | |
2028 | $('#r' + i + '_irate').html(''); | |
2029 | $('#r' + i + '_growf').html(''); | |
2030 | $('#r' + i + '_tcells').html(''); | |
2031 | if (parseFloat($('#prop' + i + '_volume').val()) > 0) { | |
2032 | if ((parseFloat($('#prop' + i + '_irate').val()) < 25) || (parseFloat($('#prop' + i + '_irate').val()) > 100)) { | |
2033 | $('#r' + i + '_irate').html("<img src='images/dialog-error.png'>"); | |
2034 | } else { | |
2035 | $('#r' + i + '_irate').html("<img src='images/dialog-ok-apply.png'>"); | |
2036 | } | |
2037 | if (parseFloat($('#prop' + i + '_growf').val()) < 1) | |
2038 | $('#r' + i + '_growf').html("<img src='images/dialog-error.png'>"); | |
2039 | if (($('#prop' + i + '_type').val() > 0) && (parseFloat($('#prop' + i + '_growf').val()) > 3)) | |
2040 | $('#r' + i + '_growf').html("<img src='images/dialog-error.png'>"); | |
2041 | if (parseFloat($('#prop' + i + '_tcells').val()) > needed) | |
2042 | $('#r' + i + '_tcells').html("<img src='images/dialog-ok-apply.png'>"); | |
2043 | use_cells = parseFloat($('#prop' + i + '_tcells').val()); | |
2044 | } else { | |
2045 | $('#r' + i + '_irate').html(''); | |
2046 | } | |
2047 | } | |
2048 | } | |
2049 | $('#plato_cells').val(parseFloat(use_cells / (volume * plato))); | |
2050 | }; | |
2051 | ||
538
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2052 | function whirlpoolHops() { |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
2053 | var row, i, time, rowscount = dataRecord.hops.length; |
538
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2054 | if (rowscount == 0) |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2055 | return; |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2056 | for (i = 0; i < rowscount; i++) { |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
2057 | row = dataRecord.hops[i]; |
538
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2058 | if (row.h_useat == 4) { |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2059 | time = parseFloat(dataRecord.brew_whirlpool9) + parseFloat(dataRecord.brew_whirlpool7) + parseFloat(dataRecord.brew_whirlpool6); |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
2060 | dataRecord.hops[i].h_time = time; |
538
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2061 | $('#hopGrid').jqxGrid('setcellvalue', i, 'h_time', time); |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2062 | } |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2063 | } |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2064 | }; |
41d21817608e
Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents:
525
diff
changeset
|
2065 | |
478 | 2066 | function calcMiscs() { |
2067 | ||
2068 | ok_miscs = 1; | |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
2069 | var row, i, rowscount = dataRecord.miscs.length; |
478 | 2070 | if (rowscount == 0) |
2071 | return; | |
2072 | for (i = 0; i < rowscount; i++) { | |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
2073 | row = dataRecord.miscs[i]; |
478 | 2074 | if ((((dataRecord.inventory_reduced <= 2) && (row.m_use_use <= 2)) || // Starter, Mash, Boil |
826
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
2075 | ((dataRecord.inventory_reduced <= 2) && (row.m_use_use == 6)) || // Sparge |
478 | 2076 | ((dataRecord.inventory_reduced <= 3) && (row.m_use_use == 3)) || // Primary |
2077 | ((dataRecord.inventory_reduced <= 5) && (row.m_use_use == 4)) || // Secondary, Teriary | |
2078 | ((dataRecord.inventory_reduced <= 6) && (row.m_use_use == 5))) && // Bottle | |
2079 | (row.m_inventory < row.m_amount)) { | |
2080 | ok_miscs = 0; | |
2081 | } | |
2082 | } | |
2083 | calcSupplies(); | |
2084 | }; | |
2085 | ||
2086 | function GetBUGU() { | |
2087 | var gu = (dataRecord.est_og - 1) * 1000; | |
2088 | if (gu > 0) | |
2089 | return dataRecord.est_ibu / gu; | |
2090 | else | |
2091 | return 0.5; | |
2092 | } | |
2093 | ||
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2094 | function GetOptSO4Clratio() { |
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2095 | var BUGU = GetBUGU(); |
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2096 | return (1.0 / (-1.2 * BUGU + 1.4)); |
478 | 2097 | } |
2098 | ||
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2099 | function setWaterAgent(name, amount, use) { |
478 | 2100 | var row, i, id, found = false, miscs, rows = $('#miscGrid').jqxGrid('getrows'); |
2101 | if (amount == 0) { | |
2102 | for (i = 0; i < rows.length; i++) { | |
2103 | row = rows[i]; | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2104 | if (row.m_name == name && row.m_use_use == use) { |
478 | 2105 | id = $('#miscGrid').jqxGrid('getrowid', i); |
2106 | $('#miscGrid').jqxGrid('deleterow', id); | |
2107 | } | |
2108 | } | |
2109 | } else { | |
2110 | for (i = 0; i < rows.length; i++) { | |
2111 | row = rows[i]; | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2112 | if (row.m_name == name && row.m_use_use == use) { |
478 | 2113 | found = true; |
2114 | $('#miscGrid').jqxGrid('setcellvalue', i, 'm_amount', amount / 1000); | |
2115 | break; | |
2116 | } | |
2117 | } | |
2118 | if (! found) { | |
2119 | miscs = new $.jqx.dataAdapter(miscInvSource, { | |
2120 | loadComplete: function() { | |
2121 | var record, i, row = {}, records = miscs.records; | |
2122 | for (i = 0; i < records.length; i++) { | |
2123 | record = records[i]; | |
2124 | if (record.name == name) { | |
2125 | row['m_name'] = record.name; | |
2126 | row['m_amount'] = amount / 1000; | |
2127 | row['m_cost'] = record.cost; | |
2128 | row['m_type'] = record.type; | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2129 | row['m_use_use'] = use; |
478 | 2130 | row['m_time'] = 0; |
2131 | row['m_amount_is_weight'] = record.amount_is_weight; | |
2132 | row['m_inventory'] = record.inventory; | |
2133 | row['m_avail'] = 1; | |
2134 | $('#miscGrid').jqxGrid('addrow', null, row); | |
2135 | } | |
2136 | } | |
2137 | } | |
2138 | }); | |
2139 | miscs.dataBind(); | |
2140 | return; | |
2141 | } | |
2142 | } | |
2143 | } | |
2144 | ||
2145 | function setRangeIndicator(ion, rangeCode) { | |
2146 | if ((rangeCode == 'laag') || (rangeCode == 'hoog')) | |
2147 | $('#wr_' + ion).html("<img src='images/dialog-error.png'><span style='vertical-align: top; font-size: 10px; font-style: italic;'>" + rangeCode + '</span>'); | |
2148 | else | |
2149 | $('#wr_' + ion).html("<img src='images/dialog-ok-apply.png'>"); | |
2150 | } | |
2151 | ||
2152 | function mix(v1, v2, c1, c2) { | |
2153 | if ((v1 + v2) > 0) { | |
2154 | return ((v1 * c1) + (v2 * c2)) / (v1 + v2); | |
2155 | } | |
2156 | return 0; | |
2157 | } | |
2158 | ||
2159 | function PartCO3(pH) { | |
2160 | var H = Math.pow(10, -pH); | |
2161 | return 100 * Ka1 * Ka2 / (H * H + H * Ka1 + Ka1 * Ka2); | |
2162 | } | |
2163 | ||
2164 | function PartHCO3(pH) { | |
2165 | var H = Math.pow(10, -pH); | |
2166 | return 100 * Ka1 * H / (H * H + H * Ka1 + Ka1 * Ka2); | |
2167 | } | |
2168 | ||
2169 | function Charge(pH) { | |
2170 | return (-2 * PartCO3(pH) - PartHCO3(pH)); | |
2171 | } | |
2172 | ||
2173 | //Z alkalinity is the amount of acid (in mEq/l) needed to bring water to the target pH (Z pH) | |
2174 | function ZAlkalinity(pHZ) { | |
2175 | var C43 = Charge(4.3), | |
2176 | Cw = Charge(parseFloat($('#wg_ph').jqxNumberInput('decimal'))), | |
2177 | Cz = Charge(pHZ), | |
2178 | DeltaCNaught = -C43 + Cw, | |
2179 | CT = parseFloat($('#wg_total_alkalinity').jqxNumberInput('decimal')) / 50 / DeltaCNaught, | |
2180 | DeltaCZ = -Cz + Cw; | |
2181 | return CT * DeltaCZ; | |
2182 | } | |
2183 | ||
2184 | //Z Residual alkalinity is the amount of acid (in mEq/l) needed to bring the water in the mash to the target pH (Z pH) | |
2185 | function ZRA(pHZ) { | |
2186 | ||
2187 | var Magn, Z, Calc = parseFloat($('#wg_calcium').jqxNumberInput('decimal')) / (MMCa / 2); | |
2188 | Magn = parseFloat($('#wg_magnesium').jqxNumberInput('decimal')) / (MMMg / 2); | |
2189 | Z = ZAlkalinity(pHZ); | |
2190 | return Z - (Calc / 3.5 + Magn / 7); | |
2191 | } | |
2192 | ||
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2193 | function BufferCapacity(di_ph, acid_to_ph_57, ebc, graintype) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2194 | C1 = 0; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2195 | if ((di_ph != 5.7) && ((acid_to_ph_57 < - 0.1) || (acid_to_ph_57 > 0.1))) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2196 | C1 = acid_to_ph_57 / (di_ph - 5.7); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2197 | } else { |
622
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2198 | // If the acid_to_ph_5.7 is unknown from the maltster, guess the required acid. |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2199 | switch (graintype) { |
622
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2200 | case 0: // Base, Special, Kilned |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2201 | case 3: |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2202 | case 5: C1 = 0.014 * ebc - 34.192; |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2203 | break; |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2204 | case 2: C1 = -0.0597 * ebc - 32.457; // Crystal |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2205 | break; |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2206 | case 1: C1 = 0.0107 * ebc - 54.768; // Roast |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2207 | break; |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2208 | case 4: C1 = -149; // Sour malt |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2209 | break; |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2210 | } |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2211 | } |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2212 | return C1; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2213 | } |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2214 | |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2215 | function ProtonDeficit(pHZ) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2216 | |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
2217 | var i, C1, x, Result = ZRA(pHZ) * parseFloat($('#wg_amount').jqxNumberInput('decimal')); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2218 | // proton deficit for the grist |
756
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
2219 | if (( $('#fermentableGrid').jqxGrid('getrows'))) { |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
2220 | for (i = 0; i < dataRecord.fermentables.length; i++) { |
b702c25661e7
Removed unnecesary code. Use existing array data instead of grid calls where possible.
Michiel Broek <mbroek@mbse.eu>
parents:
755
diff
changeset
|
2221 | row = dataRecord.fermentables[i]; |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2222 | if (row.f_added == 0 && row.f_graintype != 6) { // Added == Mash && graintype != No Malt |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2223 | C1 = BufferCapacity(row.f_di_ph, row.f_acid_to_ph_57, row.f_color, row.f_graintype); |
622
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2224 | x = C1 * (pHZ - row.f_di_ph); // AcidRequired(ZpH) |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2225 | Result += x * row.f_amount; |
478 | 2226 | } |
2227 | } | |
622
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
2228 | } else { |
642
9d1af81b20ef
Limit debug ProtoDeficit error messages. If the need for a yeast starter changes, make sure the screen is updated. Another set of extra debug logs. Fixed try yeast starter. Several dropdown lists changed the action from change to select. This should fix te too early calculations while the data was not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
641
diff
changeset
|
2229 | error_count++; |
9d1af81b20ef
Limit debug ProtoDeficit error messages. If the need for a yeast starter changes, make sure the screen is updated. Another set of extra debug logs. Fixed try yeast starter. Several dropdown lists changed the action from change to select. This should fix te too early calculations while the data was not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
641
diff
changeset
|
2230 | if (error_count < 5) |
9d1af81b20ef
Limit debug ProtoDeficit error messages. If the need for a yeast starter changes, make sure the screen is updated. Another set of extra debug logs. Fixed try yeast starter. Several dropdown lists changed the action from change to select. This should fix te too early calculations while the data was not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
641
diff
changeset
|
2231 | console.log('ProtonDeficit(' + pHZ + ') invalid grist, return ' + Result); |
478 | 2232 | } |
2233 | return Result; | |
2234 | } | |
2235 | ||
2236 | function MashpH() { | |
643
9ac2fb6b1311
Added failsave starting calcWater() when the main data is not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
642
diff
changeset
|
2237 | |
478 | 2238 | var n = 0, pH = 5.4, deltapH = 0.001, deltapd = 0.1, pd = ProtonDeficit(pH); |
2239 | while (((pd < -deltapd) || (pd > deltapd)) && (n < 2000)) { | |
2240 | n++; | |
2241 | if (pd < -deltapd) | |
2242 | pH -= deltapH; | |
2243 | else if (pd > deltapd) | |
2244 | pH += deltapH; | |
2245 | pd = ProtonDeficit(pH); | |
2246 | } | |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2247 | pH = Round(pH, 6); |
644
4654b8ee4690
Version 0.3.30 Code and logging cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
643
diff
changeset
|
2248 | //console.log('MashpH() n: ' + n + ' pH: ' + pH); |
478 | 2249 | return pH; |
2250 | } | |
2251 | ||
2252 | function calcWater() { | |
2253 | ||
644
4654b8ee4690
Version 0.3.30 Code and logging cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
643
diff
changeset
|
2254 | /* Can be called during loading and building the screens */ |
643
9ac2fb6b1311
Added failsave starting calcWater() when the main data is not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
642
diff
changeset
|
2255 | if (! data_loaded) { |
644
4654b8ee4690
Version 0.3.30 Code and logging cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
643
diff
changeset
|
2256 | console.log('calcWater() failsave'); |
643
9ac2fb6b1311
Added failsave starting calcWater() when the main data is not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
642
diff
changeset
|
2257 | return; |
9ac2fb6b1311
Added failsave starting calcWater() when the main data is not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
642
diff
changeset
|
2258 | } |
9ac2fb6b1311
Added failsave starting calcWater() when the main data is not yet loaded.
Michiel Broek <mbroek@mbse.eu>
parents:
642
diff
changeset
|
2259 | |
478 | 2260 | var liters = 0, |
2261 | calcium = 0, | |
2262 | magnesium = 0, | |
2263 | sodium = 0, | |
2264 | total_alkalinity = 0, | |
2265 | chloride = 0, | |
2266 | sulfate = 0, | |
2267 | ph = 0, | |
2268 | RA = 0, | |
2269 | frac = 0, | |
2270 | TpH = 0, | |
2271 | protonDeficit = 0, | |
760
fce78f57a44d
Removed water base additions for pH
Michiel Broek <mbroek@mbse.eu>
parents:
759
diff
changeset
|
2272 | AT, /*BT,*/ |
478 | 2273 | r1d, r2d, f1d, f2d, f3d, |
2274 | deltapH, deltapd, pd, n, | |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2275 | Res; |
478 | 2276 | |
2277 | if (dataRecord.w1_name == '') { | |
2278 | return; | |
2279 | } | |
2280 | ||
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2281 | $('#w1_hardness').val(Hardness(dataRecord.w1_calcium, dataRecord.w1_magnesium)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2282 | $('#w1_ra').val(ResidualAlkalinity(dataRecord.w1_total_alkalinity, dataRecord.w1_calcium, dataRecord.w1_magnesium)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2283 | |
478 | 2284 | // If there is a dillute water source, mix the waters. |
789
e6e696add0b3
Fixed some mess in water calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
784
diff
changeset
|
2285 | if ((dataRecord.w2_name != '') && (dataRecord.w2_name != 'Geen mengwater')) { |
478 | 2286 | liters = dataRecord.w1_amount + dataRecord.w2_amount; |
2287 | calcium = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_calcium, dataRecord.w2_calcium); | |
2288 | magnesium = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_magnesium, dataRecord.w2_magnesium); | |
2289 | sodium = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_sodium, dataRecord.w2_sodium); | |
2290 | chloride = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_chloride, dataRecord.w2_chloride); | |
2291 | sulfate = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_sulfate, dataRecord.w2_sulfate); | |
2292 | total_alkalinity = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_total_alkalinity, dataRecord.w2_total_alkalinity); | |
2293 | ph = -Math.log10(((Math.pow(10, -dataRecord.w1_ph) * dataRecord.w1_amount) + (Math.pow(10, -dataRecord.w2_ph) * dataRecord.w2_amount)) / liters); | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2294 | $('#w2_hardness').val(Hardness(dataRecord.w2_calcium, dataRecord.w2_magnesium)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2295 | $('#w2_ra').val(ResidualAlkalinity(dataRecord.w2_total_alkalinity, dataRecord.w2_calcium, dataRecord.w2_magnesium)); |
478 | 2296 | } else { |
2297 | liters = dataRecord.w1_amount; | |
2298 | calcium = dataRecord.w1_calcium; | |
2299 | magnesium = dataRecord.w1_magnesium; | |
2300 | sodium = dataRecord.w1_sodium; | |
2301 | chloride = dataRecord.w1_chloride; | |
2302 | sulfate = dataRecord.w1_sulfate; | |
2303 | total_alkalinity = dataRecord.w1_total_alkalinity; | |
2304 | ph = dataRecord.w1_ph; | |
2305 | } | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2306 | var bicarbonate = Bicarbonate(total_alkalinity, ph); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2307 | |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2308 | /* Save mixed water ions for later */ |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2309 | var wg_calcium = calcium; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2310 | var wg_sodium = sodium; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2311 | var wg_total_alkalinity = total_alkalinity; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2312 | var wg_chloride = chloride; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2313 | var wg_sulfate = sulfate; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2314 | var wg_bicarbonate = bicarbonate; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2315 | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2316 | dataRecord.wg_amount = liters; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2317 | dataRecord.wg_ph = ph; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2318 | |
478 | 2319 | $('#wg_amount').val(liters); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2320 | $('#wg_calcium').val(Round(calcium, 1)); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2321 | $('#wg_magnesium').val(Round(magnesium, 1)); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2322 | $('#wg_sodium').val(Round(sodium, 1)); |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2323 | $('#wg_bicarbonate').val(Round(bicarbonate, 1)); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2324 | $('#wg_total_alkalinity').val(Round(total_alkalinity, 1)); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2325 | $('#wg_chloride').val(Round(chloride, 1)); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2326 | $('#wg_sulfate').val(Round(sulfate, 1)); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2327 | $('#wg_ph').val(Round(ph, 2)); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2328 | $('#wg_hardness').val(Round(Hardness(calcium, magnesium), 1)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2329 | $('#wg_ra').val(Round(ResidualAlkalinity(total_alkalinity, calcium, magnesium), 1)); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2330 | |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2331 | var mash_ph = Round(MashpH(), 3); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2332 | console.log('Distilled water mash pH: ' + mash_ph); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2333 | |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2334 | /* Calculate Salt additions */ |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2335 | if (liters > 0) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2336 | calcium += (parseFloat($('#wa_cacl2').jqxNumberInput('decimal')) * MMCa / MMCaCl2 * 1000 + |
758
e6814bed4cb1
Moved NaHCO3 and CaCO3 from the base additions to the water agent salts.
Michiel Broek <mbroek@mbse.eu>
parents:
757
diff
changeset
|
2337 | parseFloat($('#wa_caso4').jqxNumberInput('decimal')) * MMCa / MMCaSO4 * 1000 + |
e6814bed4cb1
Moved NaHCO3 and CaCO3 from the base additions to the water agent salts.
Michiel Broek <mbroek@mbse.eu>
parents:
757
diff
changeset
|
2338 | parseFloat($('#wa_caco3').jqxNumberInput('decimal')) * MMCa / MMCaCO3 * 1000) / liters; |
759 | 2339 | magnesium += (parseFloat($('#wa_mgso4').jqxNumberInput('decimal')) * MMMg / MMMgSO4 * 1000 + |
2340 | parseFloat($('#wa_mgcl2').jqxNumberInput('decimal')) * MMMg / MMMgCl2 * 1000) / liters; | |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2341 | sodium += (parseFloat($('#wa_nacl').jqxNumberInput('decimal')) * MMNa / MMNaCl * 1000 + |
758
e6814bed4cb1
Moved NaHCO3 and CaCO3 from the base additions to the water agent salts.
Michiel Broek <mbroek@mbse.eu>
parents:
757
diff
changeset
|
2342 | parseFloat($('#wa_nahco3').jqxNumberInput('decimal')) * MMNa / MMNaHCO3 * 1000) / liters; |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2343 | sulfate += (parseFloat($('#wa_caso4').jqxNumberInput('decimal')) * MMSO4 / MMCaSO4 * 1000 + |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2344 | parseFloat($('#wa_mgso4').jqxNumberInput('decimal')) * MMSO4 / MMMgSO4 * 1000) / liters; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2345 | chloride += (2 * parseFloat($('#wa_cacl2').jqxNumberInput('decimal')) * MMCl / MMCaCl2 * 1000 + |
759 | 2346 | parseFloat($('#wa_nacl').jqxNumberInput('decimal')) * MMCl / MMNaCl * 1000 + |
2347 | parseFloat($('#wa_mgcl2').jqxNumberInput('decimal')) * MMCl / MMMgCl2 * 1000) / liters; | |
758
e6814bed4cb1
Moved NaHCO3 and CaCO3 from the base additions to the water agent salts.
Michiel Broek <mbroek@mbse.eu>
parents:
757
diff
changeset
|
2348 | bicarbonate += (parseFloat($('#wa_nahco3').jqxNumberInput('decimal')) * MMHCO3 / MMNaHCO3 * 1000 + |
e6814bed4cb1
Moved NaHCO3 and CaCO3 from the base additions to the water agent salts.
Michiel Broek <mbroek@mbse.eu>
parents:
757
diff
changeset
|
2349 | parseFloat($('#wa_caco3').jqxNumberInput('decimal')) / 3 * MMHCO3 / MMCaCO3 * 1000) / liters; |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2350 | } |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2351 | |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2352 | if (dataRecord.wa_acid_name < 0 || dataRecord,wa_acid_name >= AcidTypeData.length) { |
478 | 2353 | $('#wa_acid_name').val(0); |
2354 | dataRecord.wa_acid_name = 0; | |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2355 | dataRecord.wa_acid_perc = AcidTypeData[0].AcidPrc; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2356 | $('#wa_acid_perc').val(AcidTypeData[0].AcidPrc); |
478 | 2357 | } |
2358 | if (last_acid == '') | |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2359 | last_acid = AcidTypeData[dataRecord.wa_acid_name].nl; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2360 | |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2361 | if (parseFloat(dataRecord.wa_acid_perc) == 0) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2362 | dataRecord.wa_acid_perc = AcidTypeData[AT].AcidPrc; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2363 | $('#wa_acid_perc').val(AcidTypeData[AT].AcidPrc); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2364 | } |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2365 | |
478 | 2366 | AT = dataRecord.wa_acid_name; |
2367 | ||
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2368 | /* Note that the next calculations do not correct the pH change by the added salts. |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2369 | This pH change is at most 0.1 pH and is a minor difference in Acid amount. */ |
478 | 2370 | |
2371 | if (dataRecord.calc_acid) { | |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2372 | /* Auto calculate pH */ |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2373 | $('.c_mashph').show(); |
478 | 2374 | TpH = parseFloat(dataRecord.mash_ph); |
2375 | protonDeficit = ProtonDeficit(TpH); | |
644
4654b8ee4690
Version 0.3.30 Code and logging cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
643
diff
changeset
|
2376 | //console.log('calc_acid tgt: ' + TpH + ' protonDeficit: ' + protonDeficit); |
478 | 2377 | if (protonDeficit > 0) { // Add acid |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2378 | frac = CalcFrac(TpH, AcidTypeData[AT].pK1, AcidTypeData[AT].pK2, AcidTypeData[AT].pK3); |
478 | 2379 | Acid = protonDeficit / frac; |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2380 | Acid *= AcidTypeData[AT].MolWt; // mg |
478 | 2381 | Acidmg = Acid; |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2382 | var RealSG = Round(((AcidTypeData[AT].AcidSG - 1000) * (parseFloat(dataRecord.wa_acid_perc) / 100)) + 1000, 2); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2383 | Acid /= RealSG; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2384 | Acid /= AcidTypeData[AT].AcidPrc / 100; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2385 | Acid = Round(Acid, 2); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2386 | console.log('Mash auto Acid final ml: ' + Acid); |
495
fdbb6bfae569
Disabled some console.log items.
Michiel Broek <mbroek@mbse.eu>
parents:
490
diff
changeset
|
2387 | $('#wa_acid').val(Acid); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2388 | setWaterAgent(AcidTypeData[AT].nl, Acid, 1); |
478 | 2389 | |
2390 | bicarbonate = bicarbonate - protonDeficit * frac / liters; | |
2391 | total_alkalinity = bicarbonate * 50 / 61; | |
2392 | } | |
2393 | ph = TpH; | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2394 | dataRecord.wb_ph = ph; |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2395 | $('#wb_ph').val(Round(ph, 2)); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2396 | $('#est_mash_ph').val(Round(ph, 2)); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2397 | } else { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2398 | /* Manual calculate pH */ |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2399 | $('.c_mashph').hide(); |
478 | 2400 | console.log('calc_acid no'); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2401 | pHa = Round(ph, 3); // Adjusted water pH |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2402 | // Then calculate the new pH with added acids and malts |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2403 | console.log('Mash pH: ' + pHa); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2404 | Acid = AcidTypeData[AT].AcidSG * (parseFloat(dataRecord.wa_acid_perc) / 100); // ml |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2405 | Acid *= parseFloat($('#wa_acid').jqxNumberInput('decimal')); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2406 | Acid /= AcidTypeData[AT].MolWt; // mg |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2407 | Acidmg = Acid; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2408 | |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2409 | //find the pH where the protondeficit = protondeficit by the acid |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2410 | frac = CalcFrac(pHa, AcidTypeData[AT].pK1, AcidTypeData[AT].pK2, AcidTypeData[AT].pK3); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2411 | protonDeficit = Round(Acid * frac, 3); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2412 | //console.log('protonDeficit Acid: ' + protonDeficit + ' frac: ' + frac + ' pH: ' + pHa); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2413 | |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2414 | deltapH = 0.001; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2415 | deltapd = 0.1; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2416 | pd = Round(ProtonDeficit(pHa), 6); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2417 | n = 0; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2418 | while (((pd < (protonDeficit - deltapd)) || (pd > (protonDeficit + deltapd))) && (n < 4000)) { |
478 | 2419 | n++; |
2420 | if (pd < (protonDeficit - deltapd)) | |
2421 | pHa -= deltapH; | |
2422 | else if (pd > (protonDeficit + deltapd)) | |
2423 | pHa += deltapH; | |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2424 | frac = CalcFrac(pHa, AcidTypeData[AT].pK1, AcidTypeData[AT].pK2, AcidTypeData[AT].pK3); |
478 | 2425 | protonDeficit = Acid * frac; |
2426 | pd = ProtonDeficit(pHa); | |
2427 | } | |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2428 | //console.log('n: ' + n + ' pd: ' + pd + ' protonDeficit: ' + protonDeficit + ' frac: ' + frac + ' pHa: ' + pHa); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2429 | bicarbonate = wg_bicarbonate - protonDeficit * frac / liters; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2430 | total_alkalinity = bicarbonate * 50 / 61; |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2431 | ph = pHa; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2432 | $('#wb_ph').val(Round(ph, 2)); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2433 | $('#est_mash_ph').val(Round(ph, 2)); |
478 | 2434 | } |
2435 | ||
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2436 | if ((AT == 3) && (liters > 0)) { // Sulfuric / Zwavelzuur |
478 | 2437 | RA = parseFloat($('#wa_caso4').jqxNumberInput('decimal')) * MMSO4 / MMCaSO4 + |
2438 | parseFloat($('#wa_mgso4').jqxNumberInput('decimal')) * MMSO4 / MMMgSO4 + | |
2439 | Acidmg / 1000 * MMSO4 / (MMSO4 + 2); | |
2440 | RA = 1000 * RA / liters; | |
2441 | sulfate = wg_sulfate + RA; // Not add to sulfate?? | |
2442 | } else if ((AT == 1) && (liters > 0)) { // Hydrochloric, Zoutzuur | |
2443 | RA = parseFloat($('#wa_cacl2').jqxNumberInput('decimal')) * MMCl / MMCaCl2 + | |
2444 | parseFloat($('#wa_nacl').jqxNumberInput('decimal')) * MMCl / MMNaCl + | |
2445 | Acidmg / 1000 * MMCl / (MMCl + 1); | |
2446 | RA = 1000 * RA / liters; | |
2447 | chloride = wg_chloride + RA; | |
2448 | } | |
2449 | ||
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2450 | var BUGU = GetBUGU(); |
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2451 | $('#tgt_bu').val(Round(BUGU, 2)); |
478 | 2452 | // From brouwhulp. |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2453 | if (BUGU < 0.32) |
478 | 2454 | $('#wr_bu').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Zeer moutig en zoet</span>"); |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2455 | else if (BUGU < 0.43) |
478 | 2456 | $('#wr_bu').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Moutig, zoet</span>"); |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2457 | else if (BUGU < 0.52) |
478 | 2458 | $('#wr_bu').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Evenwichtig</span>"); |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2459 | else if (BUGU < 0.63) |
478 | 2460 | $('#wr_bu').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Licht hoppig, bitter</span>"); |
2461 | else | |
2462 | $('#wr_bu').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Extra hoppig, zeer bitter</span>"); | |
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2463 | |
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2464 | // Sulfate to Chloride ratio (Palmer). |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2465 | var OptSO4Clratio = GetOptSO4Clratio(); |
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2466 | $('#tgt_so4_cl').val(Round(OptSO4Clratio, 1)); |
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2467 | if (OptSO4Clratio < 0.4) |
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2468 | $('#wrt_so4_cl').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Te moutig</span>"); |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2469 | else if (OptSO4Clratio < 0.6) |
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2470 | $('#wrt_so4_cl').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Zeer moutig</span>"); |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2471 | else if (OptSO4Clratio < 0.8) |
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2472 | $('#wrt_so4_cl').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Moutig</span>"); |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2473 | else if (OptSO4Clratio < 1.5) |
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2474 | $('#wrt_so4_cl').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Gebalanceerd</span>"); |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2475 | else if (OptSO4Clratio < 2.0) |
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2476 | $('#wrt_so4_cl').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Licht bitter</span>"); |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2477 | else if (OptSO4Clratio < 4.0) |
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2478 | $('#wrt_so4_cl').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Bitter</span>"); |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2479 | else if (OptSO4Clratio < 9.0) |
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2480 | $('#wrt_so4_cl').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Zeer bitter</span>"); |
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2481 | else |
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2482 | $('#wrt_so4_cl').html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Te bitter</span>"); |
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2483 | if (chloride > 0) |
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2484 | RA = sulfate / chloride; |
478 | 2485 | else |
2486 | RA = 10; | |
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2487 | $('#got_so4_cl').val(Round(RA, 1)); |
478 | 2488 | Res = 'normaal'; |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2489 | if (RA < (0.8 * OptSO4Clratio)) |
478 | 2490 | Res = 'laag'; |
555
7c4f34b7e16f
A bit of code optimization in calcWater()
Michiel Broek <mbroek@mbse.eu>
parents:
554
diff
changeset
|
2491 | else if (RA > (1.2 * OptSO4Clratio)) |
478 | 2492 | Res = 'hoog'; |
552
ee0db754111e
In calcWater() the optimum SO4:Cl ratio is taken from the target profile if set, else it's calculated from the BUGU value. Swapped Cl:SO4 to SO4:Cl ratio presentation. Added remark text next to the Optimal SO4:Cl ratio.
Michiel Broek <mbroek@mbse.eu>
parents:
545
diff
changeset
|
2493 | setRangeIndicator('so4_cl', Res); |
478 | 2494 | |
2495 | $('#wb_calcium').val(Round(calcium, 1)); | |
2496 | $('#wb_magnesium').val(Round(magnesium, 1)); | |
2497 | $('#wb_sodium').val(Round(sodium, 1)); | |
2498 | $('#wb_sulfate').val(Round(sulfate, 1)); | |
2499 | $('#wb_chloride').val(Round(chloride, 1)); | |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2500 | $('#wb_bicarbonate').val(Round(bicarbonate, 1)); |
478 | 2501 | $('#wb_total_alkalinity').val(Round(total_alkalinity, 1)); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2502 | $('#wb_hardness').val(Hardness(calcium, magnesium)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2503 | $('#wb_ra').val(ResidualAlkalinity(total_alkalinity, calcium, magnesium)); |
478 | 2504 | |
2505 | if (calcium < 40) { | |
2506 | setRangeIndicator('calcium', 'laag'); | |
2507 | } else if (calcium > 150) { | |
2508 | setRangeIndicator('calcium', 'hoog'); | |
2509 | } else { | |
2510 | setRangeIndicator('calcium', 'normaal'); | |
2511 | } | |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2512 | if (magnesium < 5) { |
607
0efba09a694c
Added low limit for magnesium of 10 ppm
Michiel Broek <mbroek@mbse.eu>
parents:
602
diff
changeset
|
2513 | setRangeIndicator('magnesium', 'laag'); |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2514 | } else if (magnesium > 40) { |
607
0efba09a694c
Added low limit for magnesium of 10 ppm
Michiel Broek <mbroek@mbse.eu>
parents:
602
diff
changeset
|
2515 | setRangeIndicator('magnesium', 'hoog'); |
0efba09a694c
Added low limit for magnesium of 10 ppm
Michiel Broek <mbroek@mbse.eu>
parents:
602
diff
changeset
|
2516 | } else { |
478 | 2517 | setRangeIndicator('magnesium', 'normaal'); |
2518 | } | |
2519 | if (sodium <= 150) { | |
2520 | setRangeIndicator('sodium', 'normaal'); | |
2521 | } else { | |
2522 | setRangeIndicator('sodium', 'hoog'); | |
2523 | } | |
2524 | // Both chloride and sulfate should be above 50 according to | |
2525 | // John Palmer. So the Cl/SO4 ratio calculation will work. | |
2526 | if (chloride <= 50) { | |
2527 | setRangeIndicator('chloride', 'laag'); | |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2528 | } else if (chloride <= 150) { |
478 | 2529 | setRangeIndicator('chloride', 'normaal'); |
2530 | } else { | |
2531 | setRangeIndicator('chloride', 'hoog'); | |
2532 | } | |
2533 | if (sulfate <= 50) { | |
2534 | setRangeIndicator('sulfate', 'laag'); | |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2535 | } else if (sulfate <= 400) { |
478 | 2536 | setRangeIndicator('sulfate', 'normaal'); |
2537 | } else { | |
2538 | setRangeIndicator('sulfate', 'hoog'); | |
2539 | } | |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2540 | // (cloride + sulfate) > 500 is too high |
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2541 | if ((chloride + sulfate) > 500) { |
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2542 | setRangeIndicator('chloride', 'hoog'); |
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2543 | setRangeIndicator('sulfate', 'hoog'); |
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2544 | } |
478 | 2545 | if (ph < 5.2) { |
2546 | setRangeIndicator('ph', 'laag'); | |
2547 | } else if (ph > 5.6) { | |
2548 | setRangeIndicator('ph', 'hoog'); | |
2549 | } else { | |
2550 | setRangeIndicator('ph', 'normaal'); | |
2551 | } | |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2552 | if (bicarbonate > 250) { |
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2553 | setRangeIndicator('bicarbonate', 'hoog'); |
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2554 | } else { |
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2555 | setRangeIndicator('bicarbonate', 'normaal'); |
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
2556 | } |
478 | 2557 | calcSparge(); |
2558 | calcMiscs(); | |
2559 | calcSupplies(); | |
2560 | } | |
2561 | ||
2562 | function calcSparge() { | |
2563 | ||
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2564 | /* Based on the work of ajDeLange. */ |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2565 | var ws_calcium, ws_magnesium, ws_total_alkalinity, ws_sodium, ws_chloride; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2566 | var ws_sulfate, ws_ph, ws_hardness, ws_ra; |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2567 | var TargetpH = dataRecord.sparge_ph; |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2568 | var Source_pH = 7.0; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2569 | |
478 | 2570 | // Select watersource or fallback to the first source. |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2571 | if ((dataRecord.sparge_source == 1) && (dataRecord.w2_ph > 0.0)) { // Source 2 |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2572 | ws_calcium = dataRecord.w2_calcium; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2573 | ws_magnesium = dataRecord.w2_magnesium; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2574 | ws_total_alkalinity = dataRecord.w2_total_alkalinity; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2575 | ws_sodium = dataRecord.w2_sodium; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2576 | ws_chloride = dataRecord.w2_chloride; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2577 | ws_sulfate = dataRecord.w2_sulfate; |
478 | 2578 | Source_pH = dataRecord.w2_ph; |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2579 | $('#w2_button').jqxRadioButton({ checked: true }); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2580 | } else if ((dataRecord.sparge_source == 2) && (dataRecord.w2_ph > 0.0)) { // Mixed |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2581 | ws_calcium = dataRecord.wg_calcium; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2582 | ws_magnesium = dataRecord.wg_magnesium; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2583 | ws_total_alkalinity = dataRecord.wg_total_alkalinity; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2584 | ws_sodium = dataRecord.wg_sodium; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2585 | ws_chloride = dataRecord.wg_chloride; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2586 | ws_sulfate = dataRecord.wg_sulfate; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2587 | Source_pH = dataRecord.wg_ph; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2588 | $('#wg_button').jqxRadioButton({ checked: true }); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2589 | } else { |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2590 | ws_calcium = dataRecord.w1_calcium; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2591 | ws_magnesium = dataRecord.w1_magnesium; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2592 | ws_total_alkalinity = dataRecord.w1_total_alkalinity; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2593 | ws_sodium = dataRecord.w1_sodium; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2594 | ws_chloride = dataRecord.w1_chloride; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2595 | ws_sulfate = dataRecord.w1_sulfate; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2596 | Source_pH = dataRecord.w1_ph; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2597 | $('#w1_button').jqxRadioButton({ checked: true }); |
478 | 2598 | } |
2599 | ||
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2600 | if (dataRecord.sparge_volume > 0) { |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2601 | ws_calcium += (parseFloat($('#ss_cacl2').jqxNumberInput('decimal')) * MMCa / MMCaCl2 * 1000 + |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2602 | parseFloat($('#ss_caso4').jqxNumberInput('decimal')) * MMCa / MMCaSO4 * 1000) / dataRecord.sparge_volume; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2603 | ws_magnesium += (parseFloat($('#ss_mgso4').jqxNumberInput('decimal')) * MMMg / MMMgSO4 * 1000 + |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2604 | parseFloat($('#ss_mgcl2').jqxNumberInput('decimal')) * MMMg / MMMgCl2 * 1000) / dataRecord.sparge_volume; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2605 | ws_sodium += (parseFloat($('#ss_nacl').jqxNumberInput('decimal')) * MMNa / MMNaCl * 1000) / dataRecord.sparge_volume; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2606 | ws_sulfate += (parseFloat($('#ss_caso4').jqxNumberInput('decimal')) * MMSO4 / MMCaSO4 * 1000 + |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2607 | parseFloat($('#ss_mgso4').jqxNumberInput('decimal')) * MMSO4 / MMMgSO4 * 1000) / dataRecord.sparge_volume; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2608 | ws_chloride += (2 * parseFloat($('#ss_cacl2').jqxNumberInput('decimal')) * MMCl / MMCaCl2 * 1000 + |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2609 | parseFloat($('#ss_nacl').jqxNumberInput('decimal')) * MMCl / MMNaCl * 1000 + |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2610 | parseFloat($('#ss_mgcl2').jqxNumberInput('decimal')) * MMCl / MMMgCl2 * 1000) / dataRecord.sparge_volume; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2611 | } |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2612 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2613 | /* Show the spargewate with salt additions */ |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2614 | $('#sw_calcium').val(Round(ws_calcium, 1)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2615 | $('#sw_magnesium').val(Round(ws_magnesium, 1)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2616 | $('#sw_sodium').val(Round(ws_sodium, 1)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2617 | $('#sw_sulfate').val(Round(ws_sulfate, 1)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2618 | $('#sw_chloride').val(Round(ws_chloride, 1)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2619 | $('#sw_bicarbonate').val(Round(Bicarbonate(ws_total_alkalinity, Source_pH), 1)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2620 | $('#sw_total_alkalinity').val(Round(ws_total_alkalinity, 1)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2621 | $('#sw_ph').val(dataRecord.sparge_ph); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2622 | $('#sw_hardness').val(Hardness(ws_calcium, ws_magnesium)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2623 | $('#sw_ra').val(ResidualAlkalinity(ws_total_alkalinity, ws_calcium, ws_magnesium)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2624 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2625 | AT = dataRecord.sparge_acid_type; |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2626 | if (AT < 0 || AT >= AcidTypeData.length) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2627 | AT = 0; |
478 | 2628 | dataRecord.sparge_acid_type = 0; |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2629 | $('#sparge_acid_type').val(AcidTypeData[0].nl); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2630 | dataRecord.sparge_acid_perc = AcidTypeData[0].AcidPrc; |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
2631 | $('#sparge_acid_perc').val(dataRecord.sparge_acid_perc); |
478 | 2632 | } |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2633 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2634 | /* |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2635 | * Auto calculate the required acid |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2636 | */ |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2637 | if (dataRecord.calc_acid) { |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2638 | // Step 1: Compute the mole fractions of carbonic (f1) and carbonate(f3) at the source water pH |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2639 | var r1 = Math.pow(10, Source_pH - 6.35); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2640 | var r2 = Math.pow(10, Source_pH - 10.33); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2641 | var d = 1 + r1 + r1 * r2; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2642 | var f1 = 1 / d; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2643 | var f3 = r1 * r2 / d; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2644 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2645 | //Step 2. Compute the mole fractions at pH = 4.3 (the pH which defines alkalinity) |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2646 | var r143 = Math.pow(10, 4.3 - 6.35); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2647 | var r243 = Math.pow(10, 4.3 - 10.33); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2648 | var d43 = 1 + r143 + r143 * r243; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2649 | var f143 = 1 / d43; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2650 | var f343 = r143 * r243 / d43; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2651 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2652 | //Step 4. Solve |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2653 | var Ct = ws_total_alkalinity / 50 / ((f143 - f1) + (f3 - f343)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2654 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2655 | //Step 5. Compute mole fractions at desired pH |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2656 | var r1g = Math.pow(10, TargetpH - 6.35); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2657 | var r2g = Math.pow(10, TargetpH - 10.33); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2658 | var dg = 1 + r1g + r1g * r2g; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2659 | var f1g = 1 / dg; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2660 | var f3g = r1g * r2g / dg; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2661 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2662 | //Step 6. Use these to compute the milliequivalents acid required per liter (mEq/L) |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2663 | var Acid = Ct * ((f1g - f1) + (f3 - f3g)) + Math.pow(10, -TargetpH) - Math.pow(10, -Source_pH); //mEq/l |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2664 | Acid += 0.01; // Add acid that would be required for distilled water. |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2665 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2666 | //Step 8. Get the acid data. |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2667 | var fract = CalcFrac(TargetpH, AcidTypeData[AT].pK1, AcidTypeData[AT].pK2, AcidTypeData[AT].pK3); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2668 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2669 | //Step 9. Now divide the mEq required by the "fraction". This is the required number of moles of acid. |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2670 | Acid /= fract; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2671 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2672 | //Step 10. Multiply by molecular weight of the acid |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2673 | Acid *= AcidTypeData[AT].MolWt; //mg |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2674 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2675 | //Step 11. Divide by Specific Gravity and Percentage to get the final ml. |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2676 | var RealSG = Round(((AcidTypeData[AT].AcidSG - 1000) * (dataRecord.sparge_acid_perc / 100)) + 1000, 2); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2677 | Acid = Acid / RealSG; //ml |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2678 | Acid *= dataRecord.sparge_volume; //ml acid total at 100% |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2679 | Acid /= AcidTypeData[AT].AcidPrc / 100; //ml acid at supplied strength |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2680 | Acid = Round(Acid, 2); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2681 | dataRecord.sparge_acid_amount = Acid / 1000; |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2682 | $('#sparge_acid_amount').val(Acid); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2683 | } |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2684 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2685 | // Finally calculate the estimate preboil pH |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2686 | var ph = -Math.log10(((Math.pow(10, -dataRecord.wb_ph) * dataRecord.wg_amount) + (Math.pow(10, -dataRecord.sparge_ph) * dataRecord.sparge_volume)) / |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2687 | (dataRecord.wg_amount + dataRecord.sparge_volume)); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2688 | $('#preboil_ph').val(ph); |
478 | 2689 | } |
2690 | ||
2691 | function calcFermentation() { | |
2692 | var primary_svg, secondary_svg, final_svg, ABV; | |
2693 | if (dataRecord.brew_fermenter_sg < 1.020) | |
2694 | return; | |
2695 | if ((dataRecord.primary_end_sg > 0.990) && (dataRecord.primary_end_sg < dataRecord.brew_fermenter_sg)) { | |
655
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
651
diff
changeset
|
2696 | primary_svg = Round(calc_svg(dataRecord.brew_fermenter_sg, dataRecord.primary_end_sg), 1); |
478 | 2697 | $('#primary_svg').val(primary_svg); |
2698 | if ((dataRecord.secondary_end_sg > 0.990) && (dataRecord.secondary_end_sg < dataRecord.brew_fermenter_sg)) { | |
655
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
651
diff
changeset
|
2699 | secondary_svg = Round(calc_svg(dataRecord.brew_fermenter_sg, dataRecord.secondary_end_sg), 1); |
478 | 2700 | $('#secondary_svg').val(secondary_svg); |
2701 | if ((dataRecord.fg > 0.990) && (dataRecord.fg < dataRecord.brew_fermenter_sg)) { | |
655
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
651
diff
changeset
|
2702 | final_svg = Round(calc_svg(dataRecord.brew_fermenter_sg, dataRecord.fg), 1); |
478 | 2703 | $('#final_svg').val(final_svg); |
2704 | ABV = Round(abvol(dataRecord.brew_fermenter_sg, dataRecord.fg), 2); | |
2705 | $('#final_abv').val(ABV); | |
2706 | } | |
2707 | } | |
2708 | } | |
2709 | } | |
2710 | ||
651
6e89cb158153
Changed priming sugar calculation to Brew by the Numbers by Michael L. Hall. This gives a bit higher and better amount of sugar to use. Removed dead parameter from the ResCO2 function.
Michiel Broek <mbroek@mbse.eu>
parents:
649
diff
changeset
|
2711 | function ResCO2(T) { |
478 | 2712 | var F = T * 1.8 + 32; |
651
6e89cb158153
Changed priming sugar calculation to Brew by the Numbers by Michael L. Hall. This gives a bit higher and better amount of sugar to use. Removed dead parameter from the ResCO2 function.
Michiel Broek <mbroek@mbse.eu>
parents:
649
diff
changeset
|
2713 | return Round(3.0378 - 0.050062 * F + 0.00026555 * F * F, 6); |
478 | 2714 | } |
2715 | ||
2716 | function CarbCO2toS(CO2, T, SFactor) { | |
651
6e89cb158153
Changed priming sugar calculation to Brew by the Numbers by Michael L. Hall. This gives a bit higher and better amount of sugar to use. Removed dead parameter from the ResCO2 function.
Michiel Broek <mbroek@mbse.eu>
parents:
649
diff
changeset
|
2717 | //var sugar = SFactor * (CO2 - ResCO2(CO2, T)) / 0.286; |
6e89cb158153
Changed priming sugar calculation to Brew by the Numbers by Michael L. Hall. This gives a bit higher and better amount of sugar to use. Removed dead parameter from the ResCO2 function.
Michiel Broek <mbroek@mbse.eu>
parents:
649
diff
changeset
|
2718 | var sugar = Round(SFactor * (CO2 - ResCO2(T)) * 4.014094, 6); |
478 | 2719 | if (sugar < 0) |
2720 | sugar = 0; | |
2721 | return Round(sugar, 3); | |
2722 | } | |
2723 | ||
2724 | function GetPressure(CO2, T1, T2) { | |
651
6e89cb158153
Changed priming sugar calculation to Brew by the Numbers by Michael L. Hall. This gives a bit higher and better amount of sugar to use. Removed dead parameter from the ResCO2 function.
Michiel Broek <mbroek@mbse.eu>
parents:
649
diff
changeset
|
2725 | var P, V = CO2 - ResCO2(T1); |
609
e9b108569818
Testing, bottle carbonation pressure display without residential pressure
Michiel Broek <mbroek@mbse.eu>
parents:
607
diff
changeset
|
2726 | V = CO2; // TODO: temp only total pressure, testing |
478 | 2727 | if (V < 0) |
2728 | return 0; | |
2729 | P = -1.09145427669121 + 0.00800006989646477 * T2 + 0.000260276315484684 * T2 * T2 + 0.0215142075945119 * T2 * V + | |
2730 | 0.674996600795854 * V + -0.00471757220150754 * V * V; | |
2731 | if (P < 0) | |
2732 | P = 0; | |
609
e9b108569818
Testing, bottle carbonation pressure display without residential pressure
Michiel Broek <mbroek@mbse.eu>
parents:
607
diff
changeset
|
2733 | P = Round(P * 1.01325, 2); // atm to bar |
651
6e89cb158153
Changed priming sugar calculation to Brew by the Numbers by Michael L. Hall. This gives a bit higher and better amount of sugar to use. Removed dead parameter from the ResCO2 function.
Michiel Broek <mbroek@mbse.eu>
parents:
649
diff
changeset
|
2734 | console.log("GetPressure(" + CO2 + ", " + T1 + ", " + T2 + ") V:" + V + " Bar: " + P + " ignored ResCO2: " + ResCO2(T1)); |
609
e9b108569818
Testing, bottle carbonation pressure display without residential pressure
Michiel Broek <mbroek@mbse.eu>
parents:
607
diff
changeset
|
2735 | return P; |
478 | 2736 | } |
2737 | ||
2738 | function CarbCO2ToPressure(CO2, T) { | |
2739 | return (CO2 - (-0.000005594056 * Math.pow(T, 4) + 0.000144357886 * Math.pow(T, 3) + | |
2740 | 0.000362999168 * T * T - 0.064872987645 * T + 1.641145175049)) / | |
2741 | (0.00000498031 * Math.pow(T, 4) - 0.00024358267 * Math.pow(T, 3) + 0.00385867329 * T * T - 0.05671206825 * T + 1.53801423376); | |
2742 | } | |
2743 | ||
2744 | function calcCarbonation() { | |
2745 | ||
2746 | var TSec, ABV, bvol, balc, babv, mvol, malc, tvol, talc, i, row, SFactor, pvol, pabv, Pressure, kabv; | |
2747 | ||
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2748 | console.log('calcCarbonation()'); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
2749 | |
478 | 2750 | TSec = dataRecord.secondary_temp; |
2751 | if (TSec < 1) | |
2752 | TSec = dataRecord.primary_end_temp; | |
2753 | if (TSec < 1) | |
2754 | TSec = 18; | |
2755 | ||
2756 | if (dataRecord.fg == 0.000) | |
2757 | ABV = abvol(dataRecord.brew_fermenter_sg, parseFloat($('#est_fg').jqxNumberInput('decimal'))); | |
2758 | else | |
2759 | ABV = abvol(dataRecord.brew_fermenter_sg, dataRecord.fg); | |
2760 | ||
2761 | /* Calculate new volume and alcohol. */ | |
2762 | bvol = dataRecord.package_volume - (ABV * dataRecord.package_volume) / 100; | |
2763 | balc = dataRecord.package_volume - bvol; | |
2764 | mvol = dataRecord.package_infuse_amount - (dataRecord.package_infuse_abv * dataRecord.package_infuse_amount) / 100; | |
2765 | malc = dataRecord.package_infuse_amount - mvol; | |
2766 | talc = balc + malc; | |
2767 | tvol = bvol + mvol; | |
2768 | ABV = Round(talc / (tvol + talc) * 100, 2); | |
2769 | dataRecord.package_abv = ABV; | |
2770 | $('#package_abv').val(ABV); | |
2771 | ||
2772 | //console.log("calcCarbonation() TSec:"+TSec+" ABV:"+ABV); | |
2773 | if (!(rows = $('#fermentableGrid').jqxGrid('getrows'))) { | |
2774 | return; | |
2775 | } | |
2776 | ||
2777 | // Bottles | |
2778 | dataRecord.bottle_priming_amount = 0; | |
2779 | dataRecord.bottle_priming_total = 0; | |
2780 | for (i = 0; i < rows.length; i++) { | |
2781 | row = rows[i]; | |
2782 | if (row.f_added == 4) { | |
2783 | SFactor = 1 / ((row.f_yield / 100) * (1 - row.f_moisture / 100)); | |
2784 | dataRecord.bottle_priming_amount = CarbCO2toS(dataRecord.bottle_carbonation, TSec, SFactor); | |
2785 | dataRecord.bottle_priming_total = Round(dataRecord.bottle_amount * dataRecord.bottle_priming_amount, 2); | |
2786 | $('#fermentableGrid').jqxGrid('setcellvalue', i, 'f_amount', dataRecord.bottle_priming_total / 1000); | |
2787 | } | |
2788 | } | |
2789 | $('#bottle_priming_amount').val(Round(dataRecord.bottle_priming_amount, 1)); | |
2790 | $('#bottle_priming_total').val(dataRecord.bottle_priming_total); | |
2791 | pabv = ABV + dataRecord.bottle_priming_amount * 0.47 / 7.907; | |
2792 | pvol = dataRecord.bottle_amount - (pabv * dataRecord.bottle_amount) / 100; | |
2793 | talc = dataRecord.bottle_amount - pvol; | |
2794 | tvol = pvol + dataRecord.bottle_priming_water; | |
2795 | babv = Round(talc / (tvol + talc) * 100, 2); | |
2796 | //console.log("bottle pabv:"+pabv+" pvol:"+pvol+" wvol:"+dataRecord.bottle_priming_water+" tvol:"+tvol+" talc:"+talc+" abv:"+babv); | |
2797 | $('#bottle_abv').val(babv); | |
2798 | $('#bottle_pressure').val(GetPressure(dataRecord.bottle_carbonation, TSec, dataRecord.bottle_carbonation_temp)); | |
2799 | ||
2800 | // Kegs | |
2801 | Pressure = CarbCO2ToPressure(dataRecord.keg_carbonation, dataRecord.keg_carbonation_temp); | |
2802 | if (Pressure < 0) | |
557 | 2803 | Pressure = 0; |
478 | 2804 | dataRecord.keg_pressure = Pressure; |
2805 | $('#keg_pressure').val(Round(Pressure, 1)); | |
2806 | ||
2807 | dataRecord.keg_priming_amount = 0; | |
2808 | dataRecord.keg_priming_total = 0; | |
2809 | if (!dataRecord.keg_forced_carb) { | |
557 | 2810 | for (i = 0; i < rows.length; i++) { |
2811 | row = rows[i]; | |
2812 | if (row.f_added == 5) { | |
2813 | SFactor = 1 / ((row.f_yield / 100) * (1 - row.f_moisture / 100)); | |
2814 | dataRecord.keg_priming_amount = CarbCO2toS(dataRecord.keg_carbonation, TSec, SFactor); | |
2815 | dataRecord.keg_priming_total = Round(dataRecord.keg_amount * dataRecord.keg_priming_amount, 2); | |
2816 | $('#fermentableGrid').jqxGrid('setcellvalue', i, 'f_amount', dataRecord.keg_priming_total / 1000); | |
2817 | } | |
2818 | } | |
2819 | $('#keg_priming_amount').val(Round(dataRecord.keg_priming_amount, 1)); | |
2820 | $('#keg_priming_total').val(dataRecord.keg_priming_total); | |
2821 | pabv = ABV + dataRecord.keg_priming_amount * 0.47 / 7.907; | |
2822 | pvol = dataRecord.keg_amount - (pabv * dataRecord.keg_amount) / 100; | |
2823 | talc = dataRecord.keg_amount - pvol; | |
2824 | tvol = pvol + dataRecord.keg_priming_water; | |
2825 | kabv = Round(talc / (tvol + talc) * 100, 2); | |
2826 | //console.log("kegs pabv:"+pabv+" pvol:"+pvol+" wvol:"+dataRecord.keg_priming_water+" tvol:"+tvol+" talc:"+talc+" abv:"+kabv); | |
2827 | $('#keg_abv').val(kabv); | |
478 | 2828 | } else { |
557 | 2829 | $('#keg_priming_amount').val(0); |
2830 | $('#keg_priming_total').val(0); | |
2831 | $('#keg_abv').val(ABV); | |
478 | 2832 | } |
2833 | } | |
2834 | ||
2835 | function calcStage() { | |
2836 | /* | |
2837 | * Set stage and enable or disable parts of the screens. | |
2838 | */ | |
2839 | $('#stage').val(StageData[dataRecord.stage].nl); | |
2840 | ||
2841 | /* | |
723
3a837905bbce
Prepared the edit fields for dynamic enable/disable during split batches.
Michiel Broek <mbroek@mbse.eu>
parents:
721
diff
changeset
|
2842 | * Enable or disable parts of the screens. |
478 | 2843 | */ |
827 | 2844 | $('#jqxTabs').jqxTabs((dataRecord.stage < 1) ? 'disableAt':'enableAt', 8); // Brewday tab |
2845 | $('#jqxTabs').jqxTabs((dataRecord.stage > 2) ? 'enableAt':'disableAt', 9); // Fermentation tab | |
2846 | $('#jqxTabs').jqxTabs((dataRecord.stage < 9) ? 'disableAt':'enableAt', 11); // Tasting tab | |
478 | 2847 | } |
2848 | ||
2849 | ||
2850 | // initialize the input fields. | |
2851 | // Tab 1, Algemeen | |
2852 | $('#name').jqxTooltip({ content: 'De naam voor dit product.' }); | |
2853 | $('#code').jqxTooltip({ content: 'Product code nummer.' }); | |
2854 | $('#birth').jqxTooltip({ content: 'De ontwerp datum van dit product.' }); | |
2855 | $('#stage').jqxTooltip({ content: 'De productie fase van dit product.' }); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2856 | $('#divide_batch').jqxTooltip({ content: 'Het aantal extra gesplitste batches.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2857 | $('#divide_type').jqxTooltip({ content: 'Het splitsing moment in het productie proces.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2858 | $('#notes').jqxTooltip({ content: 'De uitgebreide opmerkingen over dit product.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2859 | $('#type').jqxTooltip({ content: 'Het brouw type van dit recept.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2860 | $('#efficiency').jqxTooltip({ content: 'Het rendement van maischen en koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2861 | $('#batch_size').jqxTooltip({ content: 'Het volume van het gekoelde wort na het koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2862 | $('#boil_time').jqxTooltip({ content: 'De kooktijd in minuten.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2863 | $('#boil_size').jqxTooltip({ content: 'Het volume van het wort voor het koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2864 | $('#st_guide').jqxTooltip({ content: 'De bierstijl gids voor dit recept.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2865 | $('#st_name').jqxTooltip({ content: 'De bierstijl naam voor dit recept.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2866 | $('#st_letter').jqxTooltip({ content: 'De bierstijl letter voor dit recept.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2867 | $('#st_letter').jqxInput({ theme: theme, width: 90, height: 23 }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2868 | $('#st_type').jqxTooltip({ content: 'Het bierstijl type.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2869 | $('#st_category').jqxTooltip({ content: 'De Amerikaanse bierstijl categorie.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2870 | $('#st_category_number').jqxTooltip({ content: 'De Amerikaanse bierstijl categorie sub nummer.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2871 | $('#est_og').jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2872 | $('#st_og_min').jqxTooltip({ content: 'Het minimum begin SG voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2873 | $('#st_og_max').jqxTooltip({ content: 'Het maximum begin SG voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2874 | $('#est_fg').jqxTooltip({ content: 'Het verwachte eind SG. Dit wordt automatisch berekend.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2875 | $('#st_fg_min').jqxTooltip({ content: 'Het minimum eind SG voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2876 | $('#st_fg_max').jqxTooltip({ content: 'Het maximum eind SG voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2877 | $('#est_abv').jqxTooltip({ content: 'Alcohol volume %. Dit wordt automatisch berekend.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2878 | $('#st_abv_min').jqxTooltip({ content: 'Het minimum alcohol volume % voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2879 | $('#st_abv_max').jqxTooltip({ content: 'Het maximum alcohol volume % voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2880 | $('#est_color').jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2881 | $('#st_color_min').jqxTooltip({ content: 'De minimum kleur voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2882 | $('#st_color_max').jqxTooltip({ content: 'De maximum kleur voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2883 | $('#est_ibu').jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2884 | $('#st_ibu_min').jqxTooltip({ content: 'De minimum bitterheid voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2885 | $('#st_ibu_max').jqxTooltip({ content: 'De maximum bitterheid voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2886 | $('#kcal').jqxTooltip({ content: 'Energie-inhoud in kcal/liter.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2887 | $('#est_carb').jqxTooltip({ content: 'Koolzuur volume. Dit wordt automatisch berekend.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2888 | $('#st_carb_min').jqxTooltip({ content: 'Het minimum koolzuur volume voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2889 | $('#st_carb_max').jqxTooltip({ content: 'Het maximum koolzuur volume voor deze bierstijl.'}); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2890 | |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2891 | $('#name').jqxInput({ theme: theme, width: 640, height: 23 }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2892 | $('#code, #stage').jqxInput({ theme: theme, width: 100, height: 23 }); |
478 | 2893 | $('#locked').jqxCheckBox({ theme: theme, width: 120, height: 23, disabled: true }); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2894 | $('#birth,#divide_batch,#divide_type').jqxInput({ theme: theme, width: 120, height: 23 }); |
478 | 2895 | $('#notes').jqxInput({ theme: theme, width: 960, height: 100 }); |
818
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
2896 | $('#type').jqxInput({ theme: theme, width: 180, height: 23 }); |
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
2897 | $('#efficiency').jqxNumberInput(Show1dec); |
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
2898 | $('#batch_size').jqxNumberInput(Show1dec); |
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
2899 | $('#boil_time').jqxNumberInput(Show0dec); |
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
2900 | $('#boil_size').jqxNumberInput(Show2dec); |
610 | 2901 | $('#st_guide,#st_name,#st_type,#st_category').jqxInput({ theme: theme, width: 250, height: 23 }); |
818
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
2902 | $('#est_og').jqxNumberInput(Show3dec); |
478 | 2903 | $('#est_fg').jqxNumberInput(Show3dec); |
610 | 2904 | $('#st_og_min,#st_og_max,#st_fg_min,#st_fg_max').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2905 | $('#est_ibu,#est_color').jqxNumberInput(Show0dec); |
818
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
2906 | $('#color_method').jqxInput({ theme: theme, width: 180, height: 23 }); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2907 | $('#st_color_min,#st_color_max,#st_category_number,#st_ibu_min,#st_ibu_max,#kcal').jqxNumberInput(Smal0dec); |
818
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
2908 | $('#ibu_method').jqxInput({ theme: theme, width: 180, height: 23 }); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2909 | $('#est_abv,#st_abv_min,#st_abv_max,#est_carb,#st_carb_min,#st_carb_max').jqxNumberInput(Smal1dec); |
478 | 2910 | |
2911 | // Tab 2, Equipment | |
2912 | $('#eq_name').jqxTooltip({ content: 'De naam van deze brouw apparatuur.' }); | |
2913 | $('#eq_boil_size').jqxTooltip({ content: 'Normaal kook volume in liters' }); | |
2914 | $('#eq_batch_size').jqxTooltip({ content: 'Berekende batch grootte in liters aan het eind van de kook.' }); | |
2915 | $('#eq_tun_volume').jqxTooltip({ content: 'Maisch ketel volume.' }); | |
2916 | $('#eq_top_up_water').jqxTooltip({ content: 'Extra water in het gistvat.' }); | |
842
897bf2a43253
Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents:
841
diff
changeset
|
2917 | $('#eq_trub_loss').jqxTooltip({ content: 'Standaard verlies bij het overbrengen naar het gistvat.' }); |
478 | 2918 | $('#eq_evap_rate').jqxTooltip({ content: 'Verdamping in liters per uur.' }); |
658
945d5eba869a
Implemented no-boil products.
Michiel Broek <mbroek@mbse.eu>
parents:
655
diff
changeset
|
2919 | $('#eq_boil_time').jqxTooltip({ content: 'Normale kooktijd in minuten, 0 voor no-boil recepten.' }); |
478 | 2920 | $('#eq_top_up_kettle').jqxTooltip({ content: 'Extra water toevoegen tijdens de kook.' }); |
2921 | $('#eq_notes').jqxTooltip({ content: 'Opmerkingen over deze apparatuur.' }); | |
2922 | $('#eq_lauter_deadspace').jqxTooltip({ content: 'Filterkuip verlies in liters.' }); | |
2923 | $('#eq_kettle_volume').jqxTooltip({ content: 'Kook ketel volume in liters.' }); | |
2924 | $('#eq_mash_volume').jqxTooltip({ content: 'Maisch water voor de eerste stap.' }); | |
2925 | $('#eq_mash_max').jqxTooltip({ content: 'De maximale moutstort in Kg.' }); | |
2926 | $('#eq_efficiency').jqxTooltip({ content: 'Gemiddeld brouwzaal rendement.' }); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2927 | |
841
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
2928 | $('#eq_fermenter_volume').jqxNumberInput(Show1dec); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2929 | $('#eq_name').jqxInput({ theme: theme, width: 250, height: 23 }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2930 | $('#eq_evap_rate').jqxNumberInput(Show2dec); |
840
ba607babc468
Removed hop_utilization from products and equipments.
Michiel Broek <mbroek@mbse.eu>
parents:
832
diff
changeset
|
2931 | $('#eq_boil_time').jqxNumberInput(Show0dec); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2932 | $('#eq_notes').jqxInput({ theme: theme, width: 960, height: 200 }); |
842
897bf2a43253
Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents:
841
diff
changeset
|
2933 | $('#eq_boil_size,#eq_batch_size,#eq_tun_volume,#eq_top_up_water,#eq_trub_loss,#eq_top_up_kettle').jqxNumberInput(Show1dec); |
841
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
2934 | $('#eq_lauter_deadspace,#eq_kettle_volume,#eq_mash_volume,#eq_mash_max,#eq_efficiency').jqxNumberInput(Show1dec); |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
2935 | $('#eq_chiller_type').jqxInput({ theme: theme, width: 180, height: 23 }); |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
2936 | $('#eq_chiller_to79').jqxNumberInput(Show0dec); |
60bb365fb48d
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents:
840
diff
changeset
|
2937 | $('#eq_chiller_volume,#eq_chiller_lpm,#eq_chiller_loss').jqxNumberInput(Show2dec); |
478 | 2938 | |
2939 | // Tab 3, Fermentables | |
2940 | $('#est_color2').jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); | |
2941 | $('#est_og2').jqxTooltip({ content: 'Het geschatte begin SG van dit product.' }); | |
2942 | $('#mash_kg').jqxTooltip({ content: 'Het gewicht van alle mouten in de maisch.' }); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2943 | |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2944 | $('#est_color2').jqxNumberInput(Show0dec); |
610 | 2945 | $('#est_og2,#mash_kg').jqxNumberInput(Show3dec); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2946 | |
478 | 2947 | $('#perc_malts').jqxProgressBar({ |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2948 | width: 300, height: 23, theme: theme, showText: true, max: 120, animationDuration: 0, |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2949 | colorRanges: [{ stop: 90, color: '#008C00' },{ stop: 100, color: '#EB7331' },{ stop: 120, color: '#FF0000' }], |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2950 | renderText: function(text) { return (Math.round(parseInt(text) * 1.2)) + '%'; } |
478 | 2951 | }); |
2952 | $('#perc_sugars').jqxProgressBar({ | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2953 | width: 300, height: 23, theme: theme, showText: true, max: 50, animationDuration: 0, |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2954 | colorRanges: [{ stop: 20, color: '#008C00' },{ stop: 50, color: '#FF0000' }], |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2955 | renderText: function(text) { return (Math.round(parseInt(text) * 5) / 10) + '%'; } |
478 | 2956 | }); |
2957 | $('#perc_cara').jqxProgressBar({ | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2958 | width: 300, height: 23, theme: theme, showText: true, max: 50, animationDuration: 0, |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2959 | colorRanges: [{ stop: 25, color: '#008C00' },{ stop: 50, color: '#FF0000' }], |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2960 | renderText: function(text) { return (Math.round(parseInt(text) * 5) / 10) + '%'; } |
478 | 2961 | }); |
2962 | $('#ferm_lintner').jqxProgressBar({ | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2963 | width: 300, height: 23, theme: theme, showText: true, max: 200, animationDuration: 0, |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2964 | colorRanges: [{ stop: 30, color: '#FF0000' },{ stop: 40, color: '#EB7331' },{ stop: 200, color: '#008C00' }], |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2965 | renderText: function(text) { return (parseInt(text) * 2) + ' lintner'; } |
478 | 2966 | }); |
2967 | ||
2968 | // Tab 4, Hops | |
2969 | $('#est_ibu2').jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' }); | |
2970 | $('#est_ibu2').jqxNumberInput(Smal0dec); | |
2971 | $('#hop_flavour').jqxProgressBar({ | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2972 | width: 300, height: 23, theme: theme, showText: true, animationDuration: 0, |
478 | 2973 | colorRanges: [ |
2974 | { stop: 20, color: '#004D00' }, | |
2975 | { stop: 40, color: '#008C00' }, | |
2976 | { stop: 60, color: '#00BF00' }, | |
2977 | { stop: 80, color: '#00FF00' }, | |
2978 | { stop: 100, color: '#80FF80' } | |
2979 | ], | |
2980 | renderText: function(text) { | |
2981 | var val = parseInt(text); | |
2982 | if (val < 20) | |
2983 | return 'Weinig'; | |
2984 | else if (val < 40) | |
2985 | return 'Matig'; | |
2986 | else if (val < 60) | |
2987 | return 'Redelijk'; | |
2988 | else if (val < 80) | |
2989 | return 'Veel'; | |
2990 | else | |
2991 | return 'Zeer veel'; | |
2992 | } | |
2993 | }); | |
2994 | $('#hop_aroma').jqxProgressBar({ | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
2995 | width: 300, height: 23, theme: theme, showText: true, animationDuration: 0, |
478 | 2996 | colorRanges: [ |
2997 | { stop: 20, color: '#004D00' }, | |
2998 | { stop: 40, color: '#008C00' }, | |
2999 | { stop: 60, color: '#00BF00' }, | |
3000 | { stop: 80, color: '#00FF00' }, | |
3001 | { stop: 100, color: '#80FF80' } | |
3002 | ], | |
3003 | renderText: function(text) { | |
3004 | var val = parseInt(text); | |
3005 | if (val < 20) | |
3006 | return 'Weinig'; | |
3007 | else if (val < 40) | |
3008 | return 'Matig'; | |
3009 | else if (val < 60) | |
3010 | return 'Redelijk'; | |
3011 | else if (val < 80) | |
3012 | return 'Veel'; | |
3013 | else | |
3014 | return 'Zeer veel'; | |
3015 | } | |
3016 | }); | |
3017 | ||
3018 | // Tab 5, Miscs | |
3019 | ||
3020 | // Tab 6, Yeasts | |
3021 | $('#est_fg2').jqxTooltip({ content: 'Het verwachte eind SG. Dit wordt automatisch berekend.' }); | |
622
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
3022 | $('#est_abv2').jqxTooltip({ content: 'Verwacht alcohol volume %. Dit wordt automatisch berekend.' }); |
726
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
3023 | $('#yeast_grams').jqxTooltip({ content: 'De gewenste totale hoeveelheid droge gist voor dit bier.' }); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
3024 | $('#yeast_gr_hl').jqxTooltip({ content: 'De werkelijke hoeveelheid gist per hectoliter.' }); |
622
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
3025 | $('#yeast_cells').jqxTooltip({ content: 'Het aantal miljard beschikbare gistcellen zonder eventuele starter.' }); |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
3026 | $('#need_cells').jqxTooltip({ content: 'Het aantal miljard nodige cellen is afhankelijk van het begin SG, biertype en volume.' }); |
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
3027 | $('#plato_cells').jqxTooltip({ content: 'De berekende pitchrate in miljard cellen per ml per graad Plato.' }); |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
3028 | $('#yeast_prod_date').jqxTooltip({ content: 'Bij korrelgisten is meestal "best voor" datum op het zakje gedrukt.<br>Gebruik die datum maar dan twee jaar eerder als productie datum.<br>Bij White Labs is de productie datum vier maanden voor de "Best by" datum die geprint op het buisje.<br>Bij Wyeast is dit de "manufacture date" die op het pak geprint is.<br>Voor schuine buis, slurry, opkweek en gedroogd is dit de datum dat je de gist geoogst hebt.' }); |
697
367ae7ff52f0
Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents:
669
diff
changeset
|
3029 | $('#yeast_pitchrate').jqxTooltip({ content: 'De gewenste pitchrate in miljard cellen per ml per graad Plato voor de vergisting van dit bier.' }); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3030 | |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3031 | $('#est_fg2,#plato_cells').jqxNumberInput(Show3dec); |
697
367ae7ff52f0
Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents:
669
diff
changeset
|
3032 | $('#est_fg2').jqxNumberInput({ width: 70 }); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3033 | $('#est_abv2').jqxNumberInput(Show2dec); |
697
367ae7ff52f0
Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents:
669
diff
changeset
|
3034 | $('#est_abv2').jqxNumberInput({ width: 70, symbol: '%', symbolPosition: 'right' }); |
726
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
3035 | $('#yeast_grams').jqxNumberInput(Show1dec); |
872a3635e4ef
Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
723
diff
changeset
|
3036 | $('#yeast_gr_hl').jqxNumberInput(Show1dec); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3037 | $('#yeast_cells,#need_cells').jqxNumberInput(Show1dec); |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
3038 | $('#yeast_prod_date').jqxDateTimeInput(Dateopts); |
823 | 3039 | $('#yeast_prod_date').jqxDateTimeInput({ disabled: true }); |
3040 | $('#yeast_pitchrate').jqxNumberInput(Show3dec); | |
478 | 3041 | for (i = 1; i < 5; i++) { |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3042 | $('#prop' + i + '_volume').jqxTooltip({ content: 'Het volume van deze starter stap.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3043 | $('#prop' + i + '_irate').jqxTooltip({ content: 'Voor de beste gistgroei, houd de injectie factor tussen de 25 en 100 miljoen cellen per ml.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3044 | $('#prop' + i + '_ncells').jqxTooltip({ content: 'Het aantal miljard nieuwe gistcellen in deze stap.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3045 | $('#prop' + i + '_tcells').jqxTooltip({ content: 'Het totaal aantal miljard gistcellen na deze stap.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3046 | $('#prop' + i + '_growf').jqxTooltip({ content: 'De groeifactor, minstens 1. Ongeroerde starters komen meestal niet boven de 3.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3047 | |
823 | 3048 | $('#prop' + i + '_type').jqxInput({ theme: theme, width: 120, height: 23 }); |
3049 | $('#prop' + i + '_volume').jqxNumberInput(Show3dec); | |
610 | 3050 | $('#prop' + i + '_irate,#prop' + i + '_ncells,#prop' + i + '_tcells').jqxNumberInput(Show1dec); |
478 | 3051 | $('#prop' + i + '_growf').jqxNumberInput(Show2dec); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3052 | $('#prop' + i + '_type,#prop' + i + '_volume,#prop' + i + '_irate,#prop' + i + '_ncells,#prop' + i + '_tcells,#prop' + i + '_growf').hide(); |
478 | 3053 | } |
823 | 3054 | $('#starter_type').jqxInput({ theme: theme, width: 120, height: 23 }); |
518
00e110567fee
The default starter SG changed to 1.037. Added several tooltips on the yeast tab.
Michiel Broek <mbroek@mbse.eu>
parents:
515
diff
changeset
|
3055 | $('#starter_sg').jqxTooltip({ content: 'Het ideale starter SG moet tussen de 1.030 en 1.040 zijn. Optimaal is 1.037.' }); |
823 | 3056 | $('#starter_sg').jqxNumberInput(Show3dec); |
617
f962f1e5936e
Implemented yeast viability calculation from the yeast production date. Changed the pitchrate logic and added Ale above 1.076 rate of 1.25.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
3057 | $('#starter_viability').jqxTooltip({ content: 'De gist conditie.' }); |
622
39902353b159
Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents:
621
diff
changeset
|
3058 | $('#starter_viability').jqxNumberInput(Show0dec); |
478 | 3059 | |
3060 | // Tab 7, Mashing | |
3061 | $('#mash_name').jqxTooltip({ content: 'De omschrijving van dit maisch profiel.' }); | |
3062 | $('#mash_name').jqxInput({ theme: theme, width: 320, height: 23 }); | |
484
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
3063 | $('#est_mashvol').jqxTooltip({ content: 'Het totale volume van het maishwater en de mout in de maish pan.' }); |
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
3064 | $('#est_mashvol').jqxNumberInput(Show1dec); |
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
3065 | $('#est_mashtime').jqxTooltip({ content: 'De totale tijdsduur van het maischen.' }); |
2083c274b283
In the product editor mash tab, display the total mash volume and the total mash time.
Michiel Broek <mbroek@mbse.eu>
parents:
479
diff
changeset
|
3066 | $('#est_mashtime').jqxInput({ theme: theme, width: 70, height: 23 }); |
478 | 3067 | |
3068 | // Tab 8, Water | |
3069 | $('#tgt_bu').jqxNumberInput(Show2wat); | |
610 | 3070 | $('#tgt_so4_cl,#got_so4_cl').jqxNumberInput(Show1wat); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3071 | $('#preboil_ph').jqxNumberInput(Show2wat); |
478 | 3072 | |
3073 | // Water source 1 | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3074 | $('#w1_name').jqxInput({ theme: theme, width: 200, height: 23 }); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3075 | $('#w1_button').jqxRadioButton({ theme: theme, width: 50, height: 23, disabled: true }); |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
3076 | $('#w1_amount,#w1_calcium,#w1_magnesium,#w1_sodium,#w1_bicarbonate,#w1_total_alkalinity,#w1_chloride,#w1_sulfate').jqxNumberInput(Show1wat); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
3077 | $('#w1_ph').jqxNumberInput(Show2wat); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3078 | $('#w1_hardness').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3079 | $('#w1_ra').jqxNumberInput(Show1wat); |
478 | 3080 | // Water source 2 |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3081 | $('#w2_name').jqxInput({ theme: theme, width: 200, height: 23 }); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3082 | $('#w2_button').jqxRadioButton({ theme: theme, width: 50, height: 23, disabled: true }); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3083 | $('#w2_amount').jqxNumberInput(Show1wat); |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
3084 | $('#w2_calcium,#w2_magnesium,#w2_sodium,#w2_bicarbonate,#w2_total_alkalinity,#w2_chloride,#w2_sulfate').jqxNumberInput(Show1wat); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
3085 | $('#w2_ph').jqxNumberInput(Show2wat); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3086 | $('#w2_hardness').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3087 | $('#w2_ra').jqxNumberInput(Show1wat); |
478 | 3088 | // Water mixed |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3089 | $('#wg_button').jqxRadioButton({ theme: theme, width: 50, height: 23, disabled: true }); |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
3090 | $('#wg_amount,#wg_calcium,#wg_magnesium,#wg_sodium,#wg_bicarbonate,#wg_total_alkalinity,#wg_chloride,#wg_sulfate').jqxNumberInput(Show1wat); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
3091 | $('#wg_ph').jqxNumberInput(Show2wat); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3092 | $('#wg_hardness').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3093 | $('#wg_ra').jqxNumberInput(Show1wat); |
478 | 3094 | // Water treated |
3095 | $('#wb_calcium').jqxTooltip({ content: 'De ideale hoeveelheid Calcium is tussen 40 en 150.'}); | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3096 | $('#wb_calcium').jqxNumberInput(Show1wat); |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
3097 | $('#wb_magnesium').jqxTooltip({ content: 'De ideale hoeveelheid Magnesium is tussen 5 en 40.'}); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3098 | $('#wb_magnesium').jqxNumberInput(Show1wat); |
478 | 3099 | $('#wb_sodium').jqxTooltip({ content: 'De ideale hoeveelheid Natrium is lager dan 150.'}); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3100 | $('#wb_sodium').jqxNumberInput(Show1wat); |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
3101 | $('#wb_chloride').jqxTooltip({ content: 'De ideale hoeveelheid Chloride is tussen 50 en 150. Samen met Sulfaat minder dan 500.'}); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3102 | $('#wb_chloride').jqxNumberInput(Show1wat); |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
3103 | $('#wb_sulfate').jqxTooltip({ content: 'De ideale hoeveelheid Sulfaat is tussen 50 en 400. Samen met Chloride minder dan 500.'}); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3104 | $('#wb_sulfate').jqxNumberInput(Show1wat); |
764
e95744b6b31d
Added HCO3 to the water summary. Changed some water chemicals limits to new insights.
Michiel Broek <mbroek@mbse.eu>
parents:
760
diff
changeset
|
3105 | $('#wb_bicarbonate').jqxTooltip({ content: '0 tot 50 lichte bieren, 50 tot 150 amber bieren, 150 tot 250 donkere bieren.'}); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3106 | $('#wb_bicarbonate').jqxNumberInput(Show1wat); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
3107 | $('#wb_ph').jqxNumberInput(Show2wat); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3108 | $('#wb_hardness').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3109 | $('#wb_ra').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3110 | // Sparge water |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3111 | $('#sw_amount').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3112 | $('#sw_calcium').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3113 | $('#sw_magnesium').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3114 | $('#sw_sodium').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3115 | $('#sw_bicarbonate').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3116 | $('#sw_total_alkalinity').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3117 | $('#sw_chloride').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3118 | $('#sw_sulfate').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3119 | $('#sw_ph').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3120 | $('#sw_hardness').jqxNumberInput(Show1wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3121 | $('#sw_ra').jqxNumberInput(Show1wat); |
478 | 3122 | |
3123 | // Water agents | |
3124 | $('#wa_cacl2').jqxTooltip({ content: 'Voor het maken van een ander waterprofiel. Voegt calcium en chloride toe. Voor het verbeteren van zoetere bieren.' }); | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3125 | $('#wa_cacl2').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3126 | $('#ss_cacl2').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3127 | |
478 | 3128 | $('#wa_caso4').jqxTooltip({ |
3129 | content: 'Gips. Voor het maken van een ander waterprofiel. Voegt calcium en sulfaat toe. Voor het verbeteren van bittere bieren.' | |
3130 | }); | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3131 | $('#wa_caso4').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3132 | $('#ss_caso4').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3133 | |
478 | 3134 | $('#wa_mgso4').jqxTooltip({ content: 'Epsom zout. Voor het maken van een ander waterprofiel. Voegt magnesium en sulfaat toe. Gebruik spaarzaam!' }); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3135 | $('#wa_mgso4').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3136 | $('#ss_mgso4').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3137 | |
478 | 3138 | $('#wa_nacl').jqxTooltip({ |
3139 | content: 'Keukenzout. Voor het maken van een ander waterprofiel. Voegt natrium en chloride toe. ' + | |
3140 | 'Voor het accentueren van zoetheid. Bij hoge dosering wordt het bier ziltig.' | |
3141 | }); | |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3142 | $('#wa_nacl').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3143 | $('#ss_nacl').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3144 | |
759 | 3145 | $('#wa_mgcl2').jqxTooltip({ content: 'Magnesiumchloride'}); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3146 | $('#wa_mgcl2').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3147 | $('#ss_mgcl2').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3148 | |
758
e6814bed4cb1
Moved NaHCO3 and CaCO3 from the base additions to the water agent salts.
Michiel Broek <mbroek@mbse.eu>
parents:
757
diff
changeset
|
3149 | $('#wa_nahco3').jqxTooltip({ content: 'Baksoda'}); |
e6814bed4cb1
Moved NaHCO3 and CaCO3 from the base additions to the water agent salts.
Michiel Broek <mbroek@mbse.eu>
parents:
757
diff
changeset
|
3150 | $('#wa_caco3').jqxTooltip({ content: 'Kalk'}); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3151 | $('#wa_nahco3,#wa_caco3').jqxNumberInput(Show2wat); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3152 | |
478 | 3153 | $('#mash_ph').jqxTooltip({ content: 'Maisch pH tussen 5.2 en 5.6. Gebruik 5.2 voor lichte en 5.5 voor donkere bieren.'}); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3154 | $('#mash_ph').jqxNumberInput(Show2dec); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3155 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3156 | $('#calc_acid').jqxCheckBox({ theme: theme, width: 120, height: 23, disabled: true }); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3157 | |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3158 | $('#wa_acid_name').jqxInput({ theme: theme, width: 130, height: 23 }); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3159 | $('#wa_acid').jqxNumberInput(Show2dec); |
478 | 3160 | $('#wa_acid').jqxNumberInput({ symbol: ' ml', symbolPosition: 'right' }); |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3161 | $('#wa_acid_perc').jqxNumberInput(Show0dec); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3162 | $('#wa_acid_perc').jqxNumberInput({ symbol: '%', symbolPosition: 'right' }); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3163 | |
478 | 3164 | // Sparge water |
825
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3165 | $('#sparge_ph').jqxNumberInput(Show2dec); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3166 | $('#sparge_acid_amount').jqxNumberInput(Show2dec); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3167 | $('#sparge_acid_amount').jqxNumberInput({ symbol: ' ml', symbolPosition: 'right' }); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3168 | $('#sparge_acid_type').jqxInput({ theme: theme, width: 130, height: 23 }); |
8b87ad5bd3c3
Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
824
diff
changeset
|
3169 | $('#sparge_acid_perc').jqxNumberInput(Show0dec); |
478 | 3170 | $('#sparge_acid_perc').jqxNumberInput({ symbol: '%', symbolPosition: 'right' }); |
3171 | ||
3172 | // Tab 9, Brewday | |
3173 | $('#brew_date_start').jqxTooltip({ content: 'Brouw datum en tijd. Voor planning laat de tijd op 00:00:00 staan.' }); | |
3174 | $('#brew_date_end').jqxTooltip({ content: 'End datum en tijd van de brouw. Leeg laten als er nog niet gebrouwen is.' }); | |
3175 | $('#brew_mash_ph').jqxTooltip({ content: 'De gemeten pH tijdens het maischen eventueel na correctie.' }); | |
3176 | $('#est_mash_ph').jqxTooltip({ content: 'De gewenste pH tijdens het maischen.' }); | |
3177 | $('#brew_preboil_ph').jqxTooltip({ content: 'De gemeten pH in de kookketel na het spoelen en voor de kook.' }); | |
3178 | $('#brew_aboil_ph').jqxTooltip({ content: 'De gemeten pH na het koken.' }); | |
3179 | $('#brew_mash_sg').jqxTooltip({ content: 'Het bereikte SG na het maischen.' }); | |
3180 | $('#est_mash_sg').jqxTooltip({ content: 'Het berekende verwachte SG na het maischen.' }); | |
3181 | $('#brew_preboil_sg').jqxTooltip({ content: 'Het gemeten SG in de kookketel na het spoelen en voor het koken.' }); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3182 | $('#est_pre_sg').jqxTooltip({ content: 'Het berekende SG in de kookketel na het spoelen en voor het koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3183 | $('#brew_aboil_sg').jqxTooltip({ content: 'Het gemeten SG in de kookketel na het koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3184 | $('#est_og3').jqxTooltip({ content: 'Het gewenste SG in de kookketel na het koken zonder eventuele suikers die tijdens de vergisting toegevoegd worden.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3185 | $('#brew_mash_efficiency').jqxTooltip({ content: 'Het behaalde maisch rendement.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3186 | $('#brew_preboil_volume').jqxTooltip({ content: 'Het gemeten volume van het wort voor het koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3187 | $('#est_pre_vol').jqxTooltip({ content: 'Het berekende volume van het wort voor het koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3188 | $('#brew_aboil_volume').jqxTooltip({ content: 'Het gemeten volume van het wort na het koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3189 | $('#est_a_vol').jqxTooltip({ content: 'Het gewenste volume na het koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3190 | $('#brew_preboil_efficiency').jqxTooltip({ content: 'Het berekende rendement voor het koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3191 | $('#brew_aboil_efficiency').jqxTooltip({ content: 'Het bereikte rendement na het koken.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3192 | $('#brew_sparge_temperature').jqxTooltip({ content: 'De spoelwater temperatuur, in te stellen in de Water tab.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3193 | $('#brew_sparge_volume').jqxTooltip({ content: 'Het spoelwater voorraad volume, in te stellen in de Water tab.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3194 | $('#brew_date_start,#brew_date_end').jqxDateTimeInput(DateTimeopts); |
826
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
3195 | $('#brew_date_start,#brew_date_end').jqxDateTimeInput({ disabled: true }); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
660
diff
changeset
|
3196 | $('#est_mash_ph').jqxNumberInput(Show2wat); |
826
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
3197 | $('#brew_mash_ph,#brew_preboil_ph,#brew_aboil_ph').jqxNumberInput(Show2dec); |
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
3198 | $('#brew_mash_sg,#brew_preboil_sg,#brew_aboil_sg').jqxNumberInput(Show3dec); |
610 | 3199 | $('#est_mash_sg,#est_pre_sg,#est_og3').jqxNumberInput(Show3wat); |
478 | 3200 | $('#brew_mash_efficiency').jqxNumberInput(Show1dec); |
826
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
3201 | $('#brew_preboil_volume,#brew_aboil_volume').jqxNumberInput(Show1dec); |
610 | 3202 | $('#est_pre_vol,#est_a_vol').jqxNumberInput(Show1wat); |
3203 | $('#brew_preboil_efficiency,#brew_aboil_efficiency,#brew_sparge_temperature,#brew_sparge_volume,#brew_sparge_est').jqxNumberInput(Show1dec); | |
826
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
3204 | $('#brew_cooling_to').jqxNumberInput(Show1dec); |
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
3205 | $('#brew_sparge_ph').jqxNumberInput(Show2dec); |
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
3206 | $('#brew_cooling_method').jqxInput({ theme: theme, width: 180, height: 23 }); |
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
3207 | $('#brew_cooling_time,#brew_whirlpool9,#brew_whirlpool7,#brew_whirlpool6,#brew_whirlpool2,#brew_aeration_time,#brew_aeration_speed').jqxNumberInput(Show0dec); |
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
3208 | $('#brew_aeration_type').jqxInput({ theme: theme, width: 180, height: 23 }); |
478 | 3209 | $('#brew_fermenter_volume').jqxNumberInput(Show1dec); |
3210 | $('#brew_fermenter_sg').jqxNumberInput(Show3dec); | |
826
4e681bc073bd
The brewday tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
825
diff
changeset
|
3211 | $('#brew_fermenter_extrawater,#brew_fermenter_tcloss').jqxNumberInput(Show1dec); |
610 | 3212 | $('#brew_fermenter_ibu,#brew_fermenter_color').jqxNumberInput(Show0dec); |
478 | 3213 | |
3214 | // Tab 10, Fermentation | |
3215 | $('#brew_fermenter_sg2').jqxTooltip({ content: 'Het behaalde SG in het gistvat, overgenomen van de brouwdag.' }); | |
3216 | $('#primary_start_temp').jqxTooltip({ content: 'De begintemperatuur van de hoofdvergisting.' }); | |
3217 | $('#primary_max_temp').jqxTooltip({ content: 'De hoogst bereikte piek temperatuur tijdens de hoofgvergisting.' }); | |
3218 | $('#primary_end_temp').jqxTooltip({ content: 'De eind temperatuur van de hoofdvergisting.' }); | |
3219 | $('#primary_end_sg').jqxTooltip({ content: 'Het gemeten SG aan het eind van de hoofdvergisting.' }); | |
3220 | $('#primary_svg').jqxTooltip({ content: 'De schijnbare vergisting graad behaald na de hoofdgisting.' }); | |
3221 | $('#primary_end_date').jqxTooltip({ content: 'De eind datum van de hoofdvergisting en eventueel overhevelen.' }); | |
3222 | $('#secondary_end_sg').jqxTooltip({ content: 'Het gemeten SG aan het eind van de navergisting.' }); | |
3223 | $('#secondary_svg').jqxTooltip({ content: 'De schijnbare vergisting graad behaald na de nagisting.' }); | |
3224 | $('#secondary_end_date').jqxTooltip({ content: 'De eind datum van de navergisting en het begin van het lageren.' }); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3225 | $('#est_fg3').jqxTooltip({ content: 'Het verwachte eind SG. Dit wordt automatisch berekend.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3226 | |
828
aa0a9b1a2dd7
The fermentation tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
827
diff
changeset
|
3227 | $('#primary_end_sg,#secondary_end_sg').jqxNumberInput(Show3dec); |
610 | 3228 | $('#primary_end_date,#secondary_end_date').jqxDateTimeInput(Dateopts); |
828
aa0a9b1a2dd7
The fermentation tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
827
diff
changeset
|
3229 | $('#primary_end_date,#secondary_end_date').jqxDateTimeInput({ disabled: true }); |
aa0a9b1a2dd7
The fermentation tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
827
diff
changeset
|
3230 | $('#primary_start_temp,#primary_max_temp,#primary_end_temp,#secondary_temp,#tertiary_temp').jqxNumberInput(Show1dec); |
aa0a9b1a2dd7
The fermentation tab is now a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
827
diff
changeset
|
3231 | $('#fg').jqxNumberInput(Show3dec); |
610 | 3232 | $('#brew_fermenter_sg2,#est_fg3').jqxNumberInput(Show3dec); |
478 | 3233 | $('#final_abv').jqxNumberInput(Show2dec); |
610 | 3234 | $('#primary_svg,#secondary_svg,#final_svg').jqxNumberInput(Show1dec); |
478 | 3235 | $('#FLog').jqxButton({ template: 'info', width: '150px', theme: theme }); |
3236 | $('#FLog').click(function() { | |
3237 | // Open log in a new tab. | |
3238 | window.open('log_fermentation.php?code=' + dataRecord.code + '&name=' + dataRecord.name); | |
3239 | }); | |
602
10b61aacb1c1
New products field log_ispindel. Add check for ispindel log to crontasks.php Added log_ispindel to prod_edit, pprod_divide, prod_new and prod_duplicate. Renamed some log_fermentation vergisting names into klimaatkast.
Michiel Broek <mbroek@mbse.eu>
parents:
586
diff
changeset
|
3240 | $('#ILog').jqxButton({ template: 'info', width: '150px', theme: theme }); |
10b61aacb1c1
New products field log_ispindel. Add check for ispindel log to crontasks.php Added log_ispindel to prod_edit, pprod_divide, prod_new and prod_duplicate. Renamed some log_fermentation vergisting names into klimaatkast.
Michiel Broek <mbroek@mbse.eu>
parents:
586
diff
changeset
|
3241 | $('#ILog').click(function() { |
10b61aacb1c1
New products field log_ispindel. Add check for ispindel log to crontasks.php Added log_ispindel to prod_edit, pprod_divide, prod_new and prod_duplicate. Renamed some log_fermentation vergisting names into klimaatkast.
Michiel Broek <mbroek@mbse.eu>
parents:
586
diff
changeset
|
3242 | // Open log in a new tab. |
10b61aacb1c1
New products field log_ispindel. Add check for ispindel log to crontasks.php Added log_ispindel to prod_edit, pprod_divide, prod_new and prod_duplicate. Renamed some log_fermentation vergisting names into klimaatkast.
Michiel Broek <mbroek@mbse.eu>
parents:
586
diff
changeset
|
3243 | window.open('log_ispindel.php?code=' + dataRecord.code + '&name=' + dataRecord.name); |
10b61aacb1c1
New products field log_ispindel. Add check for ispindel log to crontasks.php Added log_ispindel to prod_edit, pprod_divide, prod_new and prod_duplicate. Renamed some log_fermentation vergisting names into klimaatkast.
Michiel Broek <mbroek@mbse.eu>
parents:
586
diff
changeset
|
3244 | }); |
478 | 3245 | |
3246 | // Tab 11, Packaging | |
3247 | // TODO: high gravity packaging, extra water and recalc abv, color and ibu. | |
3248 | $('#package_date').jqxTooltip({ content: 'De verpakkings datum van dit bier.' }); | |
3249 | $('#package_volume').jqxTooltip({ content: 'Het beschikbare volume om te bottelen of op fust te zetten.' }); | |
3250 | $('#package_infuse_amount').jqxTooltip({ content: 'De hoeveelheid water of drank extra toe te voegen.' }); | |
3251 | $('#package_infuse_abv').jqxTooltip({ content: 'De hoeveelheid alcohol in de drank, of 0.0 als het water is.' }); | |
3252 | $('#package_infuse_notes').jqxTooltip({ content: 'Omschrijving van de extra toevoeging.' }); | |
3253 | $('#package_abv').jqxTooltip({ content: 'De uiteindelijke hoeveelheid alcohol volume %.' }); | |
3254 | $('#package_ph').jqxTooltip({ content: 'De gemeten pH vlak voor het verpakken.' }); | |
3255 | $('#st_carb_min2').jqxTooltip({ content: 'Het minimum aanbevolen koolzuur volume voor deze bierstijl.'}); | |
3256 | $('#st_carb_max2').jqxTooltip({ content: 'Het maximum aamnevolen koolzuur volume voor deze bierstijl.'}); | |
3257 | $('#bottle_amount').jqxTooltip({ content: 'De totale hoeveelheid te bottelen bier.' }); | |
3258 | $('#keg_amount').jqxTooltip({ content: 'De totale hoeveelheid op fust te zetten bier.' }); | |
3259 | $('#bottle_carbonation').jqxTooltip({ content: 'Het gewenste CO2 volume in de flessen.' }); | |
3260 | $('#keg_carbonation').jqxTooltip({ content: 'Het gewenste CO2 volume door de suiker in de fusten.' }); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3261 | $('#bottle_priming_water,#keg_priming_water').jqxTooltip({ content: 'De hoeveelheid water om de suiker op te lossen.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3262 | $('#bottle_pressure').jqxTooltip({ content: 'De maximaal te verwachten druk tijdens het hergisten.' }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3263 | $('#package_date').jqxDateTimeInput(Dateopts); |
829 | 3264 | $('#package_date').jqxDateTimeInput({ disabled: true }); |
3265 | $('#package_infuse_amount').jqxNumberInput(Show3dec); | |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3266 | $('#package_infuse_notes').jqxInput({ theme: theme, width: 640, height: 23 }); |
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3267 | $('#package_abv').jqxNumberInput(Show2dec); |
829 | 3268 | $('#package_ph').jqxNumberInput(Show2dec); |
633
ec4601ab3ed2
Fixed loading of the product edit page. A bit faster loading.
Michiel Broek <mbroek@mbse.eu>
parents:
623
diff
changeset
|
3269 | $('#st_carb_min2,#st_carb_max2').jqxNumberInput(Smal1dec); |
829 | 3270 | $('#package_volume,#package_infuse_abv,#bottle_amount,#keg_amount').jqxNumberInput(Show1dec); |
3271 | $('#bottle_carbonation,#keg_carbonation').jqxNumberInput(Show2dec); | |
3272 | $('#bottle_priming_sugar').jqxInput({ theme: theme, width: 200, height: 23 }); | |
3273 | $('#keg_priming_sugar').jqxInput({ theme: theme, width: 200, height: 23 }); | |
3274 | $('#bottle_priming_water,#keg_priming_water').jqxNumberInput(Show3dec); | |
3275 | $('#keg_forced_carb').jqxCheckBox({ theme: theme, width: 120, height: 23, disabled: true }); | |
610 | 3276 | $('#bottle_priming_amount,#keg_priming_amount,#bottle_priming_total,#bottle_pressure,#keg_priming_total,#keg_pressure').jqxNumberInput(Show1dec); |
3277 | $('#bottle_abv,#keg_abv').jqxNumberInput(Show2dec); | |
829 | 3278 | $('#bottle_carbonation_temp,#keg_carbonation_temp').jqxNumberInput(Show1dec); |
615
9034e65b0d7a
Added CO2 carbonation log to the products database. Added button in the packaging tab.
Michiel Broek <mbroek@mbse.eu>
parents:
613
diff
changeset
|
3279 | $('#CLog').jqxButton({ template: 'info', width: '150px', theme: theme }); |
9034e65b0d7a
Added CO2 carbonation log to the products database. Added button in the packaging tab.
Michiel Broek <mbroek@mbse.eu>
parents:
613
diff
changeset
|
3280 | $('#CLog').click(function() { |
9034e65b0d7a
Added CO2 carbonation log to the products database. Added button in the packaging tab.
Michiel Broek <mbroek@mbse.eu>
parents:
613
diff
changeset
|
3281 | // Open log in a new tab. |
9034e65b0d7a
Added CO2 carbonation log to the products database. Added button in the packaging tab.
Michiel Broek <mbroek@mbse.eu>
parents:
613
diff
changeset
|
3282 | window.open('log_co2pressure.php?code=' + dataRecord.code + '&name=' + dataRecord.name); |
9034e65b0d7a
Added CO2 carbonation log to the products database. Added button in the packaging tab.
Michiel Broek <mbroek@mbse.eu>
parents:
613
diff
changeset
|
3283 | }); |
478 | 3284 | |
3285 | // Tab 12, Tasting | |
3286 | $('#taste_date').jqxTooltip({ content: 'De proef datum van dit bier.' }); | |
3287 | $('#taste_date').jqxDateTimeInput(Dateopts); | |
830
8f3936eef739
The taste tab is now a viwer.
Michiel Broek <mbroek@mbse.eu>
parents:
829
diff
changeset
|
3288 | $('#taste_date').jqxDateTimeInput({ disabled: true }); |
478 | 3289 | $('#taste_rate').jqxTooltip({ content: 'Het cijfer voor dit bier van 1 tot 10.' }); |
830
8f3936eef739
The taste tab is now a viwer.
Michiel Broek <mbroek@mbse.eu>
parents:
829
diff
changeset
|
3290 | $('#taste_rate').jqxNumberInput(Show1dec); |
478 | 3291 | $('#taste_color').jqxTooltip({ content: 'De kleur van het bier.' }); |
3292 | $('#taste_transparency').jqxTooltip({ content: 'De helderheid van het bier.' }); | |
3293 | $('#taste_head').jqxTooltip({ content: 'Het schuim op het bier.' }); | |
610 | 3294 | $('#taste_color,#taste_transparency,#taste_head').jqxInput({ theme: theme, width: 320, height: 23 }); |
478 | 3295 | $('#taste_aroma').jqxTooltip({ content: 'Het aroma van het bier.' }); |
3296 | $('#taste_taste').jqxTooltip({ content: 'De smaak van het bier.' }); | |
3297 | $('#taste_aftertaste').jqxTooltip({ content: 'De nasmaak van het bier.' }); | |
3298 | $('#taste_mouthfeel').jqxTooltip({ content: 'Het mondgevoelvan het bier.' }); | |
610 | 3299 | $('#taste_aroma,#taste_taste,#taste_aftertaste,#taste_mouthfeel').jqxInput({ theme: theme, width: 960, height: 23 }); |
478 | 3300 | $('#taste_notes').jqxTooltip({ content: 'Het oordeel en opmerkingen over dit bier.' }); |
3301 | $('#taste_notes').jqxInput({ theme: theme, width: 960, height: 100 }); | |
3302 | ||
3303 | $('#jqxTabs').jqxTabs({ | |
3304 | theme: theme, | |
3305 | width: 1280, | |
3306 | height: 660, | |
3307 | autoHeight: false, | |
3308 | position: 'top' | |
3309 | }); | |
3310 | ||
3311 | // Buttons below | |
818
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
3312 | $('#Terug').jqxButton({ template: 'primary', width: '80px', theme: theme }); |
f9c071906643
Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents:
817
diff
changeset
|
3313 | $('#Terug').bind('click', function() { |
478 | 3314 | window.location.href = my_return; |
3315 | }); | |
111
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3316 | }); |
8c4ba91adf58
Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3317 |