Browse Source

去除无用的蜂鸣器配置 /去除红灯优先级最高逻辑

jiangjy 2 days ago
parent
commit
b62f35d954

+ 28 - 28
FrameworkLocal/Common/Device/Bases/SignalTowerBase.cs

@@ -162,12 +162,12 @@ namespace MECF.Framework.Common.Device.Bases
 
         private bool _isBuzzerOff;
 
-        public SignalTowerBase( ) : base( )
+        public SignalTowerBase() : base()
         {
             IsAutoSetLight = true;
         }
 
-        public SignalTowerBase(string module, string name):base(module, name, name, name)
+        public SignalTowerBase(string module, string name) : base(module, name, name, name)
         {
             IsAutoSetLight = true;
         }
@@ -205,14 +205,13 @@ namespace MECF.Framework.Common.Device.Bases
 
                 foreach (var signalLightBase in _lights)
                 {
-                    if (signalLightBase.Value != null)
-                    {
-                        if (IsBuzzer(signalLightBase.Key) && !IsAutoSetLight)
-                        {
-                            continue;
-                        }
-                        signalLightBase.Value.Monitor();
-                    }
+                    if (signalLightBase.Value == null)
+                        continue;
+
+                    if (IsBuzzer(signalLightBase.Key) && !IsAutoSetLight)
+                        continue;
+
+                    signalLightBase.Value.Monitor();
                 }
             }
             catch (Exception ex)
@@ -301,7 +300,7 @@ namespace MECF.Framework.Common.Device.Bases
                                     if (configTypes.Contains(lightType))
                                         configTypes.Remove(lightType);
                                 }
- 
+
                             }
                         }
                     }
@@ -336,6 +335,7 @@ namespace MECF.Framework.Common.Device.Bases
                 if (conditionValue == null)
                     continue;
 
+          
                 if (!(conditionValue is bool))
                     continue;
 
@@ -355,23 +355,23 @@ namespace MECF.Framework.Common.Device.Bases
                         }
                     }
 
-                    if(lightStateValue.ContainsKey(LightType.Red) && (lightStateValue[LightType.Red] == TowerLightStatus.Blinking || lightStateValue[LightType.Red] == TowerLightStatus.On))
-                    {
-                        if (lightStateValue.ContainsKey(LightType.Green))
-                        {
-                            lightStateValue[LightType.Green] = TowerLightStatus.Off;
-                        }
-
-                        if (lightStateValue.ContainsKey(LightType.Yellow))
-                        {
-                            lightStateValue[LightType.Yellow] = TowerLightStatus.Off;
-                        }
-
-                        if (lightStateValue.ContainsKey(LightType.Blue))
-                        {
-                            lightStateValue[LightType.Blue] = TowerLightStatus.Off;
-                        }
-                    }
+                    //if (lightStateValue.ContainsKey(LightType.Red) && (lightStateValue[LightType.Red] == TowerLightStatus.Blinking || lightStateValue[LightType.Red] == TowerLightStatus.On))
+                    //{
+                    //    if (lightStateValue.ContainsKey(LightType.Green))
+                    //    {
+                    //        lightStateValue[LightType.Green] = TowerLightStatus.Off;
+                    //    }
+
+                    //    if (lightStateValue.ContainsKey(LightType.Yellow))
+                    //    {
+                    //        lightStateValue[LightType.Yellow] = TowerLightStatus.Off;
+                    //    }
+
+                    //    if (lightStateValue.ContainsKey(LightType.Blue))
+                    //    {
+                    //        lightStateValue[LightType.Blue] = TowerLightStatus.Off;
+                    //    }
+                    //}
                 }
             }
 

+ 12 - 25
Furnace/FurnaceRT/Config/SignalTower.xml

@@ -1,32 +1,19 @@
 <?xml version="1.0" encoding="utf-8" ?>
 
 <STEvents>
-	<STEvent name ="System.IsAlarm"						Red="On" Yellow="Off" Green="Off" Blue="Off"  Buzzer1="On"/>
+	<STEvent name ="System.IsAlarm"						Red="On"		Yellow="Off"		Green="Off"		Blue="Off"  Buzzer1="On"/>
+	<STEvent name ="System.IsBusy"						Red="Off"		Yellow="Off"		Green="On"		Blue="Off"  Buzzer1="Off"/>
+	<STEvent name ="System.IsAutoRunning"				Red="Off"		Yellow="Off"		Green="On"		Blue="Off"  Buzzer1="Off"/>
+	
+	<STEvent name ="System.IsAlarmConditionBuzzerOn"	Red="Off"		Yellow="Off"		Green="Off"		Blue="Off"  Buzzer1="On"/>
+	
+	<STEvent name ="PM1.IsError"						Red="On"		Yellow="Off"		Green="Off"		Blue="Off"  Buzzer1="On"/>
+	<STEvent name ="PM1.IsProcessing"					Red="Off"		Yellow="Off"		Green="On"		Blue="Off"  Buzzer1="Off"/>
+
+	<STEvent name ="Boat.IsError"						Red="On"		Yellow="Off"		Green="Off"		Blue="Off"  Buzzer1="On"/>
+	<STEvent name ="WaferRobot.IsError"					Red="On"		Yellow="Off"		Green="Off"		Blue="Off"  Buzzer1="On"/>
+	<STEvent name ="CassetteRobot.IsError"				Red="On"		Yellow="Off"		Green="Off"		Blue="Off"  Buzzer1="On"/>
 
