Quellcode durchsuchen

添加控压状态,开关slitdoor,check压差的功能

lixiang vor 1 Jahr
Ursprung
Commit
fc317f2d07
1 geänderte Dateien mit 47 neuen und 46 gelöschten Zeilen
  1. 47 46
      Venus/Venus_RT/Devices/IODevices/IoCylinder.cs

+ 47 - 46
Venus/Venus_RT/Devices/IODevices/IoCylinder.cs

@@ -212,52 +212,53 @@ namespace Venus_RT.Devices
                     return true;
                 }
             }
-            //if (Name == "SlitDoor")
-            //{
-
-            //    bool tmIsOnline = (bool)DATA.Poll("TM.IsOnline");
-            //    if (tmIsOnline == true)
-            //    {
-            //        int difference = SC.GetValue<int>($"TM.WithPMPressureDifference");
-            //        int tmPressure = Convert.ToInt32( DATA.Poll("TM.TMProcessGauge.Value"));
-            //        int pmPressure= Convert.ToInt32( DATA.Poll($"{Module}.ProcessLowPressure"));
-            //        if (Math.Abs(tmPressure - pmPressure) > difference)
-            //        {
-            //            LOG.Write(eEvent.ERR_TM, Module, $"{Module}与TM压差过大,不可以开{Module}腔体SlitDoor");
-            //            return true;
-            //        }
-            //    }
-            //}
-            //if (Name == "LLATSlitDoor")
-            //{
-            //    bool tmIsOnline = (bool)DATA.Poll("TM.IsOnline");
-            //    if (tmIsOnline == true)
-            //    {
-            //        int difference = SC.GetValue<int>($"TM.WithPMPressureDifference");
-            //        int tmPressure = Convert.ToInt32(DATA.Poll("TM.TMProcessGauge.Value"));
-            //        int llPressure = Convert.ToInt32(DATA.Poll("TM.LLAPressureGauge.Value"));
-            //        if (Math.Abs(tmPressure - llPressure) > difference)
-            //        {
-            //            LOG.Write(eEvent.ERR_TM, Module, $"TM正在控压,LLA与TM压差过大,不可以开LLATSlitDoor");
-            //            return true;
-            //        }
-            //    }
-            //}
-            //if ( Name == "LLBTSlitDoor")
-            //{
-            //    bool tmIsOnline = (bool)DATA.Poll("TM.IsOnline");
-            //    if (tmIsOnline == true)
-            //    {
-            //        int difference = SC.GetValue<int>($"TM.WithPMPressureDifference");
-            //        int tmPressure = Convert.ToInt32(DATA.Poll("TM.TMProcessGauge.Value"));
-            //        int llPressure = Convert.ToInt32(DATA.Poll("TM.LLBPressureGauge.Value"));
-            //        if (Math.Abs(tmPressure - llPressure) > difference)
-            //        {
-            //            LOG.Write(eEvent.ERR_TM, Module, $"TM正在控压LLB与TM压差过大,不可以开腔LLBTSlitDoor");
-            //            return true;
-            //        }
-            //    }
-            //}
+            string operation = isOpen ? "开" : "关";
+            if (Name == "SlitDoor")
+            {
+
+                bool tmIsOnline = (bool)DATA.Poll("TM.IsOnline");
+                if (tmIsOnline == true)
+                {
+                    int difference = SC.GetValue<int>($"TM.WithPMPressureDifference");
+                    int tmPressure = Convert.ToInt32(DATA.Poll("TM.TMProcessGauge.Value"));
+                    int pmPressure = Convert.ToInt32(DATA.Poll($"{Module}.ProcessHighPressure"));
+                    if (Math.Abs(tmPressure - pmPressure) > difference)
+                    {
+                        LOG.Write(eEvent.ERR_TM, Module, $"TM正在控压,{Module}与TM压差过大,不可以{operation}{Module}腔体SlitDoor");
+                        return true;
+                    }
+                }
+            }
+            if (Name == "LLATSlitDoor")
+            {
+                bool tmIsOnline = (bool)DATA.Poll("TM.IsOnline");
+                if (tmIsOnline == true)
+                {
+                    int difference = SC.GetValue<int>($"TM.WithPMPressureDifference");
+                    int tmPressure = Convert.ToInt32(DATA.Poll("TM.TMProcessGauge.Value"));
+                    int llPressure = Convert.ToInt32(DATA.Poll("TM.LLAPressureGauge.Value"));
+                    if (Math.Abs(tmPressure - llPressure) > difference)
+                    {
+                        LOG.Write(eEvent.ERR_TM, Module, $"TM正在控压,LLA与TM压差过大,不可以{operation}LLATSlitDoor");
+                        return true;
+                    }
+                }
+            }
+            if (Name == "LLBTSlitDoor")
+            {
+                bool tmIsOnline = (bool)DATA.Poll("TM.IsOnline");
+                if (tmIsOnline == true)
+                {
+                    int difference = SC.GetValue<int>($"TM.WithPMPressureDifference");
+                    int tmPressure = Convert.ToInt32(DATA.Poll("TM.TMProcessGauge.Value"));
+                    int llPressure = Convert.ToInt32(DATA.Poll("TM.LLBPressureGauge.Value"));
+                    if (Math.Abs(tmPressure - llPressure) > difference)
+                    {
+                        LOG.Write(eEvent.ERR_TM, Module, $"TM正在控压,LLB与TM压差过大,不可以{operation}LLBTSlitDoor");
+                        return true;
+                    }
+                }
+            }
             ONSetPoint = isOpen;
             reason += _error;
             reason += " ";