www/js/global.js

Fri, 06 Sep 2019 13:14:52 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 06 Sep 2019 13:14:52 +0200
changeset 465
dc3e14b976be
parent 463
0efdafd23753
child 475
c34d71572023
permissions
-rw-r--r--

Global javascript code cleanup and optimisation

13
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
2 * Copyright (C) 2014-2019
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 *
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of BrewCloud
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 = [
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
27 { id: 0, en: "Plan", nl: "Plan" },
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
28 { id: 1, en: "Wait", nl: "Wacht" },
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
29 { id: 2, en: "Brew", nl: "Brouwen" },
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
30 { id: 3, en: "Primary", nl: "Hoofdgisting" },
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
31 { id: 4, en: "Secondary", nl: "Nagisting" },
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
32 { id: 5, en: "Tertiary", nl: "Lagering" },
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
33 { id: 6, en: "Package", nl: "Afvullen" },
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
34 { id: 7, en: "Carbonation", nl: "Hergisten" },
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
35 { id: 8, en: "Mature", nl: "Rijpen" },
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
36 { id: 9, en: "Taste", nl: "Proeven" },
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
37 { id: 10, en: "Ready", nl: "Gereed" },
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
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 = {
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
41 localdata: StageData,
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
42 datatype: "array",
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
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
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
47 MaterialData = [
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
48 { id: 0, en: "Stainless Steel", nl: "RVS", sh: 0.11 },
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
49 { id: 1, en: "Aluminium", nl: "Aluminium", sh: 0.22 },
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
50 { id: 2, en: "Plastics", nl: "Kunststof", sh: 0.46 },
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
51 { 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
52 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
53 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
54 localdata: MaterialData,
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
55 datatype: "array",
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
56 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
57 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
58 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
59
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
60 FermentableTypeData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
61 { id: 0, en: 'Grain', nl: 'Mout' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
62 { id: 1, en: 'Sugar', nl: 'Suiker' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
63 { id: 2, en: 'Extract', nl: 'Vloeibaar extract' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
64 { id: 3, en: 'Dry extract', nl: 'Droog extract' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
65 { id: 4, en: 'Adjunct', nl: 'Ongemout graan' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
66 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
67 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
68 localdata: FermentableTypeData,
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
69 datatype: "array",
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
70 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
71 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
72 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
73
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
74 GrainTypeData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
75 { id: 0, en: 'Base', nl: 'Basismout' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
76 { id: 1, en: 'Roast', nl: 'Geroosterde mout' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
77 { id: 2, en: 'Crystal', nl: 'Cara- of crystalmout' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
78 { id: 3, en: 'Kilned', nl: 'Geëeste mout'},
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
79 { id: 4, en: 'Sour malt', nl: 'Zuurmout' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
80 { id: 5, en: 'Special', nl: 'Speciale mout' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
81 { 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
82 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
83 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
84 localdata: GrainTypeData,
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
85 datatype: "array",
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
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 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
89
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
90 AddedData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
91 { id: 0, en: 'Mash', nl: 'Maischen' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
92 { id: 1, en: 'Boil', nl: 'Koken' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
93 { id: 2, en: 'Fermentation', nl: 'Vergisten' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
94 { id: 3, en: 'Lagering', nl: 'Nagisten/lageren' },
406
0ad967f2d6ee Added fermentable added value 5 for kegs. Ignore bottle and kegs sugars when calculating fermentables. Better rounding of results when manipulating fermentables in the recipe.
Michiel Broek <mbroek@mbse.eu>
parents: 376
diff changeset
95 { id: 4, en: 'Bottle', nl: 'Bottelen' },
0ad967f2d6ee Added fermentable added value 5 for kegs. Ignore bottle and kegs sugars when calculating fermentables. Better rounding of results when manipulating fermentables in the recipe.
Michiel Broek <mbroek@mbse.eu>
parents: 376
diff changeset
96 { id: 5, en: 'Kegs', nl: 'Fust' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
97 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
98 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
99 localdata: AddedData,
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
100 datatype: "array",
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
101 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
102 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
103 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
104
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
105 HopTypeData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
106 { id: 0, en: 'Bittering', nl: 'Bitterhop' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
107 { id: 1, en: 'Aroma', nl: 'Aromahop' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
108 { id: 2, en: 'Both', nl: 'Beide' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
109 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
110 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
111 localdata: HopTypeData,
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
112 datatype: "array",
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
113 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
114 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
115 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
116
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
117 HopFormData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
118 { id: 0, en: 'Pellet', nl: 'Pellets' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
119 { id: 1, en: 'Plug', nl: 'Plugs' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
120 { id: 2, en: 'Leaf', nl: 'Bloemen' },
446
ee7bcfb8e270 Added Cryo Hops type.
Michiel Broek <mbroek@mbse.eu>
parents: 439
diff changeset
121 { id: 3, en: 'Leaf wet', nl: 'Hop nat' },
ee7bcfb8e270 Added Cryo Hops type.
Michiel Broek <mbroek@mbse.eu>
parents: 439
diff changeset
122 { id: 4, en: 'Cryo', nl: 'Cryo' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
123 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
124 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
125 localdata: HopFormData,
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
126 datatype: "array",
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
127 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
128 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
129 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
130
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
131 HopUseData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
132 { id: 0, en: 'Mash', nl: 'Maischhop' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
133 { id: 1, en: 'First wort', nl: 'First wort hop' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
134 { id: 2, en: 'Boil', nl: 'Koken' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
135 { id: 3, en: 'Aroma', nl: 'Vlamuit' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
136 { id: 4, en: 'Whirlpool', nl: 'Whirlpool' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
137 { id: 5, en: 'Dry hop', nl: 'Koudhop' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
138 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
139 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
140 localdata: HopUseData,
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
141 datatype: "array",
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
142 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
143 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
144 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
145
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
146 YeastTypeData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
147 { id: 0, en: 'Lager', nl: 'Ondergist' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
148 { id: 1, en: 'Ale', nl: 'Bovengist' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
149 { id: 2, en: 'Wheat', nl: 'Tarwegist' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
150 { id: 3, en: 'Wine', nl: 'Wijngist' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
151 { id: 4, en: 'Champagne', nl: 'Champagnegist' }
429
0d2cf505957c Prepared for new yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 428
diff changeset
152 // { id: 5, en: 'Brett', nl: 'Brett' },
0d2cf505957c Prepared for new yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 428
diff changeset
153 // { id: 6, en: 'Kveik', nl: 'Kveik' },
0d2cf505957c Prepared for new yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 428
diff changeset
154 // { id: 7, en: 'Mixed', nl: 'Mixed' },
0d2cf505957c Prepared for new yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 428
diff changeset
155 // { id: 8, en: 'Spontaneous', nl: 'Spontaan' },
0d2cf505957c Prepared for new yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 428
diff changeset
156 // { id: 9, en: 'Other', nl: 'Overig' }
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 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
159 localdata: YeastTypeData,
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
160 datatype: "array",
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
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 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
164
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
165 YeastFormData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
166 { id: 0, en: 'Liquid', nl: 'Vloeibaar', cells: 100000000000 },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
167 { id: 1, en: 'Dry', nl: 'Korrel', cells: 15000000000 },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
168 { id: 2, en: 'Slant', nl: 'Schuine buis', cells: 1700000000 },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
169 { id: 3, en: 'Culture', nl: 'Slurry', cells: 1700000000 },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
170 { id: 4, en: 'Frozen', nl: 'Ingevroren', cells: 1700000000 },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
171 { id: 5, en: 'Bottle', nl: 'Depot', cells: 1700000000 }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
172 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
173 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
174 localdata: YeastFormData,
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
175 datatype: "array",
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
176 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
177 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
178 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
179
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
180 YeastUseData = [
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
181 { id: 0, en: 'Primary', nl: 'Hoofdgisting' },
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
182 { id: 1, en: 'Secondary', nl: 'Nagisting' },
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
183 { id: 2, en: 'Tertiary', nl: 'Lagering' },
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
184 { id: 3, en: 'Bottle', nl: 'Bottelen' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
185 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
186 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
187 localdata: YeastUseData,
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
188 datatype: "array",
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
189 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
190 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
191 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
192
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
193 FlocculationData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
194 { id: 0, en: 'Low', nl: 'Laag' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
195 { id: 1, en: 'Medium', nl: 'Medium' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
196 { id: 2, en: 'High', nl: 'Hoog' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
197 { 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
198 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
199 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
200 localdata: FlocculationData,
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
201 datatype: "array",
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
202 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
203 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
204 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
205
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
206 StarterTypeData = [
278
dc22dd5d77fd Initial design of a yeast starter calculator based on the Braukaiser model. Changed the yeast inventory prompts to the correct Dutch amounts. The pitchrate calculator makes a difference between light and heavy beers, turning point is a SG 1.060. Some code is from Homebrew Dad's calculator.
Michiel Broek <mbroek@mbse.eu>
parents: 258
diff changeset
207 { id: 0, en: 'Stirred', nl: 'Geroerd' },
dc22dd5d77fd Initial design of a yeast starter calculator based on the Braukaiser model. Changed the yeast inventory prompts to the correct Dutch amounts. The pitchrate calculator makes a difference between light and heavy beers, turning point is a SG 1.060. Some code is from Homebrew Dad's calculator.
Michiel Broek <mbroek@mbse.eu>
parents: 258
diff changeset
208 { id: 1, en: 'Shaken', nl: 'Geschud' },
dc22dd5d77fd Initial design of a yeast starter calculator based on the Braukaiser model. Changed the yeast inventory prompts to the correct Dutch amounts. The pitchrate calculator makes a difference between light and heavy beers, turning point is a SG 1.060. Some code is from Homebrew Dad's calculator.
Michiel Broek <mbroek@mbse.eu>
parents: 258
diff changeset
209 { id: 2, en: 'Simple', nl: 'Simpel' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
210 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
211 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
212 localdata: StarterTypeData,
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
213 datatype: "array",
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
214 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
215 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
216 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
217
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
218 MiscTypeData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
219 { id: 0, en: 'Spice', nl: 'Specerij' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
220 { id: 1, en: 'Herb', nl: 'Kruid' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
221 { id: 2, en: 'Flavor', nl: 'Smaakstof' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
222 { id: 3, en: 'Fining', nl: 'Klaringsmiddel' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
223 { id: 4, en: 'Water agent', nl: 'Brouwzout' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
224 { id: 5, en: 'Yeast nutrient', nl: 'Gistvoeding' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
225 { id: 6, en: 'Other', nl: 'Overig' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
226 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
227 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
228 localdata: MiscTypeData,
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
229 datatype: "array",
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
230 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
231 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
232 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
233
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
234 MiscUseData = [
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
235 { id: 0, en: 'Starter', nl: 'Starter' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
236 { id: 1, en: 'Mash', nl: 'Maischen' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
237 { id: 2, en: 'Boil', nl: 'Koken' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
238 { id: 3, en: 'Primary', nl: 'Hoofdvergisting' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
239 { id: 4, en: 'Secondary', nl: 'Nagisting/lagering' },
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
240 { id: 5, en: 'Bottling', nl: 'Bottelen' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
241 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
242 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
243 localdata: MiscUseData,
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
244 datatype: "array",
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
245 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
246 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
247 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
248
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
249 StyleTypeData = [
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
250 { id: 0, en: 'Lager', nl: 'Ondergistend bier' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
251 { id: 1, en: 'Ale', nl: 'Bovengistend bier' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
252 { id: 2, en: 'Mead', nl: 'Mede' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
253 { id: 3, en: 'Wheat', nl: 'Tarwebier' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
254 { id: 4, en: 'Mixed', nl: 'Gemengd' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
255 { id: 5, en: 'Cider', nl: 'Cider' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
256 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
257 StyleTypeSource = {
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
258 localdata: StyleTypeData,
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
259 datatype: "array",
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
260 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
261 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
262 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
263
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
264 MashStepTypeData = [
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
265 { id: 0, en: 'Infusion', nl: 'Infusie' },
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
266 { id: 1, en: 'Temperature', nl: 'Verwarming' },
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
267 { id: 2, en: 'Decoction', nl: 'Decoctie' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
268 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
269 MashStepTypeSource = {
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
270 localdata: MashStepTypeData,
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
271 datatype: "array",
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
272 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
273 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
274 MashStepTypeAdapter = new $.jqx.dataAdapter(MashStepTypeSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
275
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
276 RecipeTypeData = [
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
277 { id: 0, en: 'Extract', nl: 'Extract' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
278 { id: 1, en: 'Partial Mash', nl: 'Deelmaisch' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
279 { id: 2, en: 'All Grain', nl: 'Mout' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
280 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
281 RecipeTypeSource = {
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
282 localdata: RecipeTypeData,
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
283 datatype: "array",
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
284 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
285 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
286 RecipeTypeAdapter = new $.jqx.dataAdapter(RecipeTypeSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
287
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
288 IBUmethodData = [
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
289 { id: 0, en: 'Tinseth', nl: 'Tinseth' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
290 { id: 1, en: 'Rager', nl: 'Rager' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
291 { id: 2, en: 'Daniels', nl: 'Daniels' }
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
292 // { id: 3, en: 'Garetz', nl: 'Garetz' }, // Not yet supported.
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
293 // { id: 4, en: 'Mosher', nl: 'Mosher' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
294 // { id: 5, en: 'Noonan', nl: 'Noonan' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
295 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
296 IBUmethodSource = {
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
297 localdata: IBUmethodData,
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
298 datatype: "array",
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
299 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
300 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
301 IBUmethodAdapter = new $.jqx.dataAdapter(IBUmethodSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
302
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
303 ColorMethodData = [
372
1365b5e47130 Added color method written by Hans Halberstadt.
Michiel Broek <mbroek@mbse.eu>
parents: 371
diff changeset
304 { id: 0, en: 'Morey', nl: 'Morey' },
1365b5e47130 Added color method written by Hans Halberstadt.
Michiel Broek <mbroek@mbse.eu>
parents: 371
diff changeset
305 { id: 1, en: 'Mosher', nl: 'Mosher' },
1365b5e47130 Added color method written by Hans Halberstadt.
Michiel Broek <mbroek@mbse.eu>
parents: 371
diff changeset
306 { id: 2, en: 'Daniels', nl: 'Daniels' },
373
ee16d9b844d8 Added some info yo the about screen. Added calculating beer color using the method documented by Dirk Naudt. This looks like originated from a European Brewing Convention in 1948.
Michiel Broek <mbroek@mbse.eu>
parents: 372
diff changeset
307 { id: 3, en: 'Halberstadt', nl: 'Halberstadt' },
ee16d9b844d8 Added some info yo the about screen. Added calculating beer color using the method documented by Dirk Naudt. This looks like originated from a European Brewing Convention in 1948.
Michiel Broek <mbroek@mbse.eu>
parents: 372
diff changeset
308 { id: 4, en: 'Naudts', nl: 'Naudts' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
309 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
310 ColorMethodSource = {
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
311 localdata: ColorMethodData,
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
312 datatype: "array",
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
313 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
314 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
315 ColorMethodAdapter = new $.jqx.dataAdapter(ColorMethodSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
316
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
317 CoolingTypeData = [
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
318 { id: 0, en: '-', nl: '-' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
319 { id: 1, en: 'Emersion chiller', nl: 'Dompelkoeler' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
320 { id: 2, en: 'Counterflow chiller', nl: 'Tegenstroomkoeler' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
321 { id: 3, en: 'Au bain marie', nl: 'Au bain marie' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
322 { id: 4, en: 'Natural', nl: 'Laten afkoelen' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
323 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
324 CoolingTypeSource = {
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
325 localdata: CoolingTypeData,
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
326 datatype: "array",
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
327 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
328 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
329 CoolingTypeAdapter = new $.jqx.dataAdapter(CoolingTypeSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
330
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
331 AerationTypeData = [
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
332 { id: 0, en: 'None', nl: 'Geen' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
333 { id: 1, en: 'Air', nl: 'Lucht' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
334 { id: 2, en: 'Oxygen', nl: 'Zuurstof' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
335 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
336 AerationTypeSource = {
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
337 localdata: AerationTypeData,
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
338 datatype: "array",
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
339 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
340 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
341 AerationTypeAdapter = new $.jqx.dataAdapter(AerationTypeSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
342
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
343 AcidTypeData = [
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
344 { id: 0, en: 'Lactic', nl: 'Melkzuur' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
345 { id: 1, en: 'Hydrochloric', nl: 'Zoutzuur' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
346 { id: 2, en: 'Phosphoric', nl: 'Fosforzuur' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
347 { id: 3, en: 'Sulfuric', nl: 'Zwavelzuur' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
348 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
349 AcidTypeSource = {
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
350 localdata: AcidTypeData,
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
351 datatype: "array",
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
352 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
353 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
354 AcidTypeAdapter = new $.jqx.dataAdapter(AcidTypeSource),
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
355
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
356 BaseTypeData = [
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
357 { id: 0, en: 'Sodiumbicarbonate', nl: 'NaHCO3' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
358 { id: 1, en: 'Sodiumcarbonate', nl: 'Na2CO3' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
359 { id: 2, en: 'Calciumcarbonate', nl: 'CaCO3' },
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
360 { id: 3, en: 'Calciumhydroxide', nl: 'Ca(OH)2' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
361 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
362 BaseTypeSource = {
207
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
363 localdata: BaseTypeData,
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
364 datatype: "array",
f87ff15be531 Finished data arrays for dropdown menus.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
365 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
366 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
367 BaseTypeAdapter = new $.jqx.dataAdapter(BaseTypeSource),
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
368
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
369 SpargeSourceData = [
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
370 { id: 0, en: 'Source 1', nl: 'Bron 1' },
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
371 { id: 1, en: 'Source 2', nl: 'Bron 2' },
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
372 { id: 2, en: 'Mixed', nl: 'Gemengd' }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
373 ],
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
374 SpargeSourceSource = {
230
8edca0488e65 Finished the water treatment in the recipes editor. It seems that the recipes editor is ready.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
375 localdata: SpargeSourceData,
8edca0488e65 Finished the water treatment in the recipes editor. It seems that the recipes editor is ready.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
376 datatype: "array",
8edca0488e65 Finished the water treatment in the recipes editor. It seems that the recipes editor is ready.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
377 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }]
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
378 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
379 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
380
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
381
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
382 // 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
383
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
384 Show1wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
385 Show2wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 2, readOnly: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
386 Show3wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 3, readOnly: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
387 Smal0dec = { inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
388 Smal1dec = { inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
389 Show0dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 0 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
390 Show1dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 1 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
391 Show2dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 2 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
392 Show3dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 3 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
393 SGopts = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0.990, max: 1.199, decimalDigits: 3, spinButtons: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
394 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
395 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
396 Spin3dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 3, spinButtons: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
397 SpinpH = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1, max: 14, decimalDigits: 1, spinButtons: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
398 Spin2pH = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1, max: 14, decimalDigits: 2, spinButtons: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
399 YeastT = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 40, decimalDigits: 1, spinButtons: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
400 PosInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 0, spinButtons: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
401 Perc1dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 1, spinButtons: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
402 Perc0 = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 0, spinButtons: true },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
403 Dateopts = {
209
dc30801e6961 Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents: 207
diff changeset
404 theme: theme, width: 150, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true,
dc30801e6961 Import set tun_material from the specifix heat value. Equipment database uses POST instead of GET. Equipment editor screen in style with other inventory screens. In stock print now uses the type indexes to translate to text. Also show the correct unit and values of the yeast.
Michiel Broek <mbroek@mbse.eu>
parents: 207
diff changeset
405 formatString: 'yyyy-MM-dd', enableBrowserBoundsDetection: true
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
406 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
407 DateTimeopts = {
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
408 theme: theme, width: 230, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true,
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
409 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
410 },
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
411
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
412
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
413 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
414
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
415 // Styles dropdown list
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
416 stylesUrl = "includes/db_profile_styles.php",
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
417 stylesSource = {
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
418 datatype: "json",
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
419 datafields: [
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
420 { name: 'record', type: 'number' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
421 { name: 'name', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
422 { name: 'category', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
423 { name: 'category_number', type: 'number' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
424 { name: 'style_letter', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
425 { name: 'style_guide', type: 'string' },
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
426 { name: 'type', type: 'int' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
427 { name: 'og_min', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
428 { name: 'og_max', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
429 { name: 'fg_min', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
430 { name: 'fg_max', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
431 { name: 'ibu_min', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
432 { name: 'ibu_max', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
433 { name: 'color_min', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
434 { name: 'color_max', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
435 { name: 'carb_min', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
436 { name: 'carb_max', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
437 { name: 'abv_min', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
438 { name: 'abv_max', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
439 { name: 'notes', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
440 { name: 'profile', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
441 { name: 'ingredients', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
442 { name: 'examples', type: 'string' }
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
443 ],
221
a8aabb63fbcc Added two missing fields in getfermentablesources.php. When getting a single recipe from the database, update the fermentables json data with available inventory and ingredient. Added inventory column in the fermentable grid. Added ingredient selection in the fermentable popup window to replace ingredient.
Michiel Broek <mbroek@mbse.eu>
parents: 220
diff changeset
444 url: stylesUrl
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
445 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
446 styleslist = new $.jqx.dataAdapter(stylesSource),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
447
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
448 // Equipemnt dropdown list
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
449 equipmentUrl = "includes/db_inventory_equipments.php",
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
450 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
451 datatype: "json",
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
452 datafields: [
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
453 { name: 'name', type: 'string' },
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
454 { name: 'boil_size', type: 'float' },
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
455 { name: 'batch_size', type: 'float' },
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
456 { name: 'tun_volume', type: 'float' },
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
457 { name: 'tun_weight', type: 'float' },
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
458 { name: 'tun_specific_heat', type: 'float' },
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
459 { name: 'tun_material', type: 'int' },
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
460 { name: 'tun_height', type: 'float' },
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
461 { name: 'top_up_water', type: 'float' },
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
462 { name: 'trub_chiller_loss', type: 'float' },
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
463 { name: 'evap_rate', type: 'float' },
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
464 { name: 'boil_time', type: 'float' },
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
465 { name: 'calc_boil_volume', type: 'int' },
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
466 { name: 'top_up_kettle', type: 'float' },
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
467 { name: 'hop_utilization', type: 'float' },
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
468 { name: 'notes', type: 'string' },
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
469 { name: 'lauter_volume', type: 'float' },
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
470 { name: 'lauter_height', type: 'float' },
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
471 { name: 'lauter_deadspace', type: 'float' },
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
472 { name: 'kettle_volume', type: 'float' },
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
473 { name: 'kettle_height', type: 'float' },
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
474 { name: 'mash_volume', type: 'float' },
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
475 { name: 'mash_max', type: 'float' },
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
476 { name: 'efficiency', type: 'float' }
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
477 ],
221
a8aabb63fbcc Added two missing fields in getfermentablesources.php. When getting a single recipe from the database, update the fermentables json data with available inventory and ingredient. Added inventory column in the fermentable grid. Added ingredient selection in the fermentable popup window to replace ingredient.
Michiel Broek <mbroek@mbse.eu>
parents: 220
diff changeset
478 url: equipmentUrl
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
479 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
480 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
481
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
482 // dropdownlist datasource from inventory_fermentables
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
483 fermentableInvSource = {
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
484 datatype: "json",
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
485 datafields: [
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
486 { name: 'record', type: 'number' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
487 { name: 'name', type: 'string' },
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
488 { name: 'type', type: 'int' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
489 { name: 'yield', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
490 { name: 'color', type: 'float' },
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
491 { name: 'add_after_boil', type: 'int' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
492 { name: 'origin', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
493 { name: 'supplier', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
494 { name: 'coarse_fine_diff', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
495 { name: 'moisture', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
496 { name: 'diastatic_power', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
497 { name: 'protein', type: 'float' },
221
a8aabb63fbcc Added two missing fields in getfermentablesources.php. When getting a single recipe from the database, update the fermentables json data with available inventory and ingredient. Added inventory column in the fermentable grid. Added ingredient selection in the fermentable popup window to replace ingredient.
Michiel Broek <mbroek@mbse.eu>
parents: 220
diff changeset
498 { name: 'dissolved_protein', type: 'float' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
499 { name: 'max_in_batch', type: 'float' },
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
500 { name: 'recommend_mash', type: 'int' },
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
501 { name: 'graintype', type: 'int' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
502 { name: 'di_ph', type: 'float' },
221
a8aabb63fbcc Added two missing fields in getfermentablesources.php. When getting a single recipe from the database, update the fermentables json data with available inventory and ingredient. Added inventory column in the fermentable grid. Added ingredient selection in the fermentable popup window to replace ingredient.
Michiel Broek <mbroek@mbse.eu>
parents: 220
diff changeset
503 { name: 'acid_to_ph_57', type: 'float' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
504 { name: 'inventory', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
505 { name: 'cost', type: 'float' }
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
506 ],
221
a8aabb63fbcc Added two missing fields in getfermentablesources.php. When getting a single recipe from the database, update the fermentables json data with available inventory and ingredient. Added inventory column in the fermentable grid. Added ingredient selection in the fermentable popup window to replace ingredient.
Michiel Broek <mbroek@mbse.eu>
parents: 220
diff changeset
507 url: "getfermentablesources.php"
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
508 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
509 fermentableinstock = false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
510 fermentablelist = new $.jqx.dataAdapter(fermentableInvSource, {
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
511 beforeLoadComplete: function (records) {
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
512 var row, i, data = new Array();
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
513 for (i = 0; i < records.length; i++) {
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
514 row = records[i];
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
515 if (row.inventory || ! fermentableinstock)
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
516 data.push(row);
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
517 }
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
518 return data;
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
519 },
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
520 loadError: function(jqXHR, status, error) {
407
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
521 console.log(status + ' ' + error);
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
522 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
523 }),
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
524 fermentablesugars = new $.jqx.dataAdapter(fermentableInvSource, {
407
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
525 beforeLoadComplete: function (records) {
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
526 var row, i, data = new Array();
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
527 for (i = 0; i < records.length; i++) {
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
528 row = records[i];
407
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
529 if (row.type == 1 || row.type == 3) // Sugars or dry extract
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
530 data.push(row);
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
531 }
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
532 return data;
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
533 },
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
534 loadError: function(jqXHR, status, error) {
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
535 console.log(status + ' ' + error);
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
536 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
537 }),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
538
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
539 // dropdownlist datasource from inventory_hops
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
540 hopInvSource = {
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
541 datatype: "json",
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
542 datafields: [
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
543 { name: 'record', type: 'number' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
544 { name: 'name', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
545 { name: 'origin', type: 'string' },
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
546 { name: 'type', type: 'int' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
547 { name: 'alpha', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
548 { name: 'beta', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
549 { name: 'humulene', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
550 { name: 'caryophyllene', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
551 { name: 'cohumulone', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
552 { name: 'myrcene', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
553 { name: 'hsi', type: 'float' },
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
554 { name: 'useat', type: 'int' },
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
555 { name: 'form', type: 'int' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
556 { name: 'total_oil', type: 'float' },
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
557 { name: 'inventory', type: 'float' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
558 { name: 'cost', type: 'float' }
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
559 ],
221
a8aabb63fbcc Added two missing fields in getfermentablesources.php. When getting a single recipe from the database, update the fermentables json data with available inventory and ingredient. Added inventory column in the fermentable grid. Added ingredient selection in the fermentable popup window to replace ingredient.
Michiel Broek <mbroek@mbse.eu>
parents: 220
diff changeset
560 url: "gethopsources.php"
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 hopinstock = false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
563 hoplist = new $.jqx.dataAdapter(hopInvSource, {
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
564 beforeLoadComplete: function (records) {
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
565 var row, i, data = new Array();
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
566 for (i = 0; i < records.length; i++) {
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
567 row = records[i];
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
568 if (row.inventory || ! hopinstock)
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
569 data.push(row);
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
570 }
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
571 return data;
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
572 },
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
573 loadError: function(jqXHR, status, error) {
407
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
574 console.log(status + ' ' + error);
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
575 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
576 }),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
577
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
578 // dropdownlist datasource from inventory_miscs
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
579 miscInvSource = {
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
580 datatype: "json",
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
581 datafields: [
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
582 { name: 'record', type: 'number' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
583 { name: 'name', type: 'string' },
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
584 { name: 'type', type: 'int' },
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
585 { name: 'use_use', type: 'int' },
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
586 { name: 'amount_is_weight', type: 'int' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
587 { name: 'time', type: 'float' },
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
588 { name: 'inventory', type: 'float' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
589 { name: 'cost', type: 'float' }
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
590 ],
221
a8aabb63fbcc Added two missing fields in getfermentablesources.php. When getting a single recipe from the database, update the fermentables json data with available inventory and ingredient. Added inventory column in the fermentable grid. Added ingredient selection in the fermentable popup window to replace ingredient.
Michiel Broek <mbroek@mbse.eu>
parents: 220
diff changeset
591 url: "getmiscsources.php"
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
592 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
593 miscinstock = false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
594 misclist = new $.jqx.dataAdapter(miscInvSource, {
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
595 beforeLoadComplete: function (records) {
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
596 var row, i, data = new Array();
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
597 for (i = 0; i < records.length; i++) {
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
598 row = records[i];
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
599 if (row.inventory || ! miscinstock)
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
600 data.push(row);
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
601 }
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
602 return data;
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
603 },
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
604 loadError: function(jqXHR, status, error) {
407
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
605 console.log(status + ' ' + error);
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
606 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
607 }),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
608
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
609 // dropdownlist datasource from inventory_yeasts
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
610 yeastInvSource = {
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
611 datatype: "json",
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
612 datafields: [
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
613 { name: 'record', type: 'number' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
614 { name: 'name', type: 'string' },
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
615 { name: 'type', type: 'int' },
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
616 { name: 'form', type: 'int' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
617 { name: 'laboratory', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
618 { name: 'product_id', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
619 { name: 'min_temperature', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
620 { name: 'max_temperature', type: 'float' },
232
daf2d9d6fa18 When adding yeast the flocculation and cells fields were not added. Possible fix for double water agents in the miscs grid. Better efforts to set the initial water infuse amount. The new recipe wizzard now uses indexed fields. In recipe print fixed the yeast amount and cost.
Michiel Broek <mbroek@mbse.eu>
parents: 230
diff changeset
621 { name: 'flocculation', type: 'int' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
622 { name: 'attenuation', type: 'float' },
232
daf2d9d6fa18 When adding yeast the flocculation and cells fields were not added. Possible fix for double water agents in the miscs grid. Better efforts to set the initial water infuse amount. The new recipe wizzard now uses indexed fields. In recipe print fixed the yeast amount and cost.
Michiel Broek <mbroek@mbse.eu>
parents: 230
diff changeset
623 { name: 'cells', type: 'float' },
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
624 { name: 'inventory', type: 'float' },
337
faedcfa0610f Added command to turn lights on in monitor fermenter when a camera is started. Added the missing tolerance field when selecting a new yeast in a product or recipe.
Michiel Broek <mbroek@mbse.eu>
parents: 329
diff changeset
625 { name: 'cost', type: 'float' },
faedcfa0610f Added command to turn lights on in monitor fermenter when a camera is started. Added the missing tolerance field when selecting a new yeast in a product or recipe.
Michiel Broek <mbroek@mbse.eu>
parents: 329
diff changeset
626 { name: 'tolerance', type: 'float' }
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
627 ],
221
a8aabb63fbcc Added two missing fields in getfermentablesources.php. When getting a single recipe from the database, update the fermentables json data with available inventory and ingredient. Added inventory column in the fermentable grid. Added ingredient selection in the fermentable popup window to replace ingredient.
Michiel Broek <mbroek@mbse.eu>
parents: 220
diff changeset
628 url: "getyeastsources.php"
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
629 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
630 yeastinstock = false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
631 yeastlist = new $.jqx.dataAdapter(yeastInvSource, {
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
632 beforeLoadComplete: function (records) {
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
633 var row, i, data = new Array();
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
634 for (i = 0; i < records.length; i++) {
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
635 row = records[i];
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
636 if (row.inventory || ! yeastinstock)
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
637 data.push(row);
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
638 }
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
639 return data;
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
640 },
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
641 loadError: function(jqXHR, status, error) {
407
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
642 console.log(status + ' ' + error);
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
643 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
644 }),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
645
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
646 // dropdownlist datasource from inventory_waters
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
647 waterInvSource = {
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
648 datatype: "json",
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
649 datafields: [
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
650 { name: 'record', type: 'number' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
651 { name: 'name', type: 'string' },
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
652 { name: 'unlimited_stock', type: 'int' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
653 { name: 'calcium', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
654 { name: 'sulfate', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
655 { name: 'chloride', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
656 { name: 'sodium', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
657 { name: 'magnesium', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
658 { name: 'ph', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
659 { name: 'total_alkalinity', type: 'float' },
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
660 { name: 'inventory', type: 'float' },
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
661 { name: 'cost', type: 'float' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
662 ],
221
a8aabb63fbcc Added two missing fields in getfermentablesources.php. When getting a single recipe from the database, update the fermentables json data with available inventory and ingredient. Added inventory column in the fermentable grid. Added ingredient selection in the fermentable popup window to replace ingredient.
Michiel Broek <mbroek@mbse.eu>
parents: 220
diff changeset
663 url: "getwatersources.php"
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
664 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
665 waterinstock = false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
666 waterlist = new $.jqx.dataAdapter(waterInvSource, {
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
667 beforeLoadComplete: function (records) {
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
668 var data, i, row;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
669 data = new Array();
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
670 for (i = 0; i < records.length; i++) {
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
671 row = records[i];
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
672 if (row.inventory || row.unlimited_stock || ! waterinstock)
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
673 data.push(row);
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
674 }
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
675 return data;
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
676 },
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
677 loadError: function(jqXHR, status, error) {
407
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 406
diff changeset
678 console.log(status + ' ' + error);
146
2a6c00d325b2 In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
679 },
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
680 }),
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
681
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
682 // dropdownlist datasource from profile_water
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
683 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
684 datatype: "json",
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
685 datafields: [
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
686 { name: 'record', type: 'number' },
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
687 { name: 'name', type: 'string' },
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
688 { name: 'calcium', type: 'float' },
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
689 { name: 'bicarbonate', type: 'float' },
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
690 { name: 'sulfate', type: 'float' },
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
691 { name: 'chloride', type: 'float' },
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
692 { name: 'sodium', type: 'float' },
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
693 { name: 'magnesium', type: 'float' },
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
694 { name: 'ph', type: 'float' },
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
695 { name: 'total_alkalinity', type: 'float' },
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
696 ],
221
a8aabb63fbcc Added two missing fields in getfermentablesources.php. When getting a single recipe from the database, update the fermentables json data with available inventory and ingredient. Added inventory column in the fermentable grid. Added ingredient selection in the fermentable popup window to replace ingredient.
Michiel Broek <mbroek@mbse.eu>
parents: 220
diff changeset
697 url: "includes/db_profile_water.php"
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
698 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
699 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
700
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
701 // dropdownlist datasource from profile_mash
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
702 mashProfileSource = {
144
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
703 datatype: "json",
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
704 datafields: [
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
705 { name: 'record', type: 'number' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
706 { name: 'name', type: 'string' },
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
707 { name: 'steps', type: 'array' }
ae15cfe5f008 Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents: 139
diff changeset
708 ],
228
98536f6539ee The mash grid now uses a popup editor. There is now a dropdown mash selector to replace the mash scheme.
Michiel Broek <mbroek@mbse.eu>
parents: 221
diff changeset
709 url: "includes/db_profile_mash.php"
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
710 },
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
711 mashlist = new $.jqx.dataAdapter(mashProfileSource),
13
b8c3ca152984 Added hops inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
712
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
713
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
714
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
715 /*
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
716 * From "Rekenen aan bier" by Hans Halberstadt.
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
717 */
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
718 K1s = 0.384, K1a = -0.177, K1e = 0.241, K1g = 0.247, Ks = 0.1415, Ka1 = 0.058, Ka2 = 0.078, Ke = 0.174, Kg = 0.109;
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
719
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
720 // =E2/E6+(E3/E6)*$B$24/$B$23+(E3/E6)*(E3/E6)*$B$25/$B$23+E4/E6*$B$26/$B$23+E5/E6*$B$27/$B$23
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
721 // For Brix
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
722 function A(sugar, volume, alc, eiwit, glycerol) {
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
723
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
724 var vol, A;
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
725
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
726 vol = volume * 1000;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
727 A = sugar/vol + (alc/vol)*Ka1/Ks + (alc/vol)*(alc/vol) * Ka2/Ks + eiwit/vol * Ke/Ks + glycerol/vol * Kg/Ks;
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
728 console.log("A("+sugar+"."+volume+","+alc+","+eiwit+","+glycerol+"):"+A);
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
729 return A;
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
730 }
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
731
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
732 // =E2/E6+(E3/E6)*$B$20/$B$19+E4/E6*$B$21/$B$19+E5/E6*$B$22/$B$19
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
733 // for Plato
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
734 function B(sugar, volume, alc, eiwit, glycerol) {
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
735
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
736 var vol, B;
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
737
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
738 vol = volume * 1000;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
739 B = sugar/vol + (alc/vol)*K1a/K1s + eiwit/vol*K1e/K1s + glycerol/vol*K1g/K1s;
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
740 console.log("B("+sugar+"."+volume+","+alc+","+eiwit+","+glycerol+"):"+B);
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
741 return B;
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
742 }
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
743
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
744
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
745
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
746 $(document).ready(function(){
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
747
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
748 $("#jqxMenu").jqxMenu({
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
749 width:1280,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
750 height:'30px',
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
751 autoOpen:false,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
752 clickToOpen:true,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
753 theme:theme
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
754 });
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
755 $("#jqxWidget").css('visibility','visible');
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
756 });
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
757
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
758
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
759
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
760 function Round(n,d){
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
761
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
762 for (var i=0,m=1; i<d; i++,m*=10);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
763 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
764 }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
765
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
766
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
767
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
768 function ebc_to_srm(ebc){
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
769
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
770 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;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
771 if(srm<0)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
772 srm=0;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
773 return srm;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
774 }
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
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
777
462
c91175610f8a Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 446
diff changeset
778 function srm_to_ebc(srm){
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
779
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
780 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);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
781 if(ebc<0)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
782 ebc=0;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
783 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
784 }
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
785
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
786
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
787
462
c91175610f8a Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 446
diff changeset
788 /* Return incremented color by the boil and yeast.
c91175610f8a Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 446
diff changeset
789 * https://www.hobbybrouwen.nl/forum/index.php/topic,19020.msg281132.html#msg281132 */
c91175610f8a Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 446
diff changeset
790 function get_kt(ebc){
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
791
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
792 var kt=1;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
793 if(ebc<3)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
794 kt=3.5;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
795 else if(ebc<6)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
796 kt=3;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
797 else if(ebc<8)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
798 kt=2.75;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
799 else if(ebc<10)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
800 kt=2.5;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
801 else if(ebc<20)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
802 kt=1.8;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
803 else if(ebc<30)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
804 kt=1.6;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
805 else if(ebc<60)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
806 kt=1.3;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
807 else if(ebc<100)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
808 kt=1.2;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
809 else if(ebc<300)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
810 kt=1.1;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
811 return kt;
372
1365b5e47130 Added color method written by Hans Halberstadt.
Michiel Broek <mbroek@mbse.eu>
parents: 371
diff changeset
812 }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
813
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
814
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
815
429
0d2cf505957c Prepared for new yeast types.
Michiel Broek <mbroek@mbse.eu>
parents: 428
diff changeset
816 function abvol(og,fg){
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
817
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
818 if(((og-fg)<0)||(fg<0.9))
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
819 return 0;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
820 var factor = og*3157*Math.pow(10,-5) + 9.716*Math.pow(10,-2);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
821 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
822 }
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
823
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
824
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
825
462
c91175610f8a Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 446
diff changeset
826 /* Kleurwerking naar SRM. Niet voor Halberstadt, Naudts */
c91175610f8a Code cleanup and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 446
diff changeset
827 function kw_to_srm(colormethod,c){
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
828 if(colormethod==0)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
829 return 1.4922*Math.pow(c,0.6859);//Morey
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
830 if(colormethod==1)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
831 return 0.3*c+4.7;//Mosher
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
832 if(colormethod==2)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
833 return 0.2*c+8.4;//Daniels
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
834 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
835 }
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
836
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
837
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
838
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
839 function kw_to_ebc(colormethod, c){
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
840
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
841 return srm_to_ebc(kw_to_srm(colormethod,c));
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
842 }
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
843
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
844
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
845
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
846 /*
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
847 * 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
848 */
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
849 function toIBU(Use, Form, SG, Volume, Amount, Boiltime, Alpha, Method) {
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
850
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
851 var gravity, liters, alpha, mass, time, fmoment=1.0, pfactor=1.0, ibu=0, boilfactor, sgfactor,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
852 AddedAlphaAcids, Bigness_factor, BoilTime_factor, utiisation;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
853
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
854 gravity = parseFloat(SG);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
855 liters = parseFloat(Volume);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
856 alpha = parseFloat(Alpha)/100;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
857 mass = parseFloat(Amount)*1000;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
858 time = parseFloat(Boiltime);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
859
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
860 if ((Use==3) || (Use==4) || (Use==5)) { // Aroma, Whirlpool or Dry hop.
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
861 fmoment=0.0;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
862 } else if (Use==0) { // Mash
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
863 fmoment+=my_factor_mashhop/100; // Brouwhulp
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
864 } else if (Use==1) { // First wort
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
865 fmoment+=my_factor_fwh/100; // Brouwhulp, Louis, Ozzie
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
866 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
867
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
868 if (Form==0){ // Pellet
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
869 pfactor+=my_factor_pellet/100;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
870 } else if (Form==1) { // Plug
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
871 pfactor+=my_factor_plug/100;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
872 } else if (Form==3) { // Wet leaf
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
873 pfactor+=my_factor_wethop/100; // From https://github.com/chrisgilmerproj/brewday/blob/master/brew/constants.py
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
874 } else if (Form==4) { // Cryo hop
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
875 pfactor+=my_factor_cryohop/100;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
876 }
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
877
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
878 if(Method==0){// Tinseth
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
879 /* http://realbeer.com/hops/research.html */
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
880 AddedAlphaAcids=(alpha*mass*1000)/liters;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
881 Bigness_factor=1.65*Math.pow(0.000125,gravity-1);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
882 BoilTime_factor=((1-Math.exp(-0.04*time))/4.15);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
883 utiisation=Bigness_factor*BoilTime_factor;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
884 ibu=Round(utiisation*AddedAlphaAcids*fmoment*pfactor,1);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
885 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
886 if(Method==2){// Daniels
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
887 if (Form == 2)// Leaf
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
888 boilfactor = -(0.0041*time*time)+(0.6162*time)+1.5779;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
889 else
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
890 boilfactor = -(0.0051*time*time)+(0.7835*time)+1.9348;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
891 if (gravity < 1050)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
892 sgfactor=0;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
893 else
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
894 sgfactor=(gravity-1050)/200;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
895 ibu = Round(fmoment*((mass*(alpha*100)*boilfactor* 0.1)/(liters*(1+sgfactor))),1);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
896 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
897 if(Method==1){// Rager
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
898 boilfactor = fmoment*18.11 + 13.86*Math.tanh((time*31.32)/18.27);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
899 if (gravity < 1050)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
900 sgfactor=0;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
901 else
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
902 sgfactor=(gravity-1050)/200;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
903 ibu = Round((mass*(alpha*100)*boilfactor*0.1)/(liters*(1+sgfactor)),1);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
904 }
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
905
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
906 //console.log("toIBU("+Use+","+Form+","+SG+","+Volume+","+Amount+","+Boiltime+","+Alpha+","+Method+"):"+ibu+" fm:"+fmoment+" pf:"+pfactor);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
907 return ibu;
446
ee7bcfb8e270 Added Cryo Hops type.
Michiel Broek <mbroek@mbse.eu>
parents: 439
diff changeset
908 }
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
909
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
910
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
911
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
912 function ebc_to_color(ebc){
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
913
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
914 return srm_to_color(ebc_to_srm(ebc));
59
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
915 }
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
916
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
917
ad28e09e3abd Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
918
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
919 function srm_to_color(srm){
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
920
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
921 var i, R, G, B, color, result;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
922
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
923 i = Math.round(srm * 10);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
924 if (i < 0)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
925 i=0;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
926 if (i > 299)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
927 i=299;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
928
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
929 /* Table copied from Brouwhulp/BrewBuddy */
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
930 R=[
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
931 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,//0
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
932 250,250,250,250,250,249,248,247,246,245,244,243,242,241,240,239,238,237,236,235,//2
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
933 234,233,232,231,230,229,228,227,226,225,224,223,222,221,220,219,218,217,216,215,//4
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
934 214,213,212,211,210,209,208,207,206,205,204,203,202,201,200,200,199,199,198,198,//6
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
935 197,197,196,196,195,195,194,194,193,193,192,192,192,192,192,192,192,192,192,192,//8
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
936 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,//10
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
937 192,192,192,192,192,192,192,192,191,190,189,188,187,186,185,184,183,182,181,180,//12
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
938 179,178,177,175,174,172,171,169,168,167,195,164,162,161,159,158,157,155,154,152,//14
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
939 151,149,148,147,145,144,142,141,139,138,137,135,134,132,131,129,128,127,125,124,//16
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
940 122,121,119,118,117,115,114,112,111,109,108,107,105,104,102,101,99,98,97,95,//18
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
941 94,92,91,89,88,87,85,84,82,81,79,78,77,75,74,72,71,69,68,67,//20
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
942 65,64,62,61,59,58,57,55,54,52,51,49,48,47,45,44,43,41,39,38,//22
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
943 37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,//24
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
944 27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,//26
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
945 17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8];
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
946
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
947 G=[
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
948 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
949 250,250,250,250,250,250,249,248,247,246,245,244,242,240,238,236,234,232,230,228,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
950 226,224,222,220,218,216,214,212,210,208,206,204,202,200,198,196,194,192,190,188,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
951 186,184,182,180,178,176,174,172,170,168,166,164,162,160,158,156,154,152,150,148,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
952 146,144,142,141,140,139,139,138,137,136,136,135,134,133,133,132,131,130,130,129,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
953 128,127,127,126,125,124,124,123,122,121,121,120,119,118,118,117,116,115,115,114,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
954 113,112,112,111,110,109,109,108,107,106,106,105,104,103,103,102,101,100,100,99,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
955 98,97,97,96,95,94,94,93,92,91,91,90,89,88,88,87,86,85,85,84,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
956 83,82,82,81,80,79,78,77,76,75,75,74,73,72,72,71,70,69,69,68,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
957 67,66,66,65,64,63,63,62,61,60,60,59,58,57,57,56,55,54,54,53,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
958 52,51,51,50,49,48,48,47,46,45,45,44,43,42,42,41,40,39,39,38,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
959 37,36,36,35,34,33,33,32,31,30,30,29,28,27,27,26,25,24,24,23,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
960 22,22,22,21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,16,16,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
961 16,15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
962 9,9,8,8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3];
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
963
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
964 B=[
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
965 210,204,199,193,188,182,177,171,166,160,155,149,144,138,133,127,122,116,111,105,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
966 100,94,89,83,78,72,67,61,56,50,45,45,45,46,46,46,46,47,47,47,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
967 47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
968 52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,56,56,56,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
969 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
970 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
971 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
972 56,56,56,55,55,55,55,54,54,54,54,53,53,53,53,52,52,52,52,51,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
973 51,51,51,50,50,50,50,49,49,48,47,47,46,45,45,44,43,43,42,41,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
974 41,40,39,39,38,37,37,36,35,34,33,32,31,29,28,27,26,25,24,23,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
975 21,20,19,18,17,16,15,13,12,11,10,9,8,9,9,10,10,11,11,12,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
976 12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
977 21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,17,16,16,15,15,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
978 15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,8,
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
979 8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3,2,2,2];
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
980
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
981 color = R[i]*65536 + G[i]*256 + B[i];
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
982 result = color.toString(16).toUpperCase();
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
983 if (result.length < 6)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
984 result = '0'+result;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
985 return '#'+result;
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
986 }
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
987
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
988
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
989
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
990 function sg_to_plato(sg){
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
991 return ((135.997*sg - 630.272) * sg + 1111.14) * sg - 616.868;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
992 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
993
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
994
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
995
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
996 function plato_to_sg(plato){
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
997 return 1 + (plato / (258.6-((plato/258.2)*227.1)));
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
998 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
999
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1000
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1001
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1002 function brix_to_sg(brix){
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1003 if(my_brix_correction>0)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1004 return plato_to_sg(brix/my_brix_correction);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1005 else
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1006 return plato_to_sg(brix);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1007 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1008
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1009
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1010
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1011 function sg_to_brix(sg){
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1012 return sg_to_plato(sg)*my_brix_correction;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1013 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1014
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1015
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
1016
430
6fa1d64f7f16 Compress code
Michiel Broek <mbroek@mbse.eu>
parents: 429
diff changeset
1017 function estimate_sg(sugars,batch_size){
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1018
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1019 var plato, sg, i;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1020
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1021 plato = 100*sugars / batch_size;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1022 sg = plato_to_sg(plato);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1023 for (i = 0; i < 20; i++) {
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1024 if (sg > 0)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1025 plato = 100*sugars / (batch_size*sg);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1026 sg = plato_to_sg(plato);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1027 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1028 return Round(sg,4);
96
107c12c3e49d Renamed estimate_og() to estimate_sg() formula. Updated the formulas in javascript. The calcFermenter() function now only calculates the gravities. The colors still need to be added. When a recept is loaded in the editor, all tabs are selected once to load all subgrid data. Ugly and slow but it at least it works.
Michiel Broek <mbroek@mbse.eu>
parents: 94
diff changeset
1029 }
107c12c3e49d Renamed estimate_og() to estimate_sg() formula. Updated the formulas in javascript. The calcFermenter() function now only calculates the gravities. The colors still need to be added. When a recept is loaded in the editor, all tabs are selected once to load all subgrid data. Ugly and slow but it at least it works.
Michiel Broek <mbroek@mbse.eu>
parents: 94
diff changeset
1030
107c12c3e49d Renamed estimate_og() to estimate_sg() formula. Updated the formulas in javascript. The calcFermenter() function now only calculates the gravities. The colors still need to be added. When a recept is loaded in the editor, all tabs are selected once to load all subgrid data. Ugly and slow but it at least it works.
Michiel Broek <mbroek@mbse.eu>
parents: 94
diff changeset
1031
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
1032
463
0efdafd23753 Switched to compressed javascript and css files using the yui-compressor
Michiel Broek <mbroek@mbse.eu>
parents: 462
diff changeset
1033 function estimate_fg(percSugar,percCara,WGratio,TotTme,Temp,attenuation,og){
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
1034
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1035 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
1036
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1037 if (percSugar > 40)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1038 percSugar = 0;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1039 if (percCara > 50)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1040 percCara = 0;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1041 if ((WGratio > 0) && (TotTme > 0)) {
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1042 BD = WGratio;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1043 if(BD < 2)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1044 BD=2;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1045 if(BD > 5.5)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1046 BD=5.5;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1047 if(Temp < 60)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1048 Temp=60;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1049 if(Temp > 72)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1050 Temp=72;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1051 } else {
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1052 BD=3.5;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1053 Temp=67;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1054 TotTme=75;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1055 }
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1056 if (attenuation < 30)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1057 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
1058
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1059 // 0.00825 Attenuation factor yeast
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1060 // 0.00817 Attenuation factor water/grain ration
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1061 // -0.00684 Attenuation factor mash temperature
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1062 // 0.00026 Attenuation factor total mash time (at some places this is 0.0026 this is wrong!)
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1063 // -0.00356 Attenuation factor percentage crystal malt
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1064 // 0.00553 Attenuation factor percentage simple sugars
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1065 // 0.547 Attenuation factor constant
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1066 AttBeer = 0.00825*attenuation + 0.00817*BD - 0.00684*Temp + 0.00026*TotTme - 0.00356*percCara + 0.00553*percSugar + 0.547;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1067 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
1068
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1069 console.log("estimate_fg("+percSugar+","+percCara+","+BD+","+TotTme+","+Temp+","+attenuation+","+og+") AttBeer:"+AttBeer+" fg:"+fg);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1070 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
1071 }
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
1072
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
1073
371
023ca640b5af Fixed spelling error and Capitals
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
1074
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
1075 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
1076
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1077 var r1d, r2d, r3d, dd, f2d, f3d, f4d;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1078
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1079 r1d = Math.pow(10, TpH - pK1);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1080 r2d = Math.pow(10, TpH - pK2);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1081 r3d = Math.pow(10, TpH - pK3);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1082 dd = 1/(1 + r1d + r1d*r2d + r1d*r2d*r3d);
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1083 f2d = r1d*dd;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1084 f3d = r1d*r2d*dd;
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1085 f4d = r1d*r2d*r3d*dd;
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
1086 return f2d + 2*f3d + 3*f4d;
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
1087 }
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
1088
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
1089
465
dc3e14b976be Global javascript code cleanup and optimisation
Michiel Broek <mbroek@mbse.eu>
parents: 463
diff changeset
1090
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
1091 function lintner_to_kolbach(lintner) {
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
1092
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
1093 return (3.5 * lintner) - 16;
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
1094 }
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
1095
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
1096
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
1097 function kolbach_to_lintner(kolbach) {
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
1098
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
1099 return (kolbach + 16) / 3.5;
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
1100 }
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
1101
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
1102

mercurial