Sun, 30 Dec 2018 18:18:22 +0100
Added sparge water acid calculation. Added residual alkalinity calculation.
99
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | /***************************************************************************** |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | * Copyright (C) 2018 |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * Michiel Broek <mbroek at mbse dot eu> |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * This file is part of BMS |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * This is free software; you can redistribute it and/or modify it |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * under the terms of the GNU General Public License as published by the |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * Free Software Foundation; either version 2, or (at your option) any |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * later version. |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * BrewCloud is distributed in the hope that it will be useful, but |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | * General Public License for more details. |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | * |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | * along with ThermFerm; see the file COPYING. If not, write to the Free |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | *****************************************************************************/ |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | $(document).ready(function () { |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | var dataRecord = {}; |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | // dropdownlist datasource from inventory_waters, must load sync |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | var waterUrl = "getwatersources.php"; |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | var waterInvSource = { |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | datatype: "json", |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | datafields: [ |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | { name: 'name', type: 'string' }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
34 | ], |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | url: waterUrl, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | async: false |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
37 | }; |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
38 | var waterlist = new $.jqx.dataAdapter(waterInvSource); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
40 | var url = "includes/db_setup.php"; |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
41 | |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
42 | // Tooltips |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
43 | $("#brewery_name").jqxTooltip({ content: 'De naam voor deze brouwerij.' }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
44 | $("#factor_mashhop").jqxTooltip({ content: 'Het efficientie percentage voor hop tijdens de maisch.' }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | $("#factor_fwh").jqxTooltip({ content: 'Het efficientie percentage voor First Wort Hop.' }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | $("#factor_pellet").jqxTooltip({ content: 'Het efficientie percentage bij gebruik van hop pellets.' }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
47 | $("#factor_plug").jqxTooltip({ content: 'Het efficientie percentage bij gebruik van hop plugs.' }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
48 | $("#brix_correction").jqxTooltip({ content: 'Omzettingsfactor voor Plato naar Brix' }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
49 | $("#grain_absorbtion").jqxTooltip({ content: 'Absorbtie van water door graan (L/Kg)' }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
50 | |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
51 | // Prepare the data |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
52 | var source = { |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
53 | datatype: "json", |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
54 | cache: false, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
55 | datafields: [ |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
56 | { name: 'brewery_name', type: 'string' }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
57 | /* { name: 'brewery_logo', type: 'array' }, */ |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
58 | { name: 'factor_mashhop', type: 'number' }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
59 | { name: 'factor_fwh', type: 'number' }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
60 | { name: 'factor_pellet', type: 'number' }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
61 | { name: 'factor_plug', type: 'number' }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
62 | { name: 'ibu_method', type: 'string' }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
63 | { name: 'color_method', type: 'string' }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
64 | { name: 'brix_correction', type: 'float' }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
65 | { name: 'grain_absorbtion', type: 'float' }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
66 | { name: 'default_water', type: 'string' } |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
67 | ], |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
68 | url: url |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
69 | }; |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
70 | |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
71 | // Load data and select one record. |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
72 | var dataAdapter = new $.jqx.dataAdapter(source, { |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
73 | loadComplete: function () { |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
74 | var records = dataAdapter.records; |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
75 | dataRecord = records[0]; |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
76 | $("#brewery_name").val(dataRecord.brewery_name); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
77 | $("#factor_mashhop").val(dataRecord.factor_mashhop); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
78 | $("#factor_fwh").val(dataRecord.factor_fwh); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
79 | $("#factor_pellet").val(dataRecord.factor_pellet); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
80 | $("#factor_plug").val(dataRecord.factor_plug); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
81 | $("#color_method").val(dataRecord.color_method); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
82 | $("#ibu_method").val(dataRecord.ibu_method); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
83 | $("#brix_correction").val(dataRecord.brix_correction); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
84 | $("#grain_absorbtion").val(dataRecord.grain_absorbtion); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
85 | $("#default_water").val(dataRecord.default_water); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
86 | }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
87 | loadError: function (jqXHR, status, error) { |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
88 | }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
89 | }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
90 | dataAdapter.dataBind(); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
91 | |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
92 | // Editers |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
93 | var srcColor = [ "Morey", "Mosher", "Daniels" ]; |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
94 | var srcIBU = [ "Tinseth", "Rager", "Daniels" ]; // Only these are supported at this time. |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
95 | $("#brewery_name").jqxInput({ theme: theme, width: 640, height: 23 }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
96 | $("#factor_fwh").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: -50, max: 50, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
97 | $("#factor_mashhop").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: -50, max: 50, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); |
103 | 98 | $("#factor_pellet").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 20, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); |
99 | $("#factor_plug").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 20, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); | |
100 | $("#brix_correction").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 1.00, max: 1.05, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.01 }); | |
101 | $("#grain_absorbtion").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0.5, max: 1.1, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.01 }); | |
99
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
102 | $("#color_method").jqxDropDownList({ theme: theme, source: srcColor, width: 125, height: 23, dropDownHeight: 95 }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
103 | $("#ibu_method").jqxDropDownList({ theme: theme, source: srcIBU, width: 125, height: 23, dropDownHeight: 95 }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
104 | $('#default_water').jqxDropDownList({ |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
105 | placeHolder: "Kies water:", |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
106 | theme: theme, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
107 | source: waterlist, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
108 | valueMember: "name", |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
109 | displayMember: "name", |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
110 | width: 250, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
111 | height: 27, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
112 | dropDownHorizontalAlignment: 'right', |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
113 | dropDownWidth: 300 |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
114 | }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
115 | $('#default_water').jqxDropDownList( 'selectItem', dataRecord.default_water ); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
116 | |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
117 | $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
118 | $("#Save").click(function () { |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
119 | var row = { |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
120 | record: 1, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
121 | brewery_name: $("#brewery_name").val(), |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
122 | factor_mashhop: $("#factor_mashhop").val(), |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
123 | factor_fwh: $("#factor_fwh").val(), |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
124 | factor_pellet: $("#factor_pellet").val(), |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
125 | factor_plug: $("#factor_plug").val(), |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
126 | color_method: $("#color_method").val(), |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
127 | ibu_method: $("#ibu_method").val(), |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
128 | brix_correction: parseFloat($("#brix_correction").jqxNumberInput('decimal')), |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
129 | grain_absorbtion: parseFloat($("#grain_absorbtion").jqxNumberInput('decimal')), |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
130 | default_water: $("#default_water").val() |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
131 | }; |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
132 | var data = "update=true&" + $.param(row); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
133 | $.ajax({ |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
134 | dataType: 'json', |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
135 | url: url, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
136 | cache: false, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
137 | data: data, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
138 | type: "POST", |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
139 | success: function (data, status, xhr) { |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
140 | // update command is executed. |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
141 | //window.location.href = my_return; |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
142 | }, |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
143 | error: function(jqXHR, textStatus, errorThrown) { |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
144 | } |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
145 | }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
146 | }); |
f433193f7bb6
Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
147 | }); |