Added pitch rate fields for gram/hl for dry yeast.

Fri, 09 Apr 2021 14:45:18 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 09 Apr 2021 14:45:18 +0200
changeset 725
30346e5b9e12
parent 724
66e0b4ef9268
child 726
872a3635e4ef

Added pitch rate fields for gram/hl for dry yeast.

www/includes/db_inventory_yeasts.php file | annotate | diff | comparison | revisions
www/inv_yeasts.php file | annotate | diff | comparison | revisions
www/js/inv_yeasts.js file | annotate | diff | comparison | revisions
--- a/www/includes/db_inventory_yeasts.php	Sun Dec 20 13:40:56 2020 +0100
+++ b/www/includes/db_inventory_yeasts.php	Fri Apr 09 14:45:18 2021 +0200
@@ -43,6 +43,10 @@
 	$sql .= "', pitch_temperature='" . floatval($_POST['pitch_temperature']);
 	($_POST['pofpos'] == 'true') ? $sql .= "', pofpos='1" : $sql .= "', pofpos='0";
 	$sql .= "', zymocide='" . $_POST['zymocide'];
+	$sql .= "', gr_hl_lo='" . $_POST['gr_hl_lo'];
+	$sql .= "', sg_lo='" . floatval($_POST['sg_lo']);
+	$sql .= "', gr_hl_hi='" . $_POST['gr_hl_hi'];
+	$sql .= "', sg_hi='" . floatval($_POST['sg_hi']);
 	$sql .= "', inventory='" . $_POST['inventory'];
 	$sql .= "', cost='" . $_POST['cost'] . "'";
 	if ($_POST['production_date'] == '')
@@ -116,7 +120,11 @@
 			'harvest_time' => $row['harvest_time'],
 			'pitch_temperature' => floatval($row['pitch_temperature']),
 			'pofpos' => $row['pofpos'],
-			'zymocide' => $row['zymocide']
+			'zymocide' => $row['zymocide'],
+			'gr_hl_lo' => $row['gr_hl_lo'],
+			'sg_lo' => floatval($row['sg_lo']),
+			'gr_hl_hi' => $row['gr_hl_hi'],
+			'sg_hi' => floatval($row['sg_hi'])
 		);
 	}
 	header("Content-type: application/json");
--- a/www/inv_yeasts.php	Sun Dec 20 13:40:56 2020 +0100
+++ b/www/inv_yeasts.php	Fri Apr 09 14:45:18 2021 +0200
@@ -29,15 +29,17 @@
       <tr>
        <td align="right" style="vertical-align: top;">Type:</td>
        <td align="left"><div id="type"></div></td>
-       <td></td><td></td>
-       <td align="right" style="vertical-align: top;">Minimum temperatuur &deg;C:</td>
+       <td align="right" style="vertical-align: top;">Ent van g/hl:</td>
+       <td align="left" style="vertical-align: top;"><input id="pitch_lo" readonly /></div><input type="button" id="but_pitch_lo" value="?" style="margin-left: 10px" /></td>
+       <td align="right" style="vertical-align: top;">Min temperatuur &deg;C:</td>
        <td align="left"><div id="min_temperature"></div></td>
       </tr>
       <tr>
        <td align="right" style="vertical-align: top;">Gist vorm:</td>
        <td align="left"><div id="form"></div></td>
-       <td></td><td></td>
-       <td align="right" style="vertical-align: top;">Maximum temperatuur &deg;C:</td>
+       <td align="right" style="vertical-align: top;">Ent tot g/hl:</td>
+       <td align="left" style="vertical-align: top;"><input id="pitch_hi" readonly /><input type="button" id="but_pitch_hi" value="?" style="margin-left: 10px" /></td>
+       <td align="right" style="vertical-align: top;">Max temperatuur &deg;C:</td>
        <td align="left"><div id="max_temperature"></div></td>
       </tr>
       <tr>
@@ -115,6 +117,52 @@
     </div>
    </div>
 
+   <div id="pitchloWindow">
+    <div>Enten droge gist ondergrens</div>
+    <div style="overflow: hidden;">
+     <table style="width: 100%;">
+      <col width="50%">
+      <col width="50%">
+      <tr>
+       <td align="right" style="vertical-align: top;">Enten gram/hl:</td>
+       <td style="padding: 3px;"><div id="gr_hl_lo"></div></td>
+      </tr>
+      <tr>
+       <td align="right" style="vertical-align: top;">Bij dit SG:</td>
+       <td style="padding: 3px;"><div id="sg_lo" /></div></td>
+      </tr>
+      <tr>
+       <td style="padding-top: 30px;" colspan="2" align="center">
+        <input id="pitchloReady" type="button" value="Ok" />
+       </td>
+      </tr>
+     </table>
+    </div>
+   </div>
+
+   <div id="pitchhiWindow">
+    <div>Enten droge gist bovengrens</div>
+    <div style="overflow: hidden;">
+     <table style="width: 100%;">
+      <col width="50%">
+      <col width="50%">
+      <tr>
+       <td align="right" style="vertical-align: top;">Enten gram/hl:</td>
+       <td style="padding: 3px;"><div id="gr_hl_hi"></div></td>
+      </tr>
+      <tr>
+       <td align="right" style="vertical-align: top;">Bij dit SG:</td>
+       <td style="padding: 3px;"><div id="sg_hi" /></div></td>
+      </tr>
+      <tr>
+       <td style="padding-top: 30px;" colspan="2" align="center">
+        <input id="pitchhiReady" type="button" value="Ok" />
+       </td>
+      </tr>
+     </table>
+    </div>
+   </div>
+
 <?php
 confirm_delete();
 page_footer();
--- 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