# HG changeset patch # User Michiel Broek # Date 1659708425 -7200 # Node ID 506246d65043fd18246af2f2f043ec938546e2c6 # Parent bd20a8329b1b70a252cf9541f83b6285c17056f3 Tab 6 is a viewer diff -r bd20a8329b1b -r 506246d65043 www/js/prod_edit.js --- a/www/js/prod_edit.js Fri Aug 05 15:10:54 2022 +0200 +++ b/www/js/prod_edit.js Fri Aug 05 16:07:05 2022 +0200 @@ -35,30 +35,6 @@ cancelButton: $('#volumeReady') }); - $('#pitchrateWindow').jqxWindow({ - theme: theme, - position: { x: 330, y: 210 }, - width: 600, - height: 200, - resizable: false, - isModal: true, - modalOpacity: 0.4, - autoOpen: false, - cancelButton: $('#pitchrateReady') - }); - - $('#popupYeast').jqxWindow({ - width: 800, - height: 300, - position: { x: 230, y: 100 }, - resizable: false, - theme: theme, - isModal: true, - autoOpen: false, - cancelButton: $('#YeastReady'), - modalOpacity: 0.40 - }); - $('#popupMash').jqxWindow({ width: 800, height: 400, @@ -671,18 +647,18 @@ $('#wb_ph').val(dataRecord.wb_ph); $('#wa_acid_name').val(dataRecord.wa_acid_name); $('#wa_acid_perc').val(dataRecord.wa_acid_perc); - $('#starter_type').val(dataRecord.starter_type); + $('#starter_type').val(StarterTypeData[dataRecord.starter_type].nl); $('#starter_sg').val(dataRecord.starter_sg); $('#starter_viability').val(dataRecord.starter_viability); $('#yeast_prod_date').val(dataRecord.yeast_prod_date); $('#yeast_pitchrate').val(dataRecord.yeast_pitchrate); - $('#prop1_type').val(dataRecord.prop1_type); + $('#prop1_type').val(StarterTypeData[dataRecord.prop1_type].nl); $('#prop1_volume').val(dataRecord.prop1_volume); - $('#prop2_type').val(dataRecord.prop2_type); + $('#prop2_type').val(StarterTypeData[dataRecord.prop2_type].nl); $('#prop2_volume').val(dataRecord.prop2_volume); - $('#prop3_type').val(dataRecord.prop3_type); + $('#prop3_type').val(StarterTypeData[dataRecord.prop3_type].nl); $('#prop3_volume').val(dataRecord.prop3_volume); - $('#prop4_type').val(dataRecord.prop4_type); + $('#prop4_type').val(StarterTypeData[dataRecord.prop4_type].nl); $('#prop4_volume').val(dataRecord.prop4_volume); $('#divide_type').val(SplitData[dataRecord.divide_type].nl); if (dataRecord.divide_type > 0) @@ -1075,9 +1051,6 @@ { name: 'y_sg_hi', type: 'float' }, { name: 'y_avail', type: 'int' } ], - addrow: function(rowid, rowdata, position, commit) { commit(true); }, - deleterow: function(rowid, commit) { commit(true); }, - updaterow: function(rowid, rowdata, commit) { commit(true); } }, yeastAdapter = new $.jqx.dataAdapter(yeastSource); @@ -1086,91 +1059,7 @@ height: 325, source: yeastAdapter, theme: theme, - selectionmode: 'singlerow', - showtoolbar: true, - rendertoolbar: function(toolbar) { - var container = $('
'); - toolbar.append(container); - container.append('
'); - container.append('
In voorraad:
'); - container.append('
'); - container.append(''); - // add yeast from dropdownlist. - $('#yaddrowbutton').jqxDropDownList({ - placeHolder: 'Kies gist:', - theme: theme, - source: yeastlist, - disabled: (dataRecord.stage > 6), - template: 'primary', - displayMember: 'name', - width: 150, - height: 27, - dropDownWidth: 500, - dropDownHeight: 500, - renderer: function(index, label, value) { - var datarecord = yeastlist.records[index]; - return datarecord.laboratory + ' ' + datarecord.product_id + ' ' + datarecord.name; - } - }); - $('#yaddrowbutton').on('select', function(event) { - if (event.args) { - var datarecord, row = {}, index = event.args.index; - datarecord = yeastlist.records[index]; - row['y_name'] = datarecord.name; - row['y_laboratory'] = datarecord.laboratory; - row['y_product_id'] = datarecord.product_id; - row['y_type'] = datarecord.type; - row['y_form'] = datarecord.form; - row['y_amount'] = 0; - row['y_cost'] = datarecord.cost; - row['y_use'] = minimum_yeast(dataRecord.stage, 0); - row['y_min_temperature'] = datarecord.min_temperature; - row['y_max_temperature'] = datarecord.max_temperature; - row['y_attenuation'] = datarecord.attenuation; - row['y_flocculation'] = datarecord.flocculation; - row['y_cells'] = datarecord.cells; - row['y_tolerance'] = datarecord.tolerance; - row['y_inventory'] = datarecord.inventory; - row['y_sta1'] = datarecord.sta1; - row['y_bacteria'] = datarecord.bacteria; - row['y_harvest_top'] = datarecord.harvest_top; - row['y_harvest_time'] = datarecord.harvest_time; - row['y_pitch_temperature'] = datarecord.pitch_temperature; - row['y_pofpos'] = datarecord.pofpos; - row['y_zymocide'] = datarecord.zymocide; - row['y_gr_hl_lo'] = datarecord.gr_hl_lo; - row['y_sg_lo'] = datarecord.sg_lo; - row['y_gr_hl_hi'] = datarecord.gr_hl_hi; - row['y_sg_hi'] = datarecord.sg_hi; - $('#yeastGrid').jqxGrid('addrow', null, row); - } - calcViability(); - calcYeast(); - $('#yaddrowbutton').jqxDropDownList('clearSelection'); - }); - $('#yinstockbutton').jqxCheckBox({ theme: theme, height: 27, disabled: (dataRecord.stage > 6) }); - $('#yinstockbutton').on('change', function(event) { - yeastinstock = event.args.checked; - yeastlist.dataBind(); - }); - // delete selected yeast. - $('#ydeleterowbutton').jqxButton({ template: 'danger', theme: theme, height: 27, width: 150, disabled: (dataRecord.stage > 6) }); - $('#ydeleterowbutton').on('click', function() { - var id, rowscount, selectedrowindex = $('#yeastGrid').jqxGrid('getselectedrowindex'); - rowscount = $('#yeastGrid').jqxGrid('getdatainformation').rowscount; - if (selectedrowindex >= 0 && selectedrowindex < rowscount) { - use = $('#yeastGrid').jqxGrid('getcellvalue', selectedrowindex, 'y_use'); - if (block_yeast(dataRecord.stage, use)) { - alert('Ingredieënt is al verwerkt.'); - } else { - id = $('#yeastGrid').jqxGrid('getrowid', selectedrowindex); - $('#yeastGrid').jqxGrid('deleterow', id); - calcViability(); - calcYeast(); - } - } - }); - }, + editable: false, ready: function() { $('#jqxTabs').jqxTabs('next'); }, columns: [ { text: 'Gist', datafield: 'y_name' }, @@ -1225,40 +1114,6 @@ return ''; } } - }, - { text: '', datafield: 'Edit', columntype: 'button', width: 90, align: 'center', - cellsrenderer: function() { - return 'Wijzig'; - }, buttonclick: function(row) { - yeastRow = row; - yeastData = $('#yeastGrid').jqxGrid('getrowdata', yeastRow); - if (block_yeast(dataRecord.stage, yeastData.y_use)) { - alert('Ingredieënt is al verwerkt.'); - } else { - if (yeastData.y_form == 0) { - $('#wy_pmpt_amount').html('Pak(ken):'); - $('#wy_amount').val(yeastData.y_amount); - $('#wy_amount').jqxNumberInput({ decimalDigits: 0 }); - } else if (yeastData.y_form == 1 || yeastData.y_form == 6) { - $('#wy_pmpt_amount').html('Gewicht gram:'); - $('#wy_amount').val(yeastData.y_amount * 1000); - $('#wy_amount').jqxNumberInput({ decimalDigits: 1 }); - } else { - $('#wy_pmpt_amount').html('Volume ml:'); - $('#wy_amount').val(yeastData.y_amount * 1000); - $('#wy_amount').jqxNumberInput({ decimalDigits: 0 }); - } - $('#wy_name').val(yeastData.y_name); - $('#wy_laboratory').val(yeastData.y_laboratory); - $('#wy_product_id').val(yeastData.y_product_id); - $('#wy_use').val(yeastData.y_use); - drop_endis(dataRecord.stage > 3, '#wy_use', 0); - drop_endis(dataRecord.stage > 4, '#wy_use', 1); - drop_endis(dataRecord.stage > 5, '#wy_use', 2); - // show the popup window. - $('#popupYeast').jqxWindow('open'); - } - } } ] }); @@ -2426,6 +2281,7 @@ } if (dataRecord.starter_enable) { + calcSteps(dataRecord.starter_type, initcells, needed); for (i = 1; i < 5; i++) { @@ -3369,12 +3225,6 @@ $('#sparge_source').jqxDropDownList(onval); $('#sparge_acid_type').jqxDropDownList(onval); $('#sparge_acid_perc').jqxNumberInput(spinstate); - $('#starter_type').jqxDropDownList(onval); - $('#starter_try').jqxButton(onval); - $('#starter_sg').jqxNumberInput(spinstate); - $('#yeast_prod_date').jqxDateTimeInput(onval); - $('#yeast_pitchrate').jqxNumberInput(spinstate); - $('#but_pickpitchrate').jqxButton(onval); } function en_stage_afterprimary(istate) { @@ -3557,14 +3407,8 @@ if (dataRecord.starter_enable) { $('#propagator').show(); - $('#starter_type').jqxDropDownList({ disabled: false }); - $('#starter_try').jqxButton({ disabled: false }); - $('#starter_sg').jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 }); } else { $('#propagator').hide(); - $('#starter_type').jqxDropDownList({ disabled: true }); - $('#starter_try').jqxButton({ disabled: true }); - $('#starter_sg').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); } } @@ -3574,75 +3418,6 @@ calcEfficiencyBeforeBoil(); calcEfficiencyAfterBoil(); - $('#starter_try').click(function() { - $('#prop1_volume').val(0); - $('#prop2_volume').val(0); - $('#prop3_volume').val(0); - $('#prop4_volume').val(0); - dataRecord.prop1_volume = dataRecord.prop2_volume = dataRecord.prop3_volume = dataRecord.prop4_volume = 0; - calcYeast(); - }); - $('#starter_type').on('change', function(event) { - if (event.args) { - dataRecord.starter_type = event.args.index; - calcYeast(); - } - }); - $('#starter_sg').on('change', function(event) { - if (event.args) { - dataRecord.starter_sg = event.args.value; - calcYeast(); - } - }); - $('#prop1_type').on('change', function(event) { - if (event.args) { - dataRecord.prop1_type = event.args.index; - calcYeast(); - } - }); - $('#prop1_volume').on('change', function(event) { - if (event.args) { - dataRecord.prop1_volume = event.args.value; - calcYeast(); - } - }); - $('#prop2_type').on('change', function(event) { - if (event.args) { - dataRecord.prop2_type = event.args.index; - calcYeast(); - } - }); - $('#prop2_volume').on('change', function(event) { - if (event.args) { - dataRecord.prop2_volume = event.args.value; - calcYeast(); - } - }); - $('#prop3_type').on('change', function(event) { - if (event.args) { - dataRecord.prop3_type = event.args.index; - calcYeast(); - } - }); - $('#prop3_volume').on('change', function(event) { - if (event.args) { - dataRecord.prop3_volume = event.args.value; - calcYeast(); - } - }); - $('#prop4_type').on('change', function(event) { - if (event.args) { - dataRecord.prop4_type = event.args.index; - calcYeast(); - } - }); - $('#prop4_volume').on('change', function(event) { - if (event.args) { - dataRecord.prop4_volume = event.args.value; - calcYeast(); - } - }); - $('#calc_acid').on('checked', function(event) { dataRecord.calc_acid = 1; calcWater(); @@ -4147,171 +3922,8 @@ $('#yeast_gr_hl').jqxNumberInput(Show1dec); $('#yeast_cells,#need_cells').jqxNumberInput(Show1dec); $('#yeast_prod_date').jqxDateTimeInput(Dateopts); - $('#yeast_prod_date').on('close', function(event) { - calcViability(); - calcFermentables(); - calcYeast(); - }); - $('#yeast_pitchrate').jqxNumberInput(Spin3dec); - $('#yeast_pitchrate').on('change', function(event) { - dataRecord.yeast_pitchrate = parseFloat(event.args.value); - calcViability(); - calcFermentables(); - calcYeast(); - }); - $('#but_pickpitchrate').jqxButton({ template: 'success', width: '23px', height: 23, theme: theme }); - $('#but_pickpitchrate').bind('click', function() { - $('#pick_pitchrate').val(0); // Set default pick incase no perfect match. - $('#pick_pitchrate').val(dataRecord.yeast_pitchrate); - $('#pitchrateWindow').jqxWindow('open'); - }); - $('#pick_pitchrate').jqxDropDownList({ - theme: theme, - source: PitchrateAdapter, - valueMember: 'rate', - displayMember: 'nl', - width: 275, - height: 23, - autoDropDownHeight: true, - dropDownVerticalAlignment: 'top' - }); - $('#pitchrateReady').jqxButton({ template: 'success', width: '90px', theme: theme }); - $('#pitchrateReady').click(function() { - console.log('pitchrateReady ' + $('#pick_pitchrate').val() ); - dataRecord.yeast_pitchrate = parseFloat($('#pick_pitchrate').val()); - $('#yeast_pitchrate').val(dataRecord.yeast_pitchrate); - calcViability(); - calcFermentables(); - calcYeast(); - }); - $('#YeastReady').jqxButton({ template: 'success', width: '90px', theme: theme }); - $('#YeastReady').click(function() { - var row, rowID = $('#yeastGrid').jqxGrid('getrowid', yeastRow); - console.log('YeastReady row:' + yeastRow + ' ID:' + rowID); - row = { - y_name: yeastData.y_name, - y_laboratory: yeastData.y_laboratory, - y_product_id: yeastData.y_product_id, - y_amount: yeastData.y_amount, - y_cost: yeastData.y_cost, - y_type: yeastData.y_type, - y_form: yeastData.y_form, - y_flocculation: yeastData.y_flocculation, - y_min_temperature: yeastData.y_min_temperature, - y_max_temperature: yeastData.y_max_temperature, - y_attenuation: yeastData.y_attenuation, - y_use: yeastData.y_use, - y_cells: yeastData.y_cells, - y_tolerance: yeastData.y_tolerance, - y_inventory: yeastData.y_inventory, - y_sta1: yeastData.y_sta1, - y_bacteria: yeastData.y_bacteria, - y_harvest_top: yeastData.y_harvest_top, - y_harvest_time: yeastData.y_harvest_time, - y_pitch_temperature: yeastData.y_pitch_temperature, - y_pofpos: yeastData.y_pofpos, - y_zymocide: yeastData.y_zymocide, - y_gr_hl_lo: yeastData.y_gr_hl_lo, - y_sg_lo: yeastData.y_sg_lo, - y_gr_hl_hi: yeastData.y_gr_hl_hi, - y_sg_hi: yeastData.y_sg_hi, - y_avail: yeastData.y_avail - }; - $('#yeastGrid').jqxGrid('updaterow', rowID, row); - calcViability(); - calcFermentables(); - calcYeast(); - }); - $('#wy_name,#wy_laboratory,#wy_product_id').jqxInput({ theme: theme, width: 320, height: 23 }); - $('#wy_instock').jqxCheckBox({ theme: theme, height: 23 }); - $('#wy_instock').on('change', function(event) { - yeastinstock = event.args.checked; - yeastlist.dataBind(); - }); - $('#wy_select').jqxDropDownList({ - placeHolder: 'Kies gist:', - theme: theme, - source: yeastlist, - displayMember: 'name', - width: 150, - height: 23, - dropDownWidth: 500, - dropDownHeight: 500, - renderer: function(index, label, value) { - var datarecord = yeastlist.records[index]; - return datarecord.laboratory + ' ' + datarecord.product_id + ' ' + datarecord.name; - } - }); - $('#wy_select').on('select', function(event) { - if (event.args) { - var datarecord, index = event.args.index; - datarecord = yeastlist.records[index]; - $('#wy_name').val(datarecord.name); - $('#wy_laboratory').val(datarecord.laboratory); - $('#wy_product_id').val(datarecord.product_id); - yeastData.y_name = datarecord.name; - yeastData.y_cost = datarecord.cost; - yeastData.y_type = datarecord.type; - yeastData.y_form = datarecord.form; - yeastData.y_laboratory = datarecord.laboratory; - yeastData.y_product_id = datarecord.product_id; - yeastData.y_min_temperature = datarecord.min_temperature; - yeastData.y_max_temperature = datarecord.max_temperature; - yeastData.y_flocculation = datarecord.flocculation; - yeastData.y_attenuation = datarecord.attenuation; - yeastData.y_cells = datarecord.cells; - yeastData.y_inventory = datarecord.inventory; - yeastData.y_sta1 = datarecord.sta1; - yeastData.y_bacteria = datarecord.bacteria; - yeastData.y_harvest_top = datarecord.harvest_top; - yeastData.y_harvest_time = datarecord.harvest_time; - yeastData.y_pitch_temperature = datarecord.pitch_temperature; - yeastData.y_pofpos = datarecord.pofpos; - yeastData.y_zymocide = datarecord.zymocide; - yeastData.y_gr_hl_lo = datarecord.gr_hl_lo; - yeastData.y_sg_lo = datarecord.sg_lo; - yeastData.y_gr_hl_hi = datarecord.gr_hl_hi; - yeastData.y_sg_hi = datarecord.sg_hi; - if (yeastData.y_form == 0) { - $('#wy_pmpt_amount').html('Pak(ken):'); - } else if (yeastData.y_form == 1 || yeastData.y_form == 6) { - $('#wy_pmpt_amount').html('Gewicht gram:'); - } else { - $('#wy_pmpt_amount').html('Volume ml:'); - } - calcViability(); - calcFermentables(); - calcYeast(); - } - }); - $('#wy_amount').jqxNumberInput(Spin1dec); - $('#wy_amount').on('change', function(event) { - var amount = parseFloat(event.args.value); - if (yeastData.y_form != 0) // not Liquid - amount = parseFloat(event.args.value) / 1000; - yeastData.y_amount = amount; - calcFermentables(); - calcYeast(); - }); - $('#wy_use').jqxDropDownList({ - theme: theme, - source: YeastUseAdapter, - valueMember: 'id', - displayMember: 'nl', - width: 180, - height: 23, - autoDropDownHeight: true, - dropDownVerticalAlignment: 'top' - }); - $('#wy_use').on('select', function(event) { - if (event.args) { - var index = event.args.index; - yeastData.y_use = index; - calcViability(); - calcFermentables(); - calcYeast(); - } - }); + $('#yeast_prod_date').jqxDateTimeInput({ disabled: true }); + $('#yeast_pitchrate').jqxNumberInput(Show3dec); for (i = 1; i < 5; i++) { $('#prop' + i + '_volume').jqxTooltip({ content: 'Het volume van deze starter stap.' }); $('#prop' + i + '_irate').jqxTooltip({ content: 'Voor de beste gistgroei, houd de injectie factor tussen de 25 en 100 miljoen cellen per ml.' }); @@ -4319,35 +3931,17 @@ $('#prop' + i + '_tcells').jqxTooltip({ content: 'Het totaal aantal miljard gistcellen na deze stap.' }); $('#prop' + i + '_growf').jqxTooltip({ content: 'De groeifactor, minstens 1. Ongeroerde starters komen meestal niet boven de 3.' }); - $('#prop' + i + '_type').jqxDropDownList({ - theme: theme, - source: StarterTypeAdapter, - valueMember: 'id', - displayMember: 'nl', - width: 120, - height: 23, - autoDropDownHeight: true - }); - $('#prop' + i + '_volume').jqxNumberInput(Spin3dec); + $('#prop' + i + '_type').jqxInput({ theme: theme, width: 120, height: 23 }); + $('#prop' + i + '_volume').jqxNumberInput(Show3dec); $('#prop' + i + '_irate,#prop' + i + '_ncells,#prop' + i + '_tcells').jqxNumberInput(Show1dec); $('#prop' + i + '_growf').jqxNumberInput(Show2dec); $('#prop' + i + '_type,#prop' + i + '_volume,#prop' + i + '_irate,#prop' + i + '_ncells,#prop' + i + '_tcells,#prop' + i + '_growf').hide(); } - $('#starter_type').jqxTooltip({ content: 'starter_type' }); - $('#starter_type').jqxDropDownList({ - theme: theme, - source: StarterTypeAdapter, - valueMember: 'id', - displayMember: 'nl', - width: 120, - height: 23, - autoDropDownHeight: true - }); + $('#starter_type').jqxInput({ theme: theme, width: 120, height: 23 }); $('#starter_sg').jqxTooltip({ content: 'Het ideale starter SG moet tussen de 1.030 en 1.040 zijn. Optimaal is 1.037.' }); - $('#starter_sg').jqxNumberInput(SGopts); + $('#starter_sg').jqxNumberInput(Show3dec); $('#starter_viability').jqxTooltip({ content: 'De gist conditie.' }); $('#starter_viability').jqxNumberInput(Show0dec); - $('#starter_try').jqxButton({ template: 'primary', width: '100px', height: 23, theme: theme }); // Tab 7, Mashing $('#mash_name').jqxTooltip({ content: 'De omschrijving van dit maisch profiel.' }); diff -r bd20a8329b1b -r 506246d65043 www/prod_edit.php --- a/www/prod_edit.php Fri Aug 05 15:10:54 2022 +0200 +++ b/www/prod_edit.php Fri Aug 05 16:07:05 2022 +0200 @@ -270,7 +270,7 @@ 1 -
Niet nodig
+
Niet nodig
@@ -279,7 +279,7 @@ 2 -
Niet nodig
+
Niet nodig
@@ -288,7 +288,7 @@ 3 -
Niet nodig
+
Niet nodig
@@ -297,7 +297,7 @@ 4 -
Niet nodig
+
Niet nodig
@@ -330,7 +330,7 @@ Pitch rate: -
+
Cellen nodig miljard: @@ -340,10 +340,10 @@ Pitch cellen/ml °P:
Starter type: -
+ Starter SG: -
- +
+        
@@ -913,47 +913,6 @@ -
-
Wijzig gist detail.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Gist naam:
Product code:
Leverancier:
Andere gist:
-
-
In voorraad:
-
-
Hoeveelheid:
Gebruik voor:
- -
-
-
-
Wijzig maisch stap detail.
@@ -1032,25 +991,6 @@
-
-
Kies een voorgedefinieerde pitchrate.
-
- - - - - - - - - - -
Pitchrate in miljard cellen/ml/°P:
- -
-
-
-