diff -r 4935e86b2775 -r ad31f4bd4036 www/js/prod_edit.js --- a/www/js/prod_edit.js Wed Nov 28 21:57:06 2018 +0100 +++ b/www/js/prod_edit.js Thu Nov 29 23:21:42 2018 +0100 @@ -47,6 +47,7 @@ $(document).ready(function () { var brewstage = 0; // Numeric value of stage + var this_uuid = ''; console.log("record:" + my_record + " return:" + my_return + " theme:" + theme); @@ -60,19 +61,22 @@ { name: 'batch_size', type: 'float' }, { name: 'tun_volume', type: 'float' }, { name: 'tun_weight', type: 'float' }, + { name: 'tun_specific_heat', type: 'float' }, + { name: 'tun_material', type: 'string' }, + { name: 'tun_height', type: 'float' }, + { name: 'top_up_water', type: 'float' }, { name: 'trub_chiller_loss', type: 'float' }, { name: 'evap_rate', type: 'float' }, { name: 'boil_time', type: 'float' }, - { name: 'lauter_deadspace', type: 'float' }, + { name: 'calc_boil_volume', type: 'bool' }, { name: 'top_up_kettle', type: 'float' }, { name: 'hop_utilization', type: 'float' }, { name: 'notes', type: 'string' }, { name: 'lauter_volume', type: 'float' }, + { name: 'lauter_height', type: 'float' }, + { name: 'lauter_deadspace', type: 'float' }, { name: 'kettle_volume', type: 'float' }, - { name: 'tun_material', type: 'string' }, - { name: 'tun_height', type: 'float' }, { name: 'kettle_height', type: 'float' }, - { name: 'lauter_height', type: 'float' }, { name: 'mash_volume', type: 'float' }, { name: 'efficiency', type: 'float' } ], @@ -102,19 +106,22 @@ $("#eq_batch_size").val(datarecord.batch_size); $("#eq_tun_volume").val(datarecord.tun_volume); $("#eq_tun_weight").val(datarecord.tun_weight); + $("#eq_tun_specific_heat").val(datarecord.tun_specific_heat); + $("#eq_tun_material").val(datarecord.tun_material); + $("#eq_tun_height").val(datarecord.tun_height); + $("#eq_top_up_water").val(datarecord.top_up_water); $("#eq_trub_chiller_loss").val(datarecord.trub_chiller_loss); $("#eq_evap_rate").val(datarecord.evap_rate); $("#eq_boil_time").val(datarecord.boil_time); - $("#eq_lauter_deadspace").val(datarecord.lauter_deadspace); + $("#eq_calc_boil_volume").val(datarecord.calc_boil_volume); $("#eq_top_up_kettle").val(datarecord.top_up_kettle); $("#eq_hop_utilization").val(datarecord.hop_utilization); $("#eq_notes").val(datarecord.notes); $("#eq_lauter_volume").val(datarecord.lauter_volume); + $("#eq_lauter_height").val(datarecord.lauter_height); + $("#eq_lauter_deadspace").val(datarecord.lauter_deadspace); $("#eq_kettle_volume").val(datarecord.kettle_volume); - $("#eq_tun_material").val(datarecord.tun_material); - $("#eq_tun_height").val(datarecord.tun_height); $("#eq_kettle_height").val(datarecord.kettle_height); - $("#eq_lauter_height").val(datarecord.lauter_height); $("#eq_mash_volume").val(datarecord.mash_volume); $("#eq_efficiency").val(datarecord.efficiency); } @@ -170,19 +177,22 @@ { name: 'eq_batch_size', type: 'float' }, { name: 'eq_tun_volume', type: 'float' }, { name: 'eq_tun_weight', type: 'float' }, + { name: 'eq_tun_specific_heat', type: 'float' }, + { name: 'eq_tun_material', type: 'string' }, + { name: 'eq_tun_height', type: 'float' }, + { name: 'eq_top_up_water', type: 'float' }, { name: 'eq_trub_chiller_loss', type: 'float' }, { name: 'eq_evap_rate', type: 'float' }, { name: 'eq_boil_time', type: 'float' }, - { name: 'eq_lauter_deadspace', type: 'float' }, + { name: 'eq_calc_boil_volume', type: 'bool' }, { name: 'eq_top_up_kettle', type: 'float' }, { name: 'eq_hop_utilization', type: 'float' }, { name: 'eq_notes', type: 'string' }, { name: 'eq_lauter_volume', type: 'float' }, + { name: 'eq_lauter_height', type: 'float' }, + { name: 'eq_lauter_deadspace', type: 'float' }, { name: 'eq_kettle_volume', type: 'float' }, - { name: 'eq_tun_material', type: 'string' }, - { name: 'eq_tun_height', type: 'float' }, - { name: 'eq_kettle_height', type: 'float' }, - { name: 'eq_lauter_height', type: 'float' }, + { name: 'eq_kettle_height', type: 'float' }, { name: 'eq_mash_volume', type: 'float' }, { name: 'eq_efficiency', type: 'float' }, { name: 'brew_date_start', type: 'string' }, @@ -192,7 +202,9 @@ { name: 'brew_date_end', type: 'string' } ], id: 'record', +// data: "record=" + my_record, url: url + // url: url + '?record=' + my_record, }; // Load data and select one record. var dataAdapter = new $.jqx.dataAdapter(source, { @@ -200,6 +212,7 @@ var records = dataAdapter.records; dataRecord = records[0]; // Hidden record uuid + this_uuid = dataRecord.uuid; $("#name").val(dataRecord.name); $("#code").val(dataRecord.code); $("#birth").val(dataRecord.birth); @@ -210,23 +223,26 @@ $("#inventory_reduced").val(dataRecord.inventory_reduced); $("#locked").val(dataRecord.locked); $("#eq_name").val(dataRecord.eq_name); + $("#eq_notes").val(dataRecord.eq_notes); $("#eq_boil_size").val(dataRecord.eq_boil_size); $("#eq_batch_size").val(dataRecord.eq_batch_size); $("#eq_tun_volume").val(dataRecord.eq_tun_volume); $("#eq_tun_weight").val(dataRecord.eq_tun_weight); + $("#eq_tun_specific_heat").val(dataRecord.eq_tun_specific_heat); + $("#eq_tun_material").val(dataRecord.eq_tun_material); + $("#eq_tun_height").val(dataRecord.eq_tun_height); + $("#eq_top_up_water").val(dataRecord.eq_top_up_water); $("#eq_trub_chiller_loss").val(dataRecord.eq_trub_chiller_loss); $("#eq_evap_rate").val(dataRecord.eq_evap_rate); $("#eq_boil_time").val(dataRecord.eq_boil_time); - $("#eq_lauter_deadspace").val(dataRecord.eq_lauter_deadspace); + $("#eq_calc_boil_volume").val(dataRecord.eq_calc_boil_volume); $("#eq_top_up_kettle").val(dataRecord.eq_top_up_kettle); $("#eq_hop_utilization").val(dataRecord.eq_hop_utilization); - $("#eq_notes").val(dataRecord.eq_notes); $("#eq_lauter_volume").val(dataRecord.eq_lauter_volume); + $("#eq_lauter_height").val(dataRecord.eq_lauter_height); + $("#eq_lauter_deadspace").val(dataRecord.eq_lauter_deadspace); $("#eq_kettle_volume").val(dataRecord.eq_kettle_volume); - $("#eq_tun_material").val(dataRecord.eq_tun_material); - $("#eq_tun_height").val(dataRecord.eq_tun_height); $("#eq_kettle_height").val(dataRecord.eq_kettle_height); - $("#eq_lauter_height").val(dataRecord.eq_lauter_height); $("#eq_mash_volume").val(dataRecord.eq_mash_volume); $("#eq_efficiency").val(dataRecord.eq_efficiency); $("#brew_date_start").val(dataRecord.brew_date_start); @@ -318,19 +334,22 @@ $("#eq_batch_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); $("#eq_tun_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); $("#eq_tun_weight").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 2 }); + $("#eq_tun_specific_heat").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 3 }); + $("#eq_tun_material").jqxInput({ theme: theme, width: 100, height: 23 }); + $("#eq_tun_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); + $("#eq_top_up_water").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); $("#eq_trub_chiller_loss").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); $("#eq_evap_rate").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 2, }); $("#eq_boil_time").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 }); - $("#eq_lauter_deadspace").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); + $("#eq_calc_boil_volume").jqxCheckBox({ theme: theme, width: 120, height: 23 }); $("#eq_top_up_kettle").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); $("#eq_hop_utilization").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 }); $("#eq_notes").jqxInput({ theme: theme, width: 640, height: 100 }); $("#eq_lauter_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); + $("#eq_lauter_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); + $("#eq_lauter_deadspace").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); $("#eq_kettle_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); - $("#eq_tun_material").jqxInput({ theme: theme, width: 100, height: 23 }); - $("#eq_tun_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); $("#eq_kettle_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); - $("#eq_lauter_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); $("#eq_mash_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); $("#eq_efficiency").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); @@ -385,7 +404,7 @@ $("#Save").click(function () { var row = { record: my_record, - uuid: $("#uuid").val(), + uuid: this_uuid, name: $("#name").val(), code: $("#code").val(), birth: $("#birth").val(), @@ -400,19 +419,22 @@ eq_batch_size: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')), eq_tun_volume: parseFloat($("#eq_tun_volume").jqxNumberInput('decimal')), eq_tun_weight: parseFloat($("#eq_tun_weight").jqxNumberInput('decimal')), + eq_tun_specific_heat: parseFloat($("#eq_tun_specific_heat").jqxNumberInput('decimal')), + eq_tun_material: $("#eq_tun_material").val(), + eq_tun_height: parseFloat($("#eq_tun_height").jqxNumberInput('decimal')), + eq_top_up_water: parseFloat($("#eq_top_up_water").jqxNumberInput('decimal')), eq_trub_chiller_loss: parseFloat($("#eq_trub_chiller_loss").jqxNumberInput('decimal')), eq_evap_rate: parseFloat($("#eq_evap_rate").jqxNumberInput('decimal')), eq_boil_time: parseFloat($("#eq_boil_time").jqxNumberInput('decimal')), - eq_lauter_deadspace: parseFloat($("#eq_lauter_deadspace").jqxNumberInput('decimal')), + eq_calc_boil_volume: $("#eq_calc_boil_volume").val(), eq_top_up_kettle: parseFloat($("#eq_top_up_kettle").jqxNumberInput('decimal')), eq_hop_utilization: parseFloat($("#eq_hop_utilization").jqxNumberInput('decimal')), eq_notes: $("#eq_notes").val(), eq_lauter_volume: parseFloat($("#eq_lauter_volume").jqxNumberInput('decimal')), + eq_lauter_height: parseFloat($("#eq_lauter_height").jqxNumberInput('decimal')), + eq_lauter_deadspace: parseFloat($("#eq_lauter_deadspace").jqxNumberInput('decimal')), eq_kettle_volume: parseFloat($("#eq_kettle_volume").jqxNumberInput('decimal')), - eq_tun_material: $("#eq_tun_material").val(), - eq_tun_height: parseFloat($("#eq_tun_height").jqxNumberInput('decimal')), eq_kettle_height: parseFloat($("#eq_kettle_height").jqxNumberInput('decimal')), - eq_lauter_height: parseFloat($("#eq_lauter_height").jqxNumberInput('decimal')), eq_mash_volume: parseFloat($("#eq_mash_volume").jqxNumberInput('decimal')), eq_efficiency: parseFloat($("#eq_efficiency").jqxNumberInput('decimal')) };