Ver código fonte

amend ATVA logic

highing666 3 anos atrás
pai
commit
968811b874

+ 16 - 16
app/controllers/equipment/ahu/supply_air_temperature_set.py

@@ -25,7 +25,7 @@ class ACATAHSupplyAirTemperatureController:
     def __init__(
         self,
         vav_boxes_list: List[VAVBox],
-        current: float,
+        current_set: float,
         return_air: float,
         thermal_mode: ThermalMode,
         is_off_to_on: bool,
@@ -34,7 +34,7 @@ class ACATAHSupplyAirTemperatureController:
     ):
         super(ACATAHSupplyAirTemperatureController, self).__init__()
         self.vav_boxes_list = vav_boxes_list
-        self.current = current
+        self.current_set = current_set
         self.return_air = return_air
         self.thermal_mode = thermal_mode
         self.is_off_to_on = is_off_to_on
@@ -44,32 +44,32 @@ class ACATAHSupplyAirTemperatureController:
     def calculate_by_cold_vav(self, cold_ratio: float) -> float:
         if self.thermal_mode == ThermalMode.cooling:
             if cold_ratio < 0.3:
-                new = self.current - 1.0
+                new = self.current_set - 1.0
             elif cold_ratio < 0.45:
-                new = self.current - 0.5
+                new = self.current_set - 0.5
             elif cold_ratio <= 0.55:
-                new = self.current
+                new = self.current_set
             elif cold_ratio <= 0.7:
-                new = self.current + 1.0
+                new = self.current_set + 1.0
             elif cold_ratio <= 1.0:
-                new = self.current + 1.5
+                new = self.current_set + 1.5
             else:
-                new = self.current
+                new = self.current_set
         elif self.thermal_mode == ThermalMode.heating:
             if cold_ratio < 0.3:
                 new = self.return_air
             elif cold_ratio < 0.45:
-                new = self.current - 1.0
+                new = self.current_set - 1.0
             elif cold_ratio <= 0.55:
-                new = self.current
+                new = self.current_set
             elif cold_ratio <= 0.7:
-                new = self.current + 0.5
+                new = self.current_set + 0.5
             elif cold_ratio <= 1.0:
-                new = self.current + 1.0
+                new = self.current_set + 1.0
             else:
-                new = self.current
+                new = self.current_set
         else:
-            new = self.current
+            new = self.current_set
 
         return new
 
@@ -120,7 +120,7 @@ class ACATAHSupplyAirTemperatureController:
                 cold_ratio = self.get_cold_ratio()
                 temperature = self.calculate_by_cold_vav(cold_ratio)
             else:
-                temperature = self.current
+                temperature = self.current_set
         else:
             if self.season == Season.heating:
                 temperature = 27.0
@@ -291,7 +291,7 @@ def build_acatah_supply_air_temperature_set(
 
         controller = ACATAHSupplyAirTemperatureController(
             vav_list,
-            params.supply_air_temperature,
+            params.supply_air_temperature_set,
             params.return_air_temperature,
             thermal_mode,
             is_off_to_on,

+ 4 - 4
app/models/domain/devices.py

@@ -104,9 +104,9 @@ class ACATVAInstructionsRequest(ACATVAInstructionsRequestBase):
     season: str
     supply_air_temperature: Optional[float]
     acatah_supply_air_temperature: Optional[float]
-    supply_air_flow: float
-    supply_air_flow_lower_limit: float
-    supply_air_flow_upper_limit: float
+    supply_air_flow: Optional[float]
+    supply_air_flow_lower_limit: Optional[float]
+    supply_air_flow_upper_limit: Optional[float]
 
 
 class ACATVAInstructionsRequestV2(ACATVAInstructionsRequestBase):
@@ -203,7 +203,7 @@ class ACATAHThermalModeSetResponse(BaseModel):
 
 
 class ACATAHSupplyAirTempSetRequest(ACATAHRequestBase):
-    supply_air_temperature: float
+    supply_air_temperature_set: float
     return_air_temperature: float
     chill_water_valve_opening_set_list: Optional[List[float]]
     hot_water_valve_opening_set_list: Optional[List[float]]