www/js/global.js

Wed, 06 Dec 2023 20:26:00 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 06 Dec 2023 20:26:00 +0100
changeset 855
2d328a2a4025
parent 848
542bdc7f6522
permissions
-rw-r--r--

Fixed init scripts names in Makefile. Update crontasks to use the database to check the log entries for products.

13
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
842
897bf2a43253 Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents: 841
diff changeset
2 * Copyright (C) 2014-2023
13
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
728
6bb819bf919b Removed websocket debug info from the mainmenu
Michiel Broek <mbroek@mbse.eu>
parents: 726
diff changeset
6 * This file is part of BMS
13
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * BrewCloud is distributed in the hope that it will be useful, but
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
24 // dropdownlists arrays
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
25
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
26 var StageData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
27 { id: 0, en: 'Plan', nl: 'Plan' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
28 { id: 1, en: 'Wait', nl: 'Wacht' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
29 { id: 2, en: 'Brew', nl: 'Brouwen' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
30 { id: 3, en: 'Primary', nl: 'Hoofdgisting' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
31 { id: 4, en: 'Secondary', nl: 'Nagisting' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
32 { id: 5, en: 'Tertiary', nl: 'Lagering' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
33 { id: 6, en: 'Package', nl: 'Afvullen' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
34 { id: 7, en: 'Carbonation', nl: 'Hergisten' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
35 { id: 8, en: 'Mature', nl: 'Rijpen' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
36 { id: 9, en: 'Taste', nl: 'Proeven' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
37 { id: 10, en: 'Ready', nl: 'Gereed' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
38 { id: 11, en: 'Closed', nl: 'Afgesloten' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
39 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
40 StageSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
41 localdata: StageData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
42 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
43 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
44 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
45 StageAdapter = new $.jqx.dataAdapter(StageSource),
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
46
498
10c6eeee60ce Initial design of the divide batch screen.
Michiel Broek <mbroek@mbse.eu>
parents: 495
diff changeset
47 SplitData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
48 { id: 0, en: 'Not divided', nl: 'Niet gesplitst', ok: 100 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
49 { id: 1, en: 'After mash', nl: 'Na maischen', ok: 2 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
50 { id: 2, en: 'After boil', nl: 'Na koken', ok: 2 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
51 { id: 3, en: 'After cooling', nl: 'Na koelen', ok: 2 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
52 { id: 4, en: 'After primary', nl: 'Na hoofdgisting', ok: 3 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
53 { id: 5, en: 'After secondary', nl: 'Na nagisting', ok: 4 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
54 { id: 6, en: 'After tertiary', nl: 'Na lageren', ok: 5 }
498
10c6eeee60ce Initial design of the divide batch screen.
Michiel Broek <mbroek@mbse.eu>
parents: 495
diff changeset
55 ],
10c6eeee60ce Initial design of the divide batch screen.
Michiel Broek <mbroek@mbse.eu>
parents: 495
diff changeset
56 SplitSource = {
10c6eeee60ce Initial design of the divide batch screen.
Michiel Broek <mbroek@mbse.eu>
parents: 495
diff changeset
57 localdata: SplitData,
10c6eeee60ce Initial design of the divide batch screen.
Michiel Broek <mbroek@mbse.eu>
parents: 495
diff changeset
58 datatype: 'array',
10c6eeee60ce Initial design of the divide batch screen.
Michiel Broek <mbroek@mbse.eu>
parents: 495
diff changeset
59 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }, { name: 'ok' }]
10c6eeee60ce Initial design of the divide batch screen.
Michiel Broek <mbroek@mbse.eu>
parents: 495
diff changeset
60 },
10c6eeee60ce Initial design of the divide batch screen.
Michiel Broek <mbroek@mbse.eu>
parents: 495
diff changeset
61 SplitAdapter = new $.jqx.dataAdapter(SplitSource),
10c6eeee60ce Initial design of the divide batch screen.
Michiel Broek <mbroek@mbse.eu>
parents: 495
diff changeset
62
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
63 MaterialData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
64 { id: 0, en: 'Stainless Steel', nl: 'RVS', sh: 0.11 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
65 { id: 1, en: 'Aluminium', nl: 'Aluminium', sh: 0.22 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
66 { id: 2, en: 'Plastics', nl: 'Kunststof', sh: 0.46 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
67 { id: 3, en: 'Copper', nl: 'Koper', sh: 0.092 }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
68 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
69 MaterialSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
70 localdata: MaterialData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
71 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
72 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }, { name: 'sh' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
73 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
74 MaterialAdapter = new $.jqx.dataAdapter(MaterialSource),
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
75
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
76 FermentableTypeData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
77 { id: 0, en: 'Grain', nl: 'Mout' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
78 { id: 1, en: 'Sugar', nl: 'Suiker' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
79 { id: 2, en: 'Extract', nl: 'Vloeibaar extract' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
80 { id: 3, en: 'Dry extract', nl: 'Droog extract' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
81 { id: 4, en: 'Adjunct', nl: 'Ongemout graan' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
82 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
83 FermentableTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
84 localdata: FermentableTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
85 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
86 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
87 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
88 FermentableTypeAdapter = new $.jqx.dataAdapter(FermentableTypeSource),
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
89
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
90 GrainTypeData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
91 { id: 0, en: 'Base', nl: 'Basismout' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
92 { id: 1, en: 'Roast', nl: 'Geroosterde mout' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
93 { id: 2, en: 'Crystal', nl: 'Cara- of crystalmout' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
94 { id: 3, en: 'Kilned', nl: 'Geëeste mout'},
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
95 { id: 4, en: 'Sour malt', nl: 'Zuurmout' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
96 { id: 5, en: 'Special', nl: 'Speciale mout' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
97 { id: 6, en: 'No malt', nl: 'Geen mout' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
98 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
99 GrainTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
100 localdata: GrainTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
101 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
102 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
103 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
104 GrainTypeAdapter = new $.jqx.dataAdapter(GrainTypeSource),
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
105
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
106 AddedData = [
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
107 { id: 0, en: 'Mash', nl: 'Maischen' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
108 { id: 1, en: 'Boil', nl: 'Koken' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
109 { id: 2, en: 'Fermentation', nl: 'Vergisten' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
110 { id: 3, en: 'Lagering', nl: 'Nagisten/lageren' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
111 { id: 4, en: 'Bottle', nl: 'Bottelen' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
112 { id: 5, en: 'Kegs', nl: 'Fust' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
113 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
114 AddedSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
115 localdata: AddedData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
116 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
117 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
118 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
119 AddedAdapter = new $.jqx.dataAdapter(AddedSource),
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
120
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
121 HopTypeData = [
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
122 { id: 0, en: 'Bittering', nl: 'Bitterhop' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
123 { id: 1, en: 'Aroma', nl: 'Aromahop' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
124 { id: 2, en: 'Both', nl: 'Beide' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
125 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
126 HopTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
127 localdata: HopTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
128 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
129 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
130 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
131 HopTypeAdapter = new $.jqx.dataAdapter(HopTypeSource),
196
531d5458782f Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
132
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
133 HopFormData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
134 { id: 0, en: 'Pellet', nl: 'Pellets' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
135 { id: 1, en: 'Plug', nl: 'Plugs' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
136 { id: 2, en: 'Leaf', nl: 'Bloemen' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
137 { id: 3, en: 'Leaf wet', nl: 'Hop nat' },
806
09f29253cc7e Phase 3, hops and misc ingredients as a viewer.
Michiel Broek <mbroek@mbse.eu>
parents: 770
diff changeset
138 { id: 4, en: 'Cryo', nl: 'Cryo' },
09f29253cc7e Phase 3, hops and misc ingredients as a viewer.
Michiel Broek <mbroek@mbse.eu>
parents: 770
diff changeset
139 { id: 5, en: 'CO2 extract', nl: 'CO2 extract' },
09f29253cc7e Phase 3, hops and misc ingredients as a viewer.
Michiel Broek <mbroek@mbse.eu>
parents: 770
diff changeset
140 { id: 6, en: 'Iso extract', nl: 'Iso extract' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
141 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
142 HopFormSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
143 localdata: HopFormData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
144 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
145 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
146 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
147 HopFormAdapter = new $.jqx.dataAdapter(HopFormSource),
196
531d5458782f Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
148
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
149 HopUseData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
150 { id: 0, en: 'Mash', nl: 'Maischhop' },
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 512
diff changeset
151 { id: 1, en: 'First wort', nl: 'First wort' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
152 { id: 2, en: 'Boil', nl: 'Koken' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
153 { id: 3, en: 'Aroma', nl: 'Vlamuit' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
154 { id: 4, en: 'Whirlpool', nl: 'Whirlpool' },
806
09f29253cc7e Phase 3, hops and misc ingredients as a viewer.
Michiel Broek <mbroek@mbse.eu>
parents: 770
diff changeset
155 { id: 5, en: 'Dry hop', nl: 'Koudhop' },
09f29253cc7e Phase 3, hops and misc ingredients as a viewer.
Michiel Broek <mbroek@mbse.eu>
parents: 770
diff changeset
156 { id: 6, en: 'Bottling', nl: 'Bottelen' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
157 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
158 HopUseSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
159 localdata: HopUseData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
160 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
161 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
162 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
163 HopUseAdapter = new $.jqx.dataAdapter(HopUseSource),
220
14e349ff2a10 Recipes import uses indexes instead of strings. Started rebuilding the recipes editor using indexes and standard formats. Rebuild the fermentable editor from grid editing to popup editing. Most calculations are using indexes for dropdown values.
Michiel Broek <mbroek@mbse.eu>
parents: 217
diff changeset
164
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
165 YeastTypeData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
166 { id: 0, en: 'Lager', nl: 'Ondergist' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
167 { id: 1, en: 'Ale', nl: 'Bovengist' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
168 { id: 2, en: 'Wheat', nl: 'Tarwegist' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
169 { id: 3, en: 'Wine', nl: 'Wijngist' },
512
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
170 { id: 4, en: 'Champagne', nl: 'Champagnegist' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
171 { id: 5, en: 'Brett', nl: 'Brett' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
172 { id: 6, en: 'Kveik', nl: 'Kveik' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
173 { id: 7, en: 'Hybrid', nl: 'Hybride' }
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
174 // { id: 8, en: 'Mixed', nl: 'Mixed' },
512
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
175 // { id: 9, en: 'Spontaneous', nl: 'Spontaan' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
176 // { id: 10, en: 'Other', nl: 'Overig' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
177 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
178 YeastTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
179 localdata: YeastTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
180 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
181 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
182 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
183 YeastTypeAdapter = new $.jqx.dataAdapter(YeastTypeSource),
198
f0ec83e1e01f Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents: 196
diff changeset
184
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
185 YeastFormData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
186 { id: 0, en: 'Liquid', nl: 'Vloeibaar', cells: 100000000000 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
187 { id: 1, en: 'Dry', nl: 'Droog', cells: 15000000000 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
188 { id: 2, en: 'Slant', nl: 'Schuine buis', cells: 1700000000 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
189 { id: 3, en: 'Culture', nl: 'Slurry', cells: 1700000000 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
190 { id: 4, en: 'Frozen', nl: 'Ingevroren', cells: 1700000000 },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
191 { id: 5, en: 'Bottle', nl: 'Depot', cells: 1700000000 },
586
ed4f22cfb135 Adjusted the Kveik pitchrate to 1/10 of normal yeast.
Michiel Broek <mbroek@mbse.eu>
parents: 577
diff changeset
192 { id: 6, en: 'Dried', nl: 'Gedroogd', cells: 9000000000 } /* 9..18 billion MTF */
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
193 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
194 YeastFormSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
195 localdata: YeastFormData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
196 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
197 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }, { name: 'cells' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
198 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
199 YeastFormAdapter = new $.jqx.dataAdapter(YeastFormSource),
198
f0ec83e1e01f Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents: 196
diff changeset
200
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
201 YeastUseData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
202 { id: 0, en: 'Primary', nl: 'Hoofdgisting' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
203 { id: 1, en: 'Secondary', nl: 'Nagisting' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
204 { id: 2, en: 'Tertiary', nl: 'Lagering' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
205 { id: 3, en: 'Bottle', nl: 'Bottelen' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
206 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
207 YeastUseSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
208 localdata: YeastUseData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
209 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
210 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }, { name: 'cells' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
211 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
212 YeastUseAdapter = new $.jqx.dataAdapter(YeastUseSource),
220
14e349ff2a10 Recipes import uses indexes instead of strings. Started rebuilding the recipes editor using indexes and standard formats. Rebuild the fermentable editor from grid editing to popup editing. Most calculations are using indexes for dropdown values.
Michiel Broek <mbroek@mbse.eu>
parents: 217
diff changeset
213
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
214 FlocculationData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
215 { id: 0, en: 'Low', nl: 'Laag' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
216 { id: 1, en: 'Medium', nl: 'Medium' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
217 { id: 2, en: 'High', nl: 'Hoog' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
218 { id: 3, en: 'Very high', nl: 'Zeer hoog' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
219 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
220 FlocculationSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
221 localdata: FlocculationData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
222 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
223 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
224 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
225 FlocculationAdapter = new $.jqx.dataAdapter(FlocculationSource),
198
f0ec83e1e01f Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents: 196
diff changeset
226
512
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
227 ZymocideData = [
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
228 { id: 0, en: 'None', nl: 'Niet' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
229 { id: 1, en: 'K1', nl: 'K1' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
230 { id: 2, en: 'K2', nl: 'K2' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
231 { id: 3, en: 'K28', nl: 'K28' },
512
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
232 { id: 4, en: 'Klus', nl: 'Klus' }
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
233 ],
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
234 ZymocideSource = {
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
235 localdata: ZymocideData,
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
236 datatype: 'array',
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
237 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
238 },
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
239 ZymocideAdapter = new $.jqx.dataAdapter(ZymocideSource),
4451af8b6295 Added new fields in inventory_yeasts for Kveik and extra generic flags. Currently these fields do nothing but adding extra information in the database. Added Brett, Kveik and Hybrid yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 508
diff changeset
240
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
241 StarterTypeData = [
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
242 { id: 0, en: 'Stirred', nl: 'Geroerd' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
243 { id: 1, en: 'Shaken', nl: 'Geschud' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
244 { id: 2, en: 'Simple', nl: 'Simpel' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
245 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
246 StarterTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
247 localdata: StarterTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
248 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
249 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
250 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
251 StarterTypeAdapter = new $.jqx.dataAdapter(StarterTypeSource),
198
f0ec83e1e01f Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents: 196
diff changeset
252
697
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
253 PitchrateData = [
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
254 { rate: 0, nl: ' - Kies factor - ' },
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
255 { rate: 0.75, nl: 'Ale, 0.75' },
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
256 { rate: 1.0, nl: 'Ale, 1.00 zwaar &gt; 1.060' },
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
257 { rate: 1.25, nl: 'Ale, 1.25 zwaar &gt; 1.076' },
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
258 { rate: 1.5, nl: 'Lager 1.50' },
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
259 { rate: 2.0, nl: 'Lager, 2.00 zwaar &gt; 1.060' },
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
260 { rate: 0.075, nl: 'Kveik, 0.075 origineel' }
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
261 ],
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
262 PitchrateSource = {
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
263 localdata: PitchrateData,
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
264 datatype: 'array',
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
265 datafields: [{ name: 'rate' }, { name: 'nl' }]
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
266 },
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
267 PitchrateAdapter = new $.jqx.dataAdapter(PitchrateSource),
367ae7ff52f0 Version 0.3.34 Changed log messages in the daemon. Added yeast_pitchrate field to the product database. Added yeast pitchrate edit field to the yeast tab. Initial value is guessed. There is also a popup window for predefined values. An finally the value can be edited by the user. All popup windows are initialized together.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
268
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
269 MiscTypeData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
270 { id: 0, en: 'Spice', nl: 'Specerij' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
271 { id: 1, en: 'Herb', nl: 'Kruid' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
272 { id: 2, en: 'Flavor', nl: 'Smaakstof' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
273 { id: 3, en: 'Fining', nl: 'Klaringsmiddel' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
274 { id: 4, en: 'Water agent', nl: 'Brouwzout' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
275 { id: 5, en: 'Yeast nutrient', nl: 'Gistvoeding' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
276 { id: 6, en: 'Other', nl: 'Anders' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
277 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
278 MiscTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
279 localdata: MiscTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
280 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
281 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
282 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
283 MiscTypeAdapter = new $.jqx.dataAdapter(MiscTypeSource),
200
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 198
diff changeset
284
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
285 MiscUseData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
286 { id: 0, en: 'Starter', nl: 'Starter' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
287 { id: 1, en: 'Mash', nl: 'Maischen' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
288 { id: 2, en: 'Boil', nl: 'Koken' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
289 { id: 3, en: 'Primary', nl: 'Hoofdvergisting' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
290 { id: 4, en: 'Secondary', nl: 'Nagisting/lagering' },
806
09f29253cc7e Phase 3, hops and misc ingredients as a viewer.
Michiel Broek <mbroek@mbse.eu>
parents: 770
diff changeset
291 { id: 5, en: 'Bottling', nl: 'Bottelen' },
09f29253cc7e Phase 3, hops and misc ingredients as a viewer.
Michiel Broek <mbroek@mbse.eu>
parents: 770
diff changeset
292 { id: 6, en: 'Sparge', nl: 'Spoelen' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
293 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
294 MiscUseSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
295 localdata: MiscUseData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
296 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
297 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
298 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
299 MiscUseAdapter = new $.jqx.dataAdapter(MiscUseSource),
200
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 198
diff changeset
300
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
301 StyleTypeData = [
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
302 { id: 0, en: 'Lager', nl: 'Ondergistend bier' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
303 { id: 1, en: 'Ale', nl: 'Bovengistend bier' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
304 { id: 2, en: 'Mead', nl: 'Mede' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
305 { id: 3, en: 'Wheat', nl: 'Tarwebier' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
306 { id: 4, en: 'Mixed', nl: 'Gemengd' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
307 { id: 5, en: 'Cider', nl: 'Cider' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
308 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
309 StyleTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
310 localdata: StyleTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
311 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
312 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
313 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
314 StyleTypeAdapter = new $.jqx.dataAdapter(StyleTypeSource),
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
315
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
316 MashStepTypeData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
317 { id: 0, en: 'Infusion', nl: 'Infusie' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
318 { id: 1, en: 'Temperature', nl: 'Verwarming' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
319 { id: 2, en: 'Decoction', nl: 'Decoctie' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
320 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
321 MashStepTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
322 localdata: MashStepTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
323 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
324 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
325 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
326 MashStepTypeAdapter = new $.jqx.dataAdapter(MashStepTypeSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
327
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
328 RecipeTypeData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
329 { id: 0, en: 'Extract', nl: 'Extract' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
330 { id: 1, en: 'Partial Mash', nl: 'Deelmaisch' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
331 { id: 2, en: 'All Grain', nl: 'Mout' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
332 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
333 RecipeTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
334 localdata: RecipeTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
335 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
336 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
337 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
338 RecipeTypeAdapter = new $.jqx.dataAdapter(RecipeTypeSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
339
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
340 IBUmethodData = [
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
341 { id: 0, en: 'Tinseth', nl: 'Tinseth' },
818
f9c071906643 Removed obsolete scripts. Product editor tab 1 is a viewer.
Michiel Broek <mbroek@mbse.eu>
parents: 810
diff changeset
342 { id: 1, en: 'Tinseth++', nl: 'Tinseth++' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
343 { id: 2, en: 'Daniels', nl: 'Daniels' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
344 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
345 IBUmethodSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
346 localdata: IBUmethodData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
347 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
348 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
349 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
350 IBUmethodAdapter = new $.jqx.dataAdapter(IBUmethodSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
351
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
352 ColorMethodData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
353 { id: 0, en: 'Morey', nl: 'Morey' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
354 { id: 1, en: 'Mosher', nl: 'Mosher' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
355 { id: 2, en: 'Daniels', nl: 'Daniels' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
356 { id: 3, en: 'Halberstadt', nl: 'Halberstadt' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
357 { id: 4, en: 'Naudts', nl: 'Naudts' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
358 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
359 ColorMethodSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
360 localdata: ColorMethodData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
361 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
362 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
363 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
364 ColorMethodAdapter = new $.jqx.dataAdapter(ColorMethodSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
365
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
366 CoolingTypeData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
367 { id: 0, en: '-', nl: '-' },
841
60bb365fb48d Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents: 840
diff changeset
368 { id: 1, en: 'Immersion chiller', nl: 'Dompelkoeler' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
369 { id: 2, en: 'Counterflow chiller', nl: 'Tegenstroomkoeler' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
370 { id: 3, en: 'Au bain marie', nl: 'Au bain marie' },
841
60bb365fb48d Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
Michiel Broek <mbroek@mbse.eu>
parents: 840
diff changeset
371 { id: 4, en: 'No-chill', nl: 'Laten afkoelen' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
372 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
373 CoolingTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
374 localdata: CoolingTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
375 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
376 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
377 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
378 CoolingTypeAdapter = new $.jqx.dataAdapter(CoolingTypeSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
379
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
380 AerationTypeData = [
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
381 { id: 0, en: 'None', nl: 'Geen' },
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
382 { id: 1, en: 'Air', nl: 'Lucht' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
383 { id: 2, en: 'Oxygen', nl: 'Zuurstof' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
384 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
385 AerationTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
386 localdata: AerationTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
387 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
388 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
389 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
390 AerationTypeAdapter = new $.jqx.dataAdapter(AerationTypeSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
391
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
392 AcidTypeData = [
662
4bb005694ce7 Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents: 656
diff changeset
393 /* Note: AcidSG is for 100% use. AcidPrc is the default setting. */
4bb005694ce7 Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents: 656
diff changeset
394 { id: 0, en: 'Lactic', nl: 'Melkzuur', pK1: 3.86, pK2: 20, pK3: 20, MolWt: 90.08, AcidSG: 1238, AcidPrc: 80 },
4bb005694ce7 Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents: 656
diff changeset
395 { id: 1, en: 'Hydrochloric', nl: 'Zoutzuur', pK1: -7, pK2: 20, pK3: 20, MolWt: 36.46, AcidSG: 1497, AcidPrc: 28 },
825
8b87ad5bd3c3 Correction for Phosforic SG. Water treatment is a viewer. Start reordering and optimizing the calculations.
Michiel Broek <mbroek@mbse.eu>
parents: 818
diff changeset
396 { id: 2, en: 'Phosphoric', nl: 'Fosforzuur', pK1: 2.12, pK2: 7.20, pK3: 12.44, MolWt: 98.00, AcidSG: 1773, AcidPrc: 75 },
662
4bb005694ce7 Version 0.3.32 Inventory water and profile water edit screens updated and added ion balance fields. Moved acid specs to global.js. In prod_edit and rec_edit changed the water calculations, eliminated the double percentage calculation. The pH values in the water tab have now 2 decimal digits. The mash pH field is only shown in auto calculate mode. The calculated acid addition results are now a bit better and compare with several famous spreadsheets.
Michiel Broek <mbroek@mbse.eu>
parents: 656
diff changeset
397 { id: 3, en: 'Sulfuric', nl: 'Zwavelzuur', pK1: -1, pK2: 1.92, pK3: 20, MolWt: 98.07, AcidSG: 1884, AcidPrc: 93 }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
398 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
399 AcidTypeSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
400 localdata: AcidTypeData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
401 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
402 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
403 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
404 AcidTypeAdapter = new $.jqx.dataAdapter(AcidTypeSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
405
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
406 SpargeSourceData = [
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
407 { id: 0, en: 'Source 1', nl: 'Bron 1' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
408 { id: 1, en: 'Source 2', nl: 'Bron 2' },
529
bb8a37fe6326 Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents: 515
diff changeset
409 { id: 2, en: 'Mixed', nl: 'Gemengd' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
410 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
411 SpargeSourceSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
412 localdata: SpargeSourceData,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
413 datatype: 'array',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
414 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
415 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
416 SpargeSourceAdapter = new $.jqx.dataAdapter(SpargeSourceSource),
220
14e349ff2a10 Recipes import uses indexes instead of strings. Started rebuilding the recipes editor using indexes and standard formats. Rebuild the fermentable editor from grid editing to popup editing. Most calculations are using indexes for dropdown values.
Michiel Broek <mbroek@mbse.eu>
parents: 217
diff changeset
417
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
418
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
419 // options for editors
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
420
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
421 Show1wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
422 Show2wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 2, readOnly: true },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
423 Show3wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 3, readOnly: true },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
424 Smal0dec = { inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
425 Smal1dec = { inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true },
622
39902353b159 Workaround for hang during startup. Changed order of displayed fields on the yeast tab. Tooltip text changes. More decimals on the checklist for misc ingredients. More decimals for the starter on product print.
Michiel Broek <mbroek@mbse.eu>
parents: 587
diff changeset
426 Smal2dec = { inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 2, readOnly: true },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
427 Show0dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 0 },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
428 Show1dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 1 },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
429 Show2dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 2 },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
430 Show3dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 3 },
577
b4bfed3684d0 In production archive lists show always the OG from the brew fermenter SG. Possible fix for the not used og field in the database.
Michiel Broek <mbroek@mbse.eu>
parents: 561
diff changeset
431 Show4dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 4 },
587
31caffee8c9c Changed several float precision values. Changed some database fields to double. Everything has now the same precision as received values from the iSpindel.
Michiel Broek <mbroek@mbse.eu>
parents: 586
diff changeset
432 Show5dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 5 },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
433 SGopts = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0.990, max: 1.199, decimalDigits: 3, spinButtons: true },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
434 Spin1dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 1, spinButtons: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
435 Spin2dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 2, spinButtons: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
436 Spin3dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 3, spinButtons: true },
577
b4bfed3684d0 In production archive lists show always the OG from the brew fermenter SG. Possible fix for the not used og field in the database.
Michiel Broek <mbroek@mbse.eu>
parents: 561
diff changeset
437 Spin4dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 4, spinButtons: true },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
438 SpinpH = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1, max: 14, decimalDigits: 1, spinButtons: true },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
439 Spin2pH = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1, max: 14, decimalDigits: 2, spinButtons: true },
548
c67cd0d9249b Version 0.3.23. Maximum fermentation temperature changed to 45 degrees.
Michiel Broek <mbroek@mbse.eu>
parents: 541
diff changeset
440 YeastT = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 45, decimalDigits: 1, spinButtons: true },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
441 PosInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 0, spinButtons: true },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
442 Perc1dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 1, spinButtons: true },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
443 Perc0 = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 0, spinButtons: true },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
444 Dateopts = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
445 theme: theme, width: 150, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
446 formatString: 'yyyy-MM-dd', enableBrowserBoundsDetection: true
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
447 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
448 DateTimeopts = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
449 theme: theme, width: 230, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
450 formatString: 'yyyy-MM-dd HH:mm:ss', enableBrowserBoundsDetection: true, showTimeButton: true
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
451 },
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
452
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 186
diff changeset
453
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
454 sugardensity = 1.611, //kg/l in solution
121
875aeb365e1c Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents: 101
diff changeset
455
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
456 // Styles dropdown list
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
457 stylesSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
458 datatype: 'json',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
459 datafields: [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
460 { name: 'record', type: 'number' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
461 { name: 'name', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
462 { name: 'category', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
463 { name: 'category_number', type: 'number' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
464 { name: 'style_letter', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
465 { name: 'style_guide', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
466 { name: 'type', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
467 { name: 'og_min', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
468 { name: 'og_max', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
469 { name: 'fg_min', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
470 { name: 'fg_max', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
471 { name: 'ibu_min', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
472 { name: 'ibu_max', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
473 { name: 'color_min', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
474 { name: 'color_max', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
475 { name: 'carb_min', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
476 { name: 'carb_max', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
477 { name: 'abv_min', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
478 { name: 'abv_max', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
479 { name: 'notes', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
480 { name: 'profile', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
481 { name: 'ingredients', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
482 { name: 'examples', type: 'string' }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
483 ],
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
484 url: 'includes/db_profile_styles.php'
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
485 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
486 styleslist = new $.jqx.dataAdapter(stylesSource),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
487
167
dabcd35f8f92 Added new brew project wizzard. Moved equipment dropdown to global script. The project birth date is allways read-only, so it can never be changed.
Michiel Broek <mbroek@mbse.eu>
parents: 164
diff changeset
488 // Equipemnt dropdown list
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
489 equipmentSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
490 datatype: 'json',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
491 datafields: [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
492 { name: 'name', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
493 { name: 'boil_size', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
494 { name: 'batch_size', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
495 { name: 'tun_volume', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
496 { name: 'tun_weight', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
497 { name: 'tun_specific_heat', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
498 { name: 'tun_material', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
499 { name: 'tun_height', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
500 { name: 'top_up_water', type: 'float' },
842
897bf2a43253 Renamed trub_chiller_loss to trub_loss fields.
Michiel Broek <mbroek@mbse.eu>
parents: 841
diff changeset
501 { name: 'trub_loss', type: 'float' },
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
502 { name: 'evap_rate', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
503 { name: 'boil_time', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
504 { name: 'calc_boil_volume', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
505 { name: 'top_up_kettle', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
506 { name: 'notes', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
507 { name: 'lauter_volume', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
508 { name: 'lauter_height', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
509 { name: 'lauter_deadspace', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
510 { name: 'kettle_volume', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
511 { name: 'kettle_height', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
512 { name: 'mash_volume', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
513 { name: 'mash_max', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
514 { name: 'efficiency', type: 'float' }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
515 ],
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
516 url: 'includes/db_inventory_equipments.php'
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
517 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
518 equipmentlist = new $.jqx.dataAdapter(equipmentSource),
167
dabcd35f8f92 Added new brew project wizzard. Moved equipment dropdown to global script. The project birth date is allways read-only, so it can never be changed.
Michiel Broek <mbroek@mbse.eu>
parents: 164
diff changeset
519
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
520 // dropdownlist datasource from inventory_fermentables
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
521 fermentableInvSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
522 datatype: 'json',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
523 datafields: [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
524 { name: 'record', type: 'number' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
525 { name: 'name', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
526 { name: 'type', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
527 { name: 'yield', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
528 { name: 'color', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
529 { name: 'add_after_boil', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
530 { name: 'origin', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
531 { name: 'supplier', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
532 { name: 'coarse_fine_diff', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
533 { name: 'moisture', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
534 { name: 'diastatic_power', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
535 { name: 'protein', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
536 { name: 'dissolved_protein', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
537 { name: 'max_in_batch', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
538 { name: 'recommend_mash', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
539 { name: 'graintype', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
540 { name: 'di_ph', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
541 { name: 'acid_to_ph_57', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
542 { name: 'inventory', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
543 { name: 'cost', type: 'float' }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
544 ],
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
545 url: 'getfermentablesources.php'
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
546 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
547 fermentableinstock = false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
548 fermentablelist = new $.jqx.dataAdapter(fermentableInvSource, {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
549 beforeLoadComplete: function(records) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
550 var row, i, data = new Array();
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
551 for (i = 0; i < records.length; i++) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
552 row = records[i];
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
553 if (row.inventory || ! fermentableinstock)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
554 data.push(row);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
555 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
556 return data;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
557 },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
558 loadError: function(jqXHR, status, error) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
559 console.log(status + ' ' + error);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
560 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
561 }),
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
562 fermentablesugars = new $.jqx.dataAdapter(fermentableInvSource, {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
563 beforeLoadComplete: function(records) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
564 var row, i, data = new Array();
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
565 for (i = 0; i < records.length; i++) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
566 row = records[i];
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
567 if (row.type == 1 || row.type == 3) // Sugars or dry extract
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
568 data.push(row);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
569 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
570 return data;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
571 },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
572 loadError: function(jqXHR, status, error) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
573 console.log(status + ' ' + error);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
574 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
575 }),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
576
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
577 // dropdownlist datasource from inventory_hops
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
578 hopInvSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
579 datatype: 'json',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
580 datafields: [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
581 { name: 'record', type: 'number' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
582 { name: 'name', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
583 { name: 'origin', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
584 { name: 'type', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
585 { name: 'alpha', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
586 { name: 'beta', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
587 { name: 'humulene', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
588 { name: 'caryophyllene', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
589 { name: 'cohumulone', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
590 { name: 'myrcene', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
591 { name: 'hsi', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
592 { name: 'useat', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
593 { name: 'form', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
594 { name: 'total_oil', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
595 { name: 'inventory', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
596 { name: 'cost', type: 'float' }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
597 ],
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
598 url: 'gethopsources.php'
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
599 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
600 hopinstock = false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
601 hoplist = new $.jqx.dataAdapter(hopInvSource, {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
602 beforeLoadComplete: function(records) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
603 var row, i, data = new Array();
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
604 for (i = 0; i < records.length; i++) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
605 row = records[i];
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
606 if (row.inventory || ! hopinstock)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
607 data.push(row);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
608 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
609 return data;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
610 },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
611 loadError: function(jqXHR, status, error) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
612 console.log(status + ' ' + error);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
613 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
614 }),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
615
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
616 // dropdownlist datasource from inventory_miscs
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
617 miscInvSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
618 datatype: 'json',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
619 datafields: [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
620 { name: 'record', type: 'number' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
621 { name: 'name', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
622 { name: 'type', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
623 { name: 'use_use', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
624 { name: 'amount_is_weight', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
625 { name: 'time', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
626 { name: 'inventory', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
627 { name: 'cost', type: 'float' }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
628 ],
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
629 url: 'getmiscsources.php'
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
630 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
631 miscinstock = false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
632 misclist = new $.jqx.dataAdapter(miscInvSource, {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
633 beforeLoadComplete: function(records) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
634 var row, i, data = new Array();
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
635 for (i = 0; i < records.length; i++) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
636 row = records[i];
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
637 if (row.inventory || ! miscinstock)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
638 data.push(row);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
639 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
640 return data;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
641 },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
642 loadError: function(jqXHR, status, error) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
643 console.log(status + ' ' + error);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
644 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
645 }),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
646
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
647 // dropdownlist datasource from inventory_yeasts
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
648 yeastInvSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
649 datatype: 'json',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
650 datafields: [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
651 { name: 'record', type: 'number' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
652 { name: 'name', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
653 { name: 'type', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
654 { name: 'form', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
655 { name: 'laboratory', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
656 { name: 'product_id', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
657 { name: 'min_temperature', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
658 { name: 'max_temperature', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
659 { name: 'flocculation', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
660 { name: 'attenuation', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
661 { name: 'cells', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
662 { name: 'inventory', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
663 { name: 'cost', type: 'float' },
554
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 548
diff changeset
664 { name: 'tolerance', type: 'float' },
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 548
diff changeset
665 { name: 'sta1', type: 'int' },
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 548
diff changeset
666 { name: 'bacteria', type: 'int' },
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 548
diff changeset
667 { name: 'harvest_top', type: 'int' },
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 548
diff changeset
668 { name: 'harvest_time', type: 'int' },
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 548
diff changeset
669 { name: 'pitch_temperature', type: 'float' },
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 548
diff changeset
670 { name: 'pofpos', type: 'int' },
726
872a3635e4ef Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
671 { name: 'zymocide', type: 'int' },
872a3635e4ef Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
672 { name: 'gr_hl_lo', type: 'int' },
872a3635e4ef Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
673 { name: 'sg_lo', type: 'float' },
872a3635e4ef Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
674 { name: 'gr_hl_hi', type: 'int' },
872a3635e4ef Changed dry-yeast calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
675 { name: 'sg_hi', type: 'float' }
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
676 ],
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
677 url: 'getyeastsources.php'
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
678 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
679 yeastinstock = false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
680 yeastlist = new $.jqx.dataAdapter(yeastInvSource, {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
681 beforeLoadComplete: function(records) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
682 var row, i, data = new Array();
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
683 for (i = 0; i < records.length; i++) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
684 row = records[i];
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
685 if (row.inventory || ! yeastinstock)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
686 data.push(row);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
687 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
688 return data;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
689 },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
690 loadError: function(jqXHR, status, error) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
691 console.log(status + ' ' + error);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
692 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
693 }),
625
57bc32b5f411 Extended the max value for brix correction value to 1.09. Added setting of a private yeast lab for later use. Fixed missing some default setup values.
Michiel Broek <mbroek@mbse.eu>
parents: 622
diff changeset
694 yeastlablist = new $.jqx.dataAdapter(yeastInvSource, { autoBind: false, async: false, uniqueDataFields: ['laboratory'] }),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
695
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
696 // dropdownlist datasource from inventory_waters
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
697 waterInvSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
698 datatype: 'json',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
699 datafields: [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
700 { name: 'record', type: 'number' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
701 { name: 'name', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
702 { name: 'unlimited_stock', type: 'int' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
703 { name: 'calcium', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
704 { name: 'sulfate', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
705 { name: 'chloride', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
706 { name: 'sodium', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
707 { name: 'magnesium', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
708 { name: 'ph', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
709 { name: 'total_alkalinity', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
710 { name: 'inventory', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
711 { name: 'cost', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
712 ],
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
713 url: 'getwatersources.php'
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
714 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
715 waterinstock = false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
716 waterlist = new $.jqx.dataAdapter(waterInvSource, {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
717 beforeLoadComplete: function(records) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
718 var data, i, row;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
719 data = new Array();
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
720 for (i = 0; i < records.length; i++) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
721 row = records[i];
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
722 if (row.inventory || row.unlimited_stock || ! waterinstock)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
723 data.push(row);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
724 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
725 return data;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
726 },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
727 loadError: function(jqXHR, status, error) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
728 console.log(status + ' ' + error);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
729 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
730 }),
755
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
731 water2list = new $.jqx.dataAdapter(waterInvSource, {
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
732 beforeLoadComplete: function(records) {
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
733 var data, i, row, none = {};
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
734 data = new Array();
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
735 none['name'] = 'Geen mengwater'; /* Put empty water on top */
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
736 none['unlimited_stock'] = 0;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
737 none['calcium'] = 0;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
738 none['sulfate'] = 0;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
739 none['chloride'] = 0;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
740 none['sodium'] = 0;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
741 none['magnesium'] = 0;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
742 none['ph'] = 0;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
743 none['total_alkalinity'] = 0;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
744 none['inventory'] = 0;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
745 none['cost'] = 0;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
746 data.push(none);
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
747 for (i = 0; i < records.length; i++) {
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
748 row = records[i];
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
749 if (row.inventory || row.unlimited_stock || ! waterinstock)
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
750 data.push(row);
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
751 }
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
752 return data;
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
753 },
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
754 loadError: function(jqXHR, status, error) {
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
755 console.log(status + ' ' + error);
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
756 },
509510586665 Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
Michiel Broek <mbroek@mbse.eu>
parents: 728
diff changeset
757 }),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
758
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: 148
diff changeset
759 // dropdownlist datasource from profile_water
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
760 waterProfileSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
761 datatype: 'json',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
762 datafields: [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
763 { name: 'record', type: 'number' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
764 { name: 'name', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
765 { name: 'calcium', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
766 { name: 'bicarbonate', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
767 { name: 'sulfate', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
768 { name: 'chloride', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
769 { name: 'sodium', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
770 { name: 'magnesium', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
771 { name: 'ph', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
772 { name: 'total_alkalinity', type: 'float' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
773 ],
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
774 url: 'includes/db_profile_water.php'
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
775 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
776 waterprofiles = new $.jqx.dataAdapter(waterProfileSource),
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: 148
diff changeset
777
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
778 // dropdownlist datasource from profile_mash
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
779 mashProfileSource = {
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
780 datatype: 'json',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
781 datafields: [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
782 { name: 'record', type: 'number' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
783 { name: 'name', type: 'string' },
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
784 { name: 'steps', type: 'array' }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
785 ],
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
786 url: 'includes/db_profile_mash.php'
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
787 },
656
a4a9f6ded485 Code cleanup
Michiel Broek <mbroek@mbse.eu>
parents: 655
diff changeset
788 mashlist = new $.jqx.dataAdapter(mashProfileSource);
438
61436d428454 Added Round() function. Start new sugar calculations. Compressed some code. Dropped seanterrill refracto formula and switched back to brouwhulp/halberstadt formula and allow SVG above 100% for saisons.
Michiel Broek <mbroek@mbse.eu>
parents: 430
diff changeset
789
678
14322825cb3d The co2meters monitor screen rebuild to use websockets instead of data polling.
Michiel Broek <mbroek@mbse.eu>
parents: 671
diff changeset
790 /* Websocket interface. Place "websocket.onmessage = function(evt) {}" in the user script. */
679
48f8f3fce7c0 Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.
Michiel Broek <mbroek@mbse.eu>
parents: 678
diff changeset
791 var websocket = new ReconnectingWebSocket('ws://'+location.hostname+'/ws');
678
14322825cb3d The co2meters monitor screen rebuild to use websockets instead of data polling.
Michiel Broek <mbroek@mbse.eu>
parents: 671
diff changeset
792
14322825cb3d The co2meters monitor screen rebuild to use websockets instead of data polling.
Michiel Broek <mbroek@mbse.eu>
parents: 671
diff changeset
793 websocket.onerror = function(event) {
14322825cb3d The co2meters monitor screen rebuild to use websockets instead of data polling.
Michiel Broek <mbroek@mbse.eu>
parents: 671
diff changeset
794 console.log('Websocket error: ' + event.data);
14322825cb3d The co2meters monitor screen rebuild to use websockets instead of data polling.
Michiel Broek <mbroek@mbse.eu>
parents: 671
diff changeset
795 }
14322825cb3d The co2meters monitor screen rebuild to use websockets instead of data polling.
Michiel Broek <mbroek@mbse.eu>
parents: 671
diff changeset
796
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
797 $(document).ready(function() {
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
798
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
799 $('#jqxMenu').jqxMenu({
687
93ea9572c780 Rolled back websocket status message
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
800 width: 1280,
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
801 height: '30px',
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
802 autoOpen: false,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
803 clickToOpen: true,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
804 theme: theme
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
805 });
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
806 $('#jqxWidget').css('visibility', 'visible');
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
807 });
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
808
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
809
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
810
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
811 function Round(n, d) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
812 for (var i = 0, m = 1; i < d; i++, m *= 10);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
813 return Math.round(n * m) / m;
98
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
814 }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
815
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
816
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
817
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
818 function ebc_to_srm(ebc) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
819 var srm = -1.32303E-12 * Math.pow(ebc, 4) - 0.00000000291515 * Math.pow(ebc, 3) + 0.00000818515 * Math.pow(ebc, 2) + 0.372038 * ebc + 0.596351;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
820 if (srm < 0)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
821 srm = 0;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
822 return srm;
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
823 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
824
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
825
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
826
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
827 function srm_to_ebc(srm) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
828 var ebc = Math.round(0.000000000176506 * Math.pow(srm, 4) + 0.000000154529 * Math.pow(srm, 3) - 0.000159428 * Math.pow(srm, 2) + 2.68837 * srm - 1.6004);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
829 if (ebc < 0)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
830 ebc = 0;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
831 return ebc;
98
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
832 }
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
833
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
834
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
835
462
c91175610f8a Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 446
diff changeset
836 /* Return incremented color by the boil and yeast.
c91175610f8a Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 446
diff changeset
837 * https://www.hobbybrouwen.nl/forum/index.php/topic,19020.msg281132.html#msg281132 */
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
838 function get_kt(ebc) {
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
839
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
840 var kt = 1;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
841 if (ebc < 3)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
842 kt = 3.5;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
843 else if (ebc < 6)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
844 kt = 3;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
845 else if (ebc < 8)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
846 kt = 2.75;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
847 else if (ebc < 10)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
848 kt = 2.5;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
849 else if (ebc < 20)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
850 kt = 1.8;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
851 else if (ebc < 30)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
852 kt = 1.6;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
853 else if (ebc < 60)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
854 kt = 1.3;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
855 else if (ebc < 100)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
856 kt = 1.2;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
857 else if (ebc < 300)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
858 kt = 1.1;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
859 return kt;
372
1365b5e47130 Added color method written by Hans Halberstadt.
Michiel Broek <mbroek@mbse.eu>
parents: 371
diff changeset
860 }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
861
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
862
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
863
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
864 function abvol(og, fg) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
865 if (((og - fg) < 0) || (fg < 0.9))
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
866 return 0;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
867 var factor = og * 3157 * Math.pow(10, -5) + 9.716 * Math.pow(10, -2);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
868 return (og * 1000 - fg * 1000) * factor;
133
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
869 }
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
870
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
871
22d28dd9c041 Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents: 121
diff changeset
872
462
c91175610f8a Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 446
diff changeset
873 /* Kleurwerking naar SRM. Niet voor Halberstadt, Naudts */
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
874 function kw_to_srm(colormethod, c) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
875 if (colormethod == 0)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
876 return 1.4922 * Math.pow(c, 0.6859); //Morey
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
877 if (colormethod == 1)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
878 return 0.3 * c + 4.7; //Mosher
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
879 if (colormethod == 2)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
880 return 0.2 * c + 8.4; //Daniels
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
881 return 0; //Halberstadt,Naudts
98
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
882 }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
883
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
884
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
885
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
886 function kw_to_ebc(colormethod, c) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
887 return srm_to_ebc(kw_to_srm(colormethod, c));
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
888 }
98
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
889
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
890
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
891
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
892 /*
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
893 * Berekeningen uit https://www.hobbybrouwen.nl/forum/index.php/topic,6079.msg69464.html#msg69464
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
894 */
538
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
895 function toIBU(Use, Form, SG, Volume, Amount, Boiltime, Alpha, Method, Whirlpool9, Whirlpool7, Whirlpool6) {
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
896
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
897 var gravity, liters, alpha, mass, time, fmoment = 1.0, pfactor = 1.0, ibu = 0, boilfactor, sgfactor,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
898 AddedAlphaAcids, Bigness_factor, BoilTime_factor, utiisation;
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
899
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
900 gravity = parseFloat(SG);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
901 liters = parseFloat(Volume);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
902 alpha = parseFloat(Alpha) / 100;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
903 mass = parseFloat(Amount) * 1000;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
904 time = parseFloat(Boiltime);
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
905
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
906 if ((Use == 3) || (Use == 4) || (Use == 5)) { // Aroma, Whirlpool or Dry hop.
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
907 fmoment = 0.0;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
908 } else if (Use == 0) { // Mash
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
909 fmoment += my_factor_mashhop / 100; // Brouwhulp
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
910 } else if (Use == 1) { // First wort
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
911 fmoment += my_factor_fwh / 100; // Brouwhulp, Louis, Ozzie
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
912 }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
913
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
914 if (Form == 0) { // Pellet
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
915 pfactor += my_factor_pellet / 100;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
916 } else if (Form == 1) { // Plug
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
917 pfactor += my_factor_plug / 100;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
918 } else if (Form == 3) { // Wet leaf
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
919 pfactor += my_factor_wethop / 100; // From https://github.com/chrisgilmerproj/brewday/blob/master/brew/constants.py
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
920 } else if (Form == 4) { // Cryo hop
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
921 pfactor += my_factor_cryohop / 100;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
922 }
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
923
538
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
924 // Ideas from Zymurgy March-April 2018. These are not exact formulas!
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
925 whirlibus = 0;
541
df678aa03f4a Take in account that flamout hops also contribute during a whirlpool and cooling.
Michiel Broek <mbroek@mbse.eu>
parents: 539
diff changeset
926 if (Use == 3 || Use == 4) { // Flameout or any whirlpool
538
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
927 if (Whirlpool9) {
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
928 // 20 mg/l/50 min
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
929 whirlibus += (alpha * mass * 20) / liters * (Whirlpool9 / 50);
539
fe9ac6d49c4f Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents: 538
diff changeset
930 //console.log('Whirlpool9:' + alpha * mass * 20 + ' liter:' + liters + ' time:' + Whirlpool9 + ' ibu' + (alpha * mass * 20) / liters * (Whirlpool9 / 50));
541
df678aa03f4a Take in account that flamout hops also contribute during a whirlpool and cooling.
Michiel Broek <mbroek@mbse.eu>
parents: 539
diff changeset
931 } else {
df678aa03f4a Take in account that flamout hops also contribute during a whirlpool and cooling.
Michiel Broek <mbroek@mbse.eu>
parents: 539
diff changeset
932 if (Use == 3) // Flameout hops are 2 minutes in this range.
df678aa03f4a Take in account that flamout hops also contribute during a whirlpool and cooling.
Michiel Broek <mbroek@mbse.eu>
parents: 539
diff changeset
933 whirlibus += (alpha * mass * 20) / liters * (2 / 50);
538
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
934 }
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
935 if (Whirlpool7) {
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
936 // 6 mg/l/50 min
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
937 whirlibus += (alpha * mass * 6) / liters * (Whirlpool7 / 50);
539
fe9ac6d49c4f Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents: 538
diff changeset
938 //console.log('Whirlpool7:' + alpha * mass * 6 + ' liter:' + liters + ' time:' + Whirlpool7 + ' ibu' + (alpha * mass * 6) / liters * (Whirlpool7 / 50));
541
df678aa03f4a Take in account that flamout hops also contribute during a whirlpool and cooling.
Michiel Broek <mbroek@mbse.eu>
parents: 539
diff changeset
939 } else {
df678aa03f4a Take in account that flamout hops also contribute during a whirlpool and cooling.
Michiel Broek <mbroek@mbse.eu>
parents: 539
diff changeset
940 if (Use == 3) // Flameout hops are 4 minutes in this range.
df678aa03f4a Take in account that flamout hops also contribute during a whirlpool and cooling.
Michiel Broek <mbroek@mbse.eu>
parents: 539
diff changeset
941 whirlibus += (alpha * mass * 6) / liters * (4 / 50);
538
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
942 }
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
943 if (Whirlpool6) {
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
944 // 2 mg/l/50 min
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
945 whirlibus += (alpha * mass * 2) / liters * (Whirlpool6 / 50);
539
fe9ac6d49c4f Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents: 538
diff changeset
946 //console.log('Whirlpool6:' + alpha * mass * 2 + ' liter:' + liters + ' time:' + Whirlpool6 + ' ibu' + (alpha * mass * 2) / liters * (Whirlpool6 / 50));
538
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
947 }
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
948 }
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
949
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
950 if (Method == 0) { // Tinseth
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
951 /* http://realbeer.com/hops/research.html */
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
952 AddedAlphaAcids = (alpha * mass * 1000) / liters;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
953 Bigness_factor = 1.65 * Math.pow(0.000125, gravity - 1);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
954 BoilTime_factor = ((1 - Math.exp(-0.04 * time)) / 4.15);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
955 utiisation = Bigness_factor * BoilTime_factor;
538
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
956 ibu = Round(utiisation * AddedAlphaAcids * fmoment * pfactor + whirlibus, 1);
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
957 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
958 if (Method == 2) { // Daniels
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
959 if (Form == 2) // Leaf
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
960 boilfactor = -(0.0041 * time * time) + (0.6162 * time) + 1.5779;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
961 else
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
962 boilfactor = -(0.0051 * time * time) + (0.7835 * time) + 1.9348;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
963 if (gravity < 1050)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
964 sgfactor = 0;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
965 else
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
966 sgfactor = (gravity - 1050) / 200;
538
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
967 ibu = Round(fmoment * ((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor))) + whirlibus, 1);
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
968 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
969 if (Method == 1) { // Rager
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
970 boilfactor = fmoment * 18.11 + 13.86 * Math.tanh((time * 31.32) / 18.27);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
971 if (gravity < 1050)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
972 sgfactor = 0;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
973 else
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
974 sgfactor = (gravity - 1050) / 200;
538
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
975 ibu = Round((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor)) + whirlibus, 1);
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
976 }
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
977
538
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
978 // console.log('toIBU(' + Use + ',' + Form + ',' + SG + ',' + Volume + ',' + Amount + ',' + Boiltime + ',' +
41d21817608e Added the IBU contribution for whirlpool hops.
Michiel Broek <mbroek@mbse.eu>
parents: 529
diff changeset
979 // Alpha + ',' + Method + ',' + Whirlpool9 + ',' + Whirlpool7 + ',' + Whirlpool6 + '):' + ibu + ' fm:' + fmoment + ' pf:' + pfactor);
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
980 return ibu;
446
ee7bcfb8e270 Added Cryo Hops type.
Michiel Broek <mbroek@mbse.eu>
parents: 439
diff changeset
981 }
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
982
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
983
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
984
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
985 function ebc_to_color(ebc) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
986 return srm_to_color(ebc_to_srm(ebc));
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
987 }
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
988
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
989
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
990
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
991 function srm_to_color(srm) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
992 var i, R, G, B, color, result;
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
993
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
994 i = Math.round(srm * 10);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
995 if (i < 0)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
996 i = 0;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
997 if (i > 299)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
998 i = 299;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
999
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1000 /* Table copied from Brouwhulp/BrewBuddy */
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1001
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1002 R = [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1003 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, //0
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1004 250, 250, 250, 250, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, //2
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1005 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, //4
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1006 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 200, 199, 199, 198, 198, //6
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1007 197, 197, 196, 196, 195, 195, 194, 194, 193, 193, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, //8
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1008 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, //10
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1009 192, 192, 192, 192, 192, 192, 192, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, //12
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1010 179, 178, 177, 175, 174, 172, 171, 169, 168, 167, 195, 164, 162, 161, 159, 158, 157, 155, 154, 152, //14
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1011 151, 149, 148, 147, 145, 144, 142, 141, 139, 138, 137, 135, 134, 132, 131, 129, 128, 127, 125, 124, //16
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1012 122, 121, 119, 118, 117, 115, 114, 112, 111, 109, 108, 107, 105, 104, 102, 101, 99, 98, 97, 95, //18
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1013 94, 92, 91, 89, 88, 87, 85, 84, 82, 81, 79, 78, 77, 75, 74, 72, 71, 69, 68, 67, //20
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1014 65, 64, 62, 61, 59, 58, 57, 55, 54, 52, 51, 49, 48, 47, 45, 44, 43, 41, 39, 38, //22
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1015 37, 37, 36, 36, 35, 35, 34, 34, 33, 33, 32, 32, 31, 31, 30, 30, 29, 29, 28, 28, //24
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1016 27, 27, 26, 26, 25, 25, 24, 24, 23, 23, 22, 22, 21, 21, 20, 20, 19, 19, 18, 18, //26
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1017 17, 17, 16, 16, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8];
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1018
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1019 G = [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1020 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1021 250, 250, 250, 250, 250, 250, 249, 248, 247, 246, 245, 244, 242, 240, 238, 236, 234, 232, 230, 228,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1022 226, 224, 222, 220, 218, 216, 214, 212, 210, 208, 206, 204, 202, 200, 198, 196, 194, 192, 190, 188,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1023 186, 184, 182, 180, 178, 176, 174, 172, 170, 168, 166, 164, 162, 160, 158, 156, 154, 152, 150, 148,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1024 146, 144, 142, 141, 140, 139, 139, 138, 137, 136, 136, 135, 134, 133, 133, 132, 131, 130, 130, 129,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1025 128, 127, 127, 126, 125, 124, 124, 123, 122, 121, 121, 120, 119, 118, 118, 117, 116, 115, 115, 114,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1026 113, 112, 112, 111, 110, 109, 109, 108, 107, 106, 106, 105, 104, 103, 103, 102, 101, 100, 100, 99,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1027 98, 97, 97, 96, 95, 94, 94, 93, 92, 91, 91, 90, 89, 88, 88, 87, 86, 85, 85, 84,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1028 83, 82, 82, 81, 80, 79, 78, 77, 76, 75, 75, 74, 73, 72, 72, 71, 70, 69, 69, 68,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1029 67, 66, 66, 65, 64, 63, 63, 62, 61, 60, 60, 59, 58, 57, 57, 56, 55, 54, 54, 53,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1030 52, 51, 51, 50, 49, 48, 48, 47, 46, 45, 45, 44, 43, 42, 42, 41, 40, 39, 39, 38,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1031 37, 36, 36, 35, 34, 33, 33, 32, 31, 30, 30, 29, 28, 27, 27, 26, 25, 24, 24, 23,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1032 22, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 16, 16,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1033 16, 15, 15, 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1034 9, 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3];
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1035
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1036 B = [
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1037 210, 204, 199, 193, 188, 182, 177, 171, 166, 160, 155, 149, 144, 138, 133, 127, 122, 116, 111, 105,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1038 100, 94, 89, 83, 78, 72, 67, 61, 56, 50, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1039 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1040 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1041 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1042 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1043 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1044 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 51,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1045 51, 51, 51, 50, 50, 50, 50, 49, 49, 48, 47, 47, 46, 45, 45, 44, 43, 43, 42, 41,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1046 41, 40, 39, 39, 38, 37, 37, 36, 35, 34, 33, 32, 31, 29, 28, 27, 26, 25, 24, 23,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1047 21, 20, 19, 18, 17, 16, 15, 13, 12, 11, 10, 9, 8, 9, 9, 10, 10, 11, 11, 12,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1048 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1049 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 17, 16, 16, 15, 15,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1050 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9, 9, 9, 8,
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1051 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2];
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1052
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1053 color = R[i] * 65536 + G[i] * 256 + B[i];
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1054 result = color.toString(16).toUpperCase();
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1055 if (result.length < 6)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1056 result = '0' + result;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1057 return '#' + result;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1058 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1059
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1060
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1061
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1062 function sg_to_plato(sg) {
652
a5d9ec7e2239 Changed sg to plato and plato to sg formulas to the ones from Brew by the Numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 648
diff changeset
1063 // return ((135.997 * sg - 630.272) * sg + 1111.14) * sg - 616.868;
a5d9ec7e2239 Changed sg to plato and plato to sg formulas to the ones from Brew by the Numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 648
diff changeset
1064 return -668.962 + (1262.45 * sg) - (776.43 * sg * sg) + (182.94 * sg * sg * sg);
139
eb1ac7487710 Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1065 }
eb1ac7487710 Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1066
eb1ac7487710 Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1067
eb1ac7487710 Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents: 136
diff changeset
1068
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1069 function plato_to_sg(plato) {
652
a5d9ec7e2239 Changed sg to plato and plato to sg formulas to the ones from Brew by the Numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 648
diff changeset
1070 // return 1 + (plato / (258.6 - ((plato / 258.2) * 227.1)));
a5d9ec7e2239 Changed sg to plato and plato to sg formulas to the ones from Brew by the Numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 648
diff changeset
1071 return 1.00001 + (0.0038661 * plato) + (1.3488e-5 * plato * plato) + (4.3074e-8 * plato * plato * plato);
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1072 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1073
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1074
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1075
655
f4e00869f39f Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents: 652
diff changeset
1076 function calc_svg(og, fg) {
f4e00869f39f Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents: 652
diff changeset
1077 var oe = sg_to_plato(og);
f4e00869f39f Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents: 652
diff changeset
1078 var ae = sg_to_plato(fg);
f4e00869f39f Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents: 652
diff changeset
1079 return (oe - ae) / oe * 100;
f4e00869f39f Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents: 652
diff changeset
1080 }
f4e00869f39f Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents: 652
diff changeset
1081
f4e00869f39f Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents: 652
diff changeset
1082
f4e00869f39f Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents: 652
diff changeset
1083
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1084 function brix_to_sg(brix) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1085 if (my_brix_correction > 0)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1086 return plato_to_sg(brix / my_brix_correction);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1087 else
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1088 return plato_to_sg(brix);
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1089 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1090
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1091
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1092
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1093 function sg_to_brix(sg) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1094 return sg_to_plato(sg) * my_brix_correction;
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1095 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1096
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1097
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1098
721
4d7394ced1c3 Better FG calculation from the refractometer reading. Now using the Petr Novotny formula.
Michiel Broek <mbroek@mbse.eu>
parents: 717
diff changeset
1099 function brix_to_fg(OPt, FBrix) {
4d7394ced1c3 Better FG calculation from the refractometer reading. Now using the Petr Novotny formula.
Michiel Broek <mbroek@mbse.eu>
parents: 717
diff changeset
1100 // OPt = Original Plato
4d7394ced1c3 Better FG calculation from the refractometer reading. Now using the Petr Novotny formula.
Michiel Broek <mbroek@mbse.eu>
parents: 717
diff changeset
1101 // FBrix = Refractometer reading.
4d7394ced1c3 Better FG calculation from the refractometer reading. Now using the Petr Novotny formula.
Michiel Broek <mbroek@mbse.eu>
parents: 717
diff changeset
1102 // Brouwhulp
4d7394ced1c3 Better FG calculation from the refractometer reading. Now using the Petr Novotny formula.
Michiel Broek <mbroek@mbse.eu>
parents: 717
diff changeset
1103 var FGbh = Round(1.0031 - 0.002318474 * OPt - 0.000007775 * (OPt * OPt) - 0.000000034 * Math.pow(OPt, 3) +
561
dc618b8a9552 Refracto calculation for FG is now a global function using the New Cubic method. Fixed to typos in the prod_edit en rec_edit yeastData varialbles.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1104 0.00574 * (FBrix) + 0.00003344 * (FBrix * FBrix) + 0.000000086 * Math.pow(FBrix, 3), 4);
dc618b8a9552 Refracto calculation for FG is now a global function using the New Cubic method. Fixed to typos in the prod_edit en rec_edit yeastData varialbles.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1105
721
4d7394ced1c3 Better FG calculation from the refractometer reading. Now using the Petr Novotny formula.
Michiel Broek <mbroek@mbse.eu>
parents: 717
diff changeset
1106 // from http://seanterrill.com FGnc = new cubic
561
dc618b8a9552 Refracto calculation for FG is now a global function using the New Cubic method. Fixed to typos in the prod_edit en rec_edit yeastData varialbles.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1107 var FBc = FBrix / my_brix_correction;
dc618b8a9552 Refracto calculation for FG is now a global function using the New Cubic method. Fixed to typos in the prod_edit en rec_edit yeastData varialbles.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1108
770
dc37f2b0a00b Killed the refractometer calculation by Sean Terrill as it is not good enough.
Michiel Broek <mbroek@mbse.eu>
parents: 761
diff changeset
1109 // New cubic by Sean Terrill. Not good enough.
dc37f2b0a00b Killed the refractometer calculation by Sean Terrill as it is not good enough.
Michiel Broek <mbroek@mbse.eu>
parents: 761
diff changeset
1110 //var FGnc=Round(1-0.0044993*(OPt)+0.0117741*(FBc)+0.000275806*(OPt*OPt)-0.00127169*(FBc*FBc)-0.00000727999*Math.pow(OPt,3)+0.0000632929*Math.pow(FBc,3),4);
561
dc618b8a9552 Refracto calculation for FG is now a global function using the New Cubic method. Fixed to typos in the prod_edit en rec_edit yeastData varialbles.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1111
713
8dae8479d5e8 Added Petr Novotny, Zymurgy July/August 2017 formule to the brix_to_fg() function
Michiel Broek <mbroek@mbse.eu>
parents: 697
diff changeset
1112 // Petr Novotny, Zymurgy July/August 2017. Used by Brewers Friend.
721
4d7394ced1c3 Better FG calculation from the refractometer reading. Now using the Petr Novotny formula.
Michiel Broek <mbroek@mbse.eu>
parents: 717
diff changeset
1113 var FGbf = Round(1 + 0.006276 * FBc - 0.002349 * OPt, 4);
713
8dae8479d5e8 Added Petr Novotny, Zymurgy July/August 2017 formule to the brix_to_fg() function
Michiel Broek <mbroek@mbse.eu>
parents: 697
diff changeset
1114
721
4d7394ced1c3 Better FG calculation from the refractometer reading. Now using the Petr Novotny formula.
Michiel Broek <mbroek@mbse.eu>
parents: 717
diff changeset
1115 // The real battle is now between Brouwhulp and Petr Novotny.
770
dc37f2b0a00b Killed the refractometer calculation by Sean Terrill as it is not good enough.
Michiel Broek <mbroek@mbse.eu>
parents: 761
diff changeset
1116 console.log('brix_to_fg(' + Round(OPt, 2) + ', ' + FBrix + ') FGbh:' + FGbh + ' FGbf:' + FGbf);
721
4d7394ced1c3 Better FG calculation from the refractometer reading. Now using the Petr Novotny formula.
Michiel Broek <mbroek@mbse.eu>
parents: 717
diff changeset
1117 return FGbf;
561
dc618b8a9552 Refracto calculation for FG is now a global function using the New Cubic method. Fixed to typos in the prod_edit en rec_edit yeastData varialbles.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1118 }
dc618b8a9552 Refracto calculation for FG is now a global function using the New Cubic method. Fixed to typos in the prod_edit en rec_edit yeastData varialbles.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1119
dc618b8a9552 Refracto calculation for FG is now a global function using the New Cubic method. Fixed to typos in the prod_edit en rec_edit yeastData varialbles.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1120
dc618b8a9552 Refracto calculation for FG is now a global function using the New Cubic method. Fixed to typos in the prod_edit en rec_edit yeastData varialbles.
Michiel Broek <mbroek@mbse.eu>
parents: 554
diff changeset
1121
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1122 function estimate_sg(sugars, batch_size) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1123
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1124 var plato, sg, i;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1125
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1126 plato = 100 * sugars / batch_size;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1127 sg = plato_to_sg(plato);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1128 for (i = 0; i < 20; i++) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1129 if (sg > 0)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1130 plato = 100 * sugars / (batch_size * sg);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1131 sg = plato_to_sg(plato);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1132 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1133 return Round(sg, 4);
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1134 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1135
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1136
282
f765249d57d7 ABV calculation uses Daniels method. sg_to_plato and plato_to_sg functions use brewersfriend calculation. Added sg_to_brix and brix_to_sg functions. Make brewdate tab read only when the primary fermentation is ready. Brix aid input functions for primary end sg and final sg fields. Added tooltips on the fermentation tab. Changes in the layout of the fermentation tab.
Michiel Broek <mbroek@mbse.eu>
parents: 278
diff changeset
1137
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1138 function estimate_fg(percSugar, percCara, WGratio, TotTme, Temp, attenuation, og) {
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1139
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1140 var BD, AttBeer, fg;
136
bcc4583fd013 Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
1141
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1142 if (percSugar > 40)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1143 percSugar = 0;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1144 if (percCara > 50)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1145 percCara = 0;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1146 if ((WGratio > 0) && (TotTme > 0)) {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1147 BD = WGratio;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1148 if (BD < 2)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1149 BD = 2;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1150 if (BD > 5.5)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1151 BD = 5.5;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1152 if (Temp < 60)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1153 Temp = 60;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1154 if (Temp > 72)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1155 Temp = 72;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1156 } else {
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1157 BD = 3.5;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1158 Temp = 67;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1159 TotTme = 75;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1160 }
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1161 if (attenuation < 30)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1162 attenuation = 77;
136
bcc4583fd013 Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
1163
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1164 // 0.00825 Attenuation factor yeast
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1165 // 0.00817 Attenuation factor water/grain ration
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1166 // -0.00684 Attenuation factor mash temperature
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1167 // 0.00026 Attenuation factor total mash time (at some places this is 0.0026 this is wrong!)
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1168 // -0.00356 Attenuation factor percentage crystal malt
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1169 // 0.00553 Attenuation factor percentage simple sugars
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1170 // 0.547 Attenuation factor constant
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1171 AttBeer = 0.00825 * attenuation + 0.00817 * BD - 0.00684 * Temp + 0.00026 * TotTme - 0.00356 * percCara + 0.00553 * percSugar + 0.547;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1172 fg = Round(1 + (1 - AttBeer) * (og - 1), 4);
241
e95d2886f49f Added soe extra debug logging in db_product.php. Automatic stage increment in the product editor. On the brewday tab added tooltips.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
1173
495
fdbb6bfae569 Disabled some console.log items.
Michiel Broek <mbroek@mbse.eu>
parents: 476
diff changeset
1174 //console.log('estimate_fg(' + percSugar + ',' + percCara + ',' + BD + ',' + TotTme + ',' +
fdbb6bfae569 Disabled some console.log items.
Michiel Broek <mbroek@mbse.eu>
parents: 476
diff changeset
1175 // Temp + ',' + attenuation + ',' + og + ') AttBeer:' + AttBeer + ' fg:' + fg);
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1176 return fg;
136
bcc4583fd013 Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
1177 }
bcc4583fd013 Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
1178
bcc4583fd013 Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
1179
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
1180
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: 148
diff changeset
1181 function CalcFrac(TpH, pK1, pK2, pK3) {
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: 148
diff changeset
1182
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1183 var r1d, r2d, r3d, dd, f2d, f3d, f4d;
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1184
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1185 r1d = Math.pow(10, TpH - pK1);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1186 r2d = Math.pow(10, TpH - pK2);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1187 r3d = Math.pow(10, TpH - pK3);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1188 dd = 1 / (1 + r1d + r1d * r2d + r1d * r2d * r3d);
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1189 f2d = r1d * dd;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1190 f3d = r1d * r2d * dd;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1191 f4d = r1d * r2d * r3d * dd;
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1192 return f2d + 2 * f3d + 3 * f4d;
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: 148
diff changeset
1193 }
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: 148
diff changeset
1194
376
1de1623e1760 Inventory fermentables convert diastatic power between kolbach and lintner. In recipe and product editors calculate the recipe lintner value. For now a raw presentation of the outcome.
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
1195
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1196
376
1de1623e1760 Inventory fermentables convert diastatic power between kolbach and lintner. In recipe and product editors calculate the recipe lintner value. For now a raw presentation of the outcome.
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
1197 function lintner_to_kolbach(lintner) {
724
66e0b4ef9268 Lintner to Kolbach gives only positive results. Round Kolbach to Lintner to 3 decimals.
Michiel Broek <mbroek@mbse.eu>
parents: 721
diff changeset
1198 var wk = (3.5 * lintner) - 16;
66e0b4ef9268 Lintner to Kolbach gives only positive results. Round Kolbach to Lintner to 3 decimals.
Michiel Broek <mbroek@mbse.eu>
parents: 721
diff changeset
1199 if (wk < 0)
66e0b4ef9268 Lintner to Kolbach gives only positive results. Round Kolbach to Lintner to 3 decimals.
Michiel Broek <mbroek@mbse.eu>
parents: 721
diff changeset
1200 return 0;
475
c34d71572023 code cleanup checked bu gjslint
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
1201 return (3.5 * lintner) - 16;
376
1de1623e1760 Inventory fermentables convert diastatic power between kolbach and lintner. In recipe and product editors calculate the recipe lintner value. For now a raw presentation of the outcome.
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
1202 }
1de1623e1760 Inventory fermentables convert diastatic power between kolbach and lintner. In recipe and product editors calculate the recipe lintner value. For now a raw presentation of the outcome.
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
1203
1de1623e1760 Inventory fermentables convert diastatic power between kolbach and lintner. In recipe and product editors calculate the recipe lintner value. For now a raw presentation of the outcome.
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
1204
1de1623e1760 Inventory fermentables convert diastatic power between kolbach and lintner. In recipe and product editors calculate the recipe lintner value. For now a raw presentation of the outcome.
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
1205 function kolbach_to_lintner(kolbach) {
724
66e0b4ef9268 Lintner to Kolbach gives only positive results. Round Kolbach to Lintner to 3 decimals.
Michiel Broek <mbroek@mbse.eu>
parents: 721
diff changeset
1206 return Round((kolbach + 16) / 3.5, 3);
376
1de1623e1760 Inventory fermentables convert diastatic power between kolbach and lintner. In recipe and product editors calculate the recipe lintner value. For now a raw presentation of the outcome.
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
1207 }
1de1623e1760 Inventory fermentables convert diastatic power between kolbach and lintner. In recipe and product editors calculate the recipe lintner value. For now a raw presentation of the outcome.
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
1208
1de1623e1760 Inventory fermentables convert diastatic power between kolbach and lintner. In recipe and product editors calculate the recipe lintner value. For now a raw presentation of the outcome.
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
1209
646
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1210 function kettle_cm(vol, kettle_vol, kettle_height) {
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1211 if ((vol > 0) && (kettle_vol > 0) && (vol <= kettle_vol))
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1212 return Round(100 * ((1 - vol / kettle_vol) * kettle_height), 1);
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1213 return 0;
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1214 }
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1215
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1216
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1217 function kettle_vol(cm, kettle_vol, kettle_height) {
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1218 if ((cm >= 0) && (kettle_vol > 0) && (cm <= (kettle_height * 100)))
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1219 return Round(((kettle_height - (cm / 100)) / kettle_height) * kettle_vol, 1);
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1220 return 0;
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1221 }
2246d830a42a Fixed some html errors. Added volume calculations for the brewday tab using a popup tool.
Michiel Broek <mbroek@mbse.eu>
parents: 625
diff changeset
1222
810
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1223
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1224 function Hardness(calcium, magnesium) {
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1225 return 2.497 * calcium + 4.164 * magnesium;
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1226 }
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1227
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1228
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1229 function Bicarbonate(total_alkalinity, ph) {
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1230 return (total_alkalinity / (1 + 2*Math.pow(10, ph - 10.33)) * MMHCO3 /*61.016*/ / (MMCaCO3 / 2) /*50.043*/);
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1231 }
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1232
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1233
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1234 function RA_CaCO3(bicarbonate, carbonate, calcium, magnesium) {
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1235 return ((bicarbonate / MMHCO3) + (2*carbonate / MMCO3) - (2*calcium / MMCa)/3.5 - (2*magnesium / MMMg)/7) * 50;
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1236 }
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1237
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1238
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1239 function ResidualAlkalinity(total_alkalinity, calcium, magnesium) {
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1240 return total_alkalinity - (calcium / 1.4 + magnesium / 1.7);
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1241 }
1f2ca835fe9d The last part to make a vieuwer from the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 806
diff changeset
1242

mercurial