Browse Source

1、RouteManager增加了StopJob,AbortJob等
2、RouteManager完成了获取所有Sequence集合,获取指定Recipe名称内容;
3、在AutoCycle、SystemDispatcher增加了loadport当前ControlJob,并更新了主界面中任务显示;

chenkui 1 year ago
parent
commit
5cf3c54d79

+ 2 - 1
Venus/Framework/Common/DataCenter/IQueryDataService.cs

@@ -16,6 +16,7 @@ using MECF.Framework.Common.ControlDataContext;
 using MECF.Framework.Common.DBCore;
 using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.IOCore;
+using MECF.Framework.Common.Jobs;
 using MECF.Framework.Common.Schedulers;
 using MECF.Framework.Common.SubstrateTrackings;
 using Venus_Core;
@@ -116,7 +117,7 @@ namespace MECF.Framework.Common.DataCenter
     [ServiceKnownType(typeof(List<PMLeakCheckResult>))]
 
     [ServiceKnownType(typeof(ObservableCollection<SignalTowerItem>))]
-
+	[ServiceKnownType(typeof(ControlJobInfo))]
 
 
 

+ 9 - 2
Venus/Framework/Common/Jobs/ControlJob.cs

@@ -1,28 +1,35 @@
 using System;
 using System.Collections.Generic;
+using System.Runtime.Serialization;
 using Aitex.Core.Common;
 
 namespace MECF.Framework.Common.Jobs
 {
     [Serializable]
+    [DataContract]
     public class ControlJobInfo
     {
+        [DataMember]
         public string Name { get; set; }
 
         public Guid InnerId { get; set; }
 
         public bool BeenPosted { get; set; }
 
+        [DataMember]
         public string Module { get; set; }
  
         public List<string> ProcessJobNameList { get; set; }
 
+        [DataMember]
         public EnumControlJobState State { get; set; }
 
+        [DataMember]
         public EnumJetCtrlJobState JetState { get; set; }
 
         public string LotName { get; set; }
         public Guid LotInnerId { get; set; }
+        [DataMember]
         public List<WaferInfo> LotWafers { get; set; }
 
         public string CarrierID { get; set; }
@@ -36,9 +43,9 @@ namespace MECF.Framework.Common.Jobs
         public DateTime StartTime { get; set; }
 
         public DateTime EndTime { get; set; }
-
+        [DataMember]
         public string PreJobClean { get; set; }
-
+        [DataMember]
         public string PostJobClean { get; set; }
 
 

+ 4 - 4
Venus/Framework/Common/Routine/IRoutine.cs

@@ -25,10 +25,10 @@ namespace Aitex.Core.RT.Routine
          RState CycleState { get; }
 
 
-        void AbortJob(string jobName);
-        void StopJob(string jobName);
-        void ResumeJob(string jobName);
-        void PauseJob(string jobName);
+        bool AbortJob(string jobName,out string reason);
+        bool StopJob(string jobName,out string reason);
+        bool ResumeJob(string jobName,out string reason);
+        bool PauseJob(string jobName,out string reason);
         bool StartJob(string jobName,out string reason);
         bool CreateJob(Dictionary<string, object> param,out string reason);
         void Clear();

+ 47 - 7
Venus/Venus_MainPages/ViewModels/OperationOverViewModel.cs

@@ -2,6 +2,7 @@
 using MECF.Framework.Common.CommonData;
 using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.Equipment;
+using MECF.Framework.Common.Jobs;
 using MECF.Framework.Common.OperationCenter;
 using OpenSEMI.ClientBase;
 using Prism.Commands;
@@ -660,17 +661,17 @@ namespace Venus_MainPages.ViewModels
             List<string> slotSequence = new List<string>();
             info.ModuleData.WaferManager.Wafers.ForEach(key => { slotSequence.Insert(0, key.SequenceName); });
 
-            string jobId = info.LotId.Trim();
-            if (string.IsNullOrEmpty(jobId))
-                jobId = "CJ_Local_" + info.ModuleData.ModuleID;
-            info.LotId = jobId;
-            info.JobID = jobId;
-            info.JobStatus = "WaitingForStart";
+            //string jobId = info.LotId.Trim();
+            //if (string.IsNullOrEmpty(jobId))
+            //    jobId = "CJ_Local_" + info.ModuleData.ModuleID;
+            //info.LotId = jobId;
+            //info.JobID = jobId;
+            //info.JobStatus = "WaitingForStart";
             info.LotIdSaved = true;
 
             Dictionary<string, object> param = new Dictionary<string, object>()
             {
-                {"JobId", jobId},
+                {"JobId", ""},
                 {"Module", info.ModuleData.ModuleID},
                 {"SlotSequence", slotSequence.ToArray()},
                 {"AutoStart", true},
@@ -752,6 +753,21 @@ namespace Venus_MainPages.ViewModels
                 EFEMBladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
                 EFEMBladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
                 Aligner1Wafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
+                ControlJobInfo lp1Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP1.CurrentControlJob");
+                if(lp1Cj!=null)
+                {
+                    UPdateWaferAssociation(LP1WaferAssociation, lp1Cj);
+                }
+                ControlJobInfo lp2Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP2.CurrentControlJob");
+                if (lp2Cj != null)
+                {
+                    UPdateWaferAssociation(LP2WaferAssociation, lp2Cj);
+                }
+                ControlJobInfo lp3Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP3.CurrentControlJob");
+                if (lp3Cj != null)
+                {
+                    UPdateWaferAssociation(LP2WaferAssociation, lp3Cj);
+                }
             }
 
             RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
@@ -768,6 +784,27 @@ namespace Venus_MainPages.ViewModels
                 RouteState = "Pause";
             }          
         }
