DmitrMakeev commited on
Commit
838f241
·
verified ·
1 Parent(s): ccf89ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -4
app.py CHANGED
@@ -876,10 +876,23 @@ class NutrientCalculator:
876
 
877
  return report
878
 
879
- # Запуск расчета
880
- calculator = NutrientCalculator(INPUT_DATA)
881
- results = calculator.calculate()
882
- print(calculator.generate_report(results))
 
 
 
 
 
 
 
 
 
 
 
 
 
883
 
884
  @app.route('/calculation', methods=['POST'])
885
  def handle_calculation():
 
876
 
877
  return report
878
 
879
+ # Извлекаем данные из INPUT_DATA
880
+ fertilizer_constants = INPUT_DATA["fertilizerConstants"]
881
+ profile_settings = INPUT_DATA["profileSettings"]
882
+ liters = profile_settings["liters"]
883
+ rounding_precision = 3 # Значение по умолчанию
884
+ activation_cacl = profile_settings.get("activation_cacl", 0) # По умолчанию 0
885
+ enhancement_cacl = profile_settings.get("enhancement_cacl", 0) # По умолчанию 0
886
+
887
+ # Создаем калькулятор
888
+ calculator = NutrientCalculator(
889
+ fertilizer_constants=fertilizer_constants,
890
+ profile_settings=profile_settings,
891
+ liters=liters,
892
+ rounding_precision=rounding_precision,
893
+ activation_cacl=activation_cacl,
894
+ enhancement_cacl=enhancement_cacl
895
+ )
896
 
897
  @app.route('/calculation', methods=['POST'])
898
  def handle_calculation():