DmitrMakeev commited on
Commit
c2eb51b
·
verified ·
1 Parent(s): a1339eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py CHANGED
@@ -738,6 +738,17 @@ class NutrientCalculator:
738
  self.fertilizers = NUTRIENT_CONTENT_IN_FERTILIZERS
739
  self.total_ec = 0.0
740
 
 
 
 
 
 
 
 
 
 
 
 
741
  def _label(self, element):
742
  """Форматирование названий элементов для вывода"""
743
  labels = {
@@ -821,6 +832,15 @@ class NutrientCalculator:
821
 
822
  def calculate_ec(self):
823
  return round(self.total_ec, 2)
 
 
 
 
 
 
 
 
 
824
  def print_report(self):
825
  try:
826
  print("\n" + "="*60)
 
738
  self.fertilizers = NUTRIENT_CONTENT_IN_FERTILIZERS
739
  self.total_ec = 0.0
740
 
741
+ # Расчёт азота
742
+ total_parts = NO3_RATIO + NH4_RATIO
743
+ self.target_profile['N (NO3-)'] = TOTAL_NITROGEN * (NO3_RATIO / total_parts)
744
+ self.target_profile['N (NH4+)'] = TOTAL_NITROGEN * (NH4_RATIO / total_parts)
745
+
746
+ # Сохраняем исходный профиль азота
747
+ self.initial_n_profile = {
748
+ "NO3-": self.target_profile['N (NO3-)'],
749
+ "NH4+": self.target_profile['N (NH4+)']
750
+ }
751
+
752
  def _label(self, element):
753
  """Форматирование названий элементов для вывода"""
754
  labels = {
 
832
 
833
  def calculate_ec(self):
834
  return round(self.total_ec, 2)
835
+
836
+ def print_initial_nitrogen_report(self):
837
+ try:
838
+ print("Исходный расчёт азота:")
839
+ print(f" NO3-: {self.initial_n_profile['NO3-']} ppm")
840
+ print(f" NH4+: {self.initial_n_profile['NH4+']} ppm")
841
+ except Exception as e:
842
+ print(f"Ошибка при выводе отчёта: {str(e)}")
843
+ raise
844
  def print_report(self):
845
  try:
846
  print("\n" + "="*60)