www/js/prod_edit.js

Sat, 05 Jan 2019 17:10:39 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 05 Jan 2019 17:10:39 +0100
changeset 172
684c651dd165
parent 171
48cf3ea270f8
child 177
325bd6425978
permissions
-rw-r--r--

Added fermentation graph screen

111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
2 * Copyright (C) 2018-2019
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
112
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
24 function createDelElements() {
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
25
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
26 $('#eventWindow').jqxWindow({
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
27 theme: theme,
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
28 position: { x: 490, y: 210 },
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
29 width: 300,
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
30 height: 175,
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
31 resizable: false,
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
32 isModal: true,
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
33 modalOpacity: 0.4,
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
34 okButton: $('#delOk'),
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
35 cancelButton: $('#delCancel'),
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
36 initContent: function () {
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
37 $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme });
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
38 $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme });
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
39 $('#delCancel').focus();
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
40 }
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
41 });
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
42 $('#eventWindow').jqxWindow('hide');
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
43 }
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
44
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
45
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
46
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 $(document).ready(function () {
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
49 var brewstage = 0; // Numeric value of stage
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
50 var preboil_sg = 0;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
51 var est_mash_sg = 0;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
52 var sugarsm = 0; // Sugars after mash
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
53 var sugarsf = 0; // Sugars after boil
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
54 var psugar = 0; // Percentage real sugars
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
55 var pcara = 0; // Percentage cara/crystal malts
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
56 var svg = 77; // Default attenuation
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
57 var mashkg = 0; // Malt in mash weight
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
58 var hop_flavour = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
59 var hop_aroma = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
60 var mash_infuse = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
61 var last_base = '';
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
62 var last_acid = '';
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
63
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
64 var MMCa = 40.048;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
65 var MMMg = 24.305;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
66 var MMNa = 22.98976928;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
67 var MMCl = 35.453;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
68 var MMSO4 = 96.0626;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
69 var MMCO3 = 60.01684;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
70 var MMHCO3 = 61.01684;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
71 var MMCaSO4 = 172.171;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
72 var MMCaCl2 = 147.015;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
73 var MMCaCO3 = 100.087;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
74 var MMMgSO4 = 246.475;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
75 var MMNaHCO3 = 84.007;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
76 var MMNa2CO3 = 105.996;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
77 var MMNaCl = 58.443;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
78 var MMCaOH2 = 74.06268;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
79
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 console.log("record:" + my_record + " return:" + my_return + " theme:" + theme);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
81 $("#jqxLoader").jqxLoader({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
82 width: 250,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
83 height: 150,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
84 isModal: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
85 text: "Laden product ...",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
86 theme: theme
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
87 });
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
89 function calcFermentables() {
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
90 console.log("calcFermentables()");
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
91 sugarsf = 0;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
92 sugarsm = 0;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
93 psugar = 0;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
94 pcara = 0;
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
95 mashkg = 0;
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
96 var colorw = 0; // Colors working
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
97 var my_100 = false;
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
98
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
99 var rows = $('#fermentableGrid').jqxGrid('getrows');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
100 for (var i = 0; i < rows.length; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
101 var row = rows[i];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
102 if (row.f_adjust_to_total_100)
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
103 my_100 = true;
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
104 if (row.f_type == "Sugar")
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
105 psugar += row.f_percentage;
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
106 if (row.f_graintype == "Crystal")
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
107 pcara += row.f_percentage;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
108 var d = row.f_amount * (row.f_yield / 100) * (1 - row.f_moisture / 100);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
109 if (row.f_added == "Mash") {
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
110 d = parseFloat(dataRecord.efficiency) / 100 * d;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
111 sugarsm += d;
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
112 mashkg += row.f_amount;
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
113 }
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
114 sugarsf += d;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
115 colorw += row.f_amount * ebc_to_srm(row.f_color) / parseFloat(dataRecord.batch_size) * 8.34436;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
116 }
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
117 to_100 = my_100;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
118 var est_og = estimate_sg(sugarsf, parseFloat(dataRecord.batch_size));
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
119 $('#est_og').val(est_og);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
120 $('#est_og2').val(est_og);
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
121 $('#est_og3').val(est_og);
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
122 preboil_sg = estimate_sg(sugarsm, parseFloat(dataRecord.boil_size));
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
123 var color = kw_to_ebc(dataRecord.color_method, colorw);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
124 $('#est_color').val(color);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
125 $('#est_color2').val(color);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
126 var scolor = ebc_to_color(color);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
127 document.getElementById("bcolor").style.background= scolor;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
128 document.getElementById("bcolor2").style.background= scolor;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
129 pmalts = mashkg / dataRecord.eq_mash_max * 100;
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
130 console.log("mash kg: "+mashkg+" max: "+dataRecord.eq_mash_max+" perc: "+pmalts);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
131 $("#perc_malts").jqxProgressBar('val', pmalts);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
132 $("#perc_sugars").jqxProgressBar('val', psugar);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
133 $("#perc_cara").jqxProgressBar('val', pcara);
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
134 };
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
135
133
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
136 function calcFermentablesFromOG(OG) {
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
137
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
138 console.log("calcFermentablesFromOG("+OG+")");
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
139 var i, j, sug, d, tot, totmass;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
140 var vol, vol1, vol2, sug2;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
141 var mass1, mass2, efficiency;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
142
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
143 for (j = 1; j < 15; j++) {
133
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
144 vol = 0;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
145 sug2 = 0;
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
146 efficiency = parseFloat(dataRecord.efficiency);
133
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
147 var rows = $('#fermentableGrid').jqxGrid('getrows');
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
148 for (i = 0; i < rows.length; i++) {
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
149 var row = rows[i];
133
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
150 if ((row.f_added == "Fermentation") || (row.f_added == "Lagering") || (row.f_added == "Bottle")) {
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
151 var x = (row.f_yield / 100) * (1 - row.f_moisture / 100);
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
152 vol += row.f_amount / (x * sugardensity + (1 - x) * 1);
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
153 sug2 += row.f_amount * x;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
154 }
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
155 }
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
156 sug = sg_to_plato(OG) * OG / 100; // kg/l
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
157 vol1 = dataRecord.batch_size - dataRecord.eq_trub_chiller_loss;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
158 vol2 = vol1 + dataRecord.eq_top_up_water + vol;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
159 sug = sug * vol2; // kg in het gistvat
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
160 sug = sug - sug2; // kg voor toevoeging in gistvat
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
161 if (vol1 > 0)
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
162 sug = sug * dataRecord.batch_size / vol1; //kg in kookketel
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
163 sug = sug + sug2;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
164 // sug = sg_to_plato(OG) * parseFloat($("#batch_size").jqxNumberInput('decimal')) * OG / 100; //total amount of sugars in kg
133
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
165
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
166 tot = 0;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
167 d = 0;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
168 for (i = 0; i < rows.length; i++) {
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
169 var row = rows[i];
133
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
170 d = row.f_percentage / 100 * (row.f_yield / 100) * (1 - row.f_moisture / 100);
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
171 if (row.f_added == "Mash")
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
172 d = efficiency / 100 * d;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
173 tot += d;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
174 }
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
175 if (tot)
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
176 totmass = sug / tot;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
177 else
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
178 totmass = 0;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
179
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
180 if (totmass) {
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
181 console.log("pass:"+j+" totmass:"+totmass);
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
182 for (i = 0; i < rows.length; i++) {
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
183 var row = rows[i];
133
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
184 row.f_amount = row.f_percentage / 100 * totmass;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
185 $("#fermentableGrid").jqxGrid('setcellvalue', i, "f_amount", row.f_percentage / 100 * totmass);
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
186 }
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
187 }
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
188 };
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
189 //CalcWaterBalance;
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
190 };
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 123
diff changeset
191
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
192 function calcABV() {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
193 $("#est_abv").val(abvol(parseFloat($("#est_og").jqxNumberInput('decimal')), parseFloat($("#est_fg").jqxNumberInput('decimal'))));
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
194 };
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
195
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
196 function hopFlavourContribution(bt, vol, use, amount) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
197 var result;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
198
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
199 if ((use == "First Wort") || (use == "First wort")) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
200 result = 0.15; // assume 15% flavourcontribution for fwh
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
201 } else if (bt > 50) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
202 result = 0.10; // assume 10% flavourcontribution as a minimum
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
203 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
204 result = 15.25 / (6 * Math.sqrt(2 * Math.PI)) * Math.exp(-0.5 * Math.pow((bt - 21) /6, 2));
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
205 if (result < 0.10)
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
206 result = 0.10; // assume 10% flavourcontribution as a minimum
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
207 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
208 result = (result * amount * 1000) / vol;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
209 // console.log("hopFlavourContribution("+bt+","+vol+","+use+","+amount+"): "+result);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
210 return result;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
211 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
212
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
213 function hopAromaContribution(bt, vol, use, amount) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
214 var result = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
215
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
216 if (bt > 20) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
217 result = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
218 } else if (bt > 7.5) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
219 result = 10.03 / (4 * Math.sqrt(2 * Math.PI)) * Math.exp(-0.5 * Math.pow((bt - 7.5) /4, 2));
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
220 } else if (use == "Boil") {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
221 result = 1;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
222 } else if (use == "Aroma") {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
223 result = 1.2;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
224 } else if (use == "Whirlpool") {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
225 result = 1.2;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
226 } else if ((use == "Dry Hop") || (use == "Dry hop")) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
227 result = 1.33;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
228 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
229 result = (result * amount * 1000) / vol;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
230 // console.log("hopAromaContribution("+bt+","+vol+","+use+","+amount+"): "+result);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
231 return result;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
232 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
233
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
234 function calcIBUs() {
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
235 var total_ibus = 0;
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
236 hop_aroma = hop_flavour = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
237 var rows = $('#hopGrid').jqxGrid('getrows');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
238 for (var i = 0; i < rows.length; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
239 var row = rows[i];
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
240 total_ibus += toIBU(row.h_useat, row.h_form, preboil_sg, parseFloat(dataRecord.batch_size),
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
241 parseFloat(row.h_amount), parseFloat(row.h_time), parseFloat(row.h_alpha), dataRecord.ibu_method);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
242 hop_flavour += hopFlavourContribution(parseFloat(row.h_time), parseFloat(dataRecord.batch_size),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
243 row.h_useat, parseFloat(row.h_amount));
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
244 hop_aroma += hopAromaContribution(parseFloat(row.h_time), parseFloat(dataRecord.batch_size),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
245 row.h_useat, parseFloat(row.h_amount));
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
246 }
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
247 total_ibus = Math.round(total_ibus);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
248 console.log("calcIBUs(): " + total_ibus + " flavour: " + hop_flavour + " aroma: " + hop_aroma);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
249 dataRecord.est_ibu = total_ibus;
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
250 $('#est_ibu').val(total_ibus);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
251 $('#est_ibu2').val(total_ibus);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
252 $("#hop_flavour").jqxProgressBar('val', hop_flavour * 10);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
253 $("#hop_aroma").jqxProgressBar('val', hop_aroma * 10);
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
254 };
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
255
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
256 function calcSVG() {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
257 var rows = $('#yeastGrid').jqxGrid('getrows');
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
258 for (var i = 0; i < rows.length; i++) {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
259 var row = rows[i];
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
260 if (row.y_use == "Primary")
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
261 svg = parseFloat(row.y_attenuation);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
262 }
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
263 }
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
264
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
265 function calcSGendMash() {
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
266 est_mash_sg = 0;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
267 var mvol = 0; // Mash volume
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
268 var s = 0;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
269 var gs = 0; // Grain absorbtion
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
270 var rows = $('#mashGrid').jqxGrid('getrows');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
271 for (var i = 0; i < rows.length; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
272 var row = rows[i];
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
273 // console.log("step " + i + " " + row.step_name + " " + row.step_type);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
274 if (row.step_type == 'Infusion')
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
275 mvol += parseFloat(row.step_infuse_amount);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
276 }
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
277 if (mvol > 0) {
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
278 // console.log("mash volume: " + mvol);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
279 var rows = $('#fermentableGrid').jqxGrid('getrows');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
280 for (var i = 0; i < rows.length; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
281 var row = rows[i];
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
282 if (row.f_added == "Mash") {
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
283 var d = row.f_amount * (row.f_yield / 100) * (1 - row.f_moisture / 100);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
284 mvol += row.f_amount * row.f_moisture / 100;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
285 gs += my_grain_absorbtion * row.f_amount;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
286 s += d;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
287 }
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
288 }
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
289 // console.log("mash volume: " + mvol + " gs: " + gs + " s: " + s);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
290 var v = s / sugardensity + mvol;
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
291 s = 1000 * s / (v * 10); //deg. Plato
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
292 est_mash_sg = plato_to_sg(s);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
293 }
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
294 console.log("calcSGendMash(): " + est_mash_sg);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
295 $('#est_mash_sg').val(est_mash_sg);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
296 };
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
297
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
298 function calcMashEfficiency() {
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
299 // console.log("calcMashEfficiency()");
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
300 var c = sg_to_plato(est_mash_sg);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
301 var m = sg_to_plato(parseFloat($("#brew_mash_sg").jqxNumberInput('decimal')));
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
302 // console.log("c "+ c + " m " + m + " in " + parseFloat($("#brew_mash_sg").jqxNumberInput('decimal')));
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
303 if (c > 0.5)
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
304 $("#brew_mash_efficiency").val(100 * m / c);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
305 else
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
306 $("#brew_mash_efficiency").val(0);
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
307 };
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
308
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
309 function GetBUGU() {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
310 var gu = (dataRecord.est_og - 1) * 1000;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
311 if (gu > 0)
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
312 return dataRecord.est_ibu / gu;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
313 else
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
314 return 0.5;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
315 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
316
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
317 function GetOptClSO4ratio() {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
318 var BUGU = GetBUGU();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
319 return (-1.2 * BUGU + 1.4);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
320 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
321
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
322 function setWaterAgent(name, amount) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
323 console.log("setWaterAgent(" + name + ", " + amount + ")");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
324 var rows = $('#miscGrid').jqxGrid('getrows');
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
325 if (amount == 0) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
326 for (var i = 0; i < rows.length; i++) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
327 var row = rows[i];
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
328 if (row.m_name == name) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
329 var id = $("#miscGrid").jqxGrid('getrowid', i);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
330 var commit = $("#miscGrid").jqxGrid('deleterow', id);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
331 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
332 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
333 } else {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
334 var found = false;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
335 for (var i = 0; i < rows.length; i++) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
336 var row = rows[i];
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
337 if (row.m_name == name) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
338 found = true;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
339 $("#miscGrid").jqxGrid('setcellvalue', i, 'm_weight', amount);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
340 $("#miscGrid").jqxGrid('setcellvalue', i, 'm_amount', amount / 1000);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
341 break;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
342 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
343 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
344 if (! found) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
345 var miscs = new $.jqx.dataAdapter(miscInvSource, {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
346 loadComplete: function () {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
347 var records = miscs.records;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
348 for (var i = 0; i < records.length; i++) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
349 var record = records[i];
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
350 if (record.name == name) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
351 var row = {};
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
352 row["m_name"] = record.name;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
353 row["m_amount"] = amount / 1000;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
354 row["m_cost"] = record.cost;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
355 row["m_type"] = record.type;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
356 row["m_use_use"] = record.use_use;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
357 row["m_time"] = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
358 row["m_weight"] = amount;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
359 row["m_amount_is_weight"] = record.amount_is_weight;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
360 var commit = $("#miscGrid").jqxGrid('addrow', null, row);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
361 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
362 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
363 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
364 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
365 miscs.dataBind();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
366 return;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
367 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
368 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
369 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
370
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
371 function setRangeIndicator(ion, rangeCode) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
372 $("#wr_" + ion).html("<img src='images/checkmark_range_" + rangeCode + ".gif'><span style='font-size: 10px; font-style: italic;'>" + rangeCode + "</span>");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
373 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
374
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
375 function mix(v1, v2, c1, c2) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
376 if ((v1 + v2) > 0) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
377 return ((v1 * c1) + (v2 * c2)) / (v1 + v2);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
378 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
379 return 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
380 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
381
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
382 // mg/l as CaCO3
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
383 function ResidualAlkalinity(total_alkalinity, calcium, magnesium) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
384 return total_alkalinity - (calcium / 1.4 + magnesium / 1.7);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
385 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
386
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
387 var Ka1 = 0.0000004445;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
388 var Ka2 = 0.0000000000468;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
389
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
390 function PartCO3(pH) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
391 var H = Math.pow(10, -pH);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
392 return 100 * Ka1 * Ka2 / (H*H + H * Ka1 + Ka1 * Ka2);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
393 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
394
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
395 function PartHCO3(pH) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
396 var H = Math.pow(10, -pH);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
397 return 100 * Ka1 * H / (H*H + H * Ka1 + Ka1 * Ka2);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
398 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
399
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
400 function Charge(pH) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
401 return (-2 * PartCO3(pH) - PartHCO3(pH));
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
402 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
403
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
404 //Z alkalinity is the amount of acid (in mEq/l) needed to bring water to the target pH (Z pH)
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
405 function ZAlkalinity(pHZ) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
406 var C43 = Charge(4.3);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
407 var Cw = Charge(parseFloat($("#wg_ph").jqxNumberInput('decimal')));
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
408 var Cz = Charge(pHZ);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
409 var DeltaCNaught = -C43+Cw;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
410 var CT = parseFloat($("#wg_total_alkalinity").jqxNumberInput('decimal')) / 50 / DeltaCNaught;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
411 var DeltaCZ = -Cz+Cw;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
412 return CT * DeltaCZ;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
413 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
414
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
415 //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)
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
416 function ZRA(pHZ) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
417
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
418 var Calc = parseFloat($("#wg_calcium").jqxNumberInput('decimal')) / (MMCa / 2);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
419 var Magn = parseFloat($("#wg_magnesium").jqxNumberInput('decimal')) / (MMMg / 2);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
420 var Z = ZAlkalinity(pHZ);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
421 return Z - (Calc / 3.5 + Magn / 7);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
422 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
423
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
424 function ProtonDeficit(pHZ) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
425
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
426 var Result = ZRA(pHZ) * parseFloat($("#wg_amount").jqxNumberInput('decimal'));
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
427 // proton deficit for the grist
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
428 var rows = $('#fermentableGrid').jqxGrid('getrows');
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
429 for (var i = 0; i < rows.length; i++) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
430 var row = rows[i];
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
431 if (row.f_added == 'Mash' && row.f_graintype != 'No malt') {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
432 // Check if acid is required
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
433 var C1 = 0;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
434 if ((row.f_di_ph != 5.7) && ((row.f_acid_to_ph_57 < - 0.1) || (row.f_acid_to_ph_57 > 0.1))) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
435 C1 = row.f_acid_to_ph_57 / (row.f_di_ph - 5.7);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
436 } else {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
437 // If the acid_to_ph_5.7 is unknown from the maltster, guess the required acid.
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
438 var ebc = row.f_color;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
439 switch (row.f_graintype) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
440 case 'Base':
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
441 case 'Special':
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
442 case 'Kilned': C1 = 0.014 * ebc - 34.192;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
443 break;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
444 case 'Crystal': C1 = -0.0597 * ebc - 32.457;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
445 break;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
446 case 'Roast': C1 = 0.0107 * ebc - 54.768;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
447 break;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
448 case 'Sour': C1 = -149;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
449 break;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
450 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
451 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
452 x = C1 * (pHZ - row.f_di_ph); // AcidRequired(ZpH)
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
453 Result += x * row.f_amount;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
454 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
455 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
456 return Result;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
457 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
458
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
459 function MashpH() {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
460 var n = 0;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
461 var pH = 5.4;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
462 var deltapH = 0.001;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
463 var deltapd = 0.1;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
464 var pd = ProtonDeficit(pH);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
465 while (((pd < -deltapd) || (pd > deltapd)) && (n < 2000)) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
466 n++;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
467 if (pd < -deltapd)
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
468 pH -= deltapH;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
469 else if (pd > deltapd)
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
470 pH += deltapH;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
471 pd = ProtonDeficit(pH);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
472 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
473 console.log("MashpH() n: "+n+" pH: "+pH);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
474 return pH;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
475 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
476
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
477 function GetAcidSpecs(AT) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
478 switch(AT) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
479 case 'Melkzuur': return {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
480 pK1: 3.08,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
481 pK2: 20,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
482 pK3: 20,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
483 MolWt: 90.08,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
484 AcidSG: 1214,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
485 AcidPrc: 0.88
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
486 };
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
487 case 'Zoutzuur': return {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
488 pK1: -10,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
489 pK2: 20,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
490 pK3: 20,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
491 MolWt: 36.46,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
492 AcidSG: 1142,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
493 AcidPrc: 0.28
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
494 };
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
495 case 'Fosforzuur': return {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
496 pK1: 2.12,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
497 pK2: 7.20,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
498 pK3: 12.44,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
499 MolWt: 98.00,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
500 AcidSG: 1170,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
501 AcidPrc: 0.25
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
502 };
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
503 case 'Zwavelzuur': return {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
504 pK1: -10,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
505 pK2: 1.92,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
506 pK3: 20,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
507 MolWt: 98.07,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
508 AcidSG: 1700,
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
509 AcidPrc: 0.93
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
510 };
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
511 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
512 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
513
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
514
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
515 function calcWater() {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
516
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
517 console.log("calcWater()");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
518 var liters = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
519 var calcium = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
520 var magnesium = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
521 var sodium = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
522 var total_alkalinity = 0;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
523 var bicarbonate = 0;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
524 var chloride = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
525 var sulfate = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
526 var ph = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
527 var RA = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
528 var frac = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
529 var TpH = 0;
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
530 var Acid = 0;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
531 var Acidmg = 0;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
532 var protonDeficit = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
533
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
534 if (dataRecord.w1_name == "") {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
535 return;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
536 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
537
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
538 // If there is a dillute water source, mix the waters.
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
539 if (dataRecord.w2_name != "") {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
540 liters = dataRecord.w1_amount + dataRecord.w2_amount;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
541 calcium = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_calcium, dataRecord.w2_calcium);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
542 magnesium = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_magnesium, dataRecord.w2_magnesium);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
543 sodium = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_sodium, dataRecord.w2_sodium);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
544 chloride = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_chloride, dataRecord.w2_chloride);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
545 sulfate = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_sulfate, dataRecord.w2_sulfate);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
546 total_alkalinity = mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_total_alkalinity, dataRecord.w2_total_alkalinity);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
547 ph = -Math.log10(((Math.pow(10, -dataRecord.w1_ph) * dataRecord.w1_amount) + (Math.pow(10, -dataRecord.w2_ph) * dataRecord.w2_amount)) / liters);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
548 } else {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
549 liters = dataRecord.w1_amount;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
550 calcium = dataRecord.w1_calcium;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
551 magnesium = dataRecord.w1_magnesium;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
552 sodium = dataRecord.w1_sodium;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
553 chloride = dataRecord.w1_chloride;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
554 sulfate = dataRecord.w1_sulfate;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
555 total_alkalinity = dataRecord.w1_total_alkalinity;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
556 ph = dataRecord.w1_ph;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
557 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
558 $('#wg_amount').val(liters);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
559 var wg_calcium = calcium;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
560 $('#wg_calcium').val(Math.round(calcium * 10) / 10);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
561 var wg_magnesium = magnesium;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
562 $('#wg_magnesium').val(Math.round(magnesium * 10) / 10);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
563 var wg_sodium = sodium;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
564 $('#wg_sodium').val(Math.round(sodium * 10) / 10);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
565 var wg_total_alkalinity = total_alkalinity;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
566 $('#wg_total_alkalinity').val(Math.round(total_alkalinity * 10) / 10);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
567 var wg_chloride = chloride;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
568 $('#wg_chloride').val(Math.round(chloride * 10) / 10);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
569 var wg_sulfate = sulfate;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
570 $('#wg_sulfate').val(Math.round(sulfate * 10) / 10);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
571 // Note: brouwhulp has the malts included here in the result.
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
572 var wg_ph = ph;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
573 $('#wg_ph').val(Math.round(ph * 10) / 10);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
574 $('#wb_ph').val(Math.round(MashpH() * 10) / 10);
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
575 $('#est_mash_ph').val(Math.round(MashpH() * 10) / 10);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
576 bicarbonate = total_alkalinity * 1.22;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
577 var wg_bicarbonate = bicarbonate;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
578
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
579 // Noot: de volgende berekeningen geven bijna gelijke resultaten in Brun'water.
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
580 // Calculate Ca
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
581 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCa / MMCaCl2 +
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
582 parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMCa / MMCaSO4;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
583 calcium += 1000 * RA / liters;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
584
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
585 // Calculate Mg
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
586 RA = parseFloat($("#wa_mgso4").jqxNumberInput('decimal')) * MMMg / MMMgSO4;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
587 magnesium += 1000 * RA / liters;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
588
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
589 // Calculate Na
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
590 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl +
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
591 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMNa / MMNaHCO3;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
592 sodium += 1000 * RA / liters;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
593
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
594 // Calculate SO4
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
595 RA = parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMSO4 / MMCaSO4 +
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
596 parseFloat($("#wa_mgso4").jqxNumberInput('decimal')) * MMSO4 / MMMgSO4;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
597 sulfate += 1000 * RA / liters;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
598
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
599 // Calculate Cl
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
600 RA = 2 * parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCl / MMCaCl2 +
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
601 parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMCl / MMNaCl;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
602 chloride += 1000 * RA / liters;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
603 // Einde noot.
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
604
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
605 if ($("#wa_acid_name").val() == "") {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
606 $("#wa_acid_name").val('Melkzuur');
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
607 last_acid = 'Melkzuur';
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
608 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
609 if ($("#wa_base_name").val() == "") {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
610 $("#wa_base_name").val('NaHCO3');
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
611 last_base = 'NaHCO3';
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
612 }
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
613
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
614 var AT = $("#wa_acid_name").val();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
615 var BT = $("#wa_base_name").val();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
616
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
617 var result = GetAcidSpecs(AT);
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
618 var pK1 = result.pK1;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
619 var pK2 = result.pK2;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
620 var pK3 = result.pK3;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
621 var MolWt = result.MolWt;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
622 var AcidSG = result.AcidSG;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
623 var AcidPrc = result.AcidPrc;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
624
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
625 if (dataRecord.calc_acid) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
626 TpH = parseFloat(dataRecord.mash_ph);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
627 protonDeficit = ProtonDeficit(TpH);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
628 console.log("calc_acid tgt: "+TpH+" protonDeficit: "+protonDeficit);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
629 if (protonDeficit > 0) { // Add acid
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
630 $("#wa_base").val(0);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
631 setWaterAgent(last_base, 0);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
632 frac = CalcFrac(TpH, pK1, pK2, pK3);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
633 Acid = protonDeficit / frac;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
634 Acid *= MolWt; // mg
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
635 Acidmg = Acid;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
636 Acid = Acid / AcidSG; // ml
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
637
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
638 if (parseFloat($("#wa_acid_perc").jqxNumberInput('decimal')) == 0)
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
639 $("#wa_acid_perc").val(AcidPrc);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
640 Acid = Acid * AcidPrc / (parseFloat($("#wa_acid_perc").jqxNumberInput('decimal')) / 100); // ml
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
641 console.log("Final ml: "+Acid);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
642 $("#wa_acid").val(Math.round(Acid * 100) / 100);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
643 setWaterAgent(AT, Math.round(Acid * 100) / 100);
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
644
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
645 bicarbonate = bicarbonate - protonDeficit * frac / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
646 total_alkalinity = bicarbonate * 50 / 61;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
647 } else if (protonDeficit < 0) { //Add base
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
648 $("#wa_acid").val(0);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
649 setWaterAgent(last_acid, 0);
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
650 var r1d = Math.pow(10, (TpH - 6.38));
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
651 var r2d = Math.pow(10, (TpH - 10.38));
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
652 var f1d = 1 / (1 + r1d + r1d * r2d);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
653 var f2d = f1d * r1d;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
654 var f3d = f2d * r2d;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
655 switch (BT) {
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
656 case 'NaHCO3': RA = -protonDeficit / (f1d - f3d); //mmol totaal
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
657 RA = RA * MMNaHCO3/1000; //gram
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
658 $("#wa_base").val(Math.round(RA * 100) / 100);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
659 setWaterAgent(BT, Math.round(RA * 100) / 100);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
660 if (liters > 0) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
661 // Na
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
662 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
663 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMNa / MMNaHCO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
664 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
665 sodium = wg_sodium + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
666 // HCO3
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
667 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNaHCO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
668 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
669 bicarbonate = wg_bicarbonate + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
670 total_alkalinity = bicarbonate * 50 / 61;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
671 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
672 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
673 break;
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
674 case 'Na2CO3': RA = -protonDeficit / (2 * f1d + f2d); //mmol totaal
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
675 RA = RA * MMNa2CO3/1000; //gram
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
676 $("#wa_base").val(Math.round(RA * 100) / 100);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
677 setWaterAgent(BT, Math.round(RA * 100) / 100);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
678 if (liters > 0) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
679 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
680 parseFloat($("#wa_base").jqxNumberInput('decimal')) * 2 * MMNa / MMNa2CO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
681 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
682 sodium = wg_sodium + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
683 // HCO3
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
684 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNa2CO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
685 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
686 bicarbonate = wg_bicarbonate + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
687 total_alkalinity = bicarbonate * 50 / 61;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
688 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
689 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
690 break;
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
691 case 'CaCO3': RA = -protonDeficit * (f1d - f3d); //mmol totaal
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
692 RA = RA * MMCaCO3/1000; //gram
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
693 //but only 1/3 is effective, so add 3 times as much
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
694 RA = 3 * RA;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
695 $("#wa_base").val(Math.round(RA * 100) / 100);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
696 setWaterAgent(BT, Math.round(RA * 100) / 100);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
697 if (liters > 0) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
698 //Bicarbonate
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
699 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) / 3 * MMHCO3 / MMCaCO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
700 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
701 bicarbonate = wg_bicarbonate + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
702 total_alkalinity = bicarbonate * 50 / 61;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
703 //Ca precipitates out as Ca10(PO4)6(OH)2
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
704 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCa / MMCaCl2 +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
705 parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMCa / MMCaSO4 +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
706 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMCa / MMCaCO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
707 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
708 calcium = wg_calcium + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
709 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
710 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
711 break;
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
712 case 'Ca(OH)2': RA = -protonDeficit / 19.3; // g
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
713 $("#wa_base").val(Math.round(RA * 100) / 100);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
714 setWaterAgent(BT, Math.round(RA * 100) / 100);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
715 if (liters > 0) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
716 // Bicarbonate
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
717 RA = -protonDeficit / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
718 total_alkalinity = wg_total_alkalinity + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
719 bicarbonate = total_alkalinity * 61 / 50;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
720 // Calcium
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
721 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCa / MMCaCl2 +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
722 parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMCa / MMCaSO4 +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
723 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMCa / MMCaOH2;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
724 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
725 calcium = wg_calcium + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
726 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
727 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
728 break;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
729 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
730 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
731 ph = TpH;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
732 $('#wb_ph').val(Math.round(ph * 10) / 10);
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
733 $('#est_mash_ph').val(Math.round(ph * 10) / 10);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
734 } else { // Manual
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
735 console.log("calc_acid no");
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
736 // First add base salts
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
737 if (parseFloat($("#wa_base").jqxNumberInput('decimal')) > 0) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
738 if (liters > 0) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
739 switch (BT) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
740 case 'NaHCO3': // Na
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
741 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
742 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMNa / MMNaHCO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
743 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
744 sodium = wg_sodium + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
745 // HCO3
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
746 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNaHCO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
747 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
748 bicarbonate = wg_bicarbonate + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
749 total_alkalinity = bicarbonate * 50 / 61;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
750 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
751 break;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
752 case 'Na2CO3': RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
753 parseFloat($("#wa_base").jqxNumberInput('decimal')) * 2 * MMNa / MMNa2CO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
754 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
755 sodium = wg_sodium + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
756 // HCO3
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
757 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNa2CO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
758 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
759 bicarbonate = wg_bicarbonate + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
760 total_alkalinity = bicarbonate * 50 / 61;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
761 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
762 break;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
763 case 'CaCO3': // Bicarbonate
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
764 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) / 3 * MMHCO3 / MMCaCO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
765 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
766 bicarbonate = wg_bicarbonate + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
767 total_alkalinity = bicarbonate * 50 / 61;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
768 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
769 // Ca
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
770 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCa / MMCaCl2 +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
771 parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMCa / MMCaSO4 +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
772 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMCa / MMCaCO3;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
773 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
774 calcium = wg_calcium + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
775 break;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
776 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
777 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
778 }
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
779
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
780 TpH = parseFloat(dataRecord.mash_ph);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
781 pHa = MashpH(); // This one is in demi water, should be in adjusted water???
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
782 // Then calculate the new pH with added acids
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
783 if (parseFloat($("#wa_acid").jqxNumberInput('decimal')) > 0) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
784 console.log("TpH: "+TpH+" water: "+pHa);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
785 Acid = parseFloat($("#wa_acid").jqxNumberInput('decimal'));
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
786 if (parseFloat($("#wa_acid_perc").jqxNumberInput('decimal')) == 0)
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
787 $("#wa_acid_perc").val(AcidPrc);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
788 Acid = Acid / AcidPrc * (parseFloat($("#wa_acid_perc").jqxNumberInput('decimal')) / 100); // ml
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
789 Acid *= AcidSG; // ml
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
790 Acid /= MolWt; // mg
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
791 Acidmg = Acid;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
792
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
793 //find the pH where the protondeficit = protondeficit by the acid
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
794 frac = CalcFrac(pHa, pK1, pK2, pK3);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
795 protonDeficit = Acid * frac;
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
796
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
797 var deltapH = 0.001;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
798 var deltapd = 0.1;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
799 var pd = ProtonDeficit(pHa);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
800 var n = 0;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
801 while (((pd < (protonDeficit - deltapd)) || (pd > (protonDeficit + deltapd))) && (n < 2000)) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
802 n++;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
803 if (pd < (protonDeficit-deltapd))
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
804 pHa -= deltapH;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
805 else if (pd > (protonDeficit+deltapd))
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
806 pHa += deltapH;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
807 frac = CalcFrac(pHa, pK1, pK2, pK3);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
808 protonDeficit = Acid * frac;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
809 pd = ProtonDeficit(pHa);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
810 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
811 console.log("n: "+n+" pd: "+pd+" protonDeficit: "+protonDeficit+" frac: "+frac+" pHa: "+pHa);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
812 RA = wg_bicarbonate - protonDeficit * frac / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
813 bicarbonate = RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
814 total_alkalinity = RA * 50 / 61;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
815 ph = pHa;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
816 $('#wb_ph').val(Math.round(ph * 10) / 10);
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
817 $('#est_mash_ph').val(Math.round(ph * 10) / 10);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
818 }
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
819 }
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
820
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
821 if ((AT == 'Zwavelzuur') && (liters > 0)) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
822 RA = parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMSO4 / MMCaSO4 +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
823 parseFloat($("#wa_mgso4").jqxNumberInput('decimal')) * MMSO4 / MMMgSO4 +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
824 Acidmg / 1000 * MMSO4 / (MMSO4 + 2);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
825 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
826 sulfate = wg_sulfate + RA; // Not add to sulfate??
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
827 } else if ((AT == 'Zoutzuur') && (liters > 0)) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
828 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCl / MMCaCl2 +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
829 parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMCl / MMNaCl +
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
830 Acidmg / 1000 * MMCl / (MMCL + 1);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
831 RA = 1000 * RA / liters;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
832 chloride = wg_chloride + RA;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
833 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
834
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
835 // 2:1 Sulfate to Chroride IPA's, Pale Ales.
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
836 // 1:1 Sulfate to Chloride Balanced
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
837 // 1:2 Sulfate to Chloride Malty
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
838 $('#tgt_bu').val(Math.round(GetBUGU() * 100) / 100);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
839 $('#tgt_cl_so4').val(Math.round(GetOptClSO4ratio() * 10) / 10); // Show real value too
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
840 if (sulfate > 0)
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
841 RA = chloride / sulfate;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
842 else
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
843 RA = 10;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
844 var piCLSO4_low = 0.8 * GetOptClSO4ratio();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
845 var piCLSO4_high = 1.2 * GetOptClSO4ratio();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
846 console.log("low: "+piCLSO4_low+" val: "+RA+" high: "+piCLSO4_high);
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
847
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
848 $('#wb_calcium').val(Math.round(calcium * 10) / 10);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
849 $('#wb_magnesium').val(Math.round(magnesium * 10) / 10);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
850 $('#wb_sodium').val(Math.round(sodium * 10) / 10);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
851 $('#wb_sulfate').val(Math.round(sulfate * 10) / 10);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
852 $('#wb_chloride').val(Math.round(chloride * 10) / 10);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
853 $('#wb_total_alkalinity').val(Math.round(total_alkalinity * 10) / 10);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
854
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
855 if (calcium < 40) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
856 setRangeIndicator("calcium", "low");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
857 } else if (calcium > 150) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
858 setRangeIndicator("calcium", "high");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
859 } else {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
860 setRangeIndicator("calcium", "normal");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
861 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
862 if (magnesium >= 0 && magnesium <= 30) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
863 setRangeIndicator("magnesium", "normal");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
864 } else {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
865 setRangeIndicator("magnesium", "high");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
866 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
867 if (sodium <= 150) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
868 setRangeIndicator("sodium", "normal");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
869 } else {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
870 setRangeIndicator("sodium", "high");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
871 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
872 if (chloride <= 100) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
873 setRangeIndicator("chloride", "normal");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
874 } else {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
875 setRangeIndicator("chloride", "high");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
876 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
877 if (sulfate <= 350) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
878 setRangeIndicator("sulfate", "normal");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
879 } else {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
880 setRangeIndicator("sulfate", "high");
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
881 }
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
882 if (ph < 5.2) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
883 setRangeIndicator("ph", "low");
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
884 } else if (ph > 5.6) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
885 setRangeIndicator("ph", "high");
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
886 } else {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
887 setRangeIndicator("ph", "normal");
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
888 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
889 calcSparge();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
890 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
891
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
892 function calcSparge() {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
893
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
894 // Code from BrewBuddy/Brouwhulp, who got it from http://www.brewery.org/brewery/library/Acidi0,00fWaterAJD0497.html
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
895 var TargetpH = dataRecord.sparge_ph;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
896 var Source_pH = dataRecord.w1_ph;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
897 var Source_alkalinity = dataRecord.w1_total_alkalinity;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
898 // Select watersource or fallback to the first source.
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
899 if (dataRecord.sparge_source == 'Bron 2') {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
900 if (dataRecord.w2_ph > 0.0) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
901 Source_pH = dataRecord.w2_ph;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
902 Source_alkalinity = dataRecord.w2_total_alkalinity;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
903 } else {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
904 dataRecord.sparge_source = 'Bron 1';
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
905 $("#sparge_source").val('Bron 1');
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
906 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
907 } else if (dataRecord.sparge_source == 'Gemengd') {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
908 if (dataRecord.w2_ph > 0.0) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
909 Source_pH = parseFloat($("#wg_ph").jqxNumberInput('decimal'));
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
910 Source_alkalinity = parseFloat($("#wg_total_alkalinity").jqxNumberInput('decimal'));
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
911 } else {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
912 dataRecord.sparge_source = 'Bron 1';
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
913 $("#sparge_source").val('Bron 1');
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
914 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
915 }
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
916
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
917 console.log("calcSparge() target pH: "+TargetpH+" Source: "+Source_pH+" alkalinity: "+Source_alkalinity);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
918
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
919 // Step 1: Compute the mole fractions of carbonic (f1o), bicarbonate (f2o) and carbonate(f3o) at the water pH
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
920 var r1 = Math.pow(10, Source_pH - 6.38);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
921 var r2 = Math.pow(10, Source_pH - 10.33);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
922 var d = 1 + r1 + r1*r2;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
923 var f1 = 1/d;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
924 var f2 = r1/d;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
925 var f3 = r1 * r2 / d;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
926
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
927 //Step 2. Compute the mole fractions at pH = 4.3 (the pH which defines alkalinity)
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
928 var r143 = Math.pow(10, 4.3 - 6.38);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
929 var r243 = Math.pow(10, 4.3 - 10.33);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
930 var d43 = 1 + r143 + r143*r243;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
931 var f143 = 1/d43;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
932 var f243 = r143 / d43;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
933 var f343 = r143 * r243 / d43;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
934
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
935 //Step 3. Convert the sample alkalinity to milliequivalents/L
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
936 var alkalinity = Source_alkalinity / 50;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
937 //Step 4. Solve
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
938 alkalinity = alkalinity / ((f143-f1)+(f3-f343));
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
939
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
940 //Step 5. Compute mole fractions at desired pH
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
941 var r1g = Math.pow(10, TargetpH - 6.38);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
942 var r2g = Math.pow(10, TargetpH - 10.33);
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
943 var dg = 1 + r1g + r1g*r2g;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
944 var f1g = 1/dg;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
945 var f2g = r1g / dg;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
946 var f3g = r1g * r2g / dg;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
947
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
948 //Step 6. Use these to compute the milliequivalents acid required per liter (mEq/L)
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
949 var Acid = alkalinity * ((f1g-f1)+(f3-f3g)) + Math.pow(10, -TargetpH) - Math.pow(10, -Source_pH); //mEq/l
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
950
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
951 if ($("#sparge_acid_type").val() == "") {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
952 $("#sparge_acid_type").val('Melkzuur');
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
953 dataRecord.sparge_acid_type = 'Melkzuur';
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
954 }
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
955 var AT = dataRecord.sparge_acid_type;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
956 var result = GetAcidSpecs(AT);
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
957 var pK1 = result.pK1;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
958 var pK2 = result.pK2;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
959 var pK3 = result.pK3;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
960 var MolWt = result.MolWt;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
961 var AcidSG = result.AcidSG;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
962 var AcidPrc = result.AcidPrc;
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
963 var fract = CalcFrac(TargetpH, pK1, pK2, pK3);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
964
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
965 //Step 9. Now divide the mEq required by the "fraction". This is the required number of moles of acid.
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
966 Acid /= fract;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
967
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
968 //Step 10. Multiply by molecular weight of the acid
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
969 Acid *= MolWt; //mg
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
970
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
971 Acid = Acid / AcidSG; //ml ; 88% lactic solution
169
9a685ee91537 Made a lot of variables local in functions.
Michiel Broek <mbroek@mbse.eu>
parents: 167
diff changeset
972 var f1 = dataRecord.sparge_acid_perc;
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
973 if (f1 <= 0.1)
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
974 f1 = AcidPrc;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
975 Acid = Acid * AcidPrc / (f1 / 100);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
976
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
977 Acid *= dataRecord.sparge_volume; //ml lactic acid total
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
978 Acid = Math.round(Acid * 100) / 100;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
979 dataRecord.sparge_acid_amount = Acid / 1000;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
980 $("#sparge_acid_amount").val(Acid);
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
981 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
982
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
983 function calcFermentation() {
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
984 if (dataRecord.brew_fermenter_sg < 1.020)
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
985 return;
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
986 if ((dataRecord.primary_end_sg > 0.990) && (dataRecord.primary_end_sg < dataRecord.brew_fermenter_sg)) {
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
987 var primary_svg = 100 * (dataRecord.brew_fermenter_sg - dataRecord.primary_end_sg) / (dataRecord.brew_fermenter_sg - 1);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
988 console.log("primary svg: "+primary_svg);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
989 $("#primary_svg").val(primary_svg);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
990 if ((dataRecord.fg > 0.990) && (dataRecord.fg < dataRecord.brew_fermenter_sg)) {
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
991 var final_svg = 100 * (dataRecord.brew_fermenter_sg - dataRecord.fg) / (dataRecord.brew_fermenter_sg - 1);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
992 $("#final_svg").val(final_svg);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
993 var ABV = abvol(dataRecord.brew_fermenter_sg, dataRecord.fg);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
994 $("#final_abv").val(ABV);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
995 }
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
996 }
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
997 }
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
998
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
999 function CarbCO2toS(CO2, T, SFactor) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1000 // Calcuation of disolved CO2 in the beer.
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1001 // Brewersfriend uses: 3.0378 - (0.050062 * temp) + (0.00026555 * temp^2)
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1002 // Brouwhulp uses: 0.000849151 * T * T - 0.0587512 * T + 1.71137)
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1003 var sugar = SFactor * (CO2 - (0.000849151 * T * T - 0.0587512 * T + 1.71137)) / 0.286;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1004 if (sugar < 0)
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1005 sugar = 0;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1006 return sugar;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1007 }
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1008
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1009 function CarbCO2ToPressure(CO2, T) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1010 return (CO2 - (-0.000005594056 * Math.pow(T, 4) + 0.000144357886 * Math.pow(T, 3) +
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1011 0.000362999168 * T * T - 0.064872987645 * T + 1.641145175049)) /
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1012 (0.00000498031 * Math.pow(T, 4) - 0.00024358267 * Math.pow(T, 3) +
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1013 0.00385867329 * T * T - 0.05671206825 * T + 1.53801423376);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1014 }
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1015
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1016 function getSFactor(Sugar) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1017 switch (Sugar) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1018 case 'Kristalsuiker': return 1;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1019 case 'Glucose/dextrose': return 1.16;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1020 case 'Honing': return 1.28;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1021 case 'Moutextract': return 1.74;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1022 case 'Melasse': return 3.83;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1023 }
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1024 return 1;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1025 }
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1026
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1027 function calcCarbonation() {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1028
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1029 var TSec = dataRecord.secondary_temp; // End fermentation temperature.
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1030 if (TSec < 1)
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1031 TSec = dataRecord.primary_end_temp; // Fallback
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1032 if (TSec < 1)
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1033 TSec = 18; // Fallback to room temperature.
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1034
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1035 if (dataRecord.fg == 1.000)
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1036 var ABV = abvol(dataRecord.brew_fermenter_sg, parseFloat($("#est_fg").jqxNumberInput('decimal')));
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1037 else
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1038 var ABV = abvol(dataRecord.brew_fermenter_sg, dataRecord.fg);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1039
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1040 // Bottles
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1041 var SFactor = getSFactor(dataRecord.bottle_priming_sugar);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1042 var Amount = CarbCO2toS(dataRecord.bottle_carbonation, TSec, SFactor);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1043 dataRecord.bottle_priming_amount = Amount;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1044 $("#bottle_priming_amount").val(Math.round(dataRecord.bottle_priming_amount * 10) / 10);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1045 $("#bottle_priming_total").val(Math.round(dataRecord.bottle_amount * dataRecord.bottle_priming_amount * 10) / 10);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1046 $("#bottle_abv").val(Math.round((ABV + Amount * 0.47 / 7.907) * 10) / 10);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1047
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1048 // Kegs
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1049 SFactor = getSFactor(dataRecord.keg_priming_sugar);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1050 Amount = CarbCO2toS(dataRecord.keg_carbonation, TSec, SFactor);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1051 var Pressure = CarbCO2ToPressure(dataRecord.keg_carbonation, dataRecord.keg_carbonation_temp);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1052 if (Pressure < 0)
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1053 Pressure = 0;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1054 dataRecord.keg_pressure = Pressure;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1055 $("#keg_pressure").val(Math.round(Pressure * 10) / 10);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1056
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1057 if (dataRecord.keg_forced_carb) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1058 Amount = 0;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1059 dataRecord.keg_priming_amount = 0;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1060 $("#keg_priming_amount").val(0);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1061 $("#keg_priming_total").val(0);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1062 } else {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1063 dataRecord.keg_priming_amount = Amount;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1064 $("#keg_priming_amount").val(Math.round(dataRecord.keg_priming_amount * 10) / 10);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1065 $("#keg_priming_total").val(Math.round(dataRecord.keg_amount * dataRecord.keg_priming_amount * 10) / 10);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1066 }
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1067
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1068 $("#keg_abv").val(Math.round((ABV + Amount * 0.47 / 7.907) * 10) / 10);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1069 }
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1070
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1071 function calcInit () {
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1072 console.log("calcInit()");
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1073
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1074 calcSGendMash();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1075 calcMashEfficiency();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1076
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1077 $("#calc_acid").on('checked', function (event) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1078 dataRecord.calc_acid = true;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1079 calcWater();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1080 });
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1081 $("#calc_acid").on('unchecked', function (event) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1082 dataRecord.calc_acid = false;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1083 calcWater();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1084 });
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1085 $("#w1_name").jqxDropDownList('selectItem', dataRecord.w1_name);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1086 $("#w2_name").jqxDropDownList('selectItem', dataRecord.w2_name);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1087 // Fix tap water if zero using mash infuse amount.
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1088 if (parseFloat($("#wg_amount").jqxNumberInput('decimal')) == 0 && mash_infuse > 0) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1089 $("#w1_amount").val(mash_infuse);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1090 dataRecord.w1_amount = mash_infuse;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1091 $("#wg_amount").val(mash_infuse);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1092 $("#w2_amount").val(0);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1093 dataRecord.w2_amount = 0;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1094 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1095 calcWater();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1096 $("#w2_amount").on('change', function (event) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1097 var newval = parseFloat(event.args.value);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1098
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1099 if (newval > mash_infuse) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1100 $("#w2_amount").val(dataRecord.w2_amount);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1101 return;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1102 }
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1103 dataRecord.w1_amount = parseFloat($("#wg_amount").jqxNumberInput('decimal')) - newval;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1104 $("#w1_amount").val(dataRecord.w1_amount);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1105 dataRecord.w2_amount = newval;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1106 console.log("new: "+event.args.value+" w1: "+dataRecord.w1_amount+" w2: "+dataRecord.w2_amount);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1107 calcWater();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1108 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1109 $('#wa_cacl2').on('change', function (event) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1110 setWaterAgent('CaCl2', event.args.value);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1111 calcWater();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1112 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1113 $('#wa_caso4').on('change', function (event) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1114 setWaterAgent('CaSO4', event.args.value);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1115 calcWater();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1116 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1117 $('#wa_mgso4').on('change', function (event) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1118 setWaterAgent('MgSO4', event.args.value);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1119 calcWater();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1120 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1121 $('#wa_nacl').on('change', function (event) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1122 setWaterAgent('NaCl', event.args.value);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1123 calcWater();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1124 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1125 $('#wa_base_name').on('change', function (event) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1126 setWaterAgent(last_base, 0);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1127 last_base = event.args.item.value;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1128 setWaterAgent(last_base, parseFloat($("#wa_base").jqxNumberInput('decimal')));
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1129 calcWater();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1130 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1131 $('#wa_base').on('change', function (event) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1132 setWaterAgent($("#wa_base_name").val(), parseFloat(event.args.value));
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1133 calcWater();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1134 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1135 $('#wa_acid_name').on('change', function (event) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1136 setWaterAgent(last_acid, 0);
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1137 last_acid = event.args.item.value;
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1138 setWaterAgent(last_acid, parseFloat($("#wa_acid").jqxNumberInput('decimal')));
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1139 calcWater();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1140 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1141 $('#wa_acid').on('change', function (event) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1142 setWaterAgent($("#wa_acid_name").val(), parseFloat(event.args.value));
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1143 calcWater();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1144 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1145 $('#wa_acid_perc').on('change', function (event) { calcWater(); });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1146
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1147 $('#color_method').on('change', function (event) { calcFermentables(); });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1148 $('#ibu_method').on('change', function (event) {
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1149 calcFermentables();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1150 calcIBUs();
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1151 });
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1152
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1153 $('#batch_size').on('change', function (event) {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1154 console.log("batch_size change:"+event.args.value+" old:"+dataRecord.batch_size);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1155 var new_boil = parseFloat(event.args.value) + dataRecord.boil_size - dataRecord.batch_size;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1156 dataRecord.boil_size = new_boil;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1157 $("#boil_size").val(Math.round(new_boil * 100) / 100);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1158 dataRecord.batch_size = parseFloat(event.args.value);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1159 calcFermentablesFromOG(parseFloat($("#est_og").jqxNumberInput('decimal'))); // Keep the OG
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1160 calcFermentables();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1161 calcSVG();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1162 calcABV();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1163 // TODO: adjust the hops, miscs, yeast, water.
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1164 calcIBUs();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1165 });
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1166 $('#boil_time').on('change', function (event) {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1167 console.log("boil_time change:"+parseFloat(event.args.value)+" old:"+dataRecord.boil_time);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1168 var old_evap = parseFloat(dataRecord.boil_size) - parseFloat(dataRecord.batch_size);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1169 var new_evap = old_evap * (parseFloat(event.args.value) / dataRecord.boil_time);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1170 var new_boil = parseFloat(dataRecord.batch_size) + new_evap;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1171 dataRecord.boil_time = parseFloat(event.args.value);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1172 dataRecord.boil_size = new_boil;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1173 $("#boil_size").val(Math.round(new_boil * 100) / 100);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1174 calcFermentables();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1175 calcSVG();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1176 calcABV();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1177 // TODO: adjust the hops, miscs, yeast, water.
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1178 calcIBUs();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1179 });
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1180 $('#efficiency').on('change', function (event) {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1181 console.log("efficiency change:"+event.args.value);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1182 calcFermentables();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1183 calcSVG();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1184 calcABV();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1185 calcIBUs();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1186 });
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1187 $('#est_og').on('change', function (event) {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1188 console.log("est_og change:"+event.args.value);
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
1189 $('#est_og2').val(event.args.value);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
1190 $('#est_og3').val(event.args.value);
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1191 calcFermentablesFromOG(event.args.value); // Adjust fermentables amounts
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1192 calcFermentables(); // Update the recipe details
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1193 calcSVG();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1194 calcABV(); // and ABV
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1195 calcIBUs(); // and the IBU's.
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1196 });
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1197 $('#mash_ph').on('change', function (event) {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1198 dataRecord.mash_ph = parseFloat(event.args.value);
153
15fe253ffa83 Estimate OG recalculation now uses the equipment profile. Added basic water calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 152
diff changeset
1199 calcWater();
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1200 });
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1201
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1202 $('#sparge_ph').on('change', function (event) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1203 dataRecord.sparge_ph = parseFloat(event.args.value);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1204 calcSparge();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1205 });
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1206 $('#sparge_volume').on('change', function (event) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1207 dataRecord.sparge_volume = parseFloat(event.args.value);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1208 calcSparge();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1209 });
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1210 $('#sparge_source').on('change', function (event) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1211 dataRecord.sparge_source= event.args.item.value;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1212 calcSparge();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1213 });
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1214 $('#sparge_acid_type').on('change', function (event) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1215 dataRecord.sparge_acid_type = event.args.item.value;
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1216 console.log("new sparge_acid_type: "+dataRecord.sparge_acid_type);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1217 calcSparge();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1218 });
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1219 $('#sparge_acid_perc').on('change', function (event) {
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1220 dataRecord.sparge_acid_perc = parseFloat(event.args.value);
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1221 calcSparge();
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1222 });
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1223
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1224 calcFermentation();
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1225 calcCarbonation();
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1226 $('#bottle_amount').on('change', function (event) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1227 dataRecord.bottle_amount = parseFloat(event.args.value);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1228 calcCarbonation();
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1229 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1230 $('#keg_amount').on('change', function (event) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1231 dataRecord.keg_amount = parseFloat(event.args.value);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1232 calcCarbonation();
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1233 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1234 $('#bottle_carbonation').on('change', function (event) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1235 dataRecord.bottle_carbonation = parseFloat(event.args.value);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1236 calcCarbonation();
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1237 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1238 $('#keg_carbonation').on('change', function (event) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1239 dataRecord.keg_carbonation = parseFloat(event.args.value);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1240 calcCarbonation();
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1241 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1242 $('#bottle_priming_sugar').on('change', function (event) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1243 dataRecord.bottle_priming_sugar = event.args.item.value;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1244 calcCarbonation();
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1245 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1246 $('#keg_priming_sugar').on('change', function (event) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1247 dataRecord.keg_priming_sugar = event.args.item.value;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1248 calcCarbonation();
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1249 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1250 $("#keg_forced_carb").on('checked', function (event) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1251 dataRecord.keg_forced_carb = true;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1252 calcCarbonation();
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1253 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1254 $("#keg_forced_carb").on('unchecked', function (event) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1255 dataRecord.keg_forced_carb = false;
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1256 calcCarbonation();
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1257 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1258 $('#keg_carbonation_temp').on('change', function (event) {
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1259 dataRecord.keg_carbonation_temp = parseFloat(event.args.value);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1260 calcCarbonation();
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1261 });
171
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
1262
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
1263 $("#BLog").jqxButton({ disabled: (dataRecord.log_brew) ? false:true });
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
1264 $("#FLog").jqxButton({ disabled: (dataRecord.log_fermentation) ? false:true });
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1265 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1266
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1267 $("#styleSelect").jqxDropDownList({
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1268 placeHolder: "Kies bierstijl:",
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1269 theme: theme,
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1270 source: styleslist,
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1271 displayMember: "name",
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1272 width: 150,
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1273 height: 27,
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1274 dropDownVerticalAlignment: 'top',
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1275 dropDownWidth: 500,
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1276 dropDownHeight: 380,
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1277 renderer: function (index, label, value) {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1278 var datarecord = styleslist.records[index];
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1279 return datarecord.style_guide + " " + datarecord.style_letter+ " " + datarecord.name;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1280 }
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1281 });
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1282 $("#styleSelect").on('select', function (event) {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1283 if (event.args) {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1284 var index = event.args.index;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1285 var datarecord = styleslist.records[index];
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1286 $("#st_name").val(datarecord.name);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1287 $("#st_category").val(datarecord.category);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1288 $("#st_category_number").val(datarecord.category_number);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1289 $("#st_letter").val(datarecord.style_letter);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1290 $("#st_guide").val(datarecord.style_guide);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1291 $("#st_type").val(datarecord.type);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1292 $("#st_og_min").val(datarecord.og_min);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1293 $("#st_og_max").val(datarecord.og_max);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1294 $("#st_fg_min").val(datarecord.fg_min);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1295 $("#st_fg_max").val(datarecord.fg_max);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1296 $("#st_ibu_min").val(datarecord.ibu_min);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1297 $("#st_ibu_max").val(datarecord.ibu_max);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1298 $("#st_color_min").val(datarecord.color_min);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1299 $("#st_color_max").val(datarecord.color_max);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1300 $("#st_carb_min").val(datarecord.carb_min);
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1301 $("#st_carb_min2").val(datarecord.carb_min);
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1302 $("#st_carb_max").val(datarecord.carb_max);
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1303 $("#st_carb_max2").val(datarecord.carb_max);
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1304 $("#st_abv_min").val(datarecord.abv_min);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1305 $("#st_abv_max").val(datarecord.abv_max);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1306 }
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1307 });
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1308
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1309 // Equipemnt dropdown list
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1310 $("#equipmentSelect").jqxDropDownList({
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1311 placeHolder: "Kies apparatuur:",
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1312 theme: theme,
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1313 source: equipmentlist,
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1314 displayMember: "name",
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1315 width: 150,
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1316 height: 27,
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1317 dropDownWidth: 300,
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1318 renderer: function (index, label, value) {
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1319 var datarecord = equipmentlist.records[index];
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1320 return datarecord.batch_size + " liter " + datarecord.name;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1321 }
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1322 });
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1323 $("#equipmentSelect").on('select', function (event) {
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1324 if (event.args) {
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1325 var index = event.args.index;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1326 var datarecord = equipmentlist.records[index];
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1327 $("#eq_name").val(datarecord.name);
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1328 $("#eq_boil_size").val(datarecord.boil_size);
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1329 dataRecord.boil_size = datarecord.boil_size;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1330 $("#boil_size").val(datarecord.boil_size);
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1331 $("#eq_batch_size").val(datarecord.batch_size);
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1332 dataRecord.batch_size = datarecord.batch_size;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1333 $("#batch_size").val(datarecord.batch_size);
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1334 $("#eq_tun_volume").val(datarecord.tun_volume);
122
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
1335 dataRecord.eq_tun_weight = datarecord.tun_weight;
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
1336 dataRecord.eq_tun_specific_heat = datarecord.tun_specific_heat;
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
1337 dataRecord.eq_tun_material = datarecord.tun_material;
123
b4aaf52941e9 We get equipment kettle heights in centimeters, we use meters.
Michiel Broek <mbroek@mbse.eu>
parents: 122
diff changeset
1338 dataRecord.eq_tun_height = datarecord.tun_height / 100.0;
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1339 $("#eq_top_up_water").val(datarecord.top_up_water);
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1340 $("#eq_trub_chiller_loss").val(datarecord.trub_chiller_loss);
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1341 $("#eq_evap_rate").val(datarecord.evap_rate);
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1342 $("#eq_boil_time").val(datarecord.boil_time);
122
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
1343 dataRecord.eq_calc_boil_volume = datarecord.calc_boil_volume;
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1344 $("#eq_top_up_kettle").val(datarecord.top_up_kettle);
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1345 $("#eq_hop_utilization").val(datarecord.hop_utilization);
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1346 $("#eq_notes").val(datarecord.notes);
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1347 $("#eq_lauter_volume").val(datarecord.lauter_volume);
123
b4aaf52941e9 We get equipment kettle heights in centimeters, we use meters.
Michiel Broek <mbroek@mbse.eu>
parents: 122
diff changeset
1348 dataRecord.eq_lauter_height = datarecord.lauter_height / 100.0;
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1349 $("#eq_lauter_deadspace").val(datarecord.lauter_deadspace);
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1350 $("#eq_kettle_volume").val(datarecord.kettle_volume);
123
b4aaf52941e9 We get equipment kettle heights in centimeters, we use meters.
Michiel Broek <mbroek@mbse.eu>
parents: 122
diff changeset
1351 dataRecord.eq_kettle_height = datarecord.kettle_height / 100.0;
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1352 $("#eq_mash_volume").val(datarecord.mash_volume);
149
ff45488d480e Added some icons from Brewersfriend. They should be replaced someday. Added maximum mash weight setting to the equipment database. Usefull for brew automate and RIMS systems. During recipes import acid and base additions are translated. Brews and recipes now have 2 water sources. Added water mixer. Added basic water treatment, but not for pH yet. Redesigned the fermentables and water tabs.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
1353 $("#eq_mash_max").val(datarecord.mash_max);
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1354 dataRecord.eq_mash_max = datarecord.mash_max;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1355 $("#mash_max").val(datarecord.mash_max);
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1356 $("#eq_efficiency").val(datarecord.efficiency);
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1357 dataRecord.efficiency = datarecord.efficiency;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1358 $("#efficiency").val(datarecord.efficiency);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1359
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1360 calcFermentablesFromOG(parseFloat($("#est_og").jqxNumberInput('decimal'))); // Keep the OG
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1361 calcFermentables();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1362 calcSVG();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1363 calcABV();
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1364 // TODO: adjust the hops, miscs, yeast, water.
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
1365 calcIBUs();
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1366 }
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1367 });
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1368
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
1369 var dataRecord = {};
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1370 var url = "includes/db_product.php";
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1371 // Prepare the data
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1372 var source = {
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1373 datatype: "json",
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1374 cache: false,
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1375 datafields: [
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1376 // From prod_main
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1377 { name: 'record', type: 'number' },
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1378 { name: 'uuid', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1379 { name: 'name', type: 'string' },
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1380 { name: 'code', type: 'string' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1381 { name: 'birth', type: 'string' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1382 { name: 'stage', type: 'string' },
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1383 { name: 'notes', type: 'string' },
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1384 { name: 'log_brew', type: 'bool' },
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1385 { name: 'log_fermentation', type: 'bool' },
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1386 { name: 'inventory_reduced', type: 'bool' },
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1387 { name: 'locked', type: 'bool' },
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1388 { name: 'eq_name', type: 'string' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1389 { name: 'eq_boil_size', type: 'float' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1390 { name: 'eq_batch_size', type: 'float' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1391 { name: 'eq_tun_volume', type: 'float' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1392 { name: 'eq_tun_weight', type: 'float' },
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1393 { name: 'eq_tun_specific_heat', type: 'float' },
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1394 { name: 'eq_tun_material', type: 'string' },
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1395 { name: 'eq_tun_height', type: 'float' },
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1396 { name: 'eq_top_up_water', type: 'float' },
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1397 { name: 'eq_trub_chiller_loss', type: 'float' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1398 { name: 'eq_evap_rate', type: 'float' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1399 { name: 'eq_boil_time', type: 'float' },
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1400 { name: 'eq_calc_boil_volume', type: 'bool' },
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1401 { name: 'eq_top_up_kettle', type: 'float' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1402 { name: 'eq_hop_utilization', type: 'float' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1403 { name: 'eq_notes', type: 'string' },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1404 { name: 'eq_lauter_volume', type: 'float' },
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1405 { name: 'eq_lauter_height', type: 'float' },
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1406 { name: 'eq_lauter_deadspace', type: 'float' },
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1407 { name: 'eq_kettle_volume', type: 'float' },
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1408 { name: 'eq_kettle_height', type: 'float' },
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1409 { name: 'eq_mash_volume', type: 'float' },
149
ff45488d480e Added some icons from Brewersfriend. They should be replaced someday. Added maximum mash weight setting to the equipment database. Usefull for brew automate and RIMS systems. During recipes import acid and base additions are translated. Brews and recipes now have 2 water sources. Added water mixer. Added basic water treatment, but not for pH yet. Redesigned the fermentables and water tabs.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
1410 { name: 'eq_mash_max', type: 'float' },
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1411 { name: 'eq_efficiency', type: 'float' },
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1412 { name: 'brew_date_start', type: 'string' },
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1413 { name: 'brew_mash_ph', type: 'float' },
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1414 { name: 'brew_mash_sg', type: 'float' },
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1415 { name: 'brew_sparge_temperature', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1416 { name: 'brew_sparge_volume', type: 'float' },
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
1417 { name: 'brew_sparge_ph', type: 'float' },
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1418 { name: 'brew_preboil_volume', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1419 { name: 'brew_preboil_sg', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1420 { name: 'brew_preboil_ph', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1421 { name: 'brew_aboil_volume', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1422 { name: 'brew_aboil_sg', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1423 { name: 'brew_aboil_ph', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1424 { name: 'brew_aboil_efficiency', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1425 { name: 'brew_cooling_method', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1426 { name: 'brew_cooling_time', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1427 { name: 'brew_cooling_to', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1428 { name: 'brew_whirlpool9', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1429 { name: 'brew_whirlpool7', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1430 { name: 'brew_whirlpool6', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1431 { name: 'brew_whirlpool2', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1432 { name: 'brew_fermenter_volume', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1433 { name: 'brew_fermenter_extrawater', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1434 { name: 'brew_aeration_time', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1435 { name: 'brew_aeration_speed', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1436 { name: 'brew_aeration_type', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1437 { name: 'brew_fermenter_sg', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1438 { name: 'brew_fermenter_ibu', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1439 { name: 'brew_date_end', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1440 { name: 'brew_log_available', type: 'bool' },
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1441 { name: 'og', type: 'float' },
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1442 { name: 'fg', type: 'float' },
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1443 { name: 'primary_start_temp', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1444 { name: 'primary_max_temp', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1445 { name: 'primary_end_temp', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1446 { name: 'primary_end_sg', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1447 { name: 'primary_end_date', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1448 { name: 'secondary_temp', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1449 { name: 'secondary_end_date', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1450 { name: 'tertiary_temp', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1451 { name: 'package_date', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1452 { name: 'bottle_amount', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1453 { name: 'bottle_carbonation', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1454 { name: 'bottle_priming_sugar', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1455 { name: 'bottle_priming_amount', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1456 { name: 'bottle_carbonation_temp', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1457 { name: 'keg_amount', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1458 { name: 'keg_carbonation', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1459 { name: 'keg_priming_sugar', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1460 { name: 'keg_priming_amount', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1461 { name: 'keg_carbonation_temp', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1462 { name: 'keg_forced_carb', type: 'bool' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1463 { name: 'keg_pressure', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1464 { name: 'taste_notes', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1465 { name: 'taste_rate', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1466 { name: 'taste_date', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1467 { name: 'taste_color', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1468 { name: 'taste_transparency', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1469 { name: 'taste_head', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1470 { name: 'taste_aroma', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1471 { name: 'taste_taste', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1472 { name: 'taste_mouthfeel', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1473 { name: 'taste_aftertaste', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1474 { name: 'st_name', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1475 { name: 'st_letter', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1476 { name: 'st_guide', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1477 { name: 'st_category', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1478 { name: 'st_category_number', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1479 { name: 'st_type', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1480 { name: 'st_og_min', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1481 { name: 'st_og_max', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1482 { name: 'st_fg_min', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1483 { name: 'st_fg_max', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1484 { name: 'st_ibu_min', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1485 { name: 'st_ibu_max', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1486 { name: 'st_color_min', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1487 { name: 'st_color_max', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1488 { name: 'st_carb_min', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1489 { name: 'st_carb_max', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1490 { name: 'st_abv_min', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1491 { name: 'st_abv_max', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1492 { name: 'type', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1493 { name: 'batch_size', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1494 { name: 'boil_size', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1495 { name: 'boil_time', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1496 { name: 'efficiency', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1497 { name: 'est_og', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1498 { name: 'est_fg', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1499 { name: 'est_abv', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1500 { name: 'est_color', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1501 { name: 'color_method', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1502 { name: 'est_ibu', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1503 { name: 'ibu_method', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1504 { name: 'est_carb', type: 'float' },
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1505 { name: 'sparge_temp', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1506 { name: 'sparge_ph', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1507 { name: 'sparge_volume', type: 'float' },
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1508 { name: 'sparge_source', type: 'string' },
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1509 { name: 'sparge_acid_type', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1510 { name: 'sparge_acid_perc', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1511 { name: 'sparge_acid_amount', type: 'float' },
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1512 { name: 'mash_ph', type: 'float' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1513 { name: 'mash_name', type: 'string' },
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1514 { name: 'calc_acid', type: 'bool' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1515 { name: 'w1_name', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1516 { name: 'w1_amount', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1517 { name: 'w1_calcium', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1518 { name: 'w1_sulfate', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1519 { name: 'w1_chloride', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1520 { name: 'w1_sodium', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1521 { name: 'w1_magnesium', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1522 { name: 'w1_total_alkalinity', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1523 { name: 'w1_ph', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1524 { name: 'w1_cost', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1525 { name: 'w2_name', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1526 { name: 'w2_amount', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1527 { name: 'w2_calcium', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1528 { name: 'w2_sulfate', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1529 { name: 'w2_chloride', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1530 { name: 'w2_sodium', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1531 { name: 'w2_magnesium', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1532 { name: 'w2_total_alkalinity', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1533 { name: 'w2_ph', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1534 { name: 'w2_cost', type: 'float' },
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1535 { name: 'fermentables', type: 'array' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1536 { name: 'hops', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1537 { name: 'miscs', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1538 { name: 'yeasts', type: 'string' },
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1539 { name: 'mashs', type: 'string' }
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1540 ],
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1541 id: 'record',
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1542 url: url + '?record=' + my_record
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1543 };
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1544 // Load data and select one record.
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1545 var dataAdapter = new $.jqx.dataAdapter(source, {
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1546 loadComplete: function () {
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1547 var records = dataAdapter.records;
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1548 dataRecord = records[0];
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1549 // Hidden record uuid
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1550 $("#name").val(dataRecord.name);
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1551 $("#code").val(dataRecord.code);
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1552 $("#birth").val(dataRecord.birth);
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1553 $("#stage").val(dataRecord.stage);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1554 $("#notes").val(dataRecord.notes);
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1555 $("#inventory_reduced").val(dataRecord.inventory_reduced);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1556 $("#locked").val(dataRecord.locked);
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1557 $("#eq_name").val(dataRecord.eq_name);
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1558 $("#eq_notes").val(dataRecord.eq_notes);
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1559 $("#eq_boil_size").val(dataRecord.eq_boil_size);
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1560 $("#eq_batch_size").val(dataRecord.eq_batch_size);
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1561 $("#eq_tun_volume").val(dataRecord.eq_tun_volume);
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1562 $("#eq_top_up_water").val(dataRecord.eq_top_up_water);
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1563 $("#eq_trub_chiller_loss").val(dataRecord.eq_trub_chiller_loss);
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1564 $("#eq_evap_rate").val(dataRecord.eq_evap_rate);
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1565 $("#eq_boil_time").val(dataRecord.eq_boil_time);
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1566 $("#eq_top_up_kettle").val(dataRecord.eq_top_up_kettle);
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1567 $("#eq_hop_utilization").val(dataRecord.eq_hop_utilization);
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1568 $("#eq_lauter_volume").val(dataRecord.eq_lauter_volume);
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
1569 $("#eq_lauter_deadspace").val(dataRecord.eq_lauter_deadspace);
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1570 $("#eq_kettle_volume").val(dataRecord.eq_kettle_volume);
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1571 $("#eq_mash_volume").val(dataRecord.eq_mash_volume);
149
ff45488d480e Added some icons from Brewersfriend. They should be replaced someday. Added maximum mash weight setting to the equipment database. Usefull for brew automate and RIMS systems. During recipes import acid and base additions are translated. Brews and recipes now have 2 water sources. Added water mixer. Added basic water treatment, but not for pH yet. Redesigned the fermentables and water tabs.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
1572 $("#eq_mash_max").val(dataRecord.eq_mash_max);
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1573 $("#eq_efficiency").val(dataRecord.eq_efficiency);
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1574 // Brewdate
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1575 $("#brew_date_start").val(dataRecord.brew_date_start);
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1576 $("#brew_mash_ph").val(dataRecord.brew_mash_ph);
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1577 $("#brew_mash_sg").val(dataRecord.brew_mash_sg);
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1578 // brew_mash_efficiency to calculate on th fly.
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1579 // Header Spoelen en filteren
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1580 $("#brew_sparge_temperature").val(dataRecord.brew_sparge_temperature);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1581 $("#brew_sparge_volume").val(dataRecord.brew_sparge_volume);
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
1582 $("#brew_sparge_ph").val(dataRecord.brew_sparge_ph);
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1583 // Header Beluchten
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1584 $("#brew_aeration_type").val(dataRecord.brew_aeration_type);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1585 $("#brew_aeration_time").val(dataRecord.brew_aeration_time);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1586 $("#brew_aeration_speed").val(dataRecord.brew_aeration_speed);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1587
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1588 $("#brew_preboil_ph").val(dataRecord.brew_preboil_ph);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1589 $("#brew_preboil_sg").val(dataRecord.brew_preboil_sg);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1590 $("#brew_preboil_volume").val(dataRecord.brew_preboil_volume);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1591 //$("#brew_preboil_efficiency").val(dataRecord.brew_preboil_efficiency);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1592 // Header Koelen en whirlpoolen
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1593 $("#brew_whirlpool9").val(dataRecord.brew_whirlpool9);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1594 $("#brew_whirlpool7").val(dataRecord.brew_whirlpool7);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1595 $("#brew_whirlpool6").val(dataRecord.brew_whirlpool6);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1596 $("#brew_whirlpool2").val(dataRecord.brew_whirlpool2);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1597 // Header Naar gistvat
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1598 $("#brew_fermenter_volume").val(dataRecord.brew_fermenter_volume);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1599 $("#brew_fermenter_sg").val(dataRecord.brew_fermenter_sg);
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1600 $("#brew_fermenter_sg2").val(dataRecord.brew_fermenter_sg);
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1601 $("#brew_fermenter_ibu").val(dataRecord.brew_fermenter_ibu);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1602
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1603 $("#brew_aboil_ph").val(dataRecord.brew_aboil_ph);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1604 $("#brew_aboil_sg").val(dataRecord.brew_aboil_sg);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1605 $("#brew_aboil_volume").val(dataRecord.brew_aboil_volume);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1606 $("#brew_aboil_efficiency").val(dataRecord.brew_aboil_efficiency);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1607 // Header Koelen en whirlpoolen
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1608 $("#brew_cooling_to").val(dataRecord.brew_cooling_to);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1609 $("#brew_cooling_method").val(dataRecord.brew_cooling_method);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1610 $("#brew_cooling_time").val(dataRecord.brew_cooling_time);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1611 // Niks
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1612 // Header Naar gistvat
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1613 $("#brew_fermenter_extrawater").val(dataRecord.brew_fermenter_extrawater);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1614 $("#brew_fermenter_extrasugar").val(dataRecord.brew_fermenter_extrasugar);
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
1615 $("#brew_fermenter_color").val(dataRecord.brew_fermenter_color);
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
1616 $("#brew_date_end").val(dataRecord.brew_date_end);
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1617 $("#og").val(dataRecord.og);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1618 $("#fg").val(dataRecord.fg);
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1619 $("#primary_start_temp").val(dataRecord.primary_start_temp);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1620 $("#primary_max_temp").val(dataRecord.primary_max_temp);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1621 $("#primary_end_temp").val(dataRecord.primary_end_temp);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1622 $("#primary_end_sg").val(dataRecord.primary_end_sg);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1623 $("#primary_end_date").val(dataRecord.primary_end_date);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1624 $("#secondary_temp").val(dataRecord.secondary_temp);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1625 $("#secondary_end_date").val(dataRecord.secondary_end_date);
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1626 $("#tertiary_temp").val(dataRecord.tertiary_temp);
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1627 $("#package_date").val(dataRecord.package_date);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1628 $("#bottle_amount").val(dataRecord.bottle_amount);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1629 $("#bottle_carbonation").val(dataRecord.bottle_carbonation);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1630 $("#bottle_priming_sugar").val(dataRecord.bottle_priming_sugar);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1631 $("#bottle_priming_amount").val(dataRecord.bottle_priming_amount);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1632 $("#bottle_carbonation_temp").val(dataRecord.bottle_carbonation_temp);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1633 $("#keg_amount").val(dataRecord.keg_amount);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1634 $("#keg_carbonation").val(dataRecord.keg_carbonation);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1635 $("#keg_priming_sugar").val(dataRecord.keg_priming_sugar);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1636 $("#keg_priming_amount").val(dataRecord.keg_priming_amount);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1637 $("#keg_carbonation_temp").val(dataRecord.keg_carbonation_temp);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1638 $("#keg_forced_carb").val(dataRecord.keg_forced_carb);
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1639 $("#keg_pressure").val(dataRecord.keg_pressure);
162
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1640 $("#taste_notes").val(dataRecord.taste_notes);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1641 $("#taste_rate").val(dataRecord.taste_rate);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1642 $("#taste_date").val(dataRecord.taste_date);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1643 $("#taste_color").val(dataRecord.taste_color);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1644 $("#taste_transparency").val(dataRecord.taste_transparency);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1645 $("#taste_head").val(dataRecord.taste_head);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1646 $("#taste_aroma").val(dataRecord.taste_aroma);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1647 $("#taste_taste").val(dataRecord.taste_taste);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1648 $("#taste_mouthfeel").val(dataRecord.taste_mouthfeel);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1649 $("#taste_aftertaste").val(dataRecord.taste_aftertaste);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1650
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
1651 // Recipe
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1652 $("#st_name").val(dataRecord.st_name);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1653 $("#st_letter").val(dataRecord.st_letter);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1654 $("#st_guide").val(dataRecord.st_guide);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1655 $("#st_category").val(dataRecord.st_category);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1656 $("#st_category_number").val(dataRecord.st_category_number);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1657 $("#st_type").val(dataRecord.st_type);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1658 $("#st_og_min").val(dataRecord.st_og_min);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1659 $("#st_og_max").val(dataRecord.st_og_max);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1660 $("#st_fg_min").val(dataRecord.st_fg_min);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1661 $("#st_fg_max").val(dataRecord.st_fg_max);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1662 $("#st_abv_min").val(dataRecord.st_abv_min);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1663 $("#st_abv_max").val(dataRecord.st_abv_max);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1664 $("#st_color_min").val(dataRecord.st_color_min);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1665 $("#st_color_max").val(dataRecord.st_color_max);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1666 $("#st_ibu_min").val(dataRecord.st_ibu_min);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1667 $("#st_ibu_max").val(dataRecord.st_ibu_max);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1668 $("#st_carb_min").val(dataRecord.st_carb_min);
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1669 $("#st_carb_min2").val(dataRecord.st_carb_min);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1670 $("#st_carb_max").val(dataRecord.st_carb_max);
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
1671 $("#st_carb_max2").val(dataRecord.st_carb_max);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1672 $("#type").val(dataRecord.type);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1673 $("#batch_size").val(dataRecord.batch_size);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1674 $("#boil_size").val(dataRecord.boil_size);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1675 $("#boil_time").val(dataRecord.boil_time);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1676 $("#efficiency").val(dataRecord.efficiency);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1677 $("#est_og").val(dataRecord.est_og);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1678 $("#est_og2").val(dataRecord.est_og);
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
1679 $("#est_og3").val(dataRecord.est_og);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1680 $("#est_fg").val(dataRecord.est_fg);
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
1681 $("#est_fg2").val(dataRecord.est_fg);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1682 $("#est_color").val(dataRecord.est_color);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1683 $("#est_color2").val(dataRecord.est_color);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1684 $("#est_abv").val(dataRecord.est_abv);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1685 $("#color_method").val(dataRecord.color_method);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1686 $("#est_ibu").val(dataRecord.est_ibu);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1687 $("#est_ibu2").val(dataRecord.est_ibu);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1688 $("#ibu_method").val(dataRecord.ibu_method);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1689 $("#est_carb").val(dataRecord.est_carb);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1690 $("#mash_name").val(dataRecord.mash_name);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1691 $("#mash_ph").val(dataRecord.mash_ph);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1692 $("#sparge_temp").val(dataRecord.sparge_temp);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1693 $("#sparge_ph").val(dataRecord.sparge_ph);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1694 $("#sparge_volume").val(dataRecord.sparge_volume);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1695 $("#sparge_source").val(dataRecord.sparge_source);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1696 $("#sparge_acid_type").val(dataRecord.sparge_acid_type);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1697 $("#sparge_acid_perc").val(dataRecord.sparge_acid_perc);
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
1698 $("#sparge_acid_amount").val(dataRecord.sparge_acid_amount * 1000);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1699 $("#calc_acid").val(dataRecord.calc_acid);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1700 $("#w1_name").val(dataRecord.w1_name);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1701 $("#w1_amount").val(dataRecord.w1_amount);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1702 $("#w1_calcium").val(dataRecord.w1_calcium);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1703 $("#w1_sulfate").val(dataRecord.w1_sulfate);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1704 $("#w1_chloride").val(dataRecord.w1_chloride);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1705 $("#w1_sodium").val(dataRecord.w1_sodium);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1706 $("#w1_magnesium").val(dataRecord.w1_magnesium);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1707 $("#w1_total_alkalinity").val(dataRecord.w1_total_alkalinity);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1708 $("#w1_ph").val(dataRecord.w1_ph);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1709 $("#w1_cost").val(dataRecord.w1_cost);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1710 $("#w2_name").val(dataRecord.w2_name);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1711 $("#w2_amount").val(dataRecord.w2_amount);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1712 $("#w2_calcium").val(dataRecord.w2_calcium);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1713 $("#w2_sulfate").val(dataRecord.w2_sulfate);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1714 $("#w2_chloride").val(dataRecord.w2_chloride);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1715 $("#w2_sodium").val(dataRecord.w2_sodium);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1716 $("#w2_magnesium").val(dataRecord.w2_magnesium);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1717 $("#w2_total_alkalinity").val(dataRecord.w2_total_alkalinity);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1718 $("#w2_ph").val(dataRecord.w2_ph);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1719 $("#w2_cost").val(dataRecord.w2_cost);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1720 editFermentable(dataRecord);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1721 editHop(dataRecord);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1722 editMisc(dataRecord);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1723 editYeast(dataRecord);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1724 editMash(dataRecord);
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1725
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1726 switch (dataRecord.stage) {
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1727 case 'Plan': brewstage = 0; break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1728 case 'Wait': brewstage = 1; break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1729 case 'Brew': brewstage = 2; break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1730 case 'Primary': brewstage = 3; break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1731 case 'Secondary': brewstage = 4; break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1732 case 'Tertiary': brewstage = 5; break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1733 case 'Package': brewstage = 6; break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1734 case 'Carbonation': brewstage = 7; break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1735 case 'Mature': brewstage = 8; break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1736 case 'Taste': brewstage = 9; break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1737 case 'Ready': brewstage = 10;
162
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1738 $("#locked").jqxCheckBox({ disabled:false });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1739 break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1740 case 'Closed': brewstage = 11;
162
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1741 $("#locked").jqxCheckBox({ disabled:false });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1742 break;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1743 }
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1744 // Enable or Disable settings depending on the stage.
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1745 if (brewstage > 1)
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1746 $("#equipmentSelect").jqxDropDownList({ disabled: true });
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1747 if (brewstage > 0) {
112
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
1748 $("#Delete").jqxButton({ disabled: true });
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
1749 }
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1750 if (brewstage < 3) {
162
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1751 $('#jqxTabs').jqxTabs('disableAt', 9);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1752 // If recipe not complete, disable 8 too.
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1753 } else {
162
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1754 $('#jqxTabs').jqxTabs('enableAt', 9);
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1755 }
162
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1756 if (brewstage < 4) { // At least primary
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1757 $('#jqxTabs').jqxTabs('disableAt', 10);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1758 } else {
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1759 $('#jqxTabs').jqxTabs('enableAt', 10);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1760 }
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1761 if (brewstage < 6) {
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
1762 $("#inventory_reduced").jqxCheckBox({ disabled : true });
162
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1763 } else {
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1764 if ($('#inventory_reduced').jqxCheckBox('checked'))
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1765 $("#inventory_reduced").jqxCheckBox({ disabled : true });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1766 }
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1767 if (brewstage < 8) { // Taste when at least Mature.
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1768 $('#jqxTabs').jqxTabs('disableAt', 11);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1769 } else {
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1770 $('#jqxTabs').jqxTabs('enableAt', 11);
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
1771 }
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
1772
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1773 $('#jqxTabs').jqxTabs('select', 2);
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1774 },
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1775 loadError: function (jqXHR, status, error) {
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1776 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1777 beforeLoadComplete: function (records) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1778 $('#jqxLoader').jqxLoader('open');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1779 }
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1780 });
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1781 dataAdapter.dataBind();
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1782
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1783 // Inline fermentables editor
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1784 var editFermentable = function (data) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1785 var fermentableSource = {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1786 localdata: data.fermentables,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1787 datatype: "local",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1788 datafields: [
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1789 { name: 'f_name', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1790 { name: 'f_origin', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1791 { name: 'f_supplier', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1792 { name: 'f_amount', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1793 { name: 'f_cost', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1794 { name: 'f_type', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1795 { name: 'f_yield', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1796 { name: 'f_color', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1797 { name: 'f_coarse_fine_diff', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1798 { name: 'f_moisture', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1799 { name: 'f_diastatic_power', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1800 { name: 'f_protein', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1801 { name: 'f_max_in_batch', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1802 { name: 'f_graintype', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1803 { name: 'f_added', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1804 { name: 'f_dissolved_protein', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1805 { name: 'f_recommend_mash', type: 'bool' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1806 { name: 'f_add_after_boil', type: 'bool' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1807 { name: 'f_adjust_to_total_100', type: 'bool' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1808 { name: 'f_percentage', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1809 { name: 'f_di_ph', type: 'float' }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1810 ],
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1811 addrow: function (rowid, rowdata, position, commit) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1812 commit(true);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1813 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1814 deleterow: function (rowid, commit) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1815 commit(true);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1816 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1817 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1818 var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1819 $("#fermentableGrid").jqxGrid({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1820 width: 1150,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1821 height: 400,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1822 source: fermentableAdapter,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1823 theme: theme,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1824 selectionmode: 'singlerow',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1825 editmode: 'selectedcell',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1826 editable: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1827 localization: getLocalization(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1828 showtoolbar: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1829 rendertoolbar: function (toolbar) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1830 var me = this;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1831 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1832 toolbar.append(container);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1833 container.append('<div style="float: left; margin-left: 165px;" id="faddrowbutton"></div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1834 container.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1835 container.append('<div style="float: left; margin-left: 10px;" id="finstockbutton"></div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1836 container.append('<input style="float: left; margin-left: 400px;" id="fdeleterowbutton" type="button" value="Verwijder mout" />');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1837 // add fermentable from dropdownlist.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1838 $("#faddrowbutton").jqxDropDownList({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1839 placeHolder: "Kies mout:",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1840 theme: theme,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1841 source: fermentablelist,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1842 displayMember: "name",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1843 width: 150,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1844 height: 27,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1845 dropDownWidth: 500,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1846 dropDownHeight: 500,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1847 renderer: function (index, label, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1848 var datarecord = fermentablelist.records[index];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1849 return datarecord.supplier+ " / " + datarecord.name + " (" + datarecord.color + " EBC)";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1850 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1851 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1852 $("#faddrowbutton").on('select', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1853 if (event.args) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1854 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1855 var index = event.args.index;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1856 var datarecord = fermentablelist.records[index];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1857 var row = {};
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1858 row["f_name"] = datarecord.name;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1859 row["f_origin"] = datarecord.origin;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1860 row["f_supplier"] = datarecord.supplier;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1861 row["f_amount"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1862 row["f_cost"] = datarecord.cost;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1863 row["f_type"] = datarecord.type;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1864 row["f_yield"] = datarecord.yield;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1865 row["f_color"] = datarecord.color;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1866 row["f_coarse_fine_diff"] = datarecord.coarse_fine_diff;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1867 row["f_moisture"] = datarecord.moisture;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1868 row["f_diastatic_power"] = datarecord.diastatic_power;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1869 row["f_protein"] = datarecord.protein;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1870 row["f_max_in_batch"] = datarecord.max_in_batch;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1871 row["f_graintype"] = datarecord.graintype;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1872 if (datarecord.add_after_boil) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1873 row["f_added"] = "Primary";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1874 } else if ((datarecord.type == "Sugar") || (datarecord.type == "Adjunct")) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1875 row["f_added"] = "Boil";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1876 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1877 row["f_added"] = "Mash";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1878 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1879 row["f_dissolved_protein"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1880 row["f_recommend_mash"] = datarecord.recommend_mash;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1881 row["f_add_after_boil"] = datarecord.add_after_boil;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1882 if (rowscount == 0) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1883 // The first fermentable
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1884 row["f_adjust_to_total_100"] = 1;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1885 row["f_percentage"] = 100;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1886 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1887 row["f_adjust_to_total_100"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1888 row["f_percentage"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1889 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1890 row["f_di_ph"] = datarecord.di_ph;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1891 var commit = $("#fermentableGrid").jqxGrid('addrow', null, row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1892 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1893 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1894
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1895 $("#finstockbutton").jqxCheckBox({ theme: theme, height: 27 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1896 $("#finstockbutton").on('change', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1897 fermentableinstock = event.args.checked;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1898 fermentablelist.dataBind();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1899 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1900
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1901 // delete selected fermentable.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1902 $("#fdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1903 $("#fdeleterowbutton").on('click', function () {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1904 var selectedrowindex = $("#fermentableGrid").jqxGrid('getselectedrowindex');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1905 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1906 if (selectedrowindex >= 0 && selectedrowindex < rowscount) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1907 var id = $("#fermentableGrid").jqxGrid('getrowid', selectedrowindex);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1908 var percent = $('#fermentableGrid').jqxGrid('getcellvalue', id, "f_percentage");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1909 var amount = $('#fermentableGrid').jqxGrid('getcellvalue', id, "f_amount");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1910 var commit = $("#fermentableGrid").jqxGrid('deleterow', id);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1911 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1912 rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1913 if (rowscount > 1) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1914 if (to_100) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1915 for (var i = 0; i < rowscount; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1916 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1917 if (rowdata.f_adjust_to_total_100) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1918 rowdata.f_percentage += percent;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1919 rowdata.f_amount += amount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1920 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1921 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1922 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1923 var tw = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1924 for (i = 0; i < rowscount; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1925 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1926 tw += rowdata.f_amount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1927 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1928 for (i = 0; i < rowscount; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1929 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1930 var percentage = Math.round(rowdata.f_amount / tw * 1000) / 10.0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1931 $("#fermentableGrid").jqxGrid('setcellvalue', i, "f_percentage", percentage);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1932 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1933 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1934 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1935 $("#fermentableGrid").jqxGrid('setcellvalue', 0, "f_percentage", 100);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1936 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1937 calcFermentables();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1938 calcSVG();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1939 calcABV();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1940 calcIBUs();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1941 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1942 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1943 ready: function() {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1944 calcFermentables();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1945 $('#jqxTabs').jqxTabs('next');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1946 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1947 columns: [
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1948 { text: 'Vergistbaar ingredi&euml;nt', editable: false, datafield: 'f_name',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1949 cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1950 var rowData = $("#fermentableGrid").jqxGrid('getrowdata', row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1951 return "<span style='margin: 3px; margin-top: 6px; float: "+
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1952 columnproperties.cellsalign+"'>" +rowData.f_supplier+" / "+rowData.f_name+" ("+rowData.f_color+" EBC)</span>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1953 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1954 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1955 { text: 'Type', editable: false, align: 'center', cellsalign: 'center', width: 100, datafield: 'f_type' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1956 { text: 'Moment', width: 110, align: 'center', cellsalign: 'center', datafield: 'f_added', columntype: 'dropdownlist',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1957 createeditor: function (row, column, editor) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1958 var srcAdded = [ "Mash", "Boil", "Fermentation", "Lagering", "Bottle" ];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1959 editor.jqxDropDownList({ autoDropDownHeight: true, source: srcAdded });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1960 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1961 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1962 { text: 'Opbrengst', editable: false, datafield: 'f_yield', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1963 { text: 'Gewicht Kg', datafield: 'f_amount', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f3',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1964 columntype: 'numberinput',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1965 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1966 // Maximum weight is the batch_size, just a simple check.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1967 var maxmout = parseFloat($("#batch_size").jqxNumberInput('decimal'));
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1968 if (value < 0 || value > maxmout) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1969 return { result: false, message: "Gewicht moet 0-"+maxmout+" zijn" };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1970 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1971 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1972 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1973 initeditor: function (row, cellvalue, editor) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1974 editor.jqxNumberInput({ inputMode: 'simple', min: 0, decimalDigits: 3, spinButtons: false });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1975 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1976 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1977 if (to_100) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1978 return oldvalue; // When using percentages, don't allow edited results.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1979 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1980 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1981 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1982 { text: 'Percentage', datafield: 'f_percentage', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'p1',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1983 columntype: 'numberinput',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1984 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1985 if (value < 0 || value > 100) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1986 return { result: false, message: "Percentage moet 0-100 zijn" };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1987 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1988 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1989 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1990 initeditor: function (row, cellvalue, editor) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1991 editor.jqxNumberInput({ decimalDigits: 1, min: 0, max: 100, spinButtons: false });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1992 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1993 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1994 oldvalue = Math.round(oldvalue * 10) / 10.0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1995 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1996 if ((oldvalue != newvalue) && (rowscount > 1)) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1997 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1998 if (rowdata.f_adjust_to_total_100) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
1999 return oldvalue;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2000 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2001 var diff = newvalue - oldvalue;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2002 var tw = 0; // total weight
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2003 for (i = 0; i < rowscount; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2004 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2005 tw += rowdata.f_amount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2006 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2007 if (to_100) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2008 // Adjust this row and the 100% row.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2009 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2010 rowdata.f_amount += tw * diff / 100;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2011 for (i = 0; i < rowscount; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2012 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2013 if (rowdata.f_adjust_to_total_100) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2014 rowdata.f_percentage -= diff;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2015 rowdata.f_amount -= tw * diff / 100;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2016 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2017 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2018 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2019 // Adjust all the rows.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2020 var nw = tw * diff / 100;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2021 for (i = 0; i < rowscount; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2022 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2023 if (i == row) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2024 rowdata.f_amount += nw;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2025 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2026 rowdata.f_amount -= nw / (rowscount - 1);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2027 rowdata.f_percentage = Math.round((rowdata.f_amount / tw) * 1000) / 10.0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2028 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2029 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2030 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2031 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2032 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2033 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2034 { text: '100%', align: 'center', datafield: 'f_adjust_to_total_100', columntype: 'checkbox', width: 80,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2035 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2036 if (to_100) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2037 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2038 for (i = 0; i < rowscount; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2039 if (i != row) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2040 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2041 rowdata.f_adjust_to_total_100 = false;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2042 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2043 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2044 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2045 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2046 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2047 ]
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2048 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2049 $("#fermentableGrid").on('cellendedit', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2050 var args = event.args;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2051 console.log("Event Type: cellendedit, Column: " + args.datafield + ", Row: " + (args.rowindex) + ", Value: " + args.value);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2052 // Make sure the grid itself is updated.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2053 $("#fermentableGrid").jqxGrid('setcellvalue', args.rowindex, args.datafield, args.value);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2054 if ((args.datafield == 'f_amount') && (! to_100)) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2055 // If one of the amounts is changed, recalculate the percentages.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2056 console.log("adjust percentages");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2057 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2058 if (rowscount > 1) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2059 var tw = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2060 for (i = 0; i < rowscount; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2061 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2062 tw += rowdata.f_amount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2063 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2064 for (i = 0; i < rowscount; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2065 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2066 var percentage = Math.round(rowdata.f_amount / tw * 1000) / 10.0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2067 $("#fermentableGrid").jqxGrid('setcellvalue', i, "f_percentage", percentage);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2068 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2069 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2070 $("#fermentableGrid").jqxGrid('setcellvalue', 0, "f_percentage", 100);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2071 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2072 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2073 $('#fermentableGrid').jqxGrid('sortby', 'f_amount', 'desc'); // TODO: not reliable
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2074 calcFermentables();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2075 calcSVG();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2076 calcABV();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2077 calcIBUs(); // Depends on gravity, so recalculate.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2078 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2079 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2080
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2081 // Inline hops editor
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2082 var editHop = function (data) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2083 var hopSource = {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2084 localdata: data.hops,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2085 datatype: "local",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2086 cache: false,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2087 datafields: [
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2088 { name: 'h_name', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2089 { name: 'h_origin', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2090 { name: 'h_amount', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2091 { name: 'h_cost', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2092 { name: 'h_type', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2093 { name: 'h_form', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2094 { name: 'h_useat', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2095 { name: 'h_time', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2096 { name: 'h_alpha', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2097 { name: 'h_beta', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2098 { name: 'h_hsi', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2099 { name: 'h_humulene', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2100 { name: 'h_carophyllene', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2101 { name: 'h_cohumulone', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2102 { name: 'h_myrcene', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2103 { name: 'h_total_oil', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2104 { name: 'h_weight', type: 'float' }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2105 ],
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2106 addrow: function (rowid, rowdata, position, commit) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2107 commit(true);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2108 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2109 deleterow: function (rowid, commit) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2110 commit(true);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2111 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2112 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2113 var hopAdapter = new $.jqx.dataAdapter(hopSource, {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2114 beforeLoadComplete: function (records) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2115 var data = new Array();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2116 for (var i = 0; i < records.length; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2117 var row = records[i];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2118 row.h_weight = row.h_amount * 1000;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2119 data.push(row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2120 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2121 return data;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2122 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2123 loadError: function(jqXHR, status, error) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2124 $('#err').text(status + ' ' + error);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2125 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2126 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2127 $("#hopGrid").jqxGrid({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2128 width: 1050,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2129 height: 400,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2130 source: hopAdapter,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2131 theme: theme,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2132 selectionmode: 'singlerow',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2133 editmode: 'selectedcell',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2134 editable: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2135 localization: getLocalization(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2136 showtoolbar: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2137 rendertoolbar: function (toolbar) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2138 var me = this;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2139 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2140 toolbar.append(container);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2141 container.append('<div style="float: left; margin-left: 165px;" id="haddrowbutton"></div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2142 container.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2143 container.append('<div style="float: left; margin-left: 10px;" id="hinstockbutton"></div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2144 container.append('<input style="float: left; margin-left: 280px;" id="hdeleterowbutton" type="button" value="Verwijder hop" />');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2145 // add hop from dropdownlist.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2146 $("#haddrowbutton").jqxDropDownList({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2147 placeHolder: "Kies hop:",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2148 theme: theme,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2149 source: hoplist,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2150 displayMember: "name",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2151 width: 150,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2152 height: 27,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2153 dropDownWidth: 500,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2154 dropDownHeight: 500,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2155 renderer: function (index, label, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2156 var datarecord = hoplist.records[index];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2157 return datarecord.origin+ " / " + datarecord.name + " (" + datarecord.alpha + "% &alpha;)";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2158 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2159 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2160 $("#haddrowbutton").on('select', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2161 if (event.args) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2162 var index = event.args.index;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2163 var datarecord = hoplist.records[index];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2164 var row = {};
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2165 row["h_name"] = datarecord.name;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2166 row["h_origin"] = datarecord.origin;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2167 row["h_amount"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2168 row["h_cost"] = datarecord.cost;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2169 row["h_type"] = datarecord.type;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2170 row["h_form"] = datarecord.form;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2171 row["h_useat"] = datarecord.useat;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2172 row["h_time"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2173 row["h_alpha"] = datarecord.alpha;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2174 row["h_beta"] = datarecord.beta;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2175 row["h_hsi"] = datarecord.hsi;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2176 row["h_humulene"] = datarecord.humulene;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2177 row["h_carophyllene"] = datarecord.carophyllene;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2178 row["h_cohumulone"] = datarecord.cohumulone;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2179 row["h_myrcene"] = datarecord.myrcene;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2180 row["h_total_oil"] = datarecord.total_oil;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2181 row["h_weight"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2182 var commit = $("#hopGrid").jqxGrid('addrow', null, row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2183 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2184 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2185
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2186 $("#hinstockbutton").jqxCheckBox({ theme: theme, height: 27 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2187 $("#hinstockbutton").on('change', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2188 hopinstock = event.args.checked;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2189 hoplist.dataBind();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2190 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2191
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2192 // delete selected hop.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2193 $("#hdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2194 $("#hdeleterowbutton").on('click', function () {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2195 var selectedrowindex = $("#hopGrid").jqxGrid('getselectedrowindex');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2196 var rowscount = $("#hopGrid").jqxGrid('getdatainformation').rowscount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2197 if (selectedrowindex >= 0 && selectedrowindex < rowscount) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2198 var id = $("#hopGrid").jqxGrid('getrowid', selectedrowindex);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2199 var commit = $("#hopGrid").jqxGrid('deleterow', id);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2200 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2201 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2202 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2203 ready: function() {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2204 $('#jqxTabs').jqxTabs('next');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2205 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2206 columns: [
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2207 { text: 'Hop', editable: false, datafield: 'h_name',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2208 cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2209 var rowData = $("#hopGrid").jqxGrid('getrowdata', row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2210 return "<span style='margin: 3px; margin-top: 6px; float: "+
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2211 columnproperties.cellsalign+"'>" +rowData.h_origin+" / "+rowData.h_name+"</span>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2212 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2213 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2214 { text: 'Type', editable: false, width: 90, align: 'center', cellsalign: 'center', datafield: 'h_type' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2215 { text: 'Vorm', editable: false, width: 90, align: 'center', cellsalign: 'center', datafield: 'h_form' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2216 { text: 'Alpha', editable: false, datafield: 'h_alpha', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2217 { text: 'Amount', hidden: true, datafield: 'h_amount' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2218 { text: 'Gewicht gr', datafield: 'h_weight', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f1',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2219 columntype: 'numberinput',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2220 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2221 return "<div style='margin: 4px;' class='jqx-right-align'>" + dataAdapter.formatNumber(value, "f1") + " gr</div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2222 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2223 initeditor: function (row, cellvalue, editor, celltext, pressedChar) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2224 editor.jqxNumberInput({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2225 inputMode: 'simple', decimalDigits: 1, min: 0, max: parseFloat(dataRecord.batch_size * 200),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2226 spinButtons: false
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2227 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2228 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2229 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2230 var maxhops = parseFloat(dataRecord.batch_size) * 200;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2231 if (value < 0 || value > maxhops ) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2232 return { result: false, message: "Gewicht moet tussen 0 en "+maxhops+" gram zijn" };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2233 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2234 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2235 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2236 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2237 { text: 'Gebruik', width: 110, align: 'center', cellsalign: 'center', datafield: 'h_useat', columntype: 'dropdownlist',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2238 createeditor: function (row, column, editor) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2239 var srcUse = [ "Boil", "Dry Hop", "Mash", "First Wort", "Aroma" ];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2240 editor.jqxDropDownList({ autoDropDownHeight: true, source: srcUse });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2241 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2242 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2243 if ((newvalue == "Mash") || (newvalue == "First Wort")) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2244 $("#hopGrid").jqxGrid('setcellvalue', row, "h_time", parseFloat(dataRecord.boil_time));
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2245 } else if (newvalue == "Aroma") {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2246 $("#hopGrid").jqxGrid('setcellvalue', row, "h_time", 0);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2247 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2248 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2249 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2250 { text: 'Tijd', datafield: 'h_time', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'f0',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2251 columntype: 'numberinput',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2252 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2253 if ((rowdata.h_useat == "Boil") || (rowdata.h_useat == "Dry Hop") || (rowdata.h_useat == "Dry hop"))
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2254 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value, "f0")+"</div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2255 else
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2256 return "<div style='margin: 4px;' class='jqx-right-align'> </div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2257 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2258 initeditor: function (row, cellvalue, editor, celltext, pressedChar) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2259 editor.jqxNumberInput({ decimalDigits: 0, digits: 3, min: 0, max: parseFloat(dataRecord.boil_time) });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2260 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2261 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2262 var use = $("#hopGrid").jqxGrid('getcellvalue', row, "h_useat");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2263 if ((use == "Mash") || (use == "First Wort") || (use == "First wort") || (use == "Aroma"))
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2264 return oldvalue;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2265 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2266 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2267 var high = parseFloat(dataRecord.boil_time);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2268 if (value < 0 || value > high ) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2269 return { result: false, message: "De tijd moet 0-"+high+" zijn" };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2270 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2271 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2272 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2273 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2274 { text: 'IBU', editable: false, datafield: 'ibu', width: 80, align: 'right',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2275 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2276 var ibu = toIBU(rowdata.h_useat,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2277 rowdata.h_form,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2278 preboil_sg,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2279 parseFloat($("#batch_size").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2280 parseFloat(rowdata.h_amount),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2281 parseFloat(rowdata.h_time),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2282 parseFloat(rowdata.h_alpha),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2283 $("#ibu_method").val()
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2284 );
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2285 calcIBUs();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2286 return "<div style='margin: 4px;' class='jqx-right-align'>" + dataAdapter.formatNumber(ibu, "f1") + "</div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2287 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2288 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2289 ]
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2290 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2291 $("#hopGrid").on('cellendedit', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2292 var args = event.args;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2293 console.log("Event Type: cellendedit, Column: " + args.datafield + ", Row: " + (args.rowindex) + ", Value: " + args.value);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2294 $("#hopGrid").jqxGrid('setcellvalue', args.rowindex, args.datafield, args.value);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2295 if (args.datafield == 'h_weight')
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2296 $("#hopGrid").jqxGrid('setcellvalue', args.rowindex, 'h_amount', args.value / 1000);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2297 //$('#hopGrid').jqxGrid('sortby', 'f_amount', 'desc');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2298 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2299 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2300
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2301 // Inline miscs editor
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2302 var editMisc = function (data) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2303 var miscSource = {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2304 localdata: data.miscs,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2305 datatype: "local",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2306 cache: false,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2307 datafields: [
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2308 { name: 'm_name', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2309 { name: 'm_amount', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2310 { name: 'm_cost', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2311 { name: 'm_type', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2312 { name: 'm_use_use', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2313 { name: 'm_time', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2314 { name: 'm_amount_is_weight', type: 'bool' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2315 { name: 'm_weight', type: 'float' }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2316 ],
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2317 addrow: function (rowid, rowdata, position, commit) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2318 commit(true);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2319 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2320 deleterow: function (rowid, commit) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2321 commit(true);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2322 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2323 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2324 var miscAdapter = new $.jqx.dataAdapter(miscSource, {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2325 beforeLoadComplete: function (records) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2326 var data = new Array();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2327 for (var i = 0; i < records.length; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2328 var row = records[i];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2329 row.m_weight = row.m_amount * 1000;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2330 data.push(row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2331 // Initial set water agent values.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2332 switch (row.m_name) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2333 case 'CaCl2': $("#wa_cacl2").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2334 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2335 case 'CaSO4': $("#wa_caso4").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2336 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2337 case 'MgSO4': $("#wa_mgso4").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2338 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2339 case 'NaCl': $("#wa_nacl").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2340 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2341 case 'Melkzuur': $("#wa_acid_name").val('Melkzuur');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2342 $("#wa_acid").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2343 $("#wa_acid_perc").val(80);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2344 last_acid = 'Melkzuur';
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2345 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2346 case 'Zoutzuur': $("#wa_acid_name").val('Zoutzuur');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2347 $("#wa_acid").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2348 $("#wa_acid_perc").val(80);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2349 last_acid = 'Zoutzuur';
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2350 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2351 case 'Fosforzuur': $("#wa_acid_name").val('Fosforzuur');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2352 $("#wa_acid").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2353 $("#wa_acid_perc").val(80);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2354 last_acid = 'Fosforzuur';
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2355 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2356 case 'Zwavelzuur': $("#wa_acid_name").val('Zwavelzuur');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2357 $("#wa_acid").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2358 $("#wa_acid_perc").val(80);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2359 last_acid = 'Zwavelzuur';
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2360 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2361 case 'NaHCO3': $("#wa_base_name").val('NaHCO3');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2362 $("#wa_base").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2363 last_base = 'NaHCO3';
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2364 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2365 case 'Na2CO3': $("#wa_base_name").val('Na2CO3');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2366 $("#wa_base").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2367 last_base = 'Na2CO3';
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2368 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2369 case 'CaCO3': $("#wa_base_name").val('CaCO3');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2370 $("#wa_base").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2371 last_base = 'CaCO3';
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2372 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2373 case 'Ca(OH)2': $("#wa_base_name").val('Ca(OH)2');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2374 $("#wa_base").val(row.m_weight);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2375 last_base = 'Ca(OH)2';
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2376 break;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2377 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2378 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2379 return data;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2380 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2381 loadError: function(jqXHR, status, error) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2382 $('#err').text(status + ' ' + error);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2383 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2384 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2385 $("#miscGrid").jqxGrid({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2386 width: 960,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2387 height: 400,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2388 source: miscAdapter,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2389 theme: theme,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2390 selectionmode: 'singlerow',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2391 editmode: 'selectedcell',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2392 editable: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2393 localization: getLocalization(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2394 showtoolbar: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2395 rendertoolbar: function (toolbar) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2396 var me = this;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2397 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2398 toolbar.append(container);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2399 container.append('<div style="float: left; margin-left: 165px;" id="maddrowbutton"></div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2400 container.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2401 container.append('<div style="float: left; margin-left: 10px;" id="minstockbutton"></div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2402 container.append('<input style="float: left; margin-left: 200px;" id="mdeleterowbutton" type="button" value="Verwijder ingredient" />');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2403 // add misc from dropdownlist.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2404 $("#maddrowbutton").jqxDropDownList({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2405 placeHolder: "Kies ingredient:",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2406 theme: theme,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2407 source: misclist,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2408 displayMember: "name",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2409 width: 150,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2410 height: 27,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2411 dropDownWidth: 500,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2412 dropDownHeight: 500
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2413 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2414 $("#maddrowbutton").on('select', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2415 if (event.args) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2416 var index = event.args.index;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2417 var datarecord = misclist.records[index];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2418 var row = {};
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2419 row["m_name"] = datarecord.name;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2420 row["m_amount"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2421 row["m_cost"] = datarecord.cost;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2422 row["m_type"] = datarecord.type;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2423 row["m_use_use"] = datarecord.use_use;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2424 row["m_time"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2425 row["m_weight"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2426 row["m_amount_is_weight"] = datarecord.amount_is_weight;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2427 var commit = $("#miscGrid").jqxGrid('addrow', null, row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2428 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2429 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2430 $("#minstockbutton").jqxCheckBox({ theme: theme, height: 27 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2431 $("#minstockbutton").on('change', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2432 miscinstock = event.args.checked;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2433 misclist.dataBind();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2434 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2435 // delete selected misc.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2436 $("#mdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2437 $("#mdeleterowbutton").on('click', function () {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2438 var selectedrowindex = $("#miscGrid").jqxGrid('getselectedrowindex');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2439 var rowscount = $("#miscGrid").jqxGrid('getdatainformation').rowscount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2440 var type = $("#miscGrid").jqxGrid('getcellvalue', selectedrowindex, "m_type");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2441 if (selectedrowindex >= 0 && selectedrowindex < rowscount && type != "Water agent") {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2442 var id = $("#miscGrid").jqxGrid('getrowid', selectedrowindex);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2443 var commit = $("#miscGrid").jqxGrid('deleterow', id);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2444 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2445 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2446 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2447 ready: function() {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2448 $('#jqxTabs').jqxTabs('next');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2449 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2450 columns: [
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2451 { text: 'Ingredient', editable: false, datafield: 'm_name' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2452 { text: 'Type', editable: false, width: 120, align: 'center', cellsalign: 'center', datafield: 'm_type' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2453 { text: 'Gebruik', width: 110, align: 'center', cellsalign: 'center', datafield: 'm_use_use', columntype: 'dropdownlist',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2454 createeditor: function (row, column, editor) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2455 var srcUseUse = [ "Mash", "Boil", "Primary", "Secondary", "Bottling" ];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2456 editor.jqxDropDownList({ autoDropDownHeight: true, source: srcUseUse });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2457 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2458 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2459 var type = $("#miscGrid").jqxGrid('getcellvalue', row, "m_type");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2460 if (type == "Water agent")
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2461 return oldvalue;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2462 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2463 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2464 { datafield: 'm_amount_is_weight', hidden: true }, // We need to declare this column
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2465 { datafield: 'm_amount', hidden: true }, // We need to declare this column
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2466 { text: 'Hoeveelheid', datafield: 'm_weight', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f2',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2467 columntype: 'numberinput',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2468 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2469 var vstr = rowdata.m_amount_is_weight ? "gr":"ml";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2470 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value,"f2")+" "+vstr+"</div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2471 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2472 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2473 var high = parseFloat(dataRecord.boil_size) * 1000;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2474 if (value < 0 || value > high) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2475 return { result: false, message: "Hoeveelheid moet tussen 0 en "+high+" zijn" };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2476 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2477 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2478 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2479 initeditor: function (row, cellvalue, editor) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2480 editor.jqxNumberInput({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2481 inputMode: 'simple', min: 0, max: parseFloat(dataRecord.boil_size) * 1000,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2482 decimalDigits: 2, spinButtons: false
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2483 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2484 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2485 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2486 var type = $("#miscGrid").jqxGrid('getcellvalue', row, "m_type");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2487 if (type == "Water agent")
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2488 return oldvalue;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2489 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2490 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2491 { text: 'Tijd', datafield: 'm_time', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'f0',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2492 columntype: 'numberinput',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2493 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2494 if (rowdata.m_use_use == 'Boil') {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2495 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value, "f0")+" m</div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2496 } else if (rowdata.m_use_use == 'Secondary') {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2497 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value, "f0")+" d</div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2498 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2499 var tijd = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2500 return "<div style='margin: 4px;' class='jqx-right-align'> </div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2501 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2502 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2503 initeditor: function (row, cellvalue, editor, celltext, pressedChar) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2504 editor.jqxNumberInput({ decimalDigits: 0, digits: 3, min: 0, max: parseFloat(dataRecord.boil_time) });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2505 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2506 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2507 var use = $("#miscGrid").jqxGrid('getcellvalue', row, "m_use_use");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2508 if ((use != "Boil") && (use != "Secondary"))
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2509 return oldvalue;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2510 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2511 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2512 var high = parseFloat(dataRecord.boil_time);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2513 if (value < 0 || value > high ) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2514 return { result: false, message: "De tijd moet 0-"+high+" zijn" };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2515 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2516 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2517 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2518 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2519 ]
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2520 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2521 $("#miscGrid").on('cellendedit', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2522 var args = event.args;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2523 console.log("Event Type: cellendedit, Column: " + args.datafield + ", Row: " + (args.rowindex) + ", Value: " + args.value);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2524 $("#miscGrid").jqxGrid('setcellvalue', args.rowindex, args.datafield, args.value);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2525 if (args.datafield == 'm_weight') {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2526 $("#miscGrid").jqxGrid('setcellvalue', args.rowindex, 'm_amount', parseFloat(args.value) / 1000);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2527 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2528 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2529 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2530
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2531 // Inline yeasts editor
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2532 var editYeast = function (data) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2533 var yeastSource = {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2534 localdata: data.yeasts,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2535 datatype: "local",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2536 cache: false,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2537 datafields: [
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2538 { name: 'y_name', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2539 { name: 'y_laboratory', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2540 { name: 'y_product_id', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2541 { name: 'y_amount', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2542 { name: 'y_cost', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2543 { name: 'y_type', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2544 { name: 'y_form', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2545 { name: 'y_time', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2546 { name: 'y_min_temperature', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2547 { name: 'y_max_temperature', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2548 { name: 'y_attenuation', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2549 { name: 'y_amount_is_weight', type: 'bool' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2550 { name: 'y_use', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2551 { name: 'y_weight', type: 'float' }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2552 ],
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2553 addrow: function (rowid, rowdata, position, commit) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2554 commit(true);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2555 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2556 deleterow: function (rowid, commit) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2557 commit(true);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2558 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2559 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2560 var yeastAdapter = new $.jqx.dataAdapter(yeastSource, {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2561 beforeLoadComplete: function (records) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2562 var data = new Array();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2563 for (var i = 0; i < records.length; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2564 var row = records[i];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2565 if (row.y_form == 'Liquid')
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2566 row.y_weight = Math.round(row.y_amount * 17);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2567 else
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2568 row.y_weight = row.y_amount * 1000;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2569 data.push(row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2570 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2571 return data;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2572 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2573 loadError: function(jqXHR, status, error) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2574 $('#err').text(status + ' ' + error);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2575 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2576 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2577 $("#yeastGrid").jqxGrid({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2578 width: 1050,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2579 height: 300,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2580 source: yeastAdapter,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2581 theme: theme,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2582 selectionmode: 'singlerow',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2583 editmode: 'selectedcell',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2584 editable: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2585 localization: getLocalization(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2586 showtoolbar: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2587 rendertoolbar: function (toolbar) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2588 var me = this;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2589 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2590 toolbar.append(container);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2591 container.append('<div style="float: left; margin-left: 165px;" id="yaddrowbutton"></div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2592 container.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2593 container.append('<div style="float: left; margin-left: 10px;" id="yinstockbutton"></div>');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2594 container.append('<input style="float: left; margin-left: 230px;" id="ydeleterowbutton" type="button" value="Verwijder gist" />');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2595 // add yeast from dropdownlist.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2596 $("#yaddrowbutton").jqxDropDownList({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2597 placeHolder: "Kies gist:",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2598 theme: theme,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2599 source: yeastlist,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2600 displayMember: "name",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2601 width: 150,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2602 height: 27,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2603 dropDownWidth: 500,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2604 dropDownHeight: 500,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2605 renderer: function (index, label, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2606 var datarecord = yeastlist.records[index];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2607 return datarecord.laboratory+" "+datarecord.product_id+" "+datarecord.name;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2608 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2609 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2610 $("#yaddrowbutton").on('select', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2611 if (event.args) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2612 var index = event.args.index;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2613 var datarecord = yeastlist.records[index];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2614 var row = {};
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2615 row["y_name"] = datarecord.name;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2616 row["y_laboratory"] = datarecord.laboratory;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2617 row["y_product_id"] = datarecord.product_id;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2618 row["y_type"] = datarecord.type;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2619 row["y_form"] = datarecord.form;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2620 row["y_amount"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2621 row["y_cost"] = datarecord.cost;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2622 row["y_use"] = "Primary";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2623 row["y_time"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2624 if (datarecord.form == "Dry") {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2625 row["y_amount_is_weight"] = 1;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2626 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2627 row["y_amount_is_weight"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2628 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2629 row["y_min_temperature"] = datarecord.min_temperature;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2630 row["y_max_temperature"] = datarecord.max_temperature;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2631 row["y_attenuation"] = datarecord.attenuation;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2632 row["y_weight"] = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2633 var commit = $("#yeastGrid").jqxGrid('addrow', null, row);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2634 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2635 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2636 $("#yinstockbutton").jqxCheckBox({ theme: theme, height: 27 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2637 $("#yinstockbutton").on('change', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2638 yeastinstock = event.args.checked;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2639 yeastlist.dataBind();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2640 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2641 // delete selected yeast.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2642 $("#ydeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2643 $("#ydeleterowbutton").on('click', function () {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2644 var selectedrowindex = $("#yeastGrid").jqxGrid('getselectedrowindex');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2645 var rowscount = $("#yeastGrid").jqxGrid('getdatainformation').rowscount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2646 if (selectedrowindex >= 0 && selectedrowindex < rowscount) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2647 var id = $("#yeastGrid").jqxGrid('getrowid', selectedrowindex);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2648 var commit = $("#yeastGrid").jqxGrid('deleterow', id);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2649 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2650 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2651 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2652 ready: function() {
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
2653 calcSVG();
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2654 $('#jqxTabs').jqxTabs('next');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2655 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2656 columns: [
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2657 { text: 'Gist', editable: false, datafield: 'y_name' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2658 { text: 'Laboratorium', editable: false, width: 150, datafield: 'y_laboratory' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2659 { text: 'Code', editable: false, width: 90, datafield: 'y_product_id' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2660 { text: 'Soort', editable: false, width: 80, align: 'center', cellsalign: 'center', datafield: 'y_form' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2661 { text: 'Min.', editable: false, width: 70, align: 'right', cellsalign: 'right', datafield: 'y_min_temperature' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2662 { text: 'Max.', editable: false, width: 70, align: 'right', cellsalign: 'right', datafield: 'y_max_temperature' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2663 { text: 'Attn.', editable: false, width: 70, align: 'right', cellsalign: 'right', datafield: 'y_attenuation', cellsformat: 'f1' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2664 { text: 'Voor', width: 100, align: 'center', cellsalign: 'center', datafield: 'y_use', columntype: 'dropdownlist',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2665 createeditor: function (row, column, editor) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2666 var srcYUse = [ "Primary", "Secondary", "Bottle" ];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2667 editor.jqxDropDownList({ autoDropDownHeight: true, source: srcYUse });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2668 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2669 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2670 { datafield: 'y_amount', width: 90 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2671 { text: 'Hoeveel', datafield: 'y_weight', width: 110, align: 'right', cellsalign: 'right',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2672 cellsformat: 'f1', columntype: 'numberinput',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2673 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2674 if (rowdata.y_form == 'Liquid') {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2675 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value, "f0")+" pk</div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2676 } else if (rowdata.y_form == 'Dry') {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2677 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value, "f1")+" gr</div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2678 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2679 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value, "f0")+" ml</div>";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2680 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2681 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2682 initeditor: function (row, cellvalue, editor, celltext, pressedChar) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2683 var form = $("#yeastGrid").jqxGrid('getcellvalue', args.rowindex, 'y_form');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2684 if (form == 'Dry') {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2685 editor.jqxNumberInput({ decimalDigits: 1, min: 0, spinButtons: false });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2686 } else {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2687 editor.jqxNumberInput({ decimalDigits: 0, min: 0, spinButtons: false });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2688 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2689 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2690 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2691 if (value < 0 || value > 100000000000 ) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2692 return { result: false, message: "Hoeveelheid moet 0-~ zijn" };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2693 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2694 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2695 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2696 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2697 ]
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2698 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2699 $("#yeastGrid").on('cellendedit', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2700 var args = event.args;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2701 console.log("Event Type: cellendedit, Column: " + args.datafield + ", Row: " + (args.rowindex) + ", Value: " + args.value);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2702 $("#yeastGrid").jqxGrid('setcellvalue', args.rowindex, args.datafield, args.value);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2703 if (args.datafield == 'y_weight') {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2704 var form = $("#yeastGrid").jqxGrid('getcellvalue', args.rowindex, 'y_form');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2705 if (form == 'Liquid')
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2706 $("#yeastGrid").jqxGrid('setcellvalue', args.rowindex, 'y_amount', parseFloat(args.value * 0.0588));
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2707 else
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2708 $("#yeastGrid").jqxGrid('setcellvalue', args.rowindex, 'y_amount', parseFloat(args.value / 1000));
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2709 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2710 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2711 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2712
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2713 // inline mash editor
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2714 var editMash = function (data) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2715 var generaterow = function () {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2716 var row = {};
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2717 row["step_name"] = "Stap 1";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2718 row["step_type"] = "Infusion";
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2719 row["step_infuse_amount"] = 15;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2720 row["step_temp"] = 62.0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2721 row['step_time'] = 20.0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2722 row['ramp_time'] = 1.0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2723 row['end_temp'] = 62.0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2724 return row;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2725 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2726 var mashSource = {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2727 localdata: data.mashs,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2728 datatype: "local",
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2729 cache: false,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2730 datafields: [
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2731 { name: 'step_name', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2732 { name: 'step_type', type: 'string' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2733 { name: 'step_infuse_amount', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2734 { name: 'step_temp', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2735 { name: 'step_time', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2736 { name: 'ramp_time', type: 'float' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2737 { name: 'end_temp', type: 'float' }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2738 ],
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2739 addrow: function (rowid, rowdata, position, commit) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2740 commit(true);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2741 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2742 deleterow: function (rowid, commit) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2743 commit(true);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2744 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2745 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2746 var mashAdapter = new $.jqx.dataAdapter(mashSource, {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2747 beforeLoadComplete: function (records) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2748 mash_infuse = 0;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2749 var data = new Array();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2750 for (var i = 0; i < records.length; i++) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2751 var row = records[i];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2752 if (row.step_type == 'Infusion')
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2753 mash_infuse += parseFloat(row.step_infuse_amount);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2754 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2755 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2756 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2757 $("#mashGrid").jqxGrid({
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2758 width: 960,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2759 height: 400,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2760 source: mashAdapter,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2761 theme: theme,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2762 selectionmode: 'singlerow',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2763 editmode: 'selectedcell',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2764 editable: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2765 localization: getLocalization(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2766 showtoolbar: true,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2767 rendertoolbar: function (toolbar) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2768 var me = this;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2769 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2770 toolbar.append(container);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2771 container.append('<input style="float: left; margin-left: 165px;" id="saddrowbutton" type="button" value="Nieuwe stap" />');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2772 container.append('<input style="float: left; margin-left: 230px;" id="sdeleterowbutton" type="button" value="Verwijder stap" />');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2773 $("#saddrowbutton").jqxButton({ theme: theme, height: 27, width: 150 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2774 $("#saddrowbutton").on('click', function () {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2775 var datarow = generaterow();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2776 var commit = $("#mashGrid").jqxGrid('addrow', null, datarow);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2777 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2778 // delete selected yeast.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2779 $("#sdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2780 $("#sdeleterowbutton").on('click', function () {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2781 var selectedrowindex = $("#mashGrid").jqxGrid('getselectedrowindex');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2782 var rowscount = $("#mashGrid").jqxGrid('getdatainformation').rowscount;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2783 if (selectedrowindex >= 0 && selectedrowindex < rowscount) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2784 var id = $("#mashGrid").jqxGrid('getrowid', selectedrowindex);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2785 var commit = $("#mashGrid").jqxGrid('deleterow', id);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2786 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2787 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2788 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2789 ready: function() {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2790 var fg = estimate_fg(psugar, pcara, 0, 0, 0, svg, parseFloat(parseFloat($("#est_og").jqxNumberInput('decimal'))));
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2791 dataRecord.est_fg = fg;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2792 $('#est_fg').val(fg);
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
2793 $('#est_fg2').val(fg);
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2794 calcInit();
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2795 $('#jqxLoader').jqxLoader('close');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2796 $('#jqxTabs').jqxTabs('first');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2797 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2798 columns: [
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2799 { text: 'Stap naam', datafield: 'step_name' },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2800 { text: 'Stap type', datafield: 'step_type', width: 110, columntype: 'dropdownlist',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2801 createeditor: function (row, cellvalue, editor, celltext, cellwidth, cellheight) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2802 var dataSource = [ "Infusion", "Temperature", "Decoction" ];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2803 editor.jqxDropDownList({ source: dataSource, dropDownHeight: 105 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2804 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2805 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2806 { text: 'Temperatuur', datafield: 'step_temp', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2807 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2808 if (value < 35 || value > 80) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2809 return { result: false, message: "De temperatuur moet tussen 35 en 80 zijn." };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2810 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2811 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2812 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2813 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2814 { text: 'Eind', datafield: 'end_temp', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2815 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2816 if (value < 35 || value > 80) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2817 return { result: false, message: "De temperatuur moet tussen 35 en 80 zijn." };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2818 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2819 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2820 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2821 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2822 { text: 'Tijd', datafield: 'step_time', width: 70, align: 'right', cellsalign: 'right',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2823 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2824 if (value < 1 || value > 360) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2825 return { result: false, message: "De tijd moet tussen 1 en 360 zijn." };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2826 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2827 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2828 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2829 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2830 { text: 'Stap', datafield: 'ramp_time', width: 70, align: 'right', cellsalign: 'right',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2831 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2832 if (value < 1 || value > 60) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2833 return { result: false, message: "De tijd moet tussen 1 en 60 zijn." };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2834 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2835 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2836 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2837 },
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2838 { text: 'Infuse', datafield: 'step_infuse_amount', width: 70, align: 'right', cellsalign: 'right',
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2839 validation: function (cell, value) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2840 if (value < 0 || value > 60) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2841 return { result: false, message: "De waarde moet tussen 0 en 60 zijn." };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2842 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2843 return true;
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2844 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2845 }
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2846 ]
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2847 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2848 $("#mashGrid").on('cellendedit', function (event) {
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2849 $('#mashGrid').jqxGrid('sortby', 'step_temp', 'asc');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2850 });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2851 };
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2852
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2853 // initialize the input fields.
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2854 var srcType = [ "All Grain", "Partial Mash", "Extract" ];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2855 var srcColor = [ "Morey", "Mosher", "Daniels" ];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2856 var srcIBU = [ "Tinseth", "Rager", "Daniels" ]; // Only these are supported at this time.
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2857 var srcBase = [ "NaHCO3", "Na2CO3", "CaCO3", "Ca(OH)2" ];
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2858 var srcAcid = [ "Melkzuur", "Zoutzuur", "Fosforzuur", "Zwavelzuur" ];
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
2859 var srcSource = [ "Bron 1", "Bron 2", "Gemengd" ];
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
2860 var srcSugar = [ "Kristalsuiker", "Glucose/dextrose", "Honing", "Moutextract", "Melasse" ];
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2861 var srcMaterial= [ "RVS", "Aluminium", "Kunststof", "Koper" ];
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2862 var srcAeration= [ 'None', 'Air', 'Oxygen' ];
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2863 var srcCooling= [ '-', 'Emersion chiller', 'Counterflow chiller', 'Au bain marie', 'Natural' ];
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2864 // '-', 'Dompelkoeler', 'Tegenstroomkoeler', 'Au bain marie', 'Laten afkoelen'
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2865 // Tab 1, Algemeen
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2866 $("#name").jqxTooltip({ content: 'De naam voor dit product.' });
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2867 $("#name").jqxInput({ theme: theme, width: 640, height: 23 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2868 $("#code").jqxTooltip({ content: 'Product code nummer.' });
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2869 $("#code").jqxInput({ theme: theme, width: 100, height: 23 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2870 $("#birth").jqxTooltip({ content: 'De ontwerp datum van dit product.' });
167
dabcd35f8f92 Added new brew project wizzard. Moved equipment dropdown to global script. The project birth date is allways read-only, so it can never be changed.
Michiel Broek <mbroek@mbse.eu>
parents: 164
diff changeset
2871 $("#birth").jqxInput({ theme: theme, width: 120, height: 23 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2872 $("#stage").jqxTooltip({ content: 'De productie fase van dit product.' });
112
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
2873 $("#stage").jqxInput({ theme: theme, width: 100, height: 23 });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2874 $("#inventory_reduced").jqxCheckBox({ theme: theme, width: 120, height: 23 });
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2875 $('#inventory_reduced').on('checked', function (event) {
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2876 // Call a script to do the work and block this.
122
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
2877 // Note that this script must set this flag too, so if the user doesn't Save it is still set.
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2878 // Call the script with the uuid.
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2879 $("#inventory_reduced").jqxCheckBox({ disabled : true });
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2880 });
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2881 $("#locked").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled : true });
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2882 $('#locked').on('checked', function (event) {
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2883 if (brewstage >= 10) {
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2884 $("#stage").val('Closed');
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2885 brewstage = 11;
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2886 }
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2887 });
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
2888 $('#locked').on('unchecked', function (event) {
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2889 if (brewstage >= 10) {
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2890 $("#stage").val('Ready');
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2891 brewstage = 10;
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
2892 }
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2893 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2894 $("#notes").jqxTooltip({ content: 'De uitgebreide opmerkingen over dit product.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2895 $("#notes").jqxInput({ theme: theme, width: 960, height: 100 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2896 $("#type").jqxTooltip({ content: 'Het brouw type van dit recept.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2897 $("#type").jqxDropDownList({ theme: theme, source: srcType, width: 125, height: 23, dropDownHeight: 95 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2898 $("#efficiency").jqxTooltip({ content: 'Het rendement van maischen en koken.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2899 $("#efficiency").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 40, max: 100, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2900
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2901 $("#batch_size").jqxTooltip({ content: 'Het volume van het gekoelde wort na het koken.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2902 $("#batch_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: 'L', symbolPosition: 'right' });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2903 $("#boil_time").jqxTooltip({ content: 'De kooktijd in minuten.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2904 $("#boil_time").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, max: 360, decimalDigits: 0, spinButtons: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2905 $("#boil_size").jqxTooltip({ content: 'Het volume van het wort voor het koken.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2906 $("#boil_size").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 2, readOnly: true, symbol: 'L', symbolPosition: 'right' });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2907 $("#st_guide").jqxTooltip({ content: 'De bierstijl gids voor dit recept.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2908 $("#st_guide").jqxInput({ theme: theme, width: 250, height: 23 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2909 $("#st_name").jqxTooltip({ content: 'De bierstijl naam voor dit recept.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2910 $("#st_name").jqxInput({ theme: theme, width: 250, height: 23 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2911 $("#st_letter").jqxTooltip({ content: 'De bierstijl letter voor dit recept.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2912 $("#st_letter").jqxInput({ theme: theme, width: 100, height: 23 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2913 $("#st_type").jqxTooltip({ content: 'Het bierstijl type.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2914 $("#st_type").jqxInput({ theme: theme, width: 90, height: 23 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2915 $("#st_category").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2916 $("#st_category").jqxInput({ theme: theme, width: 250, height: 23 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2917 $("#st_category_number").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie sub nummer.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2918 $("#st_category_number").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2919
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2920 $("#est_og").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2921 $("#est_og").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 1.000, max: 1.200, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2922 $("#st_og_min").jqxTooltip({ content: 'Het minimum begin SG voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2923 $("#st_og_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2924 $("#st_og_max").jqxTooltip({ content: 'Het maximum begin SG voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2925 $("#st_og_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2926 $("#est_fg").jqxTooltip({ content: 'Het eind SG. Dit wordt automatisch berekend.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2927 $("#est_fg").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 3, readOnly: true });
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
2928 $("#est_fg2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 70, height: 23, decimalDigits: 3, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2929 $("#st_fg_min").jqxTooltip({ content: 'Het minimum eind SG voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2930 $("#st_fg_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2931 $("#st_fg_max").jqxTooltip({ content: 'Het maximum eind SG voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2932 $("#st_fg_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2933 $("#est_abv").jqxTooltip({ content: 'Alcohol volume %. Dit wordt automatisch berekend.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2934 $("#est_abv").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2935 $("#st_abv_min").jqxTooltip({ content: 'Het minimum alcohol volume % voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2936 $("#st_abv_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2937 $("#st_abv_max").jqxTooltip({ content: 'Het maximum alcohol volume % voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2938 $("#st_abv_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2939 $("#est_color").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2940 $("#est_color").jqxNumberInput({ inputMode: 'simple', theme: theme, symbol: ' EBC', symbolPosition: 'right', width: 100, height: 23, decimalDigits: 0, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2941 $("#st_color_min").jqxTooltip({ content: 'De minimum kleur voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2942 $("#st_color_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2943 $("#st_color_max").jqxTooltip({ content: 'De maximum kleur voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2944 $("#st_color_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2945 $("#color_method").jqxDropDownList({ theme: theme, source: srcColor, width: 125, height: 23, dropDownHeight: 95 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2946 $("#est_ibu").jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2947 $("#est_ibu").jqxNumberInput({ inputMode: 'simple', theme: theme, symbol: ' IBU', symbolPosition: 'right', width: 100, height: 23, decimalDigits: 0, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2948 $("#st_ibu_min").jqxTooltip({ content: 'De minimum bitterheid voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2949 $("#st_ibu_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2950 $("#st_ibu_max").jqxTooltip({ content: 'De maximum bitterheid voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2951 $("#st_ibu_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2952 $("#ibu_method").jqxDropDownList({ theme: theme, source: srcIBU, width: 125, height: 23, dropDownHeight: 95, dropDownVerticalAlignment: 'top' });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2953 $("#est_carb").jqxTooltip({ content: 'Koolzuur volume. Dit wordt automatisch berekend.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2954 $("#est_carb").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2955 $("#st_carb_min").jqxTooltip({ content: 'Het minimum koolzuur volume voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2956 $("#st_carb_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2957 $("#st_carb_max").jqxTooltip({ content: 'Het maximum koolzuur volume voor deze bierstijl.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2958 $("#st_carb_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2959
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2960 // Tab 2, Equipment
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2961 $("#eq_name").jqxTooltip({ content: 'De naam van deze brouw apparatuur.' });
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2962 $("#eq_name").jqxInput({ theme: theme, width: 250, height: 23 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2963 $("#eq_boil_size").jqxTooltip({ content: 'Normaal kook volume in liters' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2964 $("#eq_boil_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2965 $("#eq_batch_size").jqxTooltip({ content: 'Berekende batch grootte in liters aan het eind van de kook.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2966 $("#eq_batch_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2967 $("#eq_tun_volume").jqxTooltip({ content: 'Maisch ketel volume.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2968 $("#eq_tun_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2969 $("#eq_top_up_water").jqxTooltip({ content: 'Extra water in het gistvat.' });
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
2970 $("#eq_top_up_water").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2971 $("#eq_trub_chiller_loss").jqxTooltip({ content: 'Standaard verlies bij het overbrengen naar het gistvat.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2972 $("#eq_trub_chiller_loss").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2973 $("#eq_evap_rate").jqxTooltip({ content: 'Verdamping in liters per uur.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2974 $("#eq_evap_rate").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 2, });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2975 $("#eq_boil_time").jqxTooltip({ content: 'Normale kooktijd in minuten.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2976 $("#eq_boil_time").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2977 $("#eq_top_up_kettle").jqxTooltip({ content: 'Extra water toevoegen tijdens de kook.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2978 $("#eq_top_up_kettle").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2979 $("#eq_hop_utilization").jqxTooltip({ content: '100% voor kleine installaties, hoger voor grote brouwerijen.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2980 $("#eq_hop_utilization").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2981 $("#eq_notes").jqxTooltip({ content: 'Opmerkingen over deze apparatuur.' });
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
2982 $("#eq_notes").jqxInput({ theme: theme, width: 960, height: 200 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2983 $("#eq_lauter_volume").jqxTooltip({ content: 'Filterkuip volume.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2984 $("#eq_lauter_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2985 $("#eq_lauter_deadspace").jqxTooltip({ content: 'Filterkuip verlies in liters.' });
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
2986 $("#eq_lauter_deadspace").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2987 $("#eq_kettle_volume").jqxTooltip({ content: 'Kook ketel volume in liters.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2988 $("#eq_kettle_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2989 $("#eq_mash_volume").jqxTooltip({ content: 'Maisch water voor de eerste stap.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2990 $("#eq_mash_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2991 $("#eq_mash_max").jqxTooltip({ content: 'De maximale moutstort in Kg.' });
149
ff45488d480e Added some icons from Brewersfriend. They should be replaced someday. Added maximum mash weight setting to the equipment database. Usefull for brew automate and RIMS systems. During recipes import acid and base additions are translated. Brews and recipes now have 2 water sources. Added water mixer. Added basic water treatment, but not for pH yet. Redesigned the fermentables and water tabs.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
2992 $("#eq_mash_max").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2993 $("#eq_efficiency").jqxTooltip({ content: 'Gemiddeld brouwzaal rendement.' });
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
2994 $("#eq_efficiency").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2995
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2996 // Tab 3, Fermentables
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
2997 $("#est_color2").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2998 $("#est_color2").jqxNumberInput({ inputMode: 'simple', theme: theme, symbol: ' EBC', symbolPosition: 'right', width: 100, height: 23, decimalDigits: 0, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
2999 $("#perc_malts").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3000 $("#est_og2").jqxTooltip({ content: 'Het geschatte begin SG van dit product.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3001 $("#est_og2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 3, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3002 $("#perc_sugars").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3003 $("#perc_cara").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3004
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3005 // Tab 4, Hops
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3006 $("#est_ibu2").jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3007 $("#est_ibu2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3008 $("#hop_flavour").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3009 $("#hop_aroma").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3010
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3011 // Tab 5, Miscs
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3012
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3013 // Tab 6, Yeasts
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3014
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3015 // Tab 7, Mashing
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3016 $("#mash_name").jqxTooltip({ content: 'De omschrijving van dit maisch profiel.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3017 $("#mash_name").jqxInput({ theme: theme, width: 320, height: 23 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3018
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3019 // Tab 8, Water
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3020 $("#tgt_bu").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 2, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3021 $("#tgt_cl_so4").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3022 $("#w1_name").jqxDropDownList({
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3023 placeHolder: "Kies hoofd water:",
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3024 theme: theme,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3025 source: waterlist,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3026 displayMember: "name",
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3027 width: 250,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3028 height: 27,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3029 dropDownWidth: 400,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3030 dropDownHeight: 400
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3031 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3032 $("#w1_name").on('select', function (event) {
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3033 if (event.args) {
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3034 var index = event.args.index;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3035 var datarecord = waterlist.records[index];
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3036 dataRecord.w1_name = datarecord.name;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3037 $("#w1_calcium").val(datarecord.calcium);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3038 dataRecord.w1_calcium = datarecord.calcium;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3039 $("#w1_sulfate").val(datarecord.sulfate);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3040 dataRecord.w1_sulfate = datarecord.sulfate;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3041 $("#w1_chloride").val(datarecord.chloride);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3042 dataRecord.w1_chloride = datarecord.chloride;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3043 $("#w1_sodium").val(datarecord.sodium);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3044 dataRecord.w1_sodium = datarecord.sodium;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3045 $("#w1_magnesium").val(datarecord.magnesium);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3046 dataRecord.w1_magnesium = datarecord.magnesium;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3047 $("#w1_total_alkalinity").val(datarecord.total_alkalinity);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3048 dataRecord.w1_total_alkalinity = datarecord.total_alkalinity;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3049 $("#w1_ph").val(datarecord.ph);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3050 dataRecord.w1_ph = datarecord.ph;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3051 $("#w1_cost").val(datarecord.cost);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3052 dataRecord.w1_cost = datarecord.cost;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3053 calcWater();
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3054 }
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3055 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3056 $("#w1_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3057 $("#w1_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3058 $("#w1_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3059 $("#w1_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3060 $("#w1_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3061 $("#w1_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3062 $("#w1_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3063 $("#w1_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3064 $("#w2_name").jqxDropDownList({
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3065 placeHolder: "Kies meng water:",
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3066 theme: theme,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3067 source: waterlist,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3068 displayMember: "name",
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3069 width: 250,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3070 height: 27,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3071 dropDownWidth: 400,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3072 dropDownHeight: 400
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3073 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3074 $("#w2_name").on('select', function (event) {
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3075 if (event.args) {
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3076 var index = event.args.index;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3077 var datarecord = waterlist.records[index];
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3078 dataRecord.w2_name = datarecord.name;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3079 $("#w2_calcium").val(datarecord.calcium);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3080 dataRecord.w2_calcium = datarecord.calcium;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3081 $("#w2_sulfate").val(datarecord.sulfate);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3082 dataRecord.w2_sulfate = datarecord.sulfate;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3083 $("#w2_chloride").val(datarecord.chloride);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3084 dataRecord.w2_chloride = datarecord.chloride;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3085 $("#w2_sodium").val(datarecord.sodium);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3086 dataRecord.w2_sodium = datarecord.sodium;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3087 $("#w2_magnesium").val(datarecord.magnesium);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3088 dataRecord.w2_magnesium = datarecord.magnesium;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3089 $("#w2_total_alkalinity").val(datarecord.total_alkalinity);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3090 dataRecord.w2_total_alkalinity = datarecord.total_alkalinity;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3091 $("#w2_ph").val(datarecord.ph);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3092 dataRecord.w2_ph = datarecord.ph;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3093 $("#w2_cost").val(datarecord.cost);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3094 dataRecord.w2_cost = datarecord.cost;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3095 $("#w2_amount").jqxNumberInput({ max: 100000, readOnly: false }); // Set high max to enable the spinbuttons.
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3096 calcWater();
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3097 }
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3098 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3099 $("#w2_amount").jqxTooltip({ content: 'De verdeling van het hoofd en meng water. Het totale maisch water volume blijft gelijk.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3100 $("#w2_amount").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 94, height: 23, min: 0, max: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3101 $("#w2_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3102 $("#w2_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3103 $("#w2_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3104 $("#w2_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3105 $("#w2_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3106 $("#w2_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3107 $("#w2_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3108
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3109 $("#wg_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3110 $("#wg_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3111 $("#wg_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3112 $("#wg_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3113 $("#wg_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3114 $("#wg_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3115 $("#wg_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3116 $("#wg_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3117
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3118 $("#wb_calcium").jqxTooltip({ content: 'De ideale hoeveelheid Calcium is tussen 40 en 150.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3119 $("#wb_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3120 $("#wb_magnesium").jqxTooltip({ content: 'De ideale hoeveelheid Magnesium is lager dan 30.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3121 $("#wb_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3122 $("#wb_sodium").jqxTooltip({ content: 'De ideale hoeveelheid Natrium is lager dan 150.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3123 $("#wb_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3124
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3125 $("#wb_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3126 $("#wb_chloride").jqxTooltip({ content: 'De ideale hoeveelheid Chloride is lager dan 100.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3127 $("#wb_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3128 $("#wb_sulfate").jqxTooltip({ content: 'De ideale hoeveelheid Sulfaat is lager dan 350.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3129 $("#wb_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3130
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3131 $("#wb_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3132
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3133 $("#pr_name").jqxDropDownList({
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3134 placeHolder: "Kies doel profiel:",
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3135 theme: theme,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3136 source: waterprofiles,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3137 displayMember: "name",
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3138 width: 250,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3139 height: 27,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3140 dropDownWidth: 400,
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3141 dropDownHeight: 300
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3142 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3143 $("#pr_name").on('select', function (event) {
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3144 if (event.args) {
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3145 var index = event.args.index;
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3146 var datarecord = waterprofiles.records[index];
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3147 $("#pr_calcium").val(datarecord.calcium);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3148 $("#pr_sulfate").val(datarecord.sulfate);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3149 $("#pr_chloride").val(datarecord.chloride);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3150 $("#pr_sodium").val(datarecord.sodium);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3151 $("#pr_magnesium").val(datarecord.magnesium);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3152 $("#pr_total_alkalinity").val(datarecord.total_alkalinity);
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3153 }
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3154 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3155 $("#pr_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3156 $("#pr_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3157 $("#pr_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3158 $("#pr_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3159 $("#pr_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3160 $("#pr_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3161
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3162 $("#wa_cacl2").jqxTooltip({ content: 'Voor het maken van een ander waterprofiel. Voegt calcium en chloride toe. Voor het verbeteren van zoetere bieren.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3163 $("#wa_cacl2").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3164 $("#mash_ph").jqxTooltip({ content: 'Maisch pH tussen 5.2 en 5.6. Gebruik 5.2 voor lichte en 5.5 voor donkere bieren.'});
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3165 $("#mash_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, max: 8, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3166 $("#sparge_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3167 $("#wa_caso4").jqxTooltip({ content: 'Gips. Voor het maken van een ander waterprofiel. Voegt calcium en sulfaat toe. Voor het verbeteren van bittere bieren.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3168 $("#wa_caso4").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3169 $("#calc_acid").jqxCheckBox({ theme: theme, width: 120, height: 23 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3170 $("#sparge_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 70, max: 98, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3171 $("#wa_mgso4").jqxTooltip({ content: 'Epsom zout. Voor het maken van een ander waterprofiel. Voegt magnesium en sulfaat toe. Gebruik spaarzaam!' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3172 $("#wa_mgso4").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3173 $("#wa_base_name").jqxDropDownList({ theme: theme, source: srcBase, width: 100, height: 23, dropDownHeight: 128 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3174 $("#wa_base").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05, symbol: ' gr', symbolPosition: 'right' });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3175 $("#sparge_source").jqxDropDownList({ theme: theme, source: srcSource, width: 100, height: 23, dropDownHeight: 95 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3176 $("#wa_nacl").jqxTooltip({ content: 'Keukenzout. Voor het maken van een ander waterprofiel. Voegt natrium en chloride toe. Voor het accentueren van zoetheid. Bij hoge dosering wordt het bier ziltig.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3177 $("#wa_nacl").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3178 $("#wa_acid_name").jqxDropDownList({ theme: theme, source: srcAcid, width: 100, height: 23, dropDownHeight: 128 })
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3179 $("#wa_acid").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05, symbol: ' ml', symbolPosition: 'right' });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3180 $("#wa_acid_perc").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 80, height: 23, min: 0, max: 100, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3181 $("#sparge_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4.5, max: 6.5, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3182 $("#sparge_acid_type").jqxDropDownList({ theme: theme, source: srcAcid, width: 100, height: 23, dropDownHeight: 128 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3183 $("#sparge_acid_perc").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, spinButtons: true, decimalDigits: 0, symbol: '%', symbolPosition: 'right' });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3184 $("#sparge_acid_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 2, readOnly: true, symbol: ' ml', symbolPosition: 'right' });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3185
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3186 // Tab 9, Brewday
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3187 $("#brew_date_start").jqxDateTimeInput({ theme: theme, width: 230, height: 23, formatString: 'yyyy-MM-dd HH:mm:ss', showTimeButton: true });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3188 $("#brew_date_end").jqxDateTimeInput({ theme: theme, width: 230, height: 23, formatString: 'yyyy-MM-dd HH:mm:ss', showTimeButton: true });
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3189 $("#brew_mash_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3190 $("#est_mash_ph").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3191 $("#brew_preboil_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3192 // est_preboil_ph
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3193 $("#brew_aboil_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3194 // est_aboil_ph
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
3195 $("#brew_mash_sg").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 1.000, max: 1.200, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 });
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
3196 $("#brew_mash_sg").on('valueChanged', function () { calcMashEfficiency(); });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3197 $("#est_mash_sg").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 3 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3198 $("#brew_preboil_sg").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3199 $("#brew_aboil_sg").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 });
161
2218edd86ba1 Moved the tooltips to the field declarations.
Michiel Broek <mbroek@mbse.eu>
parents: 160
diff changeset
3200 $("#est_og3").jqxTooltip({ content: 'Het geschatte begin SG van dit product.' });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3201 $("#est_og3").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 70, height: 23, decimalDigits: 3, readOnly: true });
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3202 $("#brew_mash_efficiency").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3203 $("#brew_preboil_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3204 $("#brew_aboil_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3205 $("#brew_preboil_efficiency").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3206 $("#brew_aboil_efficiency").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3207 $("#brew_sparge_temperature").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3208 $("#brew_sparge_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3209 $("#brew_whirlpool9").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 120, decimalDigits: 0, spinButtons: true });
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3210 $("#brew_cooling_to").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 119
diff changeset
3211 $("#brew_sparge_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 14, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3212 $("#brew_whirlpool7").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 120, decimalDigits: 0, spinButtons: true });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3213 $("#brew_cooling_method").jqxDropDownList({ theme: theme, source: srcCooling, width: 170, height: 23, dropDownHeight: 153 });
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3214 $("#brew_whirlpool6").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 120, decimalDigits: 0, spinButtons: true });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3215 $("#brew_cooling_time").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 1440, decimalDigits: 0, spinButtons: true });
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3216 $("#brew_whirlpool2").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 120, decimalDigits: 0, spinButtons: true });
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3217 $("#brew_aeration_type").jqxDropDownList({ theme: theme, source: srcAeration, width: 100, height: 23, dropDownHeight: 95 });
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3218 $("#brew_aeration_time").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 1440, decimalDigits: 0, spinButtons: true });
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3219 $("#brew_aeration_speed").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 1440, decimalDigits: 0, spinButtons: true });
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3220 $("#brew_fermenter_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3221 $("#brew_fermenter_extrawater").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3222 $("#brew_fermenter_sg").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 3 });
119
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3223 $("#brew_fermenter_extrasugar").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3224 $("#brew_fermenter_ibu").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 });
ae5e8d740173 Renamed some fields in prod_main to prevent ambigous names with the join. Delete product also deletes the corresponding recipe. Fixed equipment load and save. Read data from the product main joined with prod_recipes completed. The brewday page is now almost complete, the calculations must be added.
Michiel Broek <mbroek@mbse.eu>
parents: 115
diff changeset
3225 $("#brew_fermenter_color").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 });
171
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3226 $("#BLog").jqxButton({ template: "info", width: '150px', theme: theme });
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3227 $("#BLog").click(function () {
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3228 // Open log in a new tab.
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3229 var url="log_brew.php?code=" + dataRecord.code;
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3230 window.open(url);
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3231 });
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3232
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3233 // Tab 10, Fermentation
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3234 // Note, fermentation temps changes must do calcCarbonation()
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3235 $("#brew_fermenter_sg2").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 3 });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3236 $("#primary_start_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 40, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3237 $("#primary_max_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 40, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3238 $("#primary_end_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 40, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3239 $("#primary_end_sg").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0.990, max: 1.2, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3240 $("#primary_svg").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3241 $("#primary_end_date").jqxTooltip({ content: 'De eind datum van de hoofdvergisting en eventueel overhevelen.' });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3242 $("#primary_end_date").jqxDateTimeInput({
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3243 theme: theme,
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3244 width: 150,
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3245 height: 23,
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3246 allowNullDate: true,
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3247 todayString: 'Vandaag',
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3248 clearString: 'Wissen',
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3249 showFooter: true,
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3250 formatString: 'yyyy-MM-dd'
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3251 });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3252 $("#secondary_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 40, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3253 $("#secondary_end_date").jqxTooltip({ content: 'De eind datum van de navergisting en het begin van het lageren.' });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3254 $("#secondary_end_date").jqxDateTimeInput({
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3255 theme: theme,
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3256 width: 150,
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3257 height: 23,
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3258 allowNullDate: true,
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3259 todayString: 'Vandaag',
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3260 clearString: 'Wissen',
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3261 showFooter: true,
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3262 formatString: 'yyyy-MM-dd'
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3263 });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3264 $("#tertiary_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 40, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3265 $("#fg").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 });
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3266 $("#final_abv").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3267 $("#final_svg").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
171
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3268 $("#FLog").jqxButton({ template: "info", width: '150px', theme: theme });
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3269 $("#FLog").click(function () {
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3270 // Open log in a new tab.
172
684c651dd165 Added fermentation graph screen
Michiel Broek <mbroek@mbse.eu>
parents: 171
diff changeset
3271 var url="log_fermentation.php?code=" + dataRecord.code + "&name=" + dataRecord.name;
171
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3272 window.open(url);
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3273 });
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3274
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3275 // Tab 11, Packaging
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3276 $("#package_date").jqxTooltip({ content: 'De verpakkings datum van dit bier.' });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3277 $("#package_date").jqxDateTimeInput({
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3278 theme: theme,
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3279 width: 150,
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3280 height: 23,
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3281 allowNullDate: true,
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3282 todayString: 'Vandaag',
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3283 clearString: 'Wissen',
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3284 showFooter: true,
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3285 formatString: 'yyyy-MM-dd'
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3286 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3287 $("#st_carb_min2").jqxTooltip({ content: 'Het minimum aanbevolen koolzuur volume voor deze bierstijl.'});
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3288 $("#st_carb_min2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3289 $("#st_carb_max2").jqxTooltip({ content: 'Het maximum aamnevolen koolzuur volume voor deze bierstijl.'});
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3290 $("#st_carb_max2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3291 $("#bottle_amount").jqxTooltip({ content: 'De totale hoeveelheid te bottelen bier.' });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3292 $("#bottle_amount").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3293 $("#keg_amount").jqxTooltip({ content: 'De totale hoeveelheid op fust te zetten bier.' });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3294 $("#keg_amount").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3295 $("#bottle_carbonation").jqxTooltip({ content: 'Het gewenste CO2 volume in de flessen.' });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3296 $("#bottle_carbonation").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 5, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3297 $("#keg_carbonation").jqxTooltip({ content: 'Het gewenste CO2 volume door de suiker in de fusten.' });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3298 $("#keg_carbonation").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, max: 5, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3299 $("#bottle_priming_sugar").jqxDropDownList({ theme: theme, source: srcSugar, width: 175, height: 23, dropDownHeight: 150 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3300 $("#keg_priming_sugar").jqxDropDownList({ theme: theme, source: srcSugar, width: 175, height: 23, dropDownHeight: 150 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3301 $("#bottle_priming_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 70, height: 23, decimalDigits: 1, readOnly: true });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3302 $("#keg_priming_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 70, height: 23, decimalDigits: 1, readOnly: true });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3303 $("#bottle_priming_total").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 70, height: 23, decimalDigits: 1, readOnly: true });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3304 $("#keg_priming_total").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 70, height: 23, decimalDigits: 1, readOnly: true });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3305 $("#keg_forced_carb").jqxCheckBox({ theme: theme, width: 120, height: 23 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3306 $("#keg_pressure").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 70, height: 23, decimalDigits: 1, readOnly: true });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3307 $("#bottle_abv").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 70, height: 23, decimalDigits: 1, readOnly: true });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3308 $("#keg_abv").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 70, height: 23, decimalDigits: 1, readOnly: true });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3309 $("#bottle_carbonation_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0.5, max: 40, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3310 $("#keg_carbonation_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0.5, max: 40, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3311
160
fea87a8d320b Added more information on the brewday tab. Move almost all screen init widgets in the source so they are in the Tabs order. This should make searching for them easier.
Michiel Broek <mbroek@mbse.eu>
parents: 159
diff changeset
3312 // Tab 12, Tasting
162
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3313 $("#taste_date").jqxTooltip({ content: 'De proef datum van dit bier.' });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3314 $("#taste_date").jqxDateTimeInput({
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3315 theme: theme,
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3316 width: 150,
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3317 height: 23,
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3318 allowNullDate: true,
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3319 todayString: 'Vandaag',
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3320 clearString: 'Wissen',
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3321 showFooter: true,
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3322 formatString: 'yyyy-MM-dd'
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3323 });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3324 $("#taste_rate").jqxTooltip({ content: 'Het cijfer voor dit bier van 1 tot 10.' });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3325 $("#taste_rate").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 1, max: 10, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3326 $("#taste_color").jqxTooltip({ content: 'De kleur van het bier.' });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3327 $("#taste_color").jqxInput({ theme: theme, width: 320, height: 23 });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3328 $("#taste_transparency").jqxTooltip({ content: 'De helderheid van het bier.' });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3329 $("#taste_transparency").jqxInput({ theme: theme, width: 320, height: 23 });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3330 $("#taste_head").jqxTooltip({ content: 'Het schuim op het bier.' });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3331 $("#taste_head").jqxInput({ theme: theme, width: 320, height: 23 });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3332 $("#taste_aroma").jqxTooltip({ content: 'Het aroma van het bier.' });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3333 $("#taste_aroma").jqxInput({ theme: theme, width: 960, height: 23 });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3334 $("#taste_taste").jqxTooltip({ content: 'De smaak van het bier.' });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3335 $("#taste_taste").jqxInput({ theme: theme, width: 960, height: 23 });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3336 $("#taste_aftertaste").jqxTooltip({ content: 'De nasmaak van het bier.' });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3337 $("#taste_aftertaste").jqxInput({ theme: theme, width: 960, height: 23 });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3338 $("#taste_mouthfeel").jqxTooltip({ content: 'Het mondgevoelvan het bier.' });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3339 $("#taste_mouthfeel").jqxInput({ theme: theme, width: 960, height: 23 });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3340 $("#taste_notes").jqxTooltip({ content: 'Het oordeel en opmerkingen over dit bier.' });
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3341 $("#taste_notes").jqxInput({ theme: theme, width: 960, height: 100 });
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3342
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3343 $('#jqxTabs').jqxTabs({
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3344 theme: theme,
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3345 width: 1280,
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3346 height: 630,
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3347 autoHeight: false,
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3348 position: 'top'
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3349 });
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3350
112
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3351 // Buttons below
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3352 $("#Print").jqxButton({ template: "info", width: '80px', theme: theme });
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3353 $("#Print").click(function () {
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3354 // Open print in a new tab.
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3355 var url="prod_print.php?record=" + my_record;
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3356 window.open(url);
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3357 });
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3358
112
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3359 $("#Delete").jqxButton({ template: "danger", width: '80px', theme: theme });
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3360 $("#Delete").click(function () {
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3361 // Open a popup to confirm this action.
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3362 $('#eventWindow').jqxWindow('open');
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3363 $("#delOk").click(function () {
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3364 var data = "delete=true&" + $.param({ uuid: dataRecord.uuid });
112
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3365 $.ajax({
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3366 dataType: 'json',
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3367 url: url,
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3368 cache: false,
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3369 data: data,
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3370 type: "POST",
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3371 success: function (data, status, xhr) {
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3372 // delete command is executed.
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3373 window.location.href = my_return;
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3374 },
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3375 error: function (jqXHR, textStatus, errorThrown) {
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3376 }
112
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3377 });
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3378 });
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3379 });
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3380
112
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3381 $("#Cancel").jqxButton({ template: "primary", width: '80px', theme: theme });
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3382 $("#Cancel").click(function () {
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3383 window.location.href = my_return;
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3384 });
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3385
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3386 $("#Save").jqxButton({ template: "success", width: '90px', theme: theme });
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3387 $("#Save").click(function () {
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3388 console.log(dataRecord.uuid);
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3389 var fermentablerow = $('#fermentableGrid').jqxGrid('getrows');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3390 var hoprow = $('#hopGrid').jqxGrid('getrows');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3391 var miscrow = $('#miscGrid').jqxGrid('getrows');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3392 var yeastrow = $('#yeastGrid').jqxGrid('getrows');
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3393 var mashrow = $('#mashGrid').jqxGrid('getrows');
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3394 var row = {
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3395 record: my_record,
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3396 uuid: dataRecord.uuid,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3397 name: $("#name").val(),
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3398 code: $("#code").val(),
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3399 birth: $("#birth").val(),
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3400 stage: $("#stage").val(),
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3401 notes: $("#notes").val(),
171
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3402 log_brew: dataRecord.log_brew,
48cf3ea270f8 Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 169
diff changeset
3403 log_fermentation: dataRecord.log_fermentation,
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3404 inventory_reduced: $("#inventory_reduced").val(),
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3405 locked: $("#locked").val(),
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3406 eq_name: $("#eq_name").val(),
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3407 eq_boil_size: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')),
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3408 eq_batch_size: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')),
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3409 eq_tun_volume: parseFloat($("#eq_tun_volume").jqxNumberInput('decimal')),
122
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
3410 eq_tun_weight: dataRecord.eq_tun_weight,
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
3411 eq_tun_specific_heat: dataRecord.eq_tun_specific_heat,
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
3412 eq_tun_material: dataRecord.eq_tun_material,
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
3413 eq_tun_height: dataRecord.eq_tun_height,
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
3414 eq_top_up_water: parseFloat($("#eq_top_up_water").jqxNumberInput('decimal')),
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3415 eq_trub_chiller_loss: parseFloat($("#eq_trub_chiller_loss").jqxNumberInput('decimal')),
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3416 eq_evap_rate: parseFloat($("#eq_evap_rate").jqxNumberInput('decimal')),
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3417 eq_boil_time: parseFloat($("#eq_boil_time").jqxNumberInput('decimal')),
122
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
3418 eq_calc_boil_volume: dataRecord.eq_calc_boil_volume,
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3419 eq_top_up_kettle: parseFloat($("#eq_top_up_kettle").jqxNumberInput('decimal')),
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3420 eq_hop_utilization: parseFloat($("#eq_hop_utilization").jqxNumberInput('decimal')),
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3421 eq_notes: $("#eq_notes").val(),
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3422 eq_lauter_volume: parseFloat($("#eq_lauter_volume").jqxNumberInput('decimal')),
122
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
3423 eq_lauter_height: dataRecord.eq_lauter_height,
115
ad31f4bd4036 Inventory database script added missing fields. Product database script added JOIN with the prod_recipes table.
Michiel Broek <mbroek@mbse.eu>
parents: 114
diff changeset
3424 eq_lauter_deadspace: parseFloat($("#eq_lauter_deadspace").jqxNumberInput('decimal')),
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3425 eq_kettle_volume: parseFloat($("#eq_kettle_volume").jqxNumberInput('decimal')),
122
5d5bcab19b8f Removed unimportant equipemnt items from the screen.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
3426 eq_kettle_height: dataRecord.eq_kettle_height,
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3427 eq_mash_volume: parseFloat($("#eq_mash_volume").jqxNumberInput('decimal')),
149
ff45488d480e Added some icons from Brewersfriend. They should be replaced someday. Added maximum mash weight setting to the equipment database. Usefull for brew automate and RIMS systems. During recipes import acid and base additions are translated. Brews and recipes now have 2 water sources. Added water mixer. Added basic water treatment, but not for pH yet. Redesigned the fermentables and water tabs.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
3428 eq_mash_max: parseFloat($("#eq_mash_max").jqxNumberInput('decimal')),
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3429 eq_efficiency: parseFloat($("#eq_efficiency").jqxNumberInput('decimal')),
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3430 brew_date_start: $("#brew_date_start").val(),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3431 brew_mash_ph: parseFloat($("#brew_mash_ph").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3432 brew_mash_sg: parseFloat($("#brew_mash_sg").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3433 brew_sparge_temperature: parseFloat($("#brew_sparge_temperature").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3434 brew_sparge_volume: parseFloat($("#brew_sparge_volume").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3435 brew_sparge_ph: parseFloat($("#brew_sparge_ph").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3436 brew_preboil_volume: parseFloat($("#brew_preboil_volume").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3437 brew_preboil_sg: parseFloat($("#brew_preboil_sg").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3438 brew_preboil_ph: parseFloat($("#brew_preboil_ph").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3439 brew_aboil_volume: parseFloat($("#brew_aboil_volume").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3440 brew_aboil_sg: parseFloat($("#brew_aboil_sg").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3441 brew_aboil_ph: parseFloat($("#brew_aboil_ph").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3442 brew_aboil_efficiency: parseFloat($("#brew_aboil_efficiency").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3443 brew_cooling_method: $("#brew_cooling_method").val(),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3444 brew_cooling_time: parseFloat($("#brew_cooling_time").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3445 brew_cooling_to: parseFloat($("#brew_cooling_to").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3446 brew_whirlpool9: parseFloat($("#brew_whirlpool9").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3447 brew_whirlpool7: parseFloat($("#brew_whirlpool7").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3448 brew_whirlpool6: parseFloat($("#brew_whirlpool6").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3449 brew_whirlpool2: parseFloat($("#brew_whirlpool2").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3450 brew_fermenter_volume: parseFloat($("#brew_fermenter_volume").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3451 brew_fermenter_extrawater: parseFloat($("#brew_fermenter_extrawater").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3452 brew_aeration_time: parseFloat($("#brew_aeration_time").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3453 brew_aeration_speed: parseFloat($("#brew_aeration_speed").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3454 brew_aeration_type: $("#brew_aeration_type").val(),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3455 brew_fermenter_sg: parseFloat($("#brew_fermenter_sg").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3456 brew_fermenter_ibu: parseFloat($("#brew_fermenter_ibu").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3457 brew_date_end: $("#brew_date_end").val(),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3458 brew_log_available: $("#brew_log_available").val(),
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3459 og: dataRecord.og,
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3460 fg: parseFloat($("#fg").jqxNumberInput('decimal')),
164
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3461 primary_start_temp: parseFloat($("#primary_start_temp").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3462 primary_max_temp: parseFloat($("#primary_max_temp").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3463 primary_end_temp: parseFloat($("#primary_end_temp").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3464 primary_end_sg: parseFloat($("#primary_end_sg").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3465 primary_end_date: $("#primary_end_date").val(),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3466 secondary_temp: parseFloat($("#secondary_temp").jqxNumberInput('decimal')),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3467 secondary_end_date: $("#secondary_end_date").val(),
0a5abea575a9 Added the last tab, fermentation to the product editer.
Michiel Broek <mbroek@mbse.eu>
parents: 163
diff changeset
3468 tertiary_temp: parseFloat($("#tertiary_temp").jqxNumberInput('decimal')),
163
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3469 package_date: $("#package_date").val(),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3470 bottle_amount: parseFloat($("#bottle_amount").jqxNumberInput('decimal')),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3471 bottle_carbonation: parseFloat($("#bottle_carbonation").jqxNumberInput('decimal')),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3472 bottle_priming_sugar: $("#bottle_priming_sugar").val(),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3473 bottle_priming_amount: parseFloat($("#bottle_priming_amount").jqxNumberInput('decimal')),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3474 bottle_carbonation_temp: parseFloat($("#bottle_carbonation_temp").jqxNumberInput('decimal')),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3475 keg_amount: parseFloat($("#keg_amount").jqxNumberInput('decimal')),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3476 keg_carbonation: parseFloat($("#keg_carbonation").jqxNumberInput('decimal')),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3477 keg_priming_sugar: $("#keg_priming_sugar").val(),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3478 keg_priming_amount: parseFloat($("#keg_priming_amount").jqxNumberInput('decimal')),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3479 keg_carbonation_temp: parseFloat($("#keg_carbonation_temp").jqxNumberInput('decimal')),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3480 keg_forced_carb: $("#keg_forced_carb").val(),
4a4cc3497a57 Added the packaging tab contents.
Michiel Broek <mbroek@mbse.eu>
parents: 162
diff changeset
3481 keg_pressure: parseFloat($("#keg_pressure").jqxNumberInput('decimal')),
162
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3482 taste_notes: $("#taste_notes").val(),
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3483 taste_rate: parseFloat($("#taste_rate").jqxNumberInput('decimal')),
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3484 taste_date: $("#taste_date").val(),
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3485 taste_color: $("#taste_color").val(),
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3486 taste_transparency: $("#taste_transparency").val(),
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3487 taste_head: $("#taste_head").val(),
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3488 taste_aroma: $("#taste_aroma").val(),
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3489 taste_taste: $("#taste_taste").val(),
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3490 taste_mouthfeel: $("#taste_mouthfeel").val(),
45248acb6252 Added contents on the Taste tab. Fixed a locked checkbox bug. Disable tabs depending on the project stage.
Michiel Broek <mbroek@mbse.eu>
parents: 161
diff changeset
3491 taste_aftertaste: $("#taste_aftertaste").val(),
152
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3492 st_name: $('#st_name').val(),
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3493 st_letter: $('#st_letter').val(),
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3494 st_guide: $('#st_guide').val(),
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3495 st_type: $('#st_type').val(),
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3496 st_category: $('#st_category').val(),
2e4249add363 Import from brouwhulp fix style color ranges. Added calcSVG and calcABV calculation. Added batch size, time, efficiency and og change actions. Added style select and redesigned the first tab to fit this in. When equipment is changed, recalculate the recipe. Added print button.
Michiel Broek <mbroek@mbse.eu>
parents: 151
diff changeset
3497 st_category_number: parseFloat($("#st_category_number").jqxNumberInput('decimal')),
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3498 st_og_min: parseFloat($("#st_og_min").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3499 st_og_max: parseFloat($("#st_og_max").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3500 st_fg_min: parseFloat($("#st_fg_min").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3501 st_fg_max: parseFloat($("#st_fg_max").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3502 st_ibu_min: parseFloat($("#st_ibu_min").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3503 st_ibu_max: parseFloat($("#st_ibu_max").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3504 st_color_min: parseFloat($("#st_color_min").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3505 st_color_max: parseFloat($("#st_color_max").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3506 st_carb_min: parseFloat($("#st_carb_min").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3507 st_carb_max: parseFloat($("#st_carb_max").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3508 st_abv_min: parseFloat($("#st_abv_min").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3509 st_abv_max: parseFloat($("#st_abv_max").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3510 type: $("#type").val(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3511 batch_size: parseFloat($("#batch_size").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3512 boil_size: parseFloat($("#boil_size").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3513 boil_time: parseFloat($("#boil_time").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3514 efficiency: parseFloat($("#efficiency").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3515 est_og: parseFloat($("#est_og").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3516 est_fg: parseFloat($("#est_fg").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3517 est_abv: parseFloat($("#est_abv").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3518 est_color: parseFloat($("#est_color").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3519 color_method: $("#color_method").val(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3520 est_ibu: parseFloat($("#est_ibu").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3521 ibu_method: $("#ibu_method").val(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3522 est_carb: parseFloat($("#est_carb").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3523 mash_name: $("#mash_name").val(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3524 mash_ph: parseFloat($("#mash_ph").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3525 sparge_temp: parseFloat($("#sparge_temp").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3526 sparge_ph: parseFloat($("#sparge_ph").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3527 sparge_volume: parseFloat($("#sparge_volume").jqxNumberInput('decimal')),
159
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
3528 sparge_source: $("#sparge_source").val(),
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
3529 sparge_acid_type: $("#sparge_acid_type").val(),
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
3530 sparge_acid_perc: parseFloat($("#sparge_acid_perc").jqxNumberInput('decimal')),
6428dae0605d Backport water treatment to the product editor (inluding the bugs).
Michiel Broek <mbroek@mbse.eu>
parents: 153
diff changeset
3531 sparge_acid_amount: dataRecord.sparge_acid_amount,
151
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3532 calc_acid: $("#calc_acid").val(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3533 w1_name: $("#w1_name").val(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3534 w1_amount: parseFloat($("#w1_amount").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3535 w1_calcium: parseFloat($("#w1_calcium").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3536 w1_sulfate: parseFloat($("#w1_sulfate").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3537 w1_chloride: parseFloat($("#w1_chloride").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3538 w1_sodium: parseFloat($("#w1_sodium").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3539 w1_magnesium: parseFloat($("#w1_magnesium").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3540 w1_total_alkalinity: parseFloat($("#w1_total_alkalinity").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3541 w1_ph: parseFloat($("#w1_ph").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3542 w1_cost: dataRecord.w1_cost,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3543 w2_name: $("#w2_name").val(),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3544 w2_amount: parseFloat($("#w2_amount").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3545 w2_calcium: parseFloat($("#w2_calcium").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3546 w2_sulfate: parseFloat($("#w2_sulfate").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3547 w2_chloride: parseFloat($("#w2_chloride").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3548 w2_sodium: parseFloat($("#w2_sodium").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3549 w2_magnesium: parseFloat($("#w2_magnesium").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3550 w2_total_alkalinity: parseFloat($("#w2_total_alkalinity").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3551 w2_ph: parseFloat($("#w2_ph").jqxNumberInput('decimal')),
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3552 w2_cost: dataRecord.w2_cost,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3553 fermentables: fermentablerow,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3554 hops: hoprow,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3555 miscs: miscrow,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3556 yeasts: yeastrow,
2c9cfe2f0860 Merged prod_main and prod_recipe database tables into products. Added recipe tabs in the products editor.
Michiel Broek <mbroek@mbse.eu>
parents: 149
diff changeset
3557 mashs: mashrow
114
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3558 };
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3559 var data = "update=true&" + $.param(row);
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3560 $.ajax({
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3561 dataType: 'json',
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3562 url: url,
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3563 cache: false,
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3564 data: data,
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3565 type: "POST",
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3566 success: function (data, status, xhr) {
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3567 // update command is executed.
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3568 window.location.href = my_return;
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3569 },
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3570 error: function(jqXHR, textStatus, errorThrown) {
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3571 }
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3572 });
4935e86b2775 Small fixes for prject import from Brouwhulp. Fixes for poduct database read/write. New menu entries. Equipment select in product editor. Started brewday editor. Added conditions on some buttons and edit fields. Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 112
diff changeset
3573 });
112
7ef48396f705 Added some buttons. Only allow product delete if it has no serious data.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
3574 createDelElements();
111
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3575 });
8c4ba91adf58 Basic screens for brew products.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3576

mercurial