Browse Source

New routing algorithm for Venus SE/DE system.

sangwq 10 months ago
parent
commit
7bf784cc5a

+ 2 - 1
Venus/Venus_RT/Devices/VCE/HongHuVce.cs

@@ -106,6 +106,7 @@ namespace Venus_RT.Devices.VCE
         private VceMessage _currentVceMessage;
         private bool _HasReceiveMsg;
         private bool _IsDashWaferError;
+        private ModuleName _baseLPIndex => _moduleName == ModuleName.VCEA ? ModuleName.LP1 : ModuleName.LP2; 
 
         private Loadport[] _LPMs = new Loadport[1];
         public override ILoadport this[ModuleName mod]
@@ -115,7 +116,7 @@ namespace Venus_RT.Devices.VCE
                 if (!ModuleHelper.IsLoadPort(mod))
                     throw new ApplicationException($"{mod} is NOT Loadport");
 
-                return _LPMs[mod - ModuleName.LP1];
+                return _LPMs[mod - _baseLPIndex];
             }
         }
 

+ 16 - 12
Venus/Venus_RT/Modules/RouteManager.cs

@@ -27,6 +27,7 @@ using System.Reflection;
 using Venus_RT.Modules.LPs;
 using System.Runtime.InteropServices;
 using Venus_RT.Devices.EFEM;
+using Venus_RT.Modules.Schedulers;
 
 namespace Venus_RT.Modules
 {
@@ -476,10 +477,10 @@ namespace Venus_RT.Modules
                 return ModuleHelper.IsInstalled((ModuleName)args[0]);
             });
             OP.Subscribe("System.SETMCycle", (cmd, args) => CheckToPostMessage((int)MSG.SETMCycle, args));
-            OP.Subscribe("System.CreateSEJob", (cmd, args) => CheckToPostMessage((int)MSG.CreateSEJob, args));
-            OP.Subscribe("System.StartSEJob", (cmd, args) => CheckToPostMessage((int)MSG.StartSEJob, args));
-            OP.Subscribe("System.ReturnAllSEWafer", (cmd, args) => CheckToPostMessage((int)MSG.SEReturnWafer, args));
-            OP.Subscribe("System.SEAbort", (cmd, args) => CheckToPostMessage((int)MSG.SEAbort, args));
+            OP.Subscribe("System.CreateSEJob", (cmd, args) => CheckToPostMessage((int)MSG.CreateJob, args));
+            OP.Subscribe("System.StartSEJob", (cmd, args) => CheckToPostMessage((int)MSG.StartJob, args));
+            OP.Subscribe("System.ReturnAllSEWafer", (cmd, args) => CheckToPostMessage((int)MSG.ReturnAllWafer, args));
+            OP.Subscribe("System.SEAbort", (cmd, args) => CheckToPostMessage((int)MSG.AbortJob, args));
         }
 
         public bool CheckToPostMessage(int msg, params object[] args)
@@ -683,6 +684,7 @@ namespace Venus_RT.Modules
                 _seTMCycle = new SETMCycle(ModuleName.SETM);
                 _setransfer = new SEManualTransfer();
                 _sereturnWafer = new SEReturnWafer(_setransfer);
+                _AutoCycle = new VenusDispatcher(); 
             }
             else
             {
@@ -960,7 +962,7 @@ namespace Venus_RT.Modules
         {
             Dictionary<string, object> obj = (Dictionary<string, object>)objs[0];
             var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), obj["Module"].ToString());
-            if (EFEM.EfemDevice[moduleName].IsLoaded)
+            if ((Singleton<TransferModule>.Instance.GetScheduler(moduleName) as SchedulerLoadPort).IsLoaded)
             {
                 return _AutoCycle.CreateJob(obj, out var reason);
             }
@@ -1112,12 +1114,13 @@ namespace Venus_RT.Modules
         }
         private bool FsmStartSETMCycle(object[] objs)
         {
-            return _seTMCycle.Start(objs) == RState.Running;
+            //return _seTMCycle.Start(objs) == RState.Running;
+            return _AutoCycle.Start(objs) == RState.Running;
         }
 
         private bool FsmMonitorSETMCycle(object[] objs)
         {
-            RState ret = _seTMCycle.Monitor();
+            RState ret = _AutoCycle.Monitor();
             if (ret == RState.Failed || ret == RState.Timeout)
             {
                 PostMsg(MSG.ERROR);
@@ -1128,24 +1131,25 @@ namespace Venus_RT.Modules
         }
         private bool FsmStopSETMCycle(object[] objs)
         {
-            _seTMCycle.Abort();
+            _AutoCycle.Abort();
             return true;
         }
 
         private bool FsmStartCreateSEJob(object[] objs)
         {
-            _seTMCycle.CreateJob((Dictionary<string, object>)objs[0]);
+            _AutoCycle.CreateJob((Dictionary<string, object>)objs[0], out string reason);
             return true;
         }
 
         private bool FsmStartSEJob(object[] objs)
         {
-            return _seTMCycle.StartJob(objs[0].ToString()) == RState.Running;
+            //return _seTMCycle.StartJob(objs[0].ToString()) == RState.Running;
+            return _AutoCycle.StartJob(objs[0].ToString(), out string reason);   
         }
 
         private bool FsmSEJobMonitor(object[] objs)
         {
-            RState ret = _seTMCycle.Monitor();
+            RState ret = _AutoCycle.Monitor();
             return ret == RState.End;
         }
 
@@ -1182,7 +1186,7 @@ namespace Venus_RT.Modules
         }
         private bool SEAbortJob(object[] objs)
         {
-            _seTMCycle.AbortJob((string)objs[0], out var reason);
+            _AutoCycle.AbortJob((string)objs[0], out var reason);
             return true;
         }
         private bool SEAbort(object[] objs)

+ 18 - 7
Venus/Venus_RT/Modules/Schedulers/SchedulerLoadPort.cs

@@ -8,6 +8,7 @@ using Aitex.Sorter.Common;
 using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.Schedulers;
 using MECF.Framework.Common.SubstrateTrackings;
+using Venus_RT.Modules.VCE;
 using Venus_RT.Scheduler;
 
 namespace Venus_RT.Modules.Schedulers
@@ -16,40 +17,50 @@ namespace Venus_RT.Modules.Schedulers
     {
         public override bool IsAvailable
         {
-            get { return _entity.IsIdle && IsLoaded && CheckTaskDone(); }
+            get { return IsIdle && IsLoaded && CheckTaskDone(); }
 
         }
 
         public override bool IsOnline
         {
-            get { return true; }
+            get { return _isVenus ? _vceEntity.IsOnline : _entity.IsOnline; }
 
         }
 
         public override bool IsError
         {
-            get { return _entity.IsError; }
+            get { return _isVenus ? _vceEntity.IsError : _entity.IsError; }
 
         }
 
         public override bool IsIdle
         {
-            get { return _entity.IsIdle; }
+            get { return _isVenus ? _vceEntity.IsIdle : _entity.IsIdle; }
         }
 
         public bool IsLoaded
         {
-            get { return _entity.EfemDevice[Module].IsLoaded; }
+            get { return _isVenus ? _vceEntity.VCEDevice[Module].IsLoaded : _entity.EfemDevice[Module].IsLoaded; }
         }
 
         private EfemEntity _entity = null;
+        private VceEntity _vceEntity = null;
+        private bool _isVenus = RtInstance.ConfigType == Venus_Core.ConfigType.VenusSE || RtInstance.ConfigType == Venus_Core.ConfigType.VenusDE; 
 
         public SchedulerLoadPort(ModuleName module) : base(module.ToString())
         {
             _module = module.ToString();
- 
+            if(RtInstance.ConfigType == Venus_Core.ConfigType.VenusSE || RtInstance.ConfigType == Venus_Core.ConfigType.VenusDE)
+            {
+                if (module == ModuleName.LP2)
+                    _vceEntity = Singleton<RouteManager>.Instance.VCEB;
+                else
+                    _vceEntity = Singleton<RouteManager>.Instance.VCEA;
+            }
+            else
+            {
                 _entity = Singleton<RouteManager>.Instance.EFEM;
- 
+            }
         }
 
         public bool Load()

+ 2 - 0
Venus/Venus_RT/Modules/VCE/VceEntity.cs

@@ -117,6 +117,8 @@ namespace Venus_RT.Modules.VCE
         public bool VCEOutDoorClosed => !_vce.OutDoorIsOpen;
         public bool CassetteArrive => _CassetteArrive;
 
+        public VCEModuleBase VCEDevice => _vce;
+
 
         public int CurrentSlot => currentSlot;
         private int currentSlot;

+ 19 - 14
Venus/Venus_RT/Modules/VenusDispatcher.cs

@@ -220,10 +220,13 @@ namespace Venus_RT.Modules
         {
             if(_runingWaferTask.Value.Count == 0)
             {
-                _runingWaferTask = _pendingWaferTasks.Dequeue();
-                if(_runingWaferTask.Value.First().Key == RecipeJobType.PreClean)
+                if(_pendingWaferTasks.Count > 0)
                 {
-                    Status = ModuleStatus.WaitPreJobClean;
+                    _runingWaferTask = _pendingWaferTasks.Dequeue();
+                    if (_runingWaferTask.Value.First().Key == RecipeJobType.PreClean)
+                    {
+                        Status = ModuleStatus.WaitPreJobClean;
+                    }
                 }
             }
             else
@@ -797,10 +800,9 @@ namespace Venus_RT.Modules
 
             if (cj.State == EnumControlJobState.WaitingForStart)
             {
-                cj.SetState(EnumControlJobState.Executing);
+                cj.SetState(EnumControlJobState.Queued);
                 //PreJobClean(cj);
 
-                cj.JetState = EnumJetCtrlJobState.Quequed;
 
                 cj.StartTime = DateTime.Now;
 
@@ -978,14 +980,10 @@ namespace Venus_RT.Modules
                     {
                         _dictModuleTask[module] = new VenusPMTask(module);
                     }
-                    else if (ModuleHelper.isSETM(module))
+                    else if (ModuleHelper.IsTMRobot(module))
                     {
                         _dictModuleTask[module] = new VenusTMRobotTask(module);
                     }
-                    else if (ModuleHelper.IsVCE(module))
-                    {
-                        _dictModuleTask[module] = new VCETask(module);
-                    }
                     else if (ModuleHelper.IsAligner(module))
                     {
                         _dictModuleTask[module] = new PreAlignTask(module);
@@ -1108,6 +1106,14 @@ namespace Venus_RT.Modules
                             _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem(ModuleName.TMRobot, (int)Hand.Blade1, aligner.First().Key, 0, Hand.Blade1) });
                         }
                     }
+                    else if(emptyAndReadyIn20sPMs.Count >= 1 && waitInWafers.Count >= 1)
+                    {
+                        _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem(waitInWafers[0].currentMod, waitInWafers[0].currentSlot, ModuleName.TMRobot, (int)Hand.Blade1, Hand.Blade1) });
+                        if (aligner.Count > 0)
+                        {
+                            _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem(ModuleName.TMRobot, (int)Hand.Blade1, aligner.First().Key, 0, Hand.Blade1) });
+                        }
+                    }
                 }
             }
             else if(robotWafers.Count == 1)
@@ -1523,7 +1529,7 @@ namespace Venus_RT.Modules
             foreach(var cj in _lstControlJobs)
             {
                 LoadportCassetteState state = (LoadportCassetteState)DATA.Poll($"{cj.Module}.CassetteState");
-                if (cj.State == EnumControlJobState.Completed && state != LoadportCassetteState.Normal && cj.JetState == EnumJetCtrlJobState.Completed)
+                if (cj.State == EnumControlJobState.Completed && state != LoadportCassetteState.Normal)
                 {
                     cjRemoveList.Add(cj);
                 }
@@ -1557,8 +1563,7 @@ namespace Venus_RT.Modules
                     {
                         foreach (var cj in _lstControlJobs)
                         {
-                            cj.SetState(EnumControlJobState.Executing);
-                            cj.JetState = EnumJetCtrlJobState.Quequed;
+                            cj.SetState(EnumControlJobState.Queued);
 
                             cj.LotInnerId = Guid.NewGuid();
 
@@ -1628,7 +1633,7 @@ namespace Venus_RT.Modules
 
         private bool ActiveControlJob(ControlJobInfo cj)
         {
-            cj.JetState = EnumJetCtrlJobState.Processing;
+            cj.SetState(EnumControlJobState.Executing);
             foreach (var pjName in cj.ProcessJobNameList)
             {
                 var pj = _lstProcessJobs.Find(x => x.Name == pjName);