-	<STEvent name ="IOPortA.IsError"					Red="On" Yellow="Off" Green="Off" Blue="Off"  Buzzer1="On"/>
-	<STEvent name ="IOPortB.IsError"					Red="On" Yellow="Off" Green="Off" Blue="Off"  Buzzer1="On"/>
-	<STEvent name ="Boat.IsError"						Red="On" Yellow="Off" Green="Off" Blue="Off"  Buzzer1="On"/>
-	<STEvent name ="WaferRobot.IsError"					Red="On" Yellow="Off" Green="Off" Blue="Off"  Buzzer1="On"/>
-	<STEvent name ="CassetteRobot.IsError"				Red="On" Yellow="Off" Green="Off" Blue="Off"  Buzzer1="On"/>
-	<STEvent name ="PM1.IsError"						Red="On" Yellow="Off" Green="Off" Blue="Off"  Buzzer1="On"/>
-	<STEvent name ="PM1.IsAlarm"						Red="On" Yellow="Off" Green="Off" Blue="Off"  Buzzer1="On"/>
-
-	<STEvent name ="PM1.IsProcessing"					Red="Off"	   Yellow="Off" Green="On" Blue="Off"  Buzzer1="Off"/>
-
-	<STEvent name ="System.IsBusy"						Red="Off"      Yellow="Off" Green="On" Blue="Off"  Buzzer1="Off"/>
-
-	<STEvent name ="System.IsIdle"						Red="Off"      Yellow="On"  Green="Off" Blue="Off"  Buzzer1="Off"/>
-
-	<STEvent name ="System.IsWaitUnload"				Red="Off"      Yellow="Blinking"  Green="Off" Blue="Off"  Buzzer1="Off"/>
-
-	<STEvent name ="System.IsAutoRunning"				Red="Off"      Yellow="Off"  Green="On" Blue="Off"  Buzzer1="Off"/>
-
-	<STEvent name ="System.IsJobFinished"				Red="Off"      Yellow="On"  Green="Off" Blue="Off"  Buzzer1="On"/>
-
-	<STEvent name ="System.IsConnectedWithHost"			Red="Off"      Yellow="Off" Green="Off" Blue="On"  Buzzer1="Off"/>
-
-	<STEvent name ="System.IsDisconnectWithHost"		Red="Off"      Yellow="Off" Green="Off" Blue="Off"  Buzzer1="Off"/>
-	<STEvent name ="System.IsAlarmConditionBuzzerOn"		Red="Off"      Yellow="Off" Green="Off" Blue="Off"  Buzzer1="On"/>
 
 </STEvents>
 

+ 6 - 7
Furnace/FurnaceRT/Equipments/Systems/FurnaceSignalTower.cs

@@ -57,8 +57,7 @@ namespace FurnaceRT.Equipments.Systems
             try
             {
                 string reason = string.Empty;
-                _trigError.CLK = (LightDO != null && LightDO.SetValue(setpoint == TowerLightStatus.On ? true : false, out reason)) ||
-                        (LightDOFlash != null && LightDOFlash.SetValue(setpoint == TowerLightStatus.Blinking ? true : false, out reason));
+                _trigError.CLK = LightDO != null && LightDO.SetValue(setpoint == TowerLightStatus.On ? true : false, out reason);
                 if (_trigError.Q)
                 {
                     EV.PostWarningLog(Module, $"Set {Type} signal light {setpoint} error, {reason}");
@@ -167,9 +166,9 @@ namespace FurnaceRT.Equipments.Systems
             {
                 return null;
             }
-            return new FurnaceSingalLight(ModuleName.System.ToString(), $"SignalLight{type}") 
-            { 
-                Type = type, 
+            return new FurnaceSingalLight(ModuleName.System.ToString(), $"SignalLight{type}")
+            {
+                Type = type,
                 LightDO = _lightDoDic[type.ToString()],
                 LightDOFlash = _lightDoDic.ContainsKey(type.ToString() + "Flash") ? _lightDoDic[type.ToString() + "Flash"] : null,
             };
@@ -177,12 +176,12 @@ namespace FurnaceRT.Equipments.Systems
 
         public bool SetLight(LightType type, TowerLightStatus setpoint)
         {
-            if(_lights == null || !_lights.ContainsKey(type))
+            if (_lights == null || !_lights.ContainsKey(type))
             {
                 return false;
             }
             (_lights[type] as FurnaceSingalLight)?.SetLight(setpoint);
-                
+
             return true;
         }
     }