Sat, 15 Jun 2019 19:43:05 +0200
Merged with default
27 | 1 | /***************************************************************************** |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
2 | * Copyright (C) 2014-2019 |
27 | 3 | * |
4 | * Michiel Broek <mbroek at mbse dot eu> | |
5 | * | |
6 | * This file is part of BrewCloud | |
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() { | |
25 | $('#eventWindow').jqxWindow({ | |
26 | theme: theme, | |
27 | position: { x: 490, y: 210 }, | |
28 | width: 300, | |
34 | 29 | height: 175, |
27 | 30 | resizable: false, |
31 | isModal: true, | |
32 | modalOpacity: 0.4, | |
33 | okButton: $('#delOk'), | |
34 | cancelButton: $('#delCancel'), | |
35 | initContent: function () { | |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
36 | $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme }); |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
37 | $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme }); |
27 | 38 | $('#delCancel').focus(); |
39 | } | |
40 | }); | |
41 | $('#eventWindow').jqxWindow('hide'); | |
42 | } | |
43 | ||
44 | ||
45 | $(document).ready(function () { | |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
46 | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
47 | var dataRecord = {}; |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
48 | |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
49 | function calcBatchVolume() { |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
50 | var calc = $("#calc_boil_volume").val(); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
51 | var boil_size = parseFloat($("#boil_size").jqxNumberInput('decimal')); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
52 | var evap_rate = parseFloat($("#evap_rate").jqxNumberInput('decimal')); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
53 | var boil_time = parseFloat($("#boil_time").jqxNumberInput('decimal')); |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
54 | var top_up = parseFloat($("#top_up_kettle").jqxNumberInput('decimal')); |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
55 | |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
56 | if (calc) { // If checked, calculate the batch size. |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
57 | var batch = boil_size - (evap_rate * boil_time / 60) + top_up; |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
58 | $("#batch_size").val(batch); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
59 | } |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
60 | } |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
61 | |
27 | 62 | var url = "includes/db_inventory_equipments.php"; |
63 | // tooltips | |
64 | $("#name").jqxTooltip({ content: 'The unique name of this brew equipment.' }); | |
65 | $("#notes").jqxTooltip({ content: 'Some notes about the equipment.' }); | |
66 | $("#tun_volume").jqxTooltip({ content: 'Mash TUN volume.' }); | |
67 | $("#tun_height").jqxTooltip({ content: 'Mash TUN height in cm.' }); | |
68 | $("#tun_weight").jqxTooltip({ content: 'Mash TUN weight in Kg.' }); | |
69 | $("#tun_material").jqxTooltip({ content: 'Mash TUN material. Needed to calculate the right strike temperature.' }); | |
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:
124
diff
changeset
|
70 | $("#mash_volume").jqxTooltip({ content: 'Liters maisch water voor de eerste maisch stap.' }); |
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:
124
diff
changeset
|
71 | $("#mash_max").jqxTooltip({ content: 'Maximale moutstort voor deze installatie in Kg.' }); |
27 | 72 | $("#lauter_volume").jqxTooltip({ content: 'Total lauter volume.' }); |
73 | $("#lauter_height").jqxTooltip({ content: 'Height of the lauter TUN in cm.' }); | |
74 | $("#lauter_deadspace").jqxTooltip({ content: 'Volume loss in the lauter TUN.' }); | |
75 | $("#efficiency").jqxTooltip({ content: 'Average efficiency.' }); | |
76 | $("#kettle_volume").jqxTooltip({ content: 'Boil kettle volume in liters.' }); | |
77 | $("#kettle_height").jqxTooltip({ content: 'Boil kettle height in cm.' }); | |
78 | $("#boil_size").jqxTooltip({ content: 'Normal boil volume in liters' }); | |
79 | $("#evap_rate").jqxTooltip({ content: 'Evaporation in liters per hour.' }); | |
80 | $("#boil_time").jqxTooltip({ content: 'Normal boil time in minutes.' }); | |
81 | $("#top_up_kettle").jqxTooltip({ content: 'Extra water added to the boil.' }); | |
82 | $("#hop_utilization").jqxTooltip({ content: '100% for smaller installations, higher for large breweries.' }); | |
83 | $("#batch_size").jqxTooltip({ content: 'Calculated batch size, liters at end of the boil.' }); | |
84 | $("#trub_chiller_loss").jqxTooltip({ content: 'Standard loss in liters during transfer to the fermenter.' }); | |
85 | ||
86 | // prepare the data | |
87 | var source = { | |
88 | datatype: "json", | |
89 | cache: false, | |
90 | datafields: [ | |
91 | { name: 'record', type: 'number' }, | |
92 | { name: 'name', type: 'string' }, | |
93 | { name: 'boil_size', type: 'float' }, | |
94 | { name: 'batch_size', type: 'float' }, | |
95 | { name: 'tun_volume', type: 'float' }, | |
96 | { name: 'tun_weight', type: 'float' }, | |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
97 | { name: 'tun_specific_heat', type: 'float' }, |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
98 | { name: 'tun_material', type: 'int' }, |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
99 | { name: 'tun_height', type: 'float' }, |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
100 | { name: 'top_up_water', type: 'float' }, |
27 | 101 | { name: 'trub_chiller_loss', type: 'float' }, |
102 | { name: 'evap_rate', type: 'float' }, | |
103 | { name: 'boil_time', type: 'float' }, | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
104 | { name: 'calc_boil_volume', type: 'int' }, |
27 | 105 | { name: 'top_up_kettle', type: 'float' }, |
106 | { name: 'hop_utilization', type: 'float' }, | |
107 | { name: 'notes', type: 'string' }, | |
108 | { name: 'lauter_volume', type: 'float' }, | |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
109 | { name: 'lauter_height', type: 'float' }, |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
110 | { name: 'lauter_deadspace', type: 'float' }, |
27 | 111 | { name: 'kettle_volume', type: 'float' }, |
112 | { name: 'kettle_height', type: 'float' }, | |
113 | { name: '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:
124
diff
changeset
|
114 | { name: 'mash_max', type: 'float' }, |
27 | 115 | { name: 'efficiency', type: 'float' } |
116 | ], | |
117 | id: 'record', | |
118 | url: url, | |
119 | deleterow: function (rowid, commit) { | |
120 | // synchronize with the server - send delete command | |
121 | var data = "delete=true&" + $.param({ record: rowid }); | |
122 | $.ajax({ | |
123 | dataType: 'json', | |
124 | url: url, | |
125 | cache: false, | |
126 | data: data, | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
127 | type: "POST", |
27 | 128 | success: function (data, status, xhr) { |
129 | // delete command is executed. | |
130 | commit(true); | |
131 | }, | |
132 | error: function (jqXHR, textStatus, errorThrown) { | |
133 | commit(false); | |
134 | } | |
135 | }); | |
136 | }, | |
137 | addrow: function (rowid, rowdata, position, commit) { | |
138 | var data = "insert=true&" + $.param(rowdata); | |
139 | $.ajax({ | |
140 | dataType: 'json', | |
141 | url: url, | |
142 | cache: false, | |
143 | data: data, | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
144 | type: "POST", |
27 | 145 | success: function (data, status, xhr) { |
146 | commit(true); | |
147 | }, | |
148 | error: function(jqXHR, textStatus, errorThrown) { | |
149 | commit(false); | |
150 | } | |
151 | }); | |
152 | }, | |
153 | updaterow: function (rowid, rowdata, commit) { | |
154 | var data = "update=true&" + $.param(rowdata); | |
155 | $.ajax({ | |
156 | dataType: 'json', | |
157 | url: url, | |
158 | cache: false, | |
159 | data: data, | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
160 | type: "POST", |
27 | 161 | success: function (data, status, xhr) { |
162 | // update command is executed. | |
163 | commit(true); | |
164 | }, | |
165 | error: function(jqXHR, textStatus, errorThrown) { | |
166 | commit(false); | |
167 | } | |
168 | }); | |
169 | } | |
170 | }; | |
124
b5a9eaca766e
Expanded equipment editor to 200 Hl.
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
171 | |
27 | 172 | // initialize the input fields. |
173 | $("#name").jqxInput({ theme: theme, width: 250, height: 23 }); | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
174 | $("#notes").jqxInput({ theme: theme, width: 640, height: 100 }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
175 | $("#boil_size").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
176 | $("#batch_size").jqxNumberInput( Spin2dec ); |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
177 | $("#batch_size").jqxNumberInput({ spinButtonsStep: 0.5 }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
178 | $("#tun_volume").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
179 | $("#tun_weight").jqxNumberInput( Spin2dec ); |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
180 | $("#tun_specific_heat").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 3 }); |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
181 | $("#tun_material").jqxDropDownList({ |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
182 | theme: theme, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
183 | source: MaterialAdapter, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
184 | valueMember: 'id', |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
185 | displayMember: 'nl', |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
186 | // selectedIndex: 0, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
187 | width: 180, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
188 | height: 23, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
189 | autoDropDownHeight: true |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
190 | }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
191 | $("#tun_height").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
192 | $("#top_up_water").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
193 | $("#trub_chiller_loss").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
194 | $("#evap_rate").jqxNumberInput( Spin2dec ); |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
195 | $("#boil_time").jqxNumberInput( PosInt ); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
196 | $("#boil_time").jqxNumberInput({ max: 1440 }); |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
197 | $("#calc_boil_volume").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
198 | $("#calc_boil_volume").on('checked', function (event) { |
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:
124
diff
changeset
|
199 | $("#batch_size").jqxNumberInput({ readOnly: true, width: 90, spinButtons: false }); |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
200 | }); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
201 | $("#calc_boil_volume").on('unchecked', function (event) { |
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:
124
diff
changeset
|
202 | $("#batch_size").jqxNumberInput({ readOnly: false, width: 110, spinButtons: true }); |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
203 | }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
204 | $("#top_up_kettle").jqxNumberInput( Spin1dec ); |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
205 | $("#hop_utilization").jqxNumberInput( Perc0 ); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
206 | $("#hop_utilization").jqxNumberInput({ Max: 200 }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
207 | $("#lauter_volume").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
208 | $("#lauter_height").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
209 | $("#lauter_deadspace").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
210 | $("#kettle_volume").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
211 | $("#kettle_height").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
212 | $("#mash_volume").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
213 | $("#mash_max").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
214 | $("#efficiency").jqxNumberInput( Perc1dec ); |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
215 | |
27 | 216 | var dataAdapter = new $.jqx.dataAdapter(source); |
217 | var editrow = -1; | |
218 | // initialize jqxGrid | |
219 | $("#jqxgrid").jqxGrid({ | |
220 | width: 1280, | |
221 | height: 630, | |
222 | source: dataAdapter, | |
223 | theme: theme, | |
224 | showstatusbar: true, | |
225 | renderstatusbar: function (statusbar) { | |
226 | var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); | |
34 | 227 | var addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>"); |
27 | 228 | container.append(addButton); |
229 | statusbar.append(container); | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
230 | addButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
27 | 231 | // add new row. |
232 | addButton.click(function (event) { | |
233 | editrow = -1; | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
234 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
235 | $("#name").val('Nieuwe brouwset'); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
236 | $("#boil_size").val(18); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
237 | $("#batch_size").val(15.3); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
238 | $("#tun_volume").val(20); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
239 | $("#tun_weight").val(2); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
240 | $("#tun_specific_heat").val(0.11); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
241 | $("#tun_material").val(0); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
242 | $("#tun_height").val(20); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
243 | $("#top_up_water").val(0); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
244 | $("#trub_chiller_loss").val(0.5); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
245 | $("#evap_rate").val(1.8); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
246 | $("#boil_time").val(90); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
247 | $("#calc_boil_volume").val(1); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
248 | $("#top_up_kettle").val(0); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
249 | $("#hop_utilization").val(100); |
27 | 250 | $("#notes").val(''); |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
251 | $("#lauter_volume").val(20); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
252 | $("#lauter_height").val(20); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
253 | $("#lauter_deadspace").val(0.5); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
254 | $("#kettle_volume").val(20); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
255 | $("#kettle_height").val(20); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
256 | $("#mash_volume").val(18); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
257 | $("#mash_max").val(6); |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
258 | $("#efficiency").val(75); |
27 | 259 | $("#popupWindow").jqxWindow('open'); |
260 | }); | |
261 | }, | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
262 | filterable: false, |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
263 | ready: function() { |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
264 | $('#boil_size').on('change', function (event) { calcBatchVolume(); }); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
265 | $('#evap_rate').on('change', function (event) { calcBatchVolume(); }); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
266 | $('#boil_time').on('change', function (event) { calcBatchVolume(); }); |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
267 | $('#top_up_kettle').on('change', function (event) { calcBatchVolume(); }); |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
268 | $("#calc_boil_volume").on('change', function (event) { calcBatchVolume(); }); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
269 | $('#tun_material').on('change', function (event) { |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
270 | dataRecord.tun_specific_heat = MaterialData[event.args.index].sh; |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
271 | $("#tun_specific_heat").val(dataRecord.tun_specific_heat); |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
272 | }); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
273 | }, |
27 | 274 | columns: [ |
34 | 275 | { text: 'Installatie naam', datafield: 'name', width: 200 }, |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
276 | { text: 'Kook volume', datafield: 'boil_size', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
277 | { text: 'Batch volume', datafield: 'batch_size', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
34 | 278 | { text: 'Opmerkingen', datafield: 'notes' }, |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
245
diff
changeset
|
279 | { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function () { |
34 | 280 | return "Wijzig"; |
27 | 281 | }, buttonclick: function (row) { |
282 | // open the popup window when the user clicks a button. | |
283 | editrow = row; | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
284 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
27 | 285 | // get the clicked row's data and initialize the input fields. |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
286 | dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
27 | 287 | $("#name").val(dataRecord.name); |
288 | $("#boil_size").val(dataRecord.boil_size); | |
289 | $("#batch_size").val(dataRecord.batch_size); | |
290 | $("#tun_volume").val(dataRecord.tun_volume); | |
291 | $("#tun_weight").val(dataRecord.tun_weight); | |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
292 | $("#tun_specific_heat").val(dataRecord.tun_specific_heat); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
293 | $("#tun_material").val(dataRecord.tun_material); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
294 | $("#tun_height").val(dataRecord.tun_height); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
295 | $("#top_up_water").val(dataRecord.top_up_water); |
27 | 296 | $("#trub_chiller_loss").val(dataRecord.trub_chiller_loss); |
297 | $("#evap_rate").val(dataRecord.evap_rate); | |
298 | $("#boil_time").val(dataRecord.boil_time); | |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
299 | $("#calc_boil_volume").val(dataRecord.calc_boil_volume); |
27 | 300 | $("#top_up_kettle").val(dataRecord.top_up_kettle); |
301 | $("#hop_utilization").val(dataRecord.hop_utilization); | |
302 | $("#notes").val(dataRecord.notes); | |
303 | $("#lauter_volume").val(dataRecord.lauter_volume); | |
116
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
304 | $("#lauter_height").val(dataRecord.lauter_height); |
ac993ef43b13
Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
305 | $("#lauter_deadspace").val(dataRecord.lauter_deadspace); |
27 | 306 | $("#kettle_volume").val(dataRecord.kettle_volume); |
307 | $("#kettle_height").val(dataRecord.kettle_height); | |
308 | $("#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:
124
diff
changeset
|
309 | $("#mash_max").val(dataRecord.mash_max); |
27 | 310 | $("#efficiency").val(dataRecord.efficiency); |
311 | // show the popup window. | |
312 | $("#popupWindow").jqxWindow('open'); | |
313 | } | |
314 | } | |
315 | ] | |
316 | }); | |
317 | // initialize the popup window and buttons. | |
318 | $("#popupWindow").jqxWindow({ | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
319 | width: 1050, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
320 | height: 600, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
321 | resizable: false, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
322 | theme: theme, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
323 | isModal: true, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
324 | autoOpen: false, |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
325 | cancelButton: $("#Cancel"), |
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
326 | modalOpacity: 0.40 |
27 | 327 | }); |
328 | $("#popupWindow").on('open', function () { | |
329 | $("#name").jqxInput('selectAll'); | |
330 | }); | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
331 | $("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme }); |
27 | 332 | $("#Delete").click(function () { |
333 | if (editrow >= 0) { | |
334 | // Open a popup to confirm this action. | |
335 | $('#eventWindow').jqxWindow('open'); | |
336 | $("#delOk").click(function () { | |
337 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); | |
338 | $("#jqxgrid").jqxGrid('deleterow', rowID); | |
339 | }); | |
340 | } | |
341 | $("#popupWindow").jqxWindow('hide'); | |
342 | }); | |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
343 | $("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme }); |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
344 | $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
27 | 345 | // update the edited row when the user clicks the 'Save' button. |
346 | $("#Save").click(function () { | |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
347 | var rowID = -1; |
27 | 348 | if (editrow >= 0) { |
349 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); | |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
350 | } |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
351 | var row = { |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
352 | record: rowID, |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
353 | name: $("#name").val(), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
354 | boil_size: parseFloat($("#boil_size").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
355 | batch_size: parseFloat($("#batch_size").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
356 | tun_volume: parseFloat($("#tun_volume").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
357 | tun_weight: parseFloat($("#tun_weight").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
358 | tun_specific_heat: parseFloat($("#tun_specific_heat").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
359 | tun_material: $("#tun_material").val(), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
360 | tun_height: parseFloat($("#tun_height").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
361 | top_up_water: parseFloat($("#top_up_water").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
362 | trub_chiller_loss: parseFloat($("#trub_chiller_loss").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
363 | evap_rate: parseFloat($("#evap_rate").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
364 | boil_time: parseFloat($("#boil_time").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
365 | calc_boil_volume: $("#calc_boil_volume").val(), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
366 | top_up_kettle: parseFloat($("#top_up_kettle").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
367 | hop_utilization: parseFloat($("#hop_utilization").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
368 | notes: $("#notes").val(), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
369 | lauter_volume: parseFloat($("#lauter_volume").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
370 | lauter_height: parseFloat($("#lauter_height").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
371 | lauter_deadspace: parseFloat($("#lauter_deadspace").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
372 | kettle_volume: parseFloat($("#kettle_volume").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
373 | kettle_height: parseFloat($("#kettle_height").jqxNumberInput('decimal')), |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
374 | mash_volume: parseFloat($("#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:
124
diff
changeset
|
375 | mash_max: parseFloat($("#mash_max").jqxNumberInput('decimal')), |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
376 | efficiency: parseFloat($("#efficiency").jqxNumberInput('decimal')) |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
377 | }; |
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
378 | if (editrow >= 0) { |
27 | 379 | $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
380 | } else { | |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
381 | $('#jqxgrid').jqxGrid('addrow', null, row); |
27 | 382 | } |
117
9e378e37f20f
Inventory editor chages: Added colors to the buttons. Add top_up_kettle to the batch size calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
116
diff
changeset
|
383 | $("#popupWindow").jqxWindow('hide'); |
209
dc30801e6961
Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents:
149
diff
changeset
|
384 | location.reload( true ); // reload ourself. |
27 | 385 | }); |
386 | createDelElements(); | |
387 | }); | |
388 |