Browse Source

add reservoir safety high monitor

chenzk 1 month ago
parent
commit
3a1e04c83d

+ 19 - 0
CyberX8_RT/Devices/Reservoir/StandardHotReservoirDevice.cs

@@ -574,6 +574,25 @@ namespace CyberX8_RT.Devices.Reservoir
                 }
 
             }
+            //High high监控
+            if (ReservoirData.SafetyHighLevel)
+            {
+                if (!errorLogSet.Contains($"{Module}.SafetyHigh"))
+                {
+                    errorLogSet.Add($"{Module}.SafetyHigh");
+                    LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"Safety High is activate");
+                }
+                HighLevelOperation();
+                if (!reservoirEntity.IsError)
+                {
+                    reservoirEntity.PostMsg(ReservoirMsg.Error);
+                }
+                if (_isSystemAutoMode && !AlarmListManager.Instance.IsContainDataError(Module, "SafetyHigh"))
+                {
+                    AlarmListManager.Instance.AddDataError(Module,
+                        $"SafetyHigh", $"Safety High is activate");
+                }
+            }
             //水位触发reservoir里面的high/low将对应的reservoir切成error
             if (_resRecipe == null) return;
             if (ReservoirData.Level < _resRecipe.CALevelErrorLow)

+ 2 - 0
CyberX8_Simulator/Devices/WagoSocketSimulator.cs

@@ -466,6 +466,8 @@ namespace CyberX8_Simulator.Devices
             if (AINameIndexDic.ContainsKey("r_CDA_EXTERNAL_PRESSURE")) AIShorts[AINameIndexDic["r_CDA_EXTERNAL_PRESSURE"]] = 10000;
             if (AINameIndexDic.ContainsKey("r_pH3")) AIShorts[AINameIndexDic["r_pH3"]] = 15000;
             if (AINameIndexDic.ContainsKey("r_MBS3_FLOW")) AIShorts[AINameIndexDic["r_MBS3_FLOW"]] = 16000;
+            
+            //if (DINameIndexDic.ContainsKey("r_RES1_HIGH_LEVEL")) DIBytes[DINameIndexDic["r_RES1_HIGH_LEVEL"]] = 1;
 
             //Reservoie Level Law
             if (AINameIndexDic.ContainsKey("r_RES1_LEVEL_raw")) AIShorts[AINameIndexDic["r_RES1_LEVEL_raw"]] = 10000;