Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -876,10 +876,23 @@ class NutrientCalculator:
|
|
| 876 |
|
| 877 |
return report
|
| 878 |
|
| 879 |
-
#
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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():
|