www/js/rec_edit.js

changeset 648
ee69b01fcb0e
parent 643
9ac2fb6b1311
child 660
0e9a725354ac
equal deleted inserted replaced
647:243be110285c 648:ee69b01fcb0e
273 colorh += row.f_amount * row.f_color * get_kt(row.f_color); 273 colorh += row.f_amount * row.f_color * get_kt(row.f_color);
274 colorn += (row.f_percentage / 100) * row.f_color; // For 8.6 Pt wort. 274 colorn += (row.f_percentage / 100) * row.f_color; // For 8.6 Pt wort.
275 } 275 }
276 } 276 }
277 $('#ferm_lintner').val(Math.round(parseFloat(lintner / mashkg))); 277 $('#ferm_lintner').val(Math.round(parseFloat(lintner / mashkg)));
278 //console.log('lintner:' + lintner + ' kg:' + mashkg);
279 to_100 = my_100; 278 to_100 = my_100;
280 if (to_100) { 279 if (to_100) {
281 $('#wf_amount').jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); 280 $('#wf_amount').jqxNumberInput({ width: 90, readOnly: true, spinButtons: false });
282 } else { 281 } else {
283 $('#wf_amount').jqxNumberInput({ width: 110, readOnly: false, spinButtons: true }); 282 $('#wf_amount').jqxNumberInput({ width: 110, readOnly: false, spinButtons: true });
396 } 395 }
397 396
398 397
399 function adjustHops(factor) { 398 function adjustHops(factor) {
400 399
401 //console.log('adjustHops(' + factor + ')');
402 var i, row, amount, rowscount = $('#hopGrid').jqxGrid('getdatainformation').rowscount; 400 var i, row, amount, rowscount = $('#hopGrid').jqxGrid('getdatainformation').rowscount;
403 if (rowscount == 0) 401 if (rowscount == 0)
404 return; 402 return;
405 403
406 for (i = 0; i < rowscount; i++) { 404 for (i = 0; i < rowscount; i++) {
411 } 409 }
412 410
413 411
414 function adjustMiscs(factor) { 412 function adjustMiscs(factor) {
415 413
416 //console.log('adjustMiscs(' + factor + ')');
417 var i, row, amount, rowscount = $('#miscGrid').jqxGrid('getdatainformation').rowscount; 414 var i, row, amount, rowscount = $('#miscGrid').jqxGrid('getdatainformation').rowscount;
418 if (rowscount == 0) 415 if (rowscount == 0)
419 return; 416 return;
420 417
421 for (i = 0; i < rowscount; i++) { 418 for (i = 0; i < rowscount; i++) {
440 } 437 }
441 438
442 439
443 function adjustYeasts(factor) { 440 function adjustYeasts(factor) {
444 441
445 //console.log('adjustYeasts(' + factor + ')');
446 var i, row, amount, rowscount = $('#yeastGrid').jqxGrid('getdatainformation').rowscount; 442 var i, row, amount, rowscount = $('#yeastGrid').jqxGrid('getdatainformation').rowscount;
447 if (rowscount == 0) 443 if (rowscount == 0)
448 return; 444 return;
449 445
450 for (i = 0; i < rowscount; i++) { 446 for (i = 0; i < rowscount; i++) {
457 } 453 }
458 454
459 455
460 function adjustWaters(factor) { 456 function adjustWaters(factor) {
461 457
462 //console.log('adjustWaters(' + factor + ')');
463 var i, row, amount, rowscount = $('#mashGrid').jqxGrid('getdatainformation').rowscount; 458 var i, row, amount, rowscount = $('#mashGrid').jqxGrid('getdatainformation').rowscount;
464 if (rowscount == 0) 459 if (rowscount == 0)
465 return; 460 return;
466 mash_infuse = 0; 461 mash_infuse = 0;
467 for (i = 0; i < rowscount; i++) { 462 for (i = 0; i < rowscount; i++) {
888 { name: 'f_di_ph', type: 'float' }, 883 { name: 'f_di_ph', type: 'float' },
889 { name: 'f_acid_to_ph_57', type: 'float' }, 884 { name: 'f_acid_to_ph_57', type: 'float' },
890 { name: 'f_inventory', type: 'float' }, 885 { name: 'f_inventory', type: 'float' },
891 { name: 'f_avail', type: 'int' } 886 { name: 'f_avail', type: 'int' }
892 ], 887 ],
893 addrow: function(rowid, rowdata, position, commit) { 888 addrow: function(rowid, rowdata, position, commit) { commit(true); },
894 //console.log("fermentable addrow "+rowid); 889 deleterow: function(rowid, commit) { commit(true); },
895 commit(true); 890 updaterow: function(rowid, rowdata, commit) { commit(true); }
896 },
897 deleterow: function(rowid, commit) {
898 //console.log("fermentable deleterow "+rowid);
899 commit(true);
900 },
901 updaterow: function(rowid, rowdata, commit) {
902 //console.log("fermentable updaterow "+rowid);
903 commit(true);
904 }
905 }, 891 },
906 fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); 892 fermentableAdapter = new $.jqx.dataAdapter(fermentableSource);
907 893
908 $('#fermentableGrid').jqxGrid({ 894 $('#fermentableGrid').jqxGrid({
909 width: 1240, 895 width: 1240,
1103 { name: 'h_myrcene', type: 'float' }, 1089 { name: 'h_myrcene', type: 'float' },
1104 { name: 'h_total_oil', type: 'float' }, 1090 { name: 'h_total_oil', type: 'float' },
1105 { name: 'h_inventory', type: 'float' }, 1091 { name: 'h_inventory', type: 'float' },
1106 { name: 'h_avail', type: 'int' } 1092 { name: 'h_avail', type: 'int' }
1107 ], 1093 ],
1108 addrow: function(rowid, rowdata, position, commit) { 1094 addrow: function(rowid, rowdata, position, commit) { commit(true); },
1109 //console.log("hop addrow "+rowid); 1095 deleterow: function(rowid, commit) { commit(true); },
1110 commit(true); 1096 updaterow: function(rowid, rowdata, commit) { commit(true); }
1111 },
1112 deleterow: function(rowid, commit) {
1113 //console.log("hop deleterow "+rowid);
1114 commit(true);
1115 },
1116 updaterow: function(rowid, rowdata, commit) {
1117 //console.log("hop updaterow "+rowid);
1118 commit(true);
1119 }
1120 }, 1097 },
1121 hopAdapter = new $.jqx.dataAdapter(hopSource); 1098 hopAdapter = new $.jqx.dataAdapter(hopSource);
1122 1099
1123 $('#hopGrid').jqxGrid({ 1100 $('#hopGrid').jqxGrid({
1124 width: 1240, 1101 width: 1240,
1302 { name: 'm_time', type: 'float' }, 1279 { name: 'm_time', type: 'float' },
1303 { name: 'm_amount_is_weight', type: 'int' }, 1280 { name: 'm_amount_is_weight', type: 'int' },
1304 { name: 'm_inventory', type: 'float' }, 1281 { name: 'm_inventory', type: 'float' },
1305 { name: 'm_avail', type: 'int' } 1282 { name: 'm_avail', type: 'int' }
1306 ], 1283 ],
1307 addrow: function(rowid, rowdata, position, commit) { 1284 addrow: function(rowid, rowdata, position, commit) { commit(true); },
1308 //console.log("misc addrow "+rowid); 1285 deleterow: function(rowid, commit) { commit(true); },
1309 commit(true); 1286 updaterow: function(rowid, rowdata, commit) { commit(true); }
1310 },
1311 deleterow: function(rowid, commit) {
1312 //console.log("misc deleterow "+rowid);
1313 commit(true);
1314 },
1315 updaterow: function(rowid, rowdata, commit) {
1316 //console.log("misc updaterow "+rowid);
1317 commit(true);
1318 }
1319 }, 1287 },
1320 miscAdapter = new $.jqx.dataAdapter(miscSource, { 1288 miscAdapter = new $.jqx.dataAdapter(miscSource, {
1321 beforeLoadComplete: function(records) { 1289 beforeLoadComplete: function(records) {
1322 var i, row, data = new Array(); 1290 var i, row, data = new Array();
1323 for (i = 0; i < records.length; i++) { 1291 for (i = 0; i < records.length; i++) {
1546 { name: 'y_pitch_temperature', type: 'float' }, 1514 { name: 'y_pitch_temperature', type: 'float' },
1547 { name: 'y_pofpos', type: 'int' }, 1515 { name: 'y_pofpos', type: 'int' },
1548 { name: 'y_zymocide', type: 'int' }, 1516 { name: 'y_zymocide', type: 'int' },
1549 { name: 'y_avail', type: 'int' } 1517 { name: 'y_avail', type: 'int' }
1550 ], 1518 ],
1551 addrow: function(rowid, rowdata, position, commit) { 1519 addrow: function(rowid, rowdata, position, commit) { commit(true); },
1552 //console.log("yeast addrow "+rowid); 1520 deleterow: function(rowid, commit) { commit(true); },
1553 commit(true); 1521 updaterow: function(rowid, rowdata, commit) { commit(true); }
1554 },
1555 deleterow: function(rowid, commit) {
1556 //console.log("yeast deleterow "+rowid);
1557 commit(true);
1558 },
1559 updaterow: function(rowid, rowdata, commit) {
1560 //console.log("yeast updaterow "+rowid);
1561 commit(true);
1562 }
1563 }, 1522 },
1564 yeastAdapter = new $.jqx.dataAdapter(yeastSource); 1523 yeastAdapter = new $.jqx.dataAdapter(yeastSource);
1565 1524
1566 $('#yeastGrid').jqxGrid({ 1525 $('#yeastGrid').jqxGrid({
1567 width: 1240, 1526 width: 1240,
1920 1879
1921 1880
1922 // Procedure TFrmWaterAdjustment.CalcWater2; 1881 // Procedure TFrmWaterAdjustment.CalcWater2;
1923 function calcWater() { 1882 function calcWater() {
1924 1883
1925 console.log('calcWater()');
1926 if (! data_loaded) { 1884 if (! data_loaded) {
1927 console.log('failsave'); 1885 console.log('calcWater(): failsave');
1928 return; 1886 return;
1929 } 1887 }
1930 1888
1931 var liters = 0, 1889 var liters = 0,
1932 calcium = 0, 1890 calcium = 0,

mercurial