Browse Source

revise reservoir initalize bug

chenzk 10 hours ago
parent
commit
a31705b56f
1 changed files with 12 additions and 7 deletions
  1. 12 7
      PunkHPX8_RT/Modules/Reservoir/DMReservoirInitializeRoutine.cs

+ 12 - 7
PunkHPX8_RT/Modules/Reservoir/DMReservoirInitializeRoutine.cs

@@ -83,7 +83,7 @@ namespace PunkHPX8_RT.Modules.Reservoir
                   .WaitWithStopCondition(InitializeStep.ANPumpWait, () => CommonFunction.CheckRoutineEndState(_anPumpOnRoutine), () => CommonFunction.CheckRoutineStopState(_anPumpOnRoutine))
                   .Delay(InitializeStep.CheckFlowWait, _flowFaultHoldOffTime)
                   .RunIf(InitializeStep.CellManualCheckFlow,_dmReservoirDevice.OperationMode == MANUAL,ManualCheckFlow,_delay_1ms)
-                  .RunIf(InitializeStep.CellManualCheckFlow,_dmReservoirDevice.OperationMode == AUTO, AutoCheckFlow, _delay_1ms)
+                  .RunIf(InitializeStep.CellAutoCheckFlow,_dmReservoirDevice.OperationMode == AUTO, AutoCheckFlow, _delay_1ms)
                   .RunIf(InitializeStep.AutoDiReplen, _recipe.DIReplenEnable || _recipe.ANDIReplenEnable, CheckFacilitiesDiReplenStatus, _delay_1ms)
                   .Run(InitializeStep.AutoCellAutoEnableHED, AutoHedOn, _delay_1ms)
                   .End(InitializeStep.End, ClearAlarmDataError, _delay_1ms);
@@ -186,8 +186,8 @@ namespace PunkHPX8_RT.Modules.Reservoir
                 LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"CA Flow {_dmReservoirDevice.ReservoirData.CaFlow} is less than CellFlowStartLowLimit{_cellFlowStartLowLimit}");
                 return false;
             }
-            _temperatureController.EnableOperation("", null);
-            _temperatureController.SetTargetTemperatureOperation("", new object[] { _recipe.TemperatureSetPoint });
+            result &= _temperatureController.EnableOperation("", null);
+            result &= _temperatureController.SetTargetTemperatureOperation("", new object[] { _recipe.TemperatureSetPoint });
             return true;
         }
         /// <summary>
@@ -400,24 +400,29 @@ namespace PunkHPX8_RT.Modules.Reservoir
         private bool CheckFacility()
         {
             SystemFacilities systemFacilities = DEVICE.GetDevice<SystemFacilities>("System.Facilities");
-            if (systemFacilities == null)
+            if (systemFacilities != null)
             {
-                if (systemFacilities.HouseChilledWaterEnable)
+                if (!systemFacilities.HouseChilledWaterEnable)
                 {
                     LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "HouseChilledWaterEnable is false");
                     return false;
                 }
-                if (systemFacilities.DIFillEnable)
+                if (!systemFacilities.DIFillEnable)
                 {
                     LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "DIFillEnable is false");
                     return false;
                 }
-                if (systemFacilities.DIReplenEnable)
+                if (!systemFacilities.DIReplenEnable)
                 {
                     LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "DIReplenEnable is false");
                     return false;
                 }
             }
+            else
+            {
+                LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, "DIReplenEnable is false");
+                return false;
+            }
             return true;
         }
     }