www/js/prod_edit.js

changeset 740
04c0e444e48e
parent 738
11e6bd8d8107
child 741
4ec5de404bc1
--- a/www/js/prod_edit.js	Thu Apr 15 13:10:21 2021 +0200
+++ b/www/js/prod_edit.js	Sun May 02 22:03:25 2021 +0200
@@ -1,4 +1,4 @@
-/*****************************************************************************
+6*****************************************************************************
  * Copyright (C) 2018-2021
  *
  * Michiel Broek <mbroek at mbse dot eu>
@@ -1603,17 +1603,17 @@
      row['step_name'] = 'Stap ' + (rowscount + 1);
      if (rowscount > 0) {
       row['step_type'] = 1;
-      row['step_infuse_amount'] = 0;
+      row['step_infuse_amount'] = 0.0;
       row['step_volume'] = mash_infuse;
      } else {
       row['step_type'] = 0;
-      row['step_infuse_amount'] = 15;
+      row['step_infuse_amount'] = 15.0;
       row['step_volume'] = 15;
      }
      row['step_infuse_temp'] = 0;
      row['step_temp'] = 62.0;
      row['step_time'] = 20.0;
-     row['step_wg_ratio'] = 0;
+     row['step_wg_ratio'] = 0.0;
      row['ramp_time'] = 1.0;
      row['end_temp'] = 62.0;
      row['step_ph'] = 0.0;
@@ -5707,9 +5707,9 @@
     infused += parseFloat(row['step_infuse_amount']);
     row['step_volume'] = infused;
     if (mashkg > 0)
-     row['step_wg_ratio'] = Round(parseFloat(mash_infuse / mashkg), 2);
+     row['step_wg_ratio'] = Round(parseFloat(mash_infuse / mashkg), 6);
     else
-     row['step_wg_ratio'] = 0;
+     row['step_wg_ratio'] = 0.0;
     $('#mashGrid').jqxGrid('addrow', null, row);
    }
    calcMash();
@@ -5822,7 +5822,8 @@
  });
  $('#wstep_brix').jqxNumberInput(Spin1dec);
  $('#wstep_brix').on('change', function(event) {
-  var sg = brix_to_sg(parseFloat(event.args.value));
+  /* Use plato_to_sg at this stage */
+  var sg = plato_to_sg(parseFloat(event.args.value));
 console.log('brix: ' + parseFloat(event.args.value) + ' sg: ' + sg);
   if (sg > 1.005) {
    var rowdata = $('#mashGrid').jqxGrid('getrowdata', mashRow);

mercurial