diff -r e6e5d007eb54 -r c0f0bbfefd63 www/js/rec_edit.js --- a/www/js/rec_edit.js Mon Dec 17 22:24:32 2018 +0100 +++ b/www/js/rec_edit.js Wed Dec 19 21:58:21 2018 +0100 @@ -44,7 +44,6 @@ $(document).ready(function () { - var dataRecord = {}; var to_100 = false; // Fermentables adjust to 100% var preboil_sg = 0; var sugarsm = 0; // Sugars after mash @@ -54,6 +53,7 @@ var svg = 77; // Default attenuation var hop_flavour = 0; var hop_aroma = 0; + var mash_infuse = 0; console.log("record:" + my_record + " return:" + my_return + " theme:" + theme); $("#jqxLoader").jqxLoader({ @@ -175,10 +175,20 @@ } + function setRangeIndicator(ion, rangeCode) { + $("#wr_" + ion).html("" + rangeCode + ""); + } + + function mix(v1, v2, c1, c2) { + if ((v1 + v2) > 0) { + return ((v1 * c1) + (v2 * c2)) / (v1 + v2); + } + return 0; + } + function calcWater() { console.log("calcWater()"); - var rows = $('#waterGrid').jqxGrid('getrows'); var liters = 0; var calcium = 0; var magnesium = 0; @@ -187,29 +197,66 @@ var chloride = 0; var sulfate = 0; var ph = 0; - for (var i = 0; i < rows.length; i++) { - var row = rows[i]; - liters += row.w_amount; - calcium += row.w_amount * row.w_calcium; - magnesium += row.w_amount * row.w_magnesium; - sodium += row.w_amount * row.w_sodium; - total_alkalinity += row.w_amount * row.w_total_alkalinity; - chloride += row.w_amount * row.w_chloride; - sulfate += row.w_amount * row.w_sulfate; - ph += Math.pow(10, -row.w_ph) * row.w_amount; + +// console.log((dataRecord.w1_name != "") + " " + (dataRecord.w2_name != "")); + if (dataRecord.w1_name != "") { + if (dataRecord.w2_name != "") { + liters = dataRecord.w1_amount + dataRecord.w2_amount; + calcium = Math.round(mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_calcium, dataRecord.w2_calcium) * 10) / 10; + magnesium = Math.round(mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_magnesium, dataRecord.w2_magnesium) * 10) / 10; + sodium = Math.round(mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_sodium, dataRecord.w2_sodium) * 10) / 10; + chloride = Math.round(mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_chloride, dataRecord.w2_chloride) * 10) / 10; + sulfate = Math.round(mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_sulfate, dataRecord.w2_sulfate) * 10) / 10; + total_alkalinity = Math.round(mix(dataRecord.w1_amount, dataRecord.w2_amount, dataRecord.w1_total_alkalinity, dataRecord.w2_total_alkalinity) * 10) / 10; + ph = Math.round(-Math.log10(((Math.pow(10, -dataRecord.w1_ph) * dataRecord.w1_amount) + (Math.pow(10, -dataRecord.w2_ph) * dataRecord.w2_amount)) / liters) * 10) / 10; + } else { + liters = dataRecord.w1_amount; + calcium = dataRecord.w1_calcium; + magnesium = dataRecord.w1_magnesium; + sodium = dataRecord.w1_sodium; + chloride = dataRecord.w1_chloride; + sulfate = dataRecord.w1_sulfate; + total_alkalinity = dataRecord.total_alkalinity; + ph = dataRecord.w1_ph; + } } - $('#wg_volume').val(liters); - calcium = Math.round(calcium / liters * 10) / 10; + $('#wg_amount').val(liters); $('#wg_calcium').val(calcium); - $('#wg_magnesium').val(Math.round(magnesium / liters * 10) / 10); - $('#wg_sodium').val(Math.round(sodium / liters * 10) / 10); - $('#wg_total_alkalinity').val(Math.round(total_alkalinity / liters * 10) / 10); - $('#wg_chloride').val(Math.round(chloride / liters * 10) / 10); - sulfate = Math.round(sulfate / liters * 10) / 10; + $('#wg_magnesium').val(magnesium); + $('#wg_sodium').val(sodium); + $('#wg_total_alkalinity').val(total_alkalinity); + $('#wg_chloride').val(chloride); $('#wg_sulfate').val(sulfate); // Note: brouwhulp has the malts included here in the result. - ph = Math.round(-Math.log10(ph / liters) * 10) / 10; $('#wg_ph').val(ph); + + // Brouwhulp < 40 || > 200 + if (calcium < 50) { setRangeIndicator("calcium", "low"); } + if (calcium >= 50 && calcium <= 150) { setRangeIndicator("calcium", "normal"); } + if (calcium > 150) { setRangeIndicator("calcium", "high"); } + if (calcium > 250) { setRangeIndicator("calcium", "harmful"); } + + // Brouwhulp > 40 + if (magnesium >= 0 && magnesium <= 30) { setRangeIndicator("magnesium", "normal"); } + if (magnesium > 30) { setRangeIndicator("magnesium", "high"); } + if (magnesium > 50) { setRangeIndicator("magnesium", "harmful"); } + + // Brouwhulp > 100 + if (sodium <= 150) { setRangeIndicator("sodium", "normal"); } + if (sodium > 150) { setRangeIndicator("sodium", "high"); } + if (sodium > 200) { setRangeIndicator("sodium", "harmful"); } + + // Brouwhulp > 200 + if (chloride <= 250) { setRangeIndicator("chloride", "normal"); } + if (chloride > 250) { setRangeIndicator("chloride", "high"); } + if (chloride > 300) { setRangeIndicator("chloride", "harmful"); } + + // Brouwhulp > 600 + if (sulfate < 50) { setRangeIndicator("sulfate", "low"); } + if (sulfate >= 50 && sulfate <= 350) { setRangeIndicator("sulfate", "normal"); } + if (sulfate > 350) { setRangeIndicator("sulfate", "high"); } + if (sulfate > 750) { setRangeIndicator("sulfate", "harmful"); } + } function calcFermentablesFromOG(OG) { @@ -249,6 +296,23 @@ function calcInit () { console.log("calc.init()"); + $("#w1_name").jqxDropDownList('selectItem', dataRecord.w1_name); + $("#w2_name").jqxDropDownList('selectItem', dataRecord.w2_name); + calcWater(); + $("#w2_amount").on('change', function (event) { + var newval = parseFloat(event.args.value); + + if (newval > mash_infuse) { + $("#w2_amount").val(dataRecord.w2_amount); + return; + } + dataRecord.w1_amount = parseFloat($("#wg_amount").jqxNumberInput('decimal')) - newval; + $("#w1_amount").val(dataRecord.w1_amount); + dataRecord.w2_amount = newval; + console.log("new: "+event.args.value+" w1: "+dataRecord.w1_amount+" w2: "+dataRecord.w2_amount); + calcWater(); + }); + $('#color_method').on('change', function (event) { calcFermentables(); }); $('#ibu_method').on('change', function (event) { calcFermentables(); @@ -343,6 +407,7 @@ } }); + var dataRecord = {}; var url = "includes/db_recipes.php"; // tooltips $("#name").jqxTooltip({ content: 'De naam voor dit recept.' }); @@ -429,11 +494,30 @@ { name: 'mash_ph', type: 'float' }, { name: 'mash_name', type: 'string' }, { name: 'calc_acid', type: 'bool' }, + { name: 'w1_name', type: 'string' }, + { name: 'w1_amount', type: 'float' }, + { name: 'w1_calcium', type: 'float' }, + { name: 'w1_sulfate', type: 'float' }, + { name: 'w1_chloride', type: 'float' }, + { name: 'w1_sodium', type: 'float' }, + { name: 'w1_magnesium', type: 'float' }, + { name: 'w1_total_alkalinity', type: 'float' }, + { name: 'w1_ph', type: 'float' }, + { name: 'w1_cost', type: 'float' }, + { name: 'w2_name', type: 'string' }, + { name: 'w2_amount', type: 'float' }, + { name: 'w2_calcium', type: 'float' }, + { name: 'w2_sulfate', type: 'float' }, + { name: 'w2_chloride', type: 'float' }, + { name: 'w2_sodium', type: 'float' }, + { name: 'w2_magnesium', type: 'float' }, + { name: 'w2_total_alkalinity', type: 'float' }, + { name: 'w2_ph', type: 'float' }, + { name: 'w2_cost', type: 'float' }, { name: 'fermentables', type: 'array' }, { name: 'hops', type: 'string' }, { name: 'miscs', type: 'string' }, { name: 'yeasts', type: 'string' }, - { name: 'waters', type: 'array' }, { name: 'mashs', type: 'string' } ], id: 'record', @@ -490,11 +574,30 @@ $("#sparge_acid_perc").val(dataRecord.sparge_acid_perc); $("#sparge_acid_amount").val(dataRecord.sparge_acid_amount); $("#calc_acid").val(dataRecord.calc_acid); + $("#w1_name").val(dataRecord.w1_name); + $("#w1_amount").val(dataRecord.w1_amount); + $("#w1_calcium").val(dataRecord.w1_calcium); + $("#w1_sulfate").val(dataRecord.w1_sulfate); + $("#w1_chloride").val(dataRecord.w1_chloride); + $("#w1_sodium").val(dataRecord.w1_sodium); + $("#w1_magnesium").val(dataRecord.w1_magnesium); + $("#w1_total_alkalinity").val(dataRecord.w1_total_alkalinity); + $("#w1_ph").val(dataRecord.w1_ph); + $("#w1_cost").val(dataRecord.w1_cost); + $("#w2_name").val(dataRecord.w2_name); + $("#w2_amount").val(dataRecord.w2_amount); + $("#w2_calcium").val(dataRecord.w2_calcium); + $("#w2_sulfate").val(dataRecord.w2_sulfate); + $("#w2_chloride").val(dataRecord.w2_chloride); + $("#w2_sodium").val(dataRecord.w2_sodium); + $("#w2_magnesium").val(dataRecord.w2_magnesium); + $("#w2_total_alkalinity").val(dataRecord.w2_total_alkalinity); + $("#w2_ph").val(dataRecord.w2_ph); + $("#w2_cost").val(dataRecord.w2_cost); editFermentable(dataRecord); editHop(dataRecord); editMisc(dataRecord); editYeast(dataRecord); - editWater(dataRecord); editMash(dataRecord); $('#jqxTabs').jqxTabs('next'); }, @@ -1398,129 +1501,6 @@ }); }; - // Inline waters editor - var editWater = function (data) { - var waterSource = { - localdata: data.waters, - datatype: "local", - datafields: [ - { name: 'w_name', type: 'string' }, - { name: 'w_amount', type: 'float' }, - { name: 'w_calcium', type: 'float' }, - { name: 'w_sulfate', type: 'float' }, - { name: 'w_chloride', type: 'float' }, - { name: 'w_sodium', type: 'float' }, - { name: 'w_magnesium', type: 'float' }, - { name: 'w_ph', type: 'float' }, - { name: 'w_total_alkalinity', type: 'float' }, - { name: 'w_cost', type: 'float' }, - ], - addrow: function (rowid, rowdata, position, commit) { - commit(true); - }, - deleterow: function (rowid, commit) { - commit(true); - } - }; - var waterAdapter = new $.jqx.dataAdapter(waterSource); - $("#waterGrid").jqxGrid({ - width: 960, - height: 200, - source: waterAdapter, - theme: theme, - selectionmode: 'singlerow', - editmode: 'selectedcell', - editable: true, - localization: getLocalization(), - showtoolbar: true, - rendertoolbar: function (toolbar) { - var me = this; - var container = $("
"); - toolbar.append(container); - container.append('
'); - container.append('
In voorraad:
'); - container.append('
'); - container.append(''); - // add water from dropdownlist. - $("#waddrowbutton").jqxDropDownList({ - placeHolder: "Kies water:", - theme: theme, - source: waterlist, - displayMember: "name", - width: 150, - height: 27, - dropDownWidth: 400, - dropDownHeight: 400 - }); - $("#waddrowbutton").on('select', function (event) { - if (event.args) { - var index = event.args.index; - var datarecord = waterlist.records[index]; - var row = {}; - row["w_name"] = datarecord.name; - row["w_amount"] = 0; - row["w_calcium"] = datarecord.calcium; - row["w_sulfate"] = datarecord.sulfate; - row["w_chloride"] = datarecord.chloride; - row["w_sodium"] = datarecord.sodium; - row["w_magnesium"] = datarecord.magnesium; - row["w_ph"] = datarecord.ph; - row["w_total_alkalinity"] = datarecord.total_alkalinity; - row["w_cost"] = datarecord.cost; - var commit = $("#waterGrid").jqxGrid('addrow', null, row); - } - }); - $("#winstockbutton").jqxCheckBox({ theme: theme, height: 27 }); - $("#winstockbutton").on('change', function (event) { - waterinstock = event.args.checked; - waterlist.dataBind(); - }); - // delete selected water. - // Overgebleven waters in volume verhogen met het verwijderde water. - $("#wdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); - $("#wdeleterowbutton").on('click', function () { - var selectedrowindex = $("#waterGrid").jqxGrid('getselectedrowindex'); - var rowscount = $("#waterGrid").jqxGrid('getdatainformation').rowscount; - if (selectedrowindex >= 0 && selectedrowindex < rowscount) { - var id = $("#waterGrid").jqxGrid('getrowid', selectedrowindex); - var commit = $("#waterGrid").jqxGrid('deleterow', id); - } - calcWater(); - }); - }, - ready: function() { - calcWater(); - $('#jqxTabs').jqxTabs('next'); - }, - columns: [ - { text: 'Water bron', editable: false, datafield: 'w_name' }, - { text: 'Volume', datafield: 'w_amount', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1', - columntype: 'numberinput', - validation: function (cell, value) { - if (value < 0 || value > 100000000000 ) { - return { result: false, message: "Volume moet 0-~ zijn" }; - } - return true; - } - }, - // TODO: validator test max is hoeveelheid maischwater. Dan water verdelen voor totaal. - { text: 'Ca', editable: false, datafield: 'w_calcium', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, - { text: 'Mg', editable: false, datafield: 'w_magnesium', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, - { text: 'Na', editable: false, datafield: 'w_sodium', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, - { text: 'Tot Alk', editable: false, datafield: 'w_total_alkalinity', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, - { text: 'CaSO4', editable: false, datafield: 'w_sulfate', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, - { text: 'Cl', editable: false, datafield: 'w_chloride', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, - { text: 'pH', editable: false, datafield: 'w_ph', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' } - ] - }); - $("#waterGrid").on('cellendedit', function (event) { - var args = event.args; - console.log("Event Type: cellendedit, Column: " + args.datafield + ", Row: " + (args.rowindex) + ", Value: " + args.value); - $("#waterGrid").jqxGrid('setcellvalue', args.rowindex, args.datafield, args.value); - calcWater(); - }); - }; - // inline mash editor var editMash = function (data) { var generaterow = function () { @@ -1554,7 +1534,17 @@ commit(true); } }; - var mashAdapter = new $.jqx.dataAdapter(mashSource); + var mashAdapter = new $.jqx.dataAdapter(mashSource, { + beforeLoadComplete: function (records) { + mash_infuse = 0; + var data = new Array(); + for (var i = 0; i < records.length; i++) { + var row = records[i]; + if (row.step_type == 'Infusion') + mash_infuse += parseFloat(row.step_infuse_amount); + } + }, + }); $("#mashGrid").jqxGrid({ width: 960, height: 400, @@ -1702,13 +1692,100 @@ $("#mash_name").jqxInput({ theme: theme, width: 320, height: 23 }); $("#mash_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, max: 8, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); $("#tgt_mash_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 1, readOnly: true }); - $("#mash_sparge_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 70, max: 98, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); + $("#sparge_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 70, max: 98, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); // Hop flavour and aroma gauges $("#hop_flavour").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); $("#hop_aroma").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); // Water treatment - $("#wg_volume").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w1_name").jqxDropDownList({ + placeHolder: "Kies hoofd water:", + theme: theme, + source: waterlist, + displayMember: "name", + width: 250, + height: 27, + dropDownWidth: 400, + dropDownHeight: 400 + }); + $("#w1_name").on('select', function (event) { + if (event.args) { + var index = event.args.index; + var datarecord = waterlist.records[index]; + dataRecord.w1_name = datarecord.name; + $("#w1_calcium").val(datarecord.calcium); + dataRecord.w1_calcium = datarecord.calcium; + $("#w1_sulfate").val(datarecord.sulfate); + dataRecord.w1_sulfate = datarecord.sulfate; + $("#w1_chloride").val(datarecord.chloride); + dataRecord.w1_chloride = datarecord.chloride; + $("#w1_sodium").val(datarecord.sodium); + dataRecord.w1_sodium = datarecord.sodium; + $("#w1_magnesium").val(datarecord.magnesium); + dataRecord.w1_magnesium = datarecord.magnesium; + $("#w1_total_alkalinity").val(datarecord.total_alkalinity); + dataRecord.w1_total_alkalinity = datarecord.total_alkalinity; + $("#w1_ph").val(datarecord.ph); + dataRecord.w1_ph = datarecord.ph; + $("#w1_cost").val(datarecord.cost); + dataRecord.w1_cost = datarecord.cost; + calcWater(); + } + }); + $("#w1_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w1_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w1_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w1_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w1_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w1_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w1_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w1_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + + $("#w2_name").jqxDropDownList({ + placeHolder: "Kies meng water:", + theme: theme, + source: waterlist, + displayMember: "name", + width: 250, + height: 27, + dropDownWidth: 400, + dropDownHeight: 400 + }); + $("#w2_name").on('select', function (event) { + if (event.args) { + var index = event.args.index; + var datarecord = waterlist.records[index]; + dataRecord.w2_name = datarecord.name; + $("#w2_calcium").val(datarecord.calcium); + dataRecord.w2_calcium = datarecord.calcium; + $("#w2_sulfate").val(datarecord.sulfate); + dataRecord.w2_sulfate = datarecord.sulfate; + $("#w2_chloride").val(datarecord.chloride); + dataRecord.w2_chloride = datarecord.chloride; + $("#w2_sodium").val(datarecord.sodium); + dataRecord.w2_sodium = datarecord.sodium; + $("#w2_magnesium").val(datarecord.magnesium); + dataRecord.w2_magnesium = datarecord.magnesium; + $("#w2_total_alkalinity").val(datarecord.total_alkalinity); + dataRecord.w2_total_alkalinity = datarecord.total_alkalinity; + $("#w2_ph").val(datarecord.ph); + dataRecord.w2_ph = datarecord.ph; + $("#w2_cost").val(datarecord.cost); + dataRecord.w2_cost = datarecord.cost; + $("#w2_amount").jqxNumberInput({ max: 100000, readOnly: false }); // Set high max to enable the spinbuttons. + calcWater(); + } + }); + $("#w2_amount").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 94, height: 23, min: 0, max: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5, readOnly: true }); + $("#w2_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w2_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w2_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w2_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w2_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w2_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + $("#w2_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); + + $("#wg_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); $("#wg_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); $("#wg_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); $("#wg_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); @@ -1797,7 +1874,6 @@ var hoprow = $('#hopGrid').jqxGrid('getrows'); var miscrow = $('#miscGrid').jqxGrid('getrows'); var yeastrow = $('#yeastGrid').jqxGrid('getrows'); - var waterrow = $('#waterGrid').jqxGrid('getrows'); var mashrow = $('#mashGrid').jqxGrid('getrows'); var row = { record: my_record, @@ -1839,15 +1915,34 @@ sparge_temp: parseFloat($("#sparge_temp").jqxNumberInput('decimal')), sparge_ph: parseFloat($("#sparge_ph").jqxNumberInput('decimal')), sparge_volume: parseFloat($("#sparge_volume").jqxNumberInput('decimal')), - sparge_acid_type: $("#sparge_acid_type").val(), - sparge_acid_perc: parseFloat($("#sparge_acid_perc").jqxNumberInput('decimal')), - sparge_acid_amount: parseFloat($("#sparge_acid_amount").jqxNumberInput('decimal')), + // sparge_acid_type: $("#sparge_acid_type").val(), + // sparge_acid_perc: parseFloat($("#sparge_acid_perc").jqxNumberInput('decimal')), + // sparge_acid_amount: parseFloat($("#sparge_acid_amount").jqxNumberInput('decimal')), calc_acid: $("#calc_acid").val(), + w1_name: $("#w1_name").val(), + w1_amount: parseFloat($("#w1_amount").jqxNumberInput('decimal')), + w1_calcium: parseFloat($("#w1_calcium").jqxNumberInput('decimal')), + w1_sulfate: parseFloat($("#w1_sulfate").jqxNumberInput('decimal')), + w1_chloride: parseFloat($("#w1_chloride").jqxNumberInput('decimal')), + w1_sodium: parseFloat($("#w1_sodium").jqxNumberInput('decimal')), + w1_magnesium: parseFloat($("#w1_magnesium").jqxNumberInput('decimal')), + w1_total_alkalinity: parseFloat($("#w1_total_alkalinity").jqxNumberInput('decimal')), + w1_ph: parseFloat($("#w1_ph").jqxNumberInput('decimal')), + w1_cost: dataRecord.w1_cost, + w2_name: $("#w2_name").val(), + w2_amount: parseFloat($("#w2_amount").jqxNumberInput('decimal')), + w2_calcium: parseFloat($("#w2_calcium").jqxNumberInput('decimal')), + w2_sulfate: parseFloat($("#w2_sulfate").jqxNumberInput('decimal')), + w2_chloride: parseFloat($("#w2_chloride").jqxNumberInput('decimal')), + w2_sodium: parseFloat($("#w2_sodium").jqxNumberInput('decimal')), + w2_magnesium: parseFloat($("#w2_magnesium").jqxNumberInput('decimal')), + w2_total_alkalinity: parseFloat($("#w2_total_alkalinity").jqxNumberInput('decimal')), + w2_ph: parseFloat($("#w2_ph").jqxNumberInput('decimal')), + w2_cost: dataRecord.w2_cost, fermentables: fermentablerow, hops: hoprow, miscs: miscrow, yeasts: yeastrow, - waters: waterrow, mashs: mashrow }; var data = "update=true&" + $.param(row);