diff --git a/SicRT/Equipments/AutoTransfer.cs b/SicRT/Equipments/AutoTransfer.cs index dfc5d4f..f874b5f 100644 --- a/SicRT/Equipments/AutoTransfer.cs +++ b/SicRT/Equipments/AutoTransfer.cs @@ -12,6 +12,7 @@ using Aitex.Core.Util; using Aitex.Sorter.Common; using MECF.Framework.Common.DBCore; using MECF.Framework.Common.Equipment; +using MECF.Framework.Common.Gem; using MECF.Framework.Common.Jobs; using MECF.Framework.Common.Schedulers; using MECF.Framework.Common.SubstrateTrackings; @@ -986,6 +987,8 @@ namespace SicRT.Modules //_dbCallback.LotCreated(cj); cj.SetState(EnumControlJobState.Executing); + + GemManager.Instance.Equipment?.TriggerEvent("JobStarted", new string[] { "LotID" }, new object[] { cj.LotName }); } } } @@ -1668,6 +1671,8 @@ namespace SicRT.Modules _loadWaferInfo.Remove(_load.GetWaferInfo(0).WaferInnerID.ToString()); + GemManager.Instance.Equipment?.TriggerEvent("JobCompleted", new string[] { "LotID" }, new object[] { _load.GetWaferInfo(0).LotId }); + return; } } diff --git a/SicRT/Equipments/Systems/EquipmentManager.cs b/SicRT/Equipments/Systems/EquipmentManager.cs index 2a90e5b..9c34dd6 100644 --- a/SicRT/Equipments/Systems/EquipmentManager.cs +++ b/SicRT/Equipments/Systems/EquipmentManager.cs @@ -34,6 +34,8 @@ using SicModules.TMs; using SicModules.UnLoads; using System.Diagnostics; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.UnLoad; +using Kxware.Common; +using MECF.Framework.Common.Gem; namespace SicRT.Equipments.Systems { @@ -174,6 +176,12 @@ namespace SicRT.Equipments.Systems // private IoTC _tc = null; + private R_TRIG _notInitialized = new R_TRIG(); + private R_TRIG _initializing = new R_TRIG(); + private R_TRIG _idle = new R_TRIG(); + private R_TRIG _autoIdle = new R_TRIG(); + private R_TRIG _autoRunning = new R_TRIG(); + /// /// 主三色灯对象。 /// 主三色灯判断方式参考方法。 @@ -895,6 +903,9 @@ namespace SicRT.Equipments.Systems modulesValue.PostMsg(MSG.ABORT); } } + + GemManager.Instance.Equipment?.SetProcessState(ProcessStates.Aborting); + return true; } @@ -1390,9 +1401,46 @@ namespace SicRT.Equipments.Systems { MonitorPmTmInfo(); MonitorUPSAlarm(); + MonitorGemSystemState(); + return true; } + private void MonitorGemSystemState() + { + //SetProcessState指的是整个设备的状态,会触发ProcessStateChanged事件 + + _notInitialized.CLK = FsmState == (int)RtState.Init; + if (_notInitialized.Q) + { + GemManager.Instance.Equipment?.SetProcessState(ProcessStates.NotInitialized); + } + + _initializing.CLK = FsmState == (int)RtState.Initializing; + if (_initializing.Q) + { + GemManager.Instance.Equipment?.SetProcessState(ProcessStates.Initializing); + } + + _idle.CLK = FsmState == (int)RtState.Idle; + if (_idle.Q) + { + GemManager.Instance.Equipment?.SetProcessState(ProcessStates.Idle); + } + + _autoIdle.CLK = FsmState == (int)RtState.AutoIdle; + if (_autoIdle.Q) + { + GemManager.Instance.Equipment?.SetProcessState(ProcessStates.Ready); + } + + _autoRunning.CLK = FsmState == (int)RtState.AutoRunning; + if (_autoRunning.Q) + { + GemManager.Instance.Equipment?.SetProcessState(ProcessStates.Executing); + } + } + private void MonitorPmTmInfo() { if (_pm1SlitValve != null) diff --git a/SicRT/SicRT.csproj b/SicRT/SicRT.csproj index 4ed97f3..58c5c92 100644 --- a/SicRT/SicRT.csproj +++ b/SicRT/SicRT.csproj @@ -65,6 +65,7 @@ ..\ThirdParty\MECF.Framework\FabConnect.dll + ..\ThirdParty\MECF.Framework\log4net.dll