www/js/prod_edit.js

changeset 457
b9055393b802
parent 456
00b199dccf72
child 458
47b592993dd5
equal deleted inserted replaced
456:00b199dccf72 457:b9055393b802
344 var row = rows[i]; 344 var row = rows[i];
345 if (row.y_use == 0) { // Primary 345 if (row.y_use == 0) { // Primary
346 if (parseFloat(row.y_attenuation) > svg) 346 if (parseFloat(row.y_attenuation) > svg)
347 svg = parseFloat(row.y_attenuation); // Take the highest if multiple yeasts. 347 svg = parseFloat(row.y_attenuation); // Take the highest if multiple yeasts.
348 if (row.y_form == 0) 348 if (row.y_form == 0)
349 initcells += (parseFloat(row.y_cells) / 1000000000) * parseFloat(row.y_amount); 349 initcells += (parseFloat(row.y_cells) / 1000000000) * parseFloat(row.y_amount) * (dataRecord.starter_viability / 100);
350 else 350 else
351 initcells += (parseFloat(row.y_cells) / 1000000) * parseFloat(row.y_amount); 351 initcells += (parseFloat(row.y_cells) / 1000000) * parseFloat(row.y_amount);
352 } 352 }
353 // TODO: brett in secondary ?? 353 // TODO: brett in secondary ??
354 if ((((dataRecord.inventory_reduced <= 3) && (row.y_use == 0)) || // Primary 354 if ((((dataRecord.inventory_reduced <= 3) && (row.y_use == 0)) || // Primary
2010 $("#sparge_acid_perc").jqxNumberInput({ spinButtons: false, readOnly: true, width: false }); 2010 $("#sparge_acid_perc").jqxNumberInput({ spinButtons: false, readOnly: true, width: false });
2011 $("#starter_enable").jqxCheckBox({ disabled: true }); 2011 $("#starter_enable").jqxCheckBox({ disabled: true });
2012 $("#starter_type").jqxDropDownList({ disabled: true }); 2012 $("#starter_type").jqxDropDownList({ disabled: true });
2013 $("#starter_try").jqxButton({ disabled: true }); 2013 $("#starter_try").jqxButton({ disabled: true });
2014 $("#starter_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 2014 $("#starter_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
2015 $("#starter_viability").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
2015 } 2016 }
2016 if (dataRecord.stage > 3) { // Primary fermentation done 2017 if (dataRecord.stage > 3) { // Primary fermentation done
2017 $("#brew_date_start").jqxDateTimeInput({ disabled: true }); 2018 $("#brew_date_start").jqxDateTimeInput({ disabled: true });
2018 $("#brew_date_end").jqxDateTimeInput({ disabled: true }); 2019 $("#brew_date_end").jqxDateTimeInput({ disabled: true });
2019 $("#brew_mash_ph").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 2020 $("#brew_mash_ph").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
2101 if (dataRecord.starter_enable) { 2102 if (dataRecord.starter_enable) {
2102 $("#propagator").show(); 2103 $("#propagator").show();
2103 $("#starter_type").jqxDropDownList( {disabled: false }); 2104 $("#starter_type").jqxDropDownList( {disabled: false });
2104 $("#starter_try").jqxButton({ disabled: false }); 2105 $("#starter_try").jqxButton({ disabled: false });
2105 $("#starter_sg").jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 }); 2106 $("#starter_sg").jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 });
2107 $("#starter_viability").jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 });
2106 } else { 2108 } else {
2107 $("#propagator").hide(); 2109 $("#propagator").hide();
2108 $("#starter_type").jqxDropDownList( {disabled: true }); 2110 $("#starter_type").jqxDropDownList( {disabled: true });
2109 $("#starter_try").jqxButton({ disabled: true }); 2111 $("#starter_try").jqxButton({ disabled: true });
2110 $("#starter_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 2112 $("#starter_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
2113 $("#starter_viability").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
2111 } 2114 }
2112 } 2115 }
2113 2116
2114 function calcInit () { 2117 function calcInit () {
2115 console.log("calcInit()"); 2118 console.log("calcInit()");
2146 if (event.args) { 2149 if (event.args) {
2147 dataRecord.starter_sg = event.args.value; 2150 dataRecord.starter_sg = event.args.value;
2148 calcYeast(); 2151 calcYeast();
2149 } 2152 }
2150 }); 2153 });
2154 $('#starter_viability').on('change', function (event) {
2155 if (event.args) {
2156 dataRecord.starter_viability = event.args.value;
2157 calcFermentables();
2158 calcYeast();
2159 }
2160 });
2151 $('#prop1_type').on('change', function (event) { 2161 $('#prop1_type').on('change', function (event) {
2152 if (event.args) { 2162 if (event.args) {
2153 var index = event.args.index; 2163 var index = event.args.index;
2154 dataRecord.prop1_type = index; 2164 dataRecord.prop1_type = index;
2155 calcYeast(); 2165 calcYeast();
2838 wa_acid_perc: parseFloat($("#wa_acid_perc").jqxNumberInput('decimal')), 2848 wa_acid_perc: parseFloat($("#wa_acid_perc").jqxNumberInput('decimal')),
2839 wa_base_name: $("#wa_base_name").val(), 2849 wa_base_name: $("#wa_base_name").val(),
2840 starter_enable: dataRecord.starter_enable, 2850 starter_enable: dataRecord.starter_enable,
2841 starter_type: $("#starter_type").val(), 2851 starter_type: $("#starter_type").val(),
2842 starter_sg: parseFloat($("#starter_sg").jqxNumberInput('decimal')), 2852 starter_sg: parseFloat($("#starter_sg").jqxNumberInput('decimal')),
2853 starter_viability: parseFloat($("#starter_viability").jqxNumberInput('decimal')),
2843 prop1_type: $("#prop1_type").val(), 2854 prop1_type: $("#prop1_type").val(),
2844 prop1_volume: parseFloat($("#prop1_volume").jqxNumberInput('decimal')), 2855 prop1_volume: parseFloat($("#prop1_volume").jqxNumberInput('decimal')),
2845 prop2_type: $("#prop2_type").val(), 2856 prop2_type: $("#prop2_type").val(),
2846 prop2_volume: parseFloat($("#prop2_volume").jqxNumberInput('decimal')), 2857 prop2_volume: parseFloat($("#prop2_volume").jqxNumberInput('decimal')),
2847 prop3_type: $("#prop3_type").val(), 2858 prop3_type: $("#prop3_type").val(),
3064 { name: 'wa_acid_perc', type: 'int' }, 3075 { name: 'wa_acid_perc', type: 'int' },
3065 { name: 'wa_base_name', type: 'int' }, 3076 { name: 'wa_base_name', type: 'int' },
3066 { name: 'starter_enable', type: 'int' }, 3077 { name: 'starter_enable', type: 'int' },
3067 { name: 'starter_type', type: 'int' }, 3078 { name: 'starter_type', type: 'int' },
3068 { name: 'starter_sg', type: 'float' }, 3079 { name: 'starter_sg', type: 'float' },
3080 { name: 'starter_viability', type: 'int' },
3069 { name: 'prop1_type', type: 'int' }, 3081 { name: 'prop1_type', type: 'int' },
3070 { name: 'prop1_volume', type: 'float' }, 3082 { name: 'prop1_volume', type: 'float' },
3071 { name: 'prop2_type', type: 'int' }, 3083 { name: 'prop2_type', type: 'int' },
3072 { name: 'prop2_volume', type: 'float' }, 3084 { name: 'prop2_volume', type: 'float' },
3073 { name: 'prop3_type', type: 'int' }, 3085 { name: 'prop3_type', type: 'int' },
3285 $("#wa_acid_perc").val(dataRecord.wa_acid_perc); 3297 $("#wa_acid_perc").val(dataRecord.wa_acid_perc);
3286 $("#wa_base_name").val(dataRecord.wa_base_name); 3298 $("#wa_base_name").val(dataRecord.wa_base_name);
3287 $("#starter_enable").val(dataRecord.starter_enable); 3299 $("#starter_enable").val(dataRecord.starter_enable);
3288 $("#starter_type").val(dataRecord.starter_type); 3300 $("#starter_type").val(dataRecord.starter_type);
3289 $("#starter_sg").val(dataRecord.starter_sg); 3301 $("#starter_sg").val(dataRecord.starter_sg);
3302 $("#starter_viability").val(dataRecord.starter_viability);
3290 $("#prop1_type").val(dataRecord.prop1_type); 3303 $("#prop1_type").val(dataRecord.prop1_type);
3291 $("#prop1_volume").val(dataRecord.prop1_volume); 3304 $("#prop1_volume").val(dataRecord.prop1_volume);
3292 $("#prop2_type").val(dataRecord.prop2_type); 3305 $("#prop2_type").val(dataRecord.prop2_type);
3293 $("#prop2_volume").val(dataRecord.prop2_volume); 3306 $("#prop2_volume").val(dataRecord.prop2_volume);
3294 $("#prop3_type").val(dataRecord.prop3_type); 3307 $("#prop3_type").val(dataRecord.prop3_type);
5262 width: 120, 5275 width: 120,
5263 height: 23, 5276 height: 23,
5264 autoDropDownHeight: true 5277 autoDropDownHeight: true
5265 }); 5278 });
5266 $("#starter_sg").jqxNumberInput( SGopts ); 5279 $("#starter_sg").jqxNumberInput( SGopts );
5280 $("#starter_viability").jqxNumberInput( Perc0 );
5267 $("#starter_try").jqxButton({ template: "primary", width: '100px', height: 23, theme: theme }); 5281 $("#starter_try").jqxButton({ template: "primary", width: '100px', height: 23, theme: theme });
5268 5282
5269 // Tab 7, Mashing 5283 // Tab 7, Mashing
5270 $("#mash_name").jqxTooltip({ content: 'De omschrijving van dit maisch profiel.' }); 5284 $("#mash_name").jqxTooltip({ content: 'De omschrijving van dit maisch profiel.' });
5271 $("#mash_name").jqxInput({ theme: theme, width: 320, height: 23 }); 5285 $("#mash_name").jqxInput({ theme: theme, width: 320, height: 23 });

mercurial