DmitrMakeev commited on
Commit
ebb5cb9
·
verified ·
1 Parent(s): db57e95

Update nutri_call.html

Browse files
Files changed (1) hide show
  1. nutri_call.html +61 -2
nutri_call.html CHANGED
@@ -983,8 +983,6 @@ legend {
983
  </div>
984
  </fieldset>
985
 
986
- <!-- Кнопка для расчета -->
987
- <button id="calculate-ppm-button">Рассчитать PPM</button>
988
 
989
 
990
 
@@ -1157,6 +1155,8 @@ document.getElementById('calculate-btn').addEventListener('click', function () {
1157
  calculateAndUpdate(call_data);
1158
 
1159
  calculateMicroElements();
 
 
1160
 
1161
  // Рассчитываем EC
1162
  const temperature = parseFloat(document.getElementById('profile_temp').value) || 25;
@@ -1444,6 +1444,65 @@ function calculateMicroElements() {
1444
 
1445
  console.log("=== РАСЧЕТ МАССЫ УДОБРЕНИЙ ===", fertilizerMasses);
1446
  } // Конец функции
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1447
  </script>
1448
 
1449
 
 
983
  </div>
984
  </fieldset>
985
 
 
 
986
 
987
 
988
 
 
1155
  calculateAndUpdate(call_data);
1156
 
1157
  calculateMicroElements();
1158
+
1159
+ calculateMicroElements2();
1160
 
1161
  // Рассчитываем EC
1162
  const temperature = parseFloat(document.getElementById('profile_temp').value) || 25;
 
1444
 
1445
  console.log("=== РАСЧЕТ МАССЫ УДОБРЕНИЙ ===", fertilizerMasses);
1446
  } // Конец функции
1447
+
1448
+
1449
+
1450
+
1451
+ function calculateMicroElements2() {
1452
+ // 1. Получаем объем раствора (в литрах)
1453
+ const solutionVolume = parseFloat(document.getElementById('liters-input').value);
1454
+ if (!solutionVolume || solutionVolume <= 0) {
1455
+ alert("Введите корректный объем раствора!");
1456
+ return;
1457
+ }
1458
+
1459
+ // 2. Получаем массы удобрений (в граммах)
1460
+ const feChelateMass = parseFloat(document.getElementById('fert_fe_chelate_mass').value) || 0;
1461
+ const complexPowderMass = parseFloat(document.getElementById('fert_complex_mass').value) || 0;
1462
+
1463
+ // 3. Содержание микроэлементов в удобрениях (%)
1464
+ const feChelateContent = {
1465
+ Fe: 0.11 // Хелат железа (11%)
1466
+ };
1467
+
1468
+ const complexPowderContent = {
1469
+ Fe: 0.0384, // Fe (ДТПА + ЭДТА) = 3.84%
1470
+ Zn: 0.0053, // Zn (ЭДТА) = 0.53%
1471
+ Cu: 0.0053, // Cu (ЭДТА) = 0.53%
1472
+ Mn: 0.0257, // Mn (ЭДТА) = 2.57%
1473
+ B: 0.0052, // B = 0.52%
1474
+ Mo: 0.0013 // Mo = 0.13%
1475
+ };
1476
+
1477
+ // 4. Рассчитываем чистые количества микроэлементов (в граммах)
1478
+ const pureElements = {
1479
+ Fe: (feChelateMass * feChelateContent.Fe) + (complexPowderMass * complexPowderContent.Fe),
1480
+ Zn: complexPowderMass * complexPowderContent.Zn,
1481
+ Cu: complexPowderMass * complexPowderContent.Cu,
1482
+ Mn: complexPowderMass * complexPowderContent.Mn,
1483
+ B: complexPowderMass * complexPowderContent.B,
1484
+ Mo: complexPowderMass * complexPowderContent.Mo
1485
+ };
1486
+
1487
+ // 5. Рассчитываем концентрации в PPM (мг/л)
1488
+ const ppm = {};
1489
+ for (const element in pureElements) {
1490
+ ppm[element] = (pureElements[element] * 1000) / solutionVolume; // Переводим граммы в мг/л
1491
+ }
1492
+
1493
+ // 6. Выводим результаты в соответствующие поля матрицы
1494
+ document.getElementById('ppm_fe').value = ppm.Fe?.toFixed(3) || 0;
1495
+ document.getElementById('ppm_zn').value = ppm.Zn?.toFixed(3) || 0;
1496
+ document.getElementById('ppm_cu').value = ppm.Cu?.toFixed(3) || 0;
1497
+ document.getElementById('ppm_mn').value = ppm.Mn?.toFixed(3) || 0;
1498
+ document.getElementById('ppm_b').value = ppm.B?.toFixed(3) || 0;
1499
+ document.getElementById('ppm_mo').value = ppm.Mo?.toFixed(3) || 0;
1500
+
1501
+ console.log("=== РАСЧЕТ PPM ===", ppm);
1502
+ }
1503
+
1504
+
1505
+
1506
  </script>
1507
 
1508