Thu, 15 Apr 2021 10:57:01 +0200
Added mash SG and pH fields. Fixed default Yeast update. Added mash step SG and pH input datafields. Added a Brix input too. The print report shows the mash measurements too. Other brewing results now show expected and measured values and the difference.
22 | 1 | /***************************************************************************** |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
2 | * Copyright (C) 2014-2020 |
22 | 3 | * |
4 | * Michiel Broek <mbroek at mbse dot eu> | |
5 | * | |
701
3ce3df681be0
Changed inventory and profile databases filtering.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
6 | * This file is part of Brewery Management System |
22 | 7 | * |
8 | * This is free software; you can redistribute it and/or modify it | |
9 | * under the terms of the GNU General Public License as published by the | |
10 | * Free Software Foundation; either version 2, or (at your option) any | |
11 | * later version. | |
12 | * | |
13 | * BrewCloud is distributed in the hope that it will be useful, but | |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | * General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with ThermFerm; see the file COPYING. If not, write to the Free | |
20 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
21 | *****************************************************************************/ | |
22 | ||
23 | ||
24 | function createDelElements() { | |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
25 | $('#eventWindow').jqxWindow({ |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
26 | theme: theme, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
27 | position: { x: 490, y: 210 }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
28 | width: 300, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
29 | height: 175, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
30 | resizable: false, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
31 | isModal: true, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
32 | modalOpacity: 0.4, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
33 | okButton: $('#delOk'), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
34 | cancelButton: $('#delCancel'), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
35 | initContent: function() { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
36 | $('#delOk').jqxButton({ template: 'danger', width: '65px', theme: theme }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
37 | $('#delCancel').jqxButton({ template: 'success', width: '65px', theme: theme }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
38 | $('#delCancel').focus(); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
39 | } |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
40 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
41 | $('#eventWindow').jqxWindow('hide'); |
22 | 42 | } |
43 | ||
44 | ||
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
45 | $(document).ready(function() { |
211
63d0e40c58b9
Water profile uses POST instead of GET. Added tooltips to the editor screen. Updated the editor screen. Total alkalinity and Bicarbonate update each other. More and smaller columns in the listing screen. Rearranged the editor screen.
Michiel Broek <mbroek@mbse.eu>
parents:
45
diff
changeset
|
46 | |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
47 | var dataRecord = {}, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
48 | url = 'includes/db_profile_water.php', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
49 | source = { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
50 | datatype: 'json', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
51 | cache: false, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
52 | datafields: [ |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
53 | { name: 'record', type: 'number' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
54 | { name: 'name', type: 'string' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
55 | { name: 'calcium', type: 'float' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
56 | { name: 'bicarbonate', type: 'float' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
57 | { name: 'sulfate', type: 'float' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
58 | { name: 'chloride', type: 'float' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
59 | { name: 'sodium', type: 'float' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
60 | { name: 'magnesium', type: 'float' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
61 | { name: 'ph', type: 'float' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
62 | { name: 'notes', type: 'string' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
63 | { name: 'total_alkalinity', type: 'float' } |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
64 | ], |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
65 | id: 'record', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
66 | url: url, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
67 | deleterow: function(rowid, commit) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
68 | // synchronize with the server - send delete command |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
69 | var data = 'delete=true&' + $.param({ record: rowid }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
70 | $.ajax({ |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
71 | dataType: 'json', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
72 | url: url, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
73 | cache: false, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
74 | data: data, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
75 | type: 'POST', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
76 | success: function(data, status, xhr) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
77 | commit(true); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
78 | location.reload(true); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
79 | }, |
701
3ce3df681be0
Changed inventory and profile databases filtering.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
80 | error: function(jqXHR, textStatus, errorThrown) { commit(false); } |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
81 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
82 | }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
83 | addrow: function(rowid, rowdata, position, commit) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
84 | var data = 'insert=true&' + $.param(rowdata); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
85 | $.ajax({ |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
86 | dataType: 'json', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
87 | url: url, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
88 | cache: false, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
89 | data: data, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
90 | type: 'POST', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
91 | success: function(data, status, xhr) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
92 | commit(true); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
93 | location.reload(true); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
94 | }, |
701
3ce3df681be0
Changed inventory and profile databases filtering.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
95 | error: function(jqXHR, textStatus, errorThrown) { commit(false); } |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
96 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
97 | }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
98 | updaterow: function(rowid, rowdata, commit) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
99 | var data = 'update=true&' + $.param(rowdata); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
100 | $.ajax({ |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
101 | dataType: 'json', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
102 | url: url, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
103 | cache: false, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
104 | data: data, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
105 | type: 'POST', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
106 | success: function(data, status, xhr) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
107 | commit(true); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
108 | location.reload(true); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
109 | }, |
701
3ce3df681be0
Changed inventory and profile databases filtering.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
110 | error: function(jqXHR, textStatus, errorThrown) { commit(false); } |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
111 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
112 | } |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
113 | }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
114 | dataAdapter = new $.jqx.dataAdapter(source), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
115 | editrow = -1; |
494
af28ebe4a779
Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents:
485
diff
changeset
|
116 | |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
117 | // tooltips |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
118 | $('#name').jqxTooltip({ content: 'De unieke naam van dit water profiel.' }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
119 | $('#notes').jqxTooltip({ content: 'Extra opmerkingen over dit water.' }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
120 | $('#calcium').jqxTooltip({ content: 'Calcium (Ca).' }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
121 | $('#bicarbonate').jqxTooltip({ content: 'Bicarbonaat (HCO3). Berekend meteen de Totale alkaliteit.' }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
122 | $('#sulfate').jqxTooltip({ content: 'Calcium Sulfaat (CaSO4).' }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
123 | $('#chloride').jqxTooltip({ content: 'Chloride (Cl).' }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
124 | $('#sodium').jqxTooltip({ content: 'Natrium, oftewel keukenzout (Na). In berekeningen ook vaak als Sodium.' }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
125 | $('#magnesium').jqxTooltip({ content: 'Magnesium (Mg).' }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
126 | $('#ph').jqxTooltip({ content: 'De zuurgraad (pH).' }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
127 | $('#total_alkalinity').jqxTooltip({ content: 'Totale alkaliniteit. Berekend meteen de Bicarbonaat.' }); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
128 | $('#balance').jqxTooltip({ content: 'De ionen balans van het water. Ideaal minder dan 0.1 verschil tussen kationen en anionen. Meer dan 0.5 is een fout in het waterraport.' }); |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
129 | |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
130 | // initialize the input fields. |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
131 | $('#name').jqxInput({ theme: theme, width: 640, height: 23 }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
132 | $('#notes').jqxInput({ theme: theme, width: 800, height: 100 }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
133 | $('#calcium').jqxNumberInput(Spin1dec); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
134 | $('#bicarbonate').jqxNumberInput(Spin1dec); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
135 | $('#sulfate').jqxNumberInput(Spin1dec); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
136 | $('#chloride').jqxNumberInput(Spin1dec); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
137 | $('#sodium').jqxNumberInput(Spin1dec); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
138 | $('#magnesium').jqxNumberInput(Spin1dec); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
139 | $('#ph').jqxNumberInput(Spin2pH); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
140 | $('#total_alkalinity').jqxNumberInput(Spin1dec); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
141 | $('#balance').jqxNumberInput(Show2dec); |
22 | 142 | |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
143 | // initialize jqxGrid |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
144 | $('#jqxgrid').jqxGrid({ |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
145 | width: 1280, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
146 | height: 630, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
147 | source: dataAdapter, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
148 | theme: theme, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
149 | showstatusbar: true, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
150 | renderstatusbar: function(statusbar) { |
702
f0896a6f9b64
Add total count in the statusbar for inventory and profile databases.
Michiel Broek <mbroek@mbse.eu>
parents:
701
diff
changeset
|
151 | var rowCount = $("#jqxgrid").jqxGrid('getrows').length; |
f0896a6f9b64
Add total count in the statusbar for inventory and profile databases.
Michiel Broek <mbroek@mbse.eu>
parents:
701
diff
changeset
|
152 | statusbar.append('<div style="float: left; margin: 8px; color: orange !important;">Aantal items: ' + rowCount + '</div>'); |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
153 | var container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>'), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
154 | addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' + |
701
3ce3df681be0
Changed inventory and profile databases filtering.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
155 | 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Nieuw</span></div>'); |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
156 | container.append(addButton); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
157 | statusbar.append(container); |
701
3ce3df681be0
Changed inventory and profile databases filtering.
Michiel Broek <mbroek@mbse.eu>
parents:
662
diff
changeset
|
158 | addButton.jqxButton({ theme: theme, width: 90, height: 17 }); |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
159 | // add new row. |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
160 | addButton.click(function(event) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
161 | editrow = -1; |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
162 | $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
163 | $('#name').val(''); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
164 | $('#calcium').val(0); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
165 | $('#bicarbonate').val(0); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
166 | $('#sulfate').val(0); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
167 | $('#chloride').val(0); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
168 | $('#sodium').val(0); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
169 | $('#magnesium').val(0); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
170 | $('#ph').val(7); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
171 | $('#notes').val(''); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
172 | $('#total_alkalinity').val(0); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
173 | $('#popupWindow').jqxWindow('open'); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
174 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
175 | }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
176 | filterable: false, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
177 | filtermode: 'excel', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
178 | columns: [ |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
179 | { text: 'Water Profiel', datafield: 'name', width: 225 }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
180 | { text: 'Opmerkingen', datafield: 'notes' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
181 | { text: 'Ca', datafield: 'calcium', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
182 | { text: 'Mg', datafield: 'magnesium', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
183 | { text: 'Na', datafield: 'sodium', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
184 | { text: 'CaCO3', datafield: 'total_alkalinity', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
185 | { text: 'Cl', datafield: 'chloride', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
186 | { text: 'SO4', datafield: 'sulfate', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
187 | { text: 'pH', datafield: 'ph', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
188 | { text: '', datafield: 'Edit', width: 100, columntype: 'button', |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
189 | cellsrenderer: function() { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
190 | return 'Wijzig'; |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
191 | }, buttonclick: function(row) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
192 | // open the popup window when the user clicks a button. |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
193 | editrow = row; |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
194 | $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
195 | // get the clicked row's data and initialize the input fields. |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
196 | dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
197 | $('#name').val(dataRecord.name); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
198 | $('#calcium').val(dataRecord.calcium); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
199 | $('#bicarbonate').val(dataRecord.bicarbonate); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
200 | $('#sulfate').val(dataRecord.sulfate); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
201 | $('#chloride').val(dataRecord.chloride); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
202 | $('#sodium').val(dataRecord.sodium); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
203 | $('#magnesium').val(dataRecord.magnesium); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
204 | $('#ph').val(dataRecord.ph); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
205 | $('#notes').val(dataRecord.notes); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
206 | $('#total_alkalinity').val(dataRecord.total_alkalinity); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
207 | calcBalance(); |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
208 | // show the popup window. |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
209 | $('#popupWindow').jqxWindow('open'); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
210 | } |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
211 | } |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
212 | ] |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
213 | }); |
211
63d0e40c58b9
Water profile uses POST instead of GET. Added tooltips to the editor screen. Updated the editor screen. Total alkalinity and Bicarbonate update each other. More and smaller columns in the listing screen. Rearranged the editor screen.
Michiel Broek <mbroek@mbse.eu>
parents:
45
diff
changeset
|
214 | |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
215 | function calcBalance() { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
216 | var cations = (dataRecord.calcium / 20.039) + (dataRecord.magnesium / 12.1525) + (dataRecord.sodium / 22.989); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
217 | var anions = (dataRecord.bicarbonate / 61.016) + (dataRecord.sulfate / 48.031) + (dataRecord.chloride / 35.4527); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
218 | var balance = Round(cations - anions, 2); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
219 | $('#balance').val(balance); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
220 | if (balance <= 0.1 && balance >= -0.1) |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
221 | $('#wr_balance').html("<img src='images/dialog-ok-apply.png'>"); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
222 | else if (balance <= 0.5 && balance >= -0.5) |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
223 | $('#wr_balance').html("<img src='images/dialog-ok.png'>"); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
224 | else |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
225 | $('#wr_balance').html("<img src='images/dialog-error.png'>"); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
226 | } |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
227 | |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
228 | $('#calcium').on('change', function(event) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
229 | dataRecord.calcium = parseFloat(event.args.value); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
230 | calcBalance(); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
231 | }); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
232 | $('#magnesium').on('change', function(event) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
233 | dataRecord.magnesium = parseFloat(event.args.value); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
234 | calcBalance(); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
235 | }); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
236 | $('#sodium').on('change', function(event) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
237 | dataRecord.sodium = parseFloat(event.args.value); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
238 | calcBalance(); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
239 | }); |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
240 | $('#total_alkalinity').on('change', function(event) { |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
241 | dataRecord.total_alkalinity = parseFloat(event.args.value); |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
242 | dataRecord.bicarbonate = parseFloat(event.args.value) * 1.22; |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
243 | $('#bicarbonate').val(dataRecord.bicarbonate); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
244 | calcBalance(); |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
245 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
246 | $('#bicarbonate').on('change', function(event) { |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
247 | dataRecord.bicarbonate = parseFloat(event.args.value); |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
248 | dataRecord.total_alkalinity = parseFloat(event.args.value) * 50 / 61; |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
249 | $('#total_alkalinity').val(dataRecord.total_alkalinity); |
662
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
250 | calcBalance(); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
251 | }); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
252 | $('#sulfate').on('change', function(event) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
253 | dataRecord.sulfate = parseFloat(event.args.value); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
254 | calcBalance(); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
255 | }); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
256 | $('#chloride').on('change', function(event) { |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
257 | dataRecord.chloride = parseFloat(event.args.value); |
4bb005694ce7
Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents:
522
diff
changeset
|
258 | calcBalance(); |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
259 | }); |
211
63d0e40c58b9
Water profile uses POST instead of GET. Added tooltips to the editor screen. Updated the editor screen. Total alkalinity and Bicarbonate update each other. More and smaller columns in the listing screen. Rearranged the editor screen.
Michiel Broek <mbroek@mbse.eu>
parents:
45
diff
changeset
|
260 | |
522
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
261 | // initialize the popup window and buttons. |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
262 | $('#popupWindow').jqxWindow({ |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
263 | width: 1050, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
264 | height: 550, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
265 | resizable: false, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
266 | theme: theme, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
267 | isModal: true, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
268 | autoOpen: false, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
269 | cancelButton: $('#Cancel'), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
270 | modalOpacity: 0.40 |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
271 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
272 | $('#popupWindow').on('open', function() { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
273 | $('#name').jqxInput('selectAll'); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
274 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
275 | $('#Delete').jqxButton({ template: 'danger', width: '90px', theme: theme }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
276 | $('#Delete').click(function() { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
277 | if (editrow >= 0) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
278 | // Open a popup to confirm this action. |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
279 | $('#eventWindow').jqxWindow('open'); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
280 | $('#delOk').click(function() { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
281 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
282 | $('#jqxgrid').jqxGrid('deleterow', rowID); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
283 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
284 | } |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
285 | $('#popupWindow').jqxWindow('hide'); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
286 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
287 | $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
288 | $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
289 | // update the edited row when the user clicks the 'Save' button. |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
290 | $('#Save').click(function() { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
291 | var row, rowID = -1; |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
292 | if (editrow >= 0) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
293 | rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
294 | } |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
295 | row = { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
296 | record: rowID, |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
297 | name: $('#name').val(), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
298 | calcium: parseFloat($('#calcium').jqxNumberInput('decimal')), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
299 | bicarbonate: parseFloat($('#bicarbonate').jqxNumberInput('decimal')), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
300 | sulfate: parseFloat($('#sulfate').jqxNumberInput('decimal')), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
301 | chloride: parseFloat($('#chloride').jqxNumberInput('decimal')), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
302 | sodium: parseFloat($('#sodium').jqxNumberInput('decimal')), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
303 | magnesium: parseFloat($('#magnesium').jqxNumberInput('decimal')), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
304 | ph: parseFloat($('#ph').jqxNumberInput('decimal')), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
305 | notes: $('#notes').val(), |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
306 | total_alkalinity: parseFloat($('#total_alkalinity').jqxNumberInput('decimal')) |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
307 | }; |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
308 | if (editrow >= 0) { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
309 | $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
310 | } else { |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
311 | $('#jqxgrid').jqxGrid('addrow', null, row); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
312 | } |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
313 | $('#popupWindow').jqxWindow('hide'); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
314 | }); |
35675eadc655
Removed yui-compressor on javascript files.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
315 | createDelElements(); |
22 | 316 | }); |
317 |