chenhaiyang 1 سال پیش
والد
کامیت
7bd4f366fc
2فایلهای تغییر یافته به همراه17 افزوده شده و 2 حذف شده
  1. 16 1
      app/controllers/targets/temperature.py
  2. 1 1
      docker-compose.yml

+ 16 - 1
app/controllers/targets/temperature.py

@@ -103,6 +103,21 @@ class NewTemperatureTargetBuilder(NewTargetBuilder):
         return clipper.cut(new_actual_target)
 
 
+class NewTempTargetBuilderV2(NewTargetBuilder):
+    """
+    Calculate a new temperature target value for zhijaing.
+    """
+
+    def __init__(self, actual_target: float, step_sze: float):
+        self.actual_target = actual_target
+        self.step_size = step_sze
+
+    def build(self) -> float:
+        new_actual_target = self.actual_target + self.step_size
+        clipper = Clipper()
+        return clipper.cut(new_actual_target)
+
+
 class TemporaryTargetInit:
     """
     Initialize temporary temperature target.
@@ -582,7 +597,7 @@ class TemperatureTargetControllerV3:
                 or feedback == FeedbackValue.so_cold
         ):
             step_size = SimpleStepSizeCalculator.run(feedback)
-            new_actual_target = self.data["current_target"] + step_size
+            new_actual_target = NewTempTargetBuilderV2(self.data["current_target"], step_size)
             need_run_room_control = True
             if new_actual_target != self.data["current_target"]:
                 new_global_target = SimpleGlobalTemperatureTargetBuilder(

+ 1 - 1
docker-compose.yml

@@ -2,7 +2,7 @@ version: "3"
 
 services:
   app:
-      image: registry.persagy.com/sagacloud/saga_algo_api:0.5.18
+      image: registry.persagy.com/sagacloud/saga_algo_api:0.5.19
       container_name: saga_algo_api
       ports:
         - "8002:8002"