www/js/inv_yeasts.js

changeset 725
30346e5b9e12
parent 702
f0896a6f9b64
child 727
08f91a68e757
--- a/www/js/inv_yeasts.js	Sun Dec 20 13:40:56 2020 +0100
+++ b/www/js/inv_yeasts.js	Fri Apr 09 14:45:18 2021 +0200
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Copyright (C) 2014-2020
+ * Copyright (C) 2014-2021
  *
  * Michiel Broek <mbroek at mbse dot eu>
  *
@@ -97,6 +97,10 @@
    { name: 'pitch_temperature', type: 'float' },
    { name: 'pofpos', type: 'int' },
    { name: 'zymocide', type: 'int' },
+   { name: 'gr_hl_lo', type: 'int' },
+   { name: 'sg_lo', type: 'float' },
+   { name: 'gr_hl_hi', type: 'int' },
+   { name: 'sg_hi', type: 'float' },
    { name: 'short_desc', type: 'string' }
   ],
   id: 'record',
@@ -174,6 +178,26 @@
   height: 23,
   autoDropDownHeight: true
  });
+ $('#gr_hl_lo').jqxNumberInput(PosInt);
+ $('#gr_hl_lo').jqxNumberInput({ min: 30, max: 200 });
+ $('#sg_lo').jqxNumberInput(SGopts);
+ $('#gr_hl_hi').jqxNumberInput(PosInt);
+ $('#gr_hl_hi').jqxNumberInput({ min: 30, max: 200 });
+ $('#sg_hi').jqxNumberInput(SGopts);
+ $('#pitch_lo').jqxInput({ theme: theme, width: 100, height: 23 });
+ $('#but_pitch_lo').jqxButton({ template: 'success', width: '23px', height: 23, theme: theme });
+ $('#but_pitch_lo').bind('click', function() { $('#pitchloWindow').jqxWindow('open'); });
+ $('#pitchloReady').jqxButton({ template: 'success', width: '90px', theme: theme });
+ $('#pitchloReady').click(function() {
+  $('#pitch_lo').val($('#gr_hl_lo').val() + '@' + $('#sg_lo').val().toFixed(3));
+ });
+ $('#pitch_hi').jqxInput({ theme: theme, width: 100, height: 23 });
+ $('#but_pitch_hi').jqxButton({ template: 'success', width: '23px', height: 23, theme: theme });
+ $('#but_pitch_hi').bind('click', function() { $('#pitchhiWindow').jqxWindow('open'); });
+ $('#pitchhiReady').jqxButton({ template: 'success', width: '90px', theme: theme });
+ $('#pitchhiReady').click(function() {
+  $('#pitch_hi').val($('#gr_hl_hi').val() + '@' + $('#sg_hi').val().toFixed(3));
+ });
  $('#notes').jqxInput({ theme: theme, width: 800, height: 120 });
  $('#best_for').jqxInput({ theme: theme, width: 320, height: 100 });
  $('#inventory').jqxNumberInput(Spin1dec);
@@ -280,6 +304,10 @@
     $('#pitch_temperature').val(0);
     $('#pofpos').val(0);
     $('#zymocide').val(0);
+    $('#gr_hl_lo').val(50);
+    $('#sg_lo').val(1.050);
+    $('#gr_hl_hi').val(80);
+    $('#sg_hi').val(1.080);
     $('#popupWindow').jqxWindow('open');
    });
    impButton.click(function(event) {
@@ -361,6 +389,12 @@
      $('#pitch_temperature').val(parseFloat(dataRecord.pitch_temperature));
      $('#pofpos').val(dataRecord.pofpos);
      $('#zymocide').val(dataRecord.zymocide);
+     $('#gr_hl_lo').val(dataRecord.gr_hl_lo);
+     $('#sg_lo').val(parseFloat(dataRecord.sg_lo));
+     $('#pitch_lo').val(dataRecord.gr_hl_lo + '@' + parseFloat(dataRecord.sg_lo).toFixed(3));
+     $('#gr_hl_hi').val(dataRecord.gr_hl_hi);
+     $('#sg_hi').val(parseFloat(dataRecord.sg_hi));
+     $('#pitch_hi').val(dataRecord.gr_hl_hi + '@' + parseFloat(dataRecord.sg_hi).toFixed(3));
      $('#short_desc').val(dataRecord.short_desc);
      calcTotal();
      // show the popup window.
@@ -388,6 +422,28 @@
  });
 
  // initialize the popup window and buttons.
+ $('#pitchloWindow').jqxWindow({
+  theme: theme,
+  position: { x: 380, y: 210 },
+  width: 500,
+  height: 200,
+  resizable: false,
+  isModal: true,
+  modalOpacity: 0.4,
+  autoOpen: false,
+  cancelButton: $('#pitchloReady')
+ });
+ $('#pitchhiWindow').jqxWindow({
+  theme: theme,
+  position: { x: 380, y: 210 },
+  width: 500,
+  height: 200,
+  resizable: false,
+  isModal: true,
+  modalOpacity: 0.4,
+  autoOpen: false,
+  cancelButton: $('#pitchhiReady')
+ });
  $('#popupWindow').jqxWindow({
   width: 1050,
   height: 625,
@@ -442,7 +498,11 @@
    harvest_time: $('#harvest_time').val(),
    pitch_temperature: parseFloat($('#pitch_temperature').jqxNumberInput('decimal')),
    pofpos: $('#pofpos').val(),
-   zymocide: $('#zymocide').val()
+   zymocide: $('#zymocide').val(),
+   gr_hl_lo: $('#gr_hl_lo').val(),
+   sg_lo: parseFloat($('#sg_lo').jqxNumberInput('decimal')),
+   gr_hl_hi: $('#gr_hl_hi').val(),
+   sg_hi: parseFloat($('#sg_hi').jqxNumberInput('decimal'))
   };
   $('#jqxgrid').jqxGrid('addrow', null, row);
   $('#popupWindow').jqxWindow('hide');
@@ -485,6 +545,10 @@
    pitch_temperature: parseFloat($('#pitch_temperature').jqxNumberInput('decimal')),
    pofpos: $('#pofpos').val(),
    zymocide: $('#zymocide').val(),
+   gr_hl_lo: $('#gr_hl_lo').val(),
+   sg_lo: parseFloat($('#sg_lo').jqxNumberInput('decimal')),
+   gr_hl_hi: $('#gr_hl_hi').val(),
+   sg_hi: parseFloat($('#sg_hi').jqxNumberInput('decimal')),
    short_desc: $('#short_desc').val()
   };
   if (editrow >= 0) {

mercurial