DmitrMakeev commited on
Commit
34788ee
·
verified ·
1 Parent(s): 2ab9134

Update nutri_call.html

Browse files
Files changed (1) hide show
  1. nutri_call.html +53 -1
nutri_call.html CHANGED
@@ -1068,6 +1068,8 @@ document.getElementById('calculate-btn').addEventListener('click', function () {
1068
  updateNitrogenFields(call_data);
1069
 
1070
  calculateAndUpdate(call_data);
 
 
1071
 
1072
  // Рассчитываем EC
1073
  const temperature = parseFloat(document.getElementById('profile_temp').value) || 25;
@@ -1304,7 +1306,57 @@ function calculateEC(data, temperature, alpha = 0.019) {
1304
 
1305
 
1306
 
1307
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1308
  </script>
1309
 
1310
 
 
1068
  updateNitrogenFields(call_data);
1069
 
1070
  calculateAndUpdate(call_data);
1071
+
1072
+ addEventListener();
1073
 
1074
  // Рассчитываем EC
1075
  const temperature = parseFloat(document.getElementById('profile_temp').value) || 25;
 
1306
 
1307
 
1308
 
1309
+ function addEventListener() {
1310
+ // Получаем объем раствора
1311
+ const solutionVolume = parseFloat(document.getElementById('liters-input').value);
1312
+ if (!solutionVolume || solutionVolume <= 0) {
1313
+ alert("Введите корректный объем раствора!");
1314
+ return;
1315
+ }
1316
+
1317
+ // Содержание микроэлементов в удобрениях (%)
1318
+ const microContent = {
1319
+ Fe: 0.11, // Fe-DTPA (11%)
1320
+ Zn: 0.15, // Zn-EDTA (15%)
1321
+ Cu: 0.13, // Cu-EDTA (13%)
1322
+ Mn: 0.13, // Mn-EDTA (13%)
1323
+ B: 0.17, // Борная кислота (17%)
1324
+ Mo: 0.39 // Молибдат аммония (39%)
1325
+ };
1326
+
1327
+ // Получаем концентрации микроэлементов (мг/л)
1328
+ const concentrations = {
1329
+ Fe: parseFloat(document.getElementById('fert_fe_coeff').value),
1330
+ Zn: parseFloat(document.getElementById('fert_zn_coeff').value),
1331
+ Cu: parseFloat(document.getElementById('fert_cu_coeff').value),
1332
+ Mn: parseFloat(document.getElementById('fert_mn_coeff').value),
1333
+ B: parseFloat(document.getElementById('fert_b_coeff').value),
1334
+ Mo: parseFloat(document.getElementById('fert_mo_coeff').value)
1335
+ };
1336
+
1337
+ // Рассчитываем массы удобрений
1338
+ const fertilizerMasses = {};
1339
+ for (const element in concentrations) {
1340
+ const concentration = concentrations[element];
1341
+ if (!concentration || concentration <= 0) continue;
1342
+
1343
+ // Чистое количество микроэлемента (г)
1344
+ const pureElementMass = (concentration * solutionVolume) / 1000;
1345
+
1346
+ // Масса удобрения (г)
1347
+ fertilizerMasses[element] = pureElementMass / microContent[element];
1348
+ }
1349
+
1350
+ // Записываем результаты в поля вывода
1351
+ document.getElementById('iron_amount').value = fertilizerMasses.Fe?.toFixed(3) || 0;
1352
+ document.getElementById('zinc_amount').value = fertilizerMasses.Zn?.toFixed(3) || 0;
1353
+ document.getElementById('copper_amount').value = fertilizerMasses.Cu?.toFixed(3) || 0;
1354
+ document.getElementById('manganese_amount').value = fertilizerMasses.Mn?.toFixed(3) || 0;
1355
+ document.getElementById('boron_amount').value = fertilizerMasses.B?.toFixed(3) || 0;
1356
+ document.getElementById('molybdenum_amount').value = fertilizerMasses.Mo?.toFixed(3) || 0;
1357
+
1358
+ console.log("=== РАСЧЕТ МАССЫ УДОБРЕНИЙ ===", fertilizerMasses);
1359
+ });
1360
  </script>
1361
 
1362