Browse Source

enhance wafer manager.

sangwq 2 years ago
parent
commit
46261ca338

+ 22 - 17
Venus/Framework/Common/SubstrateTrackings/WaferInfo.cs

@@ -42,23 +42,11 @@ namespace Aitex.Core.Common
 
 	}
 
-    public enum EnumWaferProcessResult
+    public enum EnumWaferChuckStatus
     {
-        Unprocessed = 0,
-        Warning,
-        Alarm,
-        Aborted,
-    }
-
-
-    [Obsolete("Do not use this enum, using EnumWaferProcessStatus instead")]
-    public enum ProcessStatus
-    {
-        Idle = 0,
-        Wait = 1,
-        Busy = 2,
-        Completed = 3,
-        Failed = 4,
+        Init = 0,
+        Chucked,
+        Dechucked,
     }
 
     [Serializable]
@@ -248,10 +236,25 @@ namespace Aitex.Core.Common
 			set
 			{
 				processState = value;
-			    InvokePropertyChanged("ProcessStatus");
+			    InvokePropertyChanged("ProcessState");
 			}
 		}
 
+		private EnumWaferChuckStatus chuckState;
+		[DataMember]
+		public EnumWaferChuckStatus ChuckState
+        {
+			get
+            {
+				return chuckState;
+            }
+			set
+            {
+				chuckState = value;
+				InvokePropertyChanged("ChuckState");
+            }
+        }
+
 		private bool isSource;
 	    [DataMember]
         public bool IsSource
@@ -312,6 +315,7 @@ namespace Aitex.Core.Common
 			T7Code = source.T7Code;
 			Status = source.Status;
 			ProcessState = source.ProcessState;
+			ChuckState = source.ChuckState;
 			IsSource = source.IsSource;
 			IsDestination = source.IsDestination;
 
@@ -348,6 +352,7 @@ namespace Aitex.Core.Common
             this.Status = (int)WaferStatus.Empty;
  
 	        this.ProcessState = EnumWaferProcessStatus.Idle;
+			this.ChuckState = EnumWaferChuckStatus.Init;
 
 	        this.IsSource = false;
 

+ 31 - 61
Venus/Framework/Common/SubstrateTrackings/WaferManager.cs

@@ -89,7 +89,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
             }
             else
             {
-                //LOG.Write(string.Format("Failed SubscribeLocation, module name invalid, {0} ", module));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed SubscribeLocation, module name invalid, {0} ", module));
             }
         }
 
@@ -111,13 +111,13 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (_locationWafers[moduleFrom][slotFrom].IsEmpty)
             {
-                //LOG.Write(string.Format("Invalid wafer move, no wafer at source, {0}{1}=>{2}{3}", moduleFrom, slotFrom+1, moduleTo, slotTo+1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Invalid wafer move, no wafer at source, {0}{1}=>{2}{3}", moduleFrom, slotFrom+1, moduleTo, slotTo+1));
                 return;
             }
 
             if (!_locationWafers[moduleTo][slotTo].IsEmpty)
             {
-                //LOG.Write(string.Format("Invalid wafer move, destination has wafer, {0}{1}=>{2}{3}", moduleFrom, slotFrom + 1, moduleTo, slotTo + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Invalid wafer move, destination has wafer, {0}{1}=>{2}{3}", moduleFrom, slotFrom + 1, moduleTo, slotTo + 1));
                 return;
             }
 
@@ -339,7 +339,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Invalid wafer create, invalid parameter, {0},{1}", module, slot+1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Invalid wafer create, invalid parameter, {0},{1}", module, slot+1));
                 return null;
             }
 
@@ -350,8 +350,8 @@ namespace MECF.Framework.Common.SubstrateTrackings
                 CarrierInfo carrier = CarrierManager.Instance.GetCarrier(module.ToString());
                 if (carrier == null)
                 {
-                    EV.PostMessage(ModuleName.System.ToString(), EventEnum.DefaultWarning,
-                        string.Format("No carrier at {0}, can not create wafer", module));
+                    LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System,
+                       string.Format("No carrier at {0}, can not create wafer", module));
                     return null;
                 }
 
@@ -363,6 +363,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
             {
                 _locationWafers[module][slot].Status = state;
                 _locationWafers[module][slot].ProcessState = EnumWaferProcessStatus.Idle;
+                _locationWafers[module][slot].ChuckState = EnumWaferChuckStatus.Init;
 
                 _locationWafers[module][slot].WaferID = GenerateWaferId(module, slot,"");
                 _locationWafers[module][slot].WaferOrigin = GenerateOrigin(module, slot);
@@ -390,7 +391,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Invalid wafer create, invalid parameter, {0},{1}", module, slot + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Invalid wafer create, invalid parameter, {0},{1}", module, slot + 1));
                 return null;
             }
 
@@ -401,7 +402,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
                 CarrierInfo carrier = CarrierManager.Instance.GetCarrier(module.ToString());
                 if (carrier == null)
                 {
-                    EV.PostWarningLog(ModuleName.System.ToString(),string.Format("No carrier at {0}, can not create wafer.", module));
+                    LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("No carrier at {0}, can not create wafer.", module));
                     return null;
                 }
 
@@ -413,7 +414,8 @@ namespace MECF.Framework.Common.SubstrateTrackings
             {
                 _locationWafers[module][slot].Status = state;
                 _locationWafers[module][slot].ProcessState = EnumWaferProcessStatus.Idle;
- 
+                _locationWafers[module][slot].ChuckState = EnumWaferChuckStatus.Init;
+
 
                 _locationWafers[module][slot].WaferID = GenerateWaferId(module, slot, carrierID);
                 _locationWafers[module][slot].WaferOrigin = GenerateOrigin(module, slot);
@@ -435,10 +437,9 @@ namespace MECF.Framework.Common.SubstrateTrackings
 
                 _dict[_locationWafers[module][slot].WaferID] = _locationWafers[module][slot];
                 
-
             }
  
-            EV.PostInfoLog("System", $"Create wafer successfully on {module} slot:{slot+1} wafersize:{wz}.");
+            LOG.Write(eEvent.EV_WAFER_MANAGER_NOTIFY, ModuleName.System, "System", $"Create wafer successfully on {module} slot:{slot+1} wafersize:{wz}.");
             WaferDataRecorder.CreateWafer(_locationWafers[module][slot].InnerId.ToString(), carrierInnerId, module.ToString(), slot, _locationWafers[module][slot].WaferID );
 
             Serialize();
@@ -455,7 +456,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
                     int slot = slotFrom+i;
                     if (!IsWaferSlotLocationValid(module, slot))
                     {
-                        //LOG.Write(string.Format("Invalid wafer delete, invalid parameter, {0},{1}", module, slot + 1));
+                        LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Invalid wafer delete, invalid parameter, {0},{1}", module, slot + 1));
                         continue;
                     }
                     WaferDataRecorder.DeleteWafer(_locationWafers[module][slot].InnerId.ToString());
@@ -473,7 +474,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Failed UpdateWaferLaser, invalid parameter, {0},{1}", module, slot + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed UpdateWaferLaser, invalid parameter, {0},{1}", module, slot + 1));
                 return;
             }
             lock (_lockerWaferList)
@@ -490,7 +491,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Failed UpdateWaferT7Code, invalid parameter, {0},{1}", module, slot + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed UpdateWaferT7Code, invalid parameter, {0},{1}", module, slot + 1));
                 return;
             }
             lock (_lockerWaferList)
@@ -506,7 +507,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Failed UpdateWaferTransFlag, invalid parameter, {0},{1}", module, slot + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed UpdateWaferTransFlag, invalid parameter, {0},{1}", module, slot + 1));
                 return;
             }
             lock (_lockerWaferList)
@@ -521,7 +522,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Failed UpdateWaferNotch, invalid parameter, {0},{1}", module, slot + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed UpdateWaferNotch, invalid parameter, {0},{1}", module, slot + 1));
                 return;
             }
             lock (_lockerWaferList)
@@ -535,7 +536,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Failed UpdateWaferProcessStatus, invalid parameter, {0},{1}", module, slot + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed UpdateWaferProcessStatus, invalid parameter, {0},{1}", module, slot + 1));
                 return;
             }
 
@@ -544,59 +545,28 @@ namespace MECF.Framework.Common.SubstrateTrackings
                 _locationWafers[module][slot].ProcessState = status;
             }
             Serialize();
-        }
-#pragma warning disable CS0618  
-        public void UpdateWaferProcessStatus(ModuleName module, int slot, ProcessStatus status)
+        } 
+
+        public void UpdateWaferChuckStatus(ModuleName module, int slot, EnumWaferChuckStatus status)
         {
-            switch (status)
+            if (!IsWaferSlotLocationValid(module, slot))
             {
-                case ProcessStatus.Busy:
-                    UpdateWaferProcessStatus(module, slot, EnumWaferProcessStatus.InProcess);
-                    break;
-                case ProcessStatus.Completed:
-                    UpdateWaferProcessStatus(module, slot, EnumWaferProcessStatus.Completed);
-                    break;
-                case ProcessStatus.Failed:
-                    UpdateWaferProcessStatus(module, slot, EnumWaferProcessStatus.Failed);
-                    break;
-                case ProcessStatus.Idle:
-                    UpdateWaferProcessStatus(module, slot, EnumWaferProcessStatus.Idle);
-                    break;
-                case ProcessStatus.Wait:
-                    UpdateWaferProcessStatus(module, slot, EnumWaferProcessStatus.InProcess);
-                    break;
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed UpdateWaferChuckStatus, invalid parameter, {0},{1}", module, slot + 1));
+                return;
             }
-        }
 
-        public void UpdateWaferProcessStatus(string waferID, ProcessStatus status)
-        {
-            switch (status)
+            lock (_lockerWaferList)
             {
-                case ProcessStatus.Busy:
-                    UpdateWaferProcessStatus(waferID, EnumWaferProcessStatus.InProcess);
-                    break;
-                case ProcessStatus.Completed:
-                    UpdateWaferProcessStatus(waferID, EnumWaferProcessStatus.Completed);
-                    break;
-                case ProcessStatus.Failed:
-                    UpdateWaferProcessStatus(waferID, EnumWaferProcessStatus.Failed);
-                    break;
-                case ProcessStatus.Idle:
-                    UpdateWaferProcessStatus(waferID, EnumWaferProcessStatus.Idle);
-                    break;
-                case ProcessStatus.Wait:
-                    UpdateWaferProcessStatus(waferID, EnumWaferProcessStatus.InProcess);
-                    break;
+                _locationWafers[module][slot].ChuckState = status;
             }
+            Serialize();
         }
 
-#pragma warning restore CS0618  
-
         public void UpdateWaferId(ModuleName module, int slot, string waferId)
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Failed UpdateWaferId, invalid parameter, {0},{1}", module, slot + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed UpdateWaferId, invalid parameter, {0},{1}", module, slot + 1));
                 return;
             }
 
@@ -611,7 +581,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Failed UpdateWaferLotId, invalid parameter, {0},{1}", module, slot + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed UpdateWaferLotId, invalid parameter, {0},{1}", module, slot + 1));
                 return;
             }
 
@@ -655,7 +625,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Failed CopyWaferInfo, invalid parameter, {0},{1}", module, slot + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed CopyWaferInfo, invalid parameter, {0},{1}", module, slot + 1));
                 return null;
             }
 
@@ -674,7 +644,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
         {
             if (!IsWaferSlotLocationValid(module, slot))
             {
-                //LOG.Write(string.Format("Failed UpdateWaferSize, invalid parameter, {0},{1}", module, slot + 1));
+                LOG.Write(eEvent.ERR_WAFER_MANAGER_FAILED, ModuleName.System, string.Format("Failed UpdateWaferSize, invalid parameter, {0},{1}", module, slot + 1));
                 return false;
             }
 

+ 3 - 0
Venus/Venus_Core/EventDefine.cs

@@ -18,6 +18,9 @@ namespace Aitex.Core.RT.Log{
 		ERR_DEVICE_INFO = 17,
 		ERR_EXCEPTION = 18,
 		WARN_DEVICE_INFO = 19,
+		EV_WAFER_MANAGER_NOTIFY = 20,
+		WARN_WAFER_MANAGER_WARN = 21,
+		ERR_WAFER_MANAGER_FAILED = 22,
 		INFO_DEVICE_IO_HEATER = 1000,
 		WARN_DEVICE_IO_HEATER = 1001,
 		ERR_DEVICE_IO_HEATER = 1002,

+ 27 - 0
Venus/Venus_RT/Config/LogDefine.json

@@ -153,6 +153,33 @@
     "Note": "Device Warning"
   },
   {
+    "Id": 20,
+    "Level": "Info",
+    "LogEnum": "EV_WAFER_MANAGER_NOTIFY",
+    "GlobalDescription_zh": "{0}。",
+    "GlobalDescription_en": "{0}.",
+    "Module": "System",
+    "Note": "Wafermanager Notify"
+  },
+  {
+    "Id": 21,
+    "Level": "Warning",
+    "LogEnum": "WARN_WAFER_MANAGER_WARN",
+    "GlobalDescription_zh": "{0}。",
+    "GlobalDescription_en": "{0}.",
+    "Module": "System",
+    "Note": "Wafermanager Warning"
+  },
+  {
+    "Id": 22,
+    "Level": "Error",
+    "LogEnum": "ERR_WAFER_MANAGER_FAILED",
+    "GlobalDescription_zh": "{0}。",
+    "GlobalDescription_en": "{0}.",
+    "Module": "System",
+    "Note": "Wafermanager Failed"
+  },
+  {
     "Id": 1000,
     "Level": "Info",
     "LogEnum": "INFO_DEVICE_IO_HEATER",

+ 6 - 0
Venus/Venus_RT/Modules/PMs/LLPickRoutine.cs

@@ -47,6 +47,12 @@ namespace Venus_RT.Modules.PMs
                 return RState.Failed;
             }
 
+            if(WaferManager.Instance.GetWafer(ModuleName.PMA, 0).ChuckState == Aitex.Core.Common.EnumWaferChuckStatus.Chucked)
+            {
+                Stop("腔体中Wafer没有 Dechuck,不能执行取片动作");
+                return RState.Failed;
+            }
+
             if (_isATMMode)
             {
                 if (!_chamber.IsATM || !_chamber.IsATMLoadlock)

+ 18 - 0
Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

@@ -320,6 +320,8 @@ namespace Venus_RT.Modules.PMs
                 else
                 {
                     Notify($"Recipe:{CurrentRunningRecipe} finished");
+
+                    UpdateWaferStatus();
                     return !StartNewRecipe();
                 }
             }
@@ -333,6 +335,22 @@ namespace Venus_RT.Modules.PMs
             return true;
         }
 
+        private void UpdateWaferStatus()
+        {
+            switch(_currentRecipe.Header.Type)
+            {
+                case RecipeType.Process:
+                    break;
+                case RecipeType.Chuck:
+                    WaferManager.Instance.UpdateWaferChuckStatus(ModuleName.PMA, 0, EnumWaferChuckStatus.Chucked);
+                    break;
+                case RecipeType.DeChuck:
+                    WaferManager.Instance.UpdateWaferProcessStatus(ModuleName.PMA, 0, EnumWaferProcessStatus.Completed);
+                    WaferManager.Instance.UpdateWaferChuckStatus(ModuleName.PMA, 0, EnumWaferChuckStatus.Dechucked);
+                    break;
+            }
+        }
+
         public void Abort()
         {
             CloseAllValves();

+ 6 - 0
Venus/Venus_RT/Modules/PMs/StartTurboPumpRoutine.cs

@@ -30,6 +30,12 @@ namespace Venus_RT.Modules.PMs
                 return RState.Failed;
             }
 
+            if(!_chamber.IsPumpRunning)
+            {
+                Stop("干泵没有启动, 请先启动干泵");
+                return RState.Failed;
+            }
+
             if(_chamber.ForelinePressure >= FORELINE_PRESSURE_THRESHOLD)
             {
                 Stop($"Foreline:{_chamber.ForelinePressure} 压力太高, 不能启动 Turbo Pump");

+ 0 - 4
Venus/Venus_Simulator/Devices/TurboPumpMockPMA.cs

@@ -57,10 +57,6 @@ namespace Venus_Simulator.Devices
             if (string.IsNullOrEmpty(message))
                 throw new ArgumentException("Hardware command message is invalid");
 
-            if(message.Contains("TMPON"))
-            {
-                string[] temps = message.Trim().Split('\r');
-            }
             string[] strs = message.Trim().Split('\r');
             foreach(string msg in strs)
             {