+        /// <summary>
+        /// 更新Wafer情况
+        /// </summary>
+        /// <param name="info"></param>
+        /// <param name="cjInfo"></param>
+        private void UPdateWaferAssociation(WaferAssociationInfo info,ControlJobInfo cjInfo)
+        {
+            info.LotId = cjInfo.Name;
+            info.JobID = cjInfo.Name;
+            info.JobStatus = cjInfo.State.ToString() ;
+            if (cjInfo.LotWafers != null)
+            {
+                for (int i=0;i< cjInfo.LotWafers.Count;i++)
+                {
+                    int index = cjInfo.LotWafers[i].Slot;
+                    info.ModuleData.WaferManager.Wafers[index].SequenceName = cjInfo.LotWafers[i].SequenceName;
+                }
+            }
+            info.PreCleanRecipeName = cjInfo.PreJobClean;
+            info.PostCleanRecipeName = cjInfo.PostJobClean;
+        }
         private async void RobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
         {
             string RobotTarget;
@@ -1200,6 +1237,9 @@ namespace Venus_MainPages.ViewModels
                 m_RtDataKeys.Add("LP1.CassettePlaced");
                 m_RtDataKeys.Add("LP2.CassettePlaced");
                 m_RtDataKeys.Add("LP3.CassettePlaced");
+                m_RtDataKeys.Add("LP1.CurrentControlJob");
+                m_RtDataKeys.Add("LP2.CurrentControlJob");
+                m_RtDataKeys.Add("LP3.CurrentControlJob");
                 m_RtDataKeys.Add("EFEM.IsOnline");
             }
 

+ 40 - 11
Venus/Venus_RT/Modules/AutoCycle.cs

@@ -145,6 +145,8 @@ namespace Venus_RT.Modules
         public bool HasJobRunning => _lstControlJobs.Count > 0;
         public RState CycleState => _cycleState;
 
+        private Dictionary<string, ControlJobInfo> _loadportControlJobDic = new Dictionary<string, ControlJobInfo>();
+
         #region public interface
         public AutoCycle()
         {
@@ -172,6 +174,12 @@ namespace Venus_RT.Modules
 
             DATA.Subscribe("Scheduler.PjIdList", () => Array.ConvertAll(_lstProcessJobs.ToArray(), x => x.InnerId.ToString()).ToList());
             DATA.Subscribe("Scheduler.PjNameList", () => Array.ConvertAll(_lstProcessJobs.ToArray(), x => x.LotName.ToString()).ToList());
+            for(int i=1;i<=3;i++)
+            {
+                _loadportControlJobDic[$"LP{i}"] = null;
+                string lp = $"LP{i}";
+                DATA.Subscribe($"{lp}.CurrentControlJob", () =>  _loadportControlJobDic[lp],SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            }
 
         }
 
@@ -378,8 +386,9 @@ namespace Venus_RT.Modules
 
             _lstControlJobs.Add(cj);
             //AssociatedPMWithLP(cj);
-
+            _loadportControlJobDic[cj.Module] = cj;
             _faCallback.JobCreated(cj, GetFirstProcessJob(cj));
+
             return true;
         }
 
@@ -421,13 +430,15 @@ namespace Venus_RT.Modules
 
             return null;
         }
-        public void AbortJob(string jobName)
+        public bool AbortJob(string jobName,out string reason)
         {
+            reason = "";
             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName);
             if (cj == null)
             {
-                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"abort job rejected, not found job with id {jobName}");
-                return;
+                reason=$"abort job rejected, not found job with id {jobName}";
+                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, reason);
+                return false;
             }
 
             List<ProcessJobInfo> pjAbortList = new List<ProcessJobInfo>();
@@ -460,15 +471,22 @@ namespace Venus_RT.Modules
             }
 
             _lstControlJobs.Remove(cj);
+            if (_loadportControlJobDic.ContainsKey(cj.Module))
+            {
+                _loadportControlJobDic[cj.Module] = null;
+            }
+            return true;
         }
 
-        public void StopJob(string jobName)
+        public bool StopJob(string jobName,out string reason)
         {
+            reason = "";
             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName);
             if (cj == null)
             {
-                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"stop job rejected, not found job with id {jobName}");
-                return;
+                reason = $"stop job rejected, not found job with id {jobName}";
+                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System,reason);
+                return false;
             }
 
             foreach (var pj in _lstProcessJobs)
@@ -481,15 +499,22 @@ namespace Venus_RT.Modules
 
             _faCallback.JobStopped(cj, GetFirstProcessJob(cj));
             _dbCallback.LotFinished(cj);
+            if (_loadportControlJobDic.ContainsKey(cj.Module))
+            {
+                _loadportControlJobDic[cj.Module] = null;
+            }
+            return true;
         }
 
-        public void ResumeJob(string jobName)
+        public bool ResumeJob(string jobName,out string reason)
         {
+            reason = "";
             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName);
             if (cj == null)
             {
+                reason = $"resume job rejected, not found job with id {jobName}";
                 //LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"resume job rejected, not found job with id {jobName}");
-                return;
+                return false;
             }
 
             if (cj.State == EnumControlJobState.Paused)
@@ -499,15 +524,18 @@ namespace Venus_RT.Modules
 
             _faCallback.JobResumed(cj, GetFirstProcessJob(cj));
             _cycleState = RState.Running;
+            return true;
         }
 
-        public void PauseJob(string jobName)
+        public bool PauseJob(string jobName,out string reason)
         {
+            reason = "";
             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName);
             if (cj == null)
             {
+                reason = $"pause job rejected, not found job with id {jobName}";
                 //LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"pause job rejected, not found job with id {jobName}");
-                return;
+                return false;
             }
 
             if (cj.State == EnumControlJobState.Executing)
@@ -519,6 +547,7 @@ namespace Venus_RT.Modules
 
             if (!_lstControlJobs.Exists(job => job.State == EnumControlJobState.Executing))
                 _cycleState = RState.Paused;
+            return true;
         }
 
 

+ 71 - 6
Venus/Venus_RT/Modules/RouteManager.cs

@@ -22,6 +22,7 @@ using Venus_RT.Modules.VCE;
 using Venus_RT.Devices.PreAligner;
 using Venus_RT.Modules.TM.VenusEntity;
 using SecsGem.Core.Application;
+using Aitex.Core.RT.RecipeCenter;
 
 namespace Venus_RT.Modules
 {
@@ -926,25 +927,26 @@ namespace Venus_RT.Modules
 
         private bool FsmPauseJob(object[] objs)
         {
-            _AutoCycle.PauseJob((string)objs[0]);
+            _AutoCycle.PauseJob((string)objs[0],out var reason);
             return true;
         }
 
         private bool FsmResumeJob(object[] objs)
         {
-            _AutoCycle.ResumeJob((string)objs[0]);
+            _AutoCycle.ResumeJob((string)objs[0],out var reason);
             return true;
         }
 
         private bool FsmStopJob(object[] objs)
         {
-            _AutoCycle.StopJob((string)objs[0]);
+            _AutoCycle.StopJob((string)objs[0], out var reason);
+
             return true;
         }
 
         private bool FsmAbortJob(object[] objs)
         {
-            _AutoCycle.AbortJob((string)objs[0]);
+            _AutoCycle.AbortJob((string)objs[0],out var reason);
             return true;
         }
 
@@ -1153,10 +1155,20 @@ namespace Venus_RT.Modules
                     return FaCreateJob(paras, out reason);
                 case "StartJob":
                     return FaStartJob(paras[0].ToString(), out reason);
+                case "StopJob":
+                    return FaStopJob(paras[0].ToString(), out reason);
+                case "AbortJob":
+                    return FaAbortob(paras[0].ToString(), out reason);
+                case "PauseJob":
+                    return FaPauseJob(paras[0].ToString(), out reason);
+                case "ResumeJob":
+                    return FaResumeJob(paras[0].ToString(), out reason);
                 case "Load":
                     return FaLoad(paras[0].ToString());
                 case "Unload":
                     return FaUnLoad(paras[0].ToString());
+                case "ReadID":
+                    return FaReadId(paras[0].ToString());
                     
             }
             return true;
@@ -1203,6 +1215,46 @@ namespace Venus_RT.Modules
             return _AutoCycle.StartJob(jobName,out reason);
         }
         /// <summary>
+        /// Fa停止任务
+        /// </summary>
+        /// <param name="jobName"></param>
+        /// <param name="reason"></param>
+        /// <returns></returns>
+        private bool FaStopJob(string jobName, out string reason)
+        {
+            return _AutoCycle.StopJob(jobName, out reason);
+        }
+        /// <summary>
+        /// Fa中止任务
+        /// </summary>
+        /// <param name="jobName"></param>
+        /// <param name="reason"></param>
+        /// <returns></returns>
+        private bool FaAbortob(string jobName, out string reason)
+        {
+            return _AutoCycle.AbortJob(jobName, out reason);
+        }
+        /// <summary>
+        /// Fa暂停任务
+        /// </summary>
+        /// <param name="jobName"></param>
+        /// <param name="reason"></param>
+        /// <returns></returns>
+        private bool FaPauseJob(string jobName, out string reason)
+        {
+            return _AutoCycle.PauseJob(jobName, out reason);
+        }
+        /// <summary>
+        /// Fa恢复任务
+        /// </summary>
+        /// <param name="jobName"></param>
+        /// <param name="reason"></param>
+        /// <returns></returns>
+        private bool FaResumeJob(string jobName, out string reason)
+        {
+            return _AutoCycle.ResumeJob(jobName, out reason);
+        }
+        /// <summary>
         /// Fa Load
         /// </summary>
         /// <param name="lp"></param>
@@ -1212,6 +1264,15 @@ namespace Venus_RT.Modules
             return EFEM.EfemDevice.Load(ModuleHelper.Converter($"LP{lp}"));
         }
         /// <summary>
+        /// 读取Id
+        /// </summary>
+        /// <param name="lp"></param>
+        /// <returns></returns>
+        private bool FaReadId(string lp)
+        {
+            return EFEM.EfemDevice.ReadCarrierId(ModuleHelper.Converter($"LP{lp}"));
+        }
+        /// <summary>
         /// Fa Unload
         /// </summary>
         /// <param name="lp"></param>
@@ -1220,14 +1281,18 @@ namespace Venus_RT.Modules
         {
             return EFEM.EfemDevice.Unload(ModuleHelper.Converter($"LP{lp}"));
         }
+        /// <summary>
+        /// 获取所有Sequence
+        /// </summary>
+        /// <returns></returns>
         public string[] GetSequenceList()
         {
-            return null;
+            return RecipeFileManager.Instance.GetSequenceNameList().ToArray();
         }
 
         public string GetSequenceBody(string ppid)
         {
-            return "";
+            return RecipeFileManager.Instance.GetSequence(ppid, false);
         }
 
         public List<string> GetFormatedSequence(string ppid)

+ 39 - 11
Venus/Venus_RT/Modules/SystemDispatcher.cs

@@ -693,6 +693,7 @@ namespace Venus_RT.Modules
 
         private RState _cycleState = RState.Init;
         public RState CycleState => _cycleState;
+        private Dictionary<string, ControlJobInfo> _loadportControlJobDic = new Dictionary<string, ControlJobInfo>();
 
         #region public interface
         public SystemDispatcher()
@@ -716,6 +717,13 @@ namespace Venus_RT.Modules
 
             DATA.Subscribe("Scheduler.PjIdList", () => Array.ConvertAll(_lstProcessJobs.ToArray(), x => x.InnerId.ToString()).ToList());
             DATA.Subscribe("Scheduler.PjNameList", () => Array.ConvertAll(_lstProcessJobs.ToArray(), x => x.LotName.ToString()).ToList());
+
+            for (int i = 1; i <= 3; i++)
+            {
+                _loadportControlJobDic[$"LP{i}"] = null;
+                string lp = $"LP{i}";
+                DATA.Subscribe($"{lp}.CurrentControlJob", () => _loadportControlJobDic[lp], SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            }
         }
 
         public RState Start(params object[] objs)
@@ -951,13 +959,15 @@ namespace Venus_RT.Modules
 
             return null;
         }
-        public void AbortJob(string jobName)
+        public bool AbortJob(string jobName,out string reason)
         {
+            reason = "";
             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName);
             if (cj == null)
             {
-                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"abort job rejected, not found job with id {jobName}");
-                return;
+                reason = $"abort job rejected, not found job with id {jobName}";
+                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, reason);
+                return false;
             }
 
             List<ProcessJobInfo> pjAbortList = new List<ProcessJobInfo>();
@@ -990,15 +1000,22 @@ namespace Venus_RT.Modules
             }
 
             _lstControlJobs.Remove(cj);
+            if (_loadportControlJobDic.ContainsKey(cj.Module))
+            {
+                _loadportControlJobDic[cj.Module] = null;
+            }
+            return true;
         }
 
-        public void StopJob(string jobName)
+        public bool StopJob(string jobName, out string reason)
         {
+            reason = "";
             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName);
             if (cj == null)
             {
-                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"stop job rejected, not found job with id {jobName}");
-                return;
+                reason = $"stop job rejected, not found job with id {jobName}";
+                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, reason);
+                return false;
             }
 
             foreach (var pj in _lstProcessJobs)
@@ -1011,15 +1028,22 @@ namespace Venus_RT.Modules
 
             _faCallback.JobStopped(cj, GetFirstProcessJob(cj));
             _dbCallback.LotFinished(cj);
+            if (_loadportControlJobDic.ContainsKey(cj.Module))
+            {
+                _loadportControlJobDic[cj.Module] = null;
+            }
+            return true;
         }
 
-        public void ResumeJob(string jobName)
+        public bool ResumeJob(string jobName, out string reason)
         {
+            reason = "";
             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName);
             if (cj == null)
             {
+                reason = $"resume job rejected, not found job with id {jobName}";
                 //LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"resume job rejected, not found job with id {jobName}");
-                return;
+                return false;
             }
 
             if (cj.State == EnumControlJobState.Paused)
@@ -1029,15 +1053,18 @@ namespace Venus_RT.Modules
 
             _faCallback.JobResumed(cj, GetFirstProcessJob(cj));
             _cycleState = RState.Running;
+            return true;
         }
 
-        public void PauseJob(string jobName)
+        public bool PauseJob(string jobName, out string reason)
         {
+            reason = "";
             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName);
             if (cj == null)
             {
-                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"pause job rejected, not found job with id {jobName}");
-                return;
+                reason = $"pause job rejected, not found job with id {jobName}";
+                //LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"pause job rejected, not found job with id {jobName}");
+                return false;
             }
 
             if (cj.State == EnumControlJobState.Executing)
@@ -1049,6 +1076,7 @@ namespace Venus_RT.Modules
 
             if (!_lstControlJobs.Exists(job => job.State == EnumControlJobState.Executing))
                 _cycleState = RState.Paused;
+            return true;
         }