浏览代码

fix some AutoCycle/manualMove/ReturnWafer/Abort bugs.

sangwq 1 年之前
父节点
当前提交
a88d0012df

+ 2 - 2
Venus/Framework/Common/Fsm/StateMachine.cs

@@ -166,7 +166,7 @@ namespace Aitex.Core.RT.Fsm
                                     PrevState = State;
                                     State = anyStateTransition[_msgInProcess.Key].Item2;
                                     ///add log
-                                    if (Name == "EFEM FSM")
+                                    //if (Name == "EFEM FSM")
                                     {
                                         LOG.Write(eEvent.EV_FSM_NOTIFY, MECF.Framework.Common.Equipment.ModuleName.System, $"状态机 {Name}收到消息 {GetStringMessage(_msgInProcess.Key)}, 状态 {GetStringState(PrevState)}==>{GetStringState(State)}");
                                     }
@@ -238,7 +238,7 @@ namespace Aitex.Core.RT.Fsm
                             State = transition[State][_msgInProcess.Key].Item2;
 
                             ///add log
-                            if (Name == "EFEM FSM")
+                            //if (Name == "EFEM FSM")
                             {
                                 LOG.Write(eEvent.EV_FSM_NOTIFY, MECF.Framework.Common.Equipment.ModuleName.System, $"状态机 {Name}收到消息 {GetStringMessage(_msgInProcess.Key)}, 状态 {GetStringState(PrevState)}==>{GetStringState(State)}");
                             }

+ 51 - 0
Venus/Framework/Common/SubstrateTrackings/WaferInfo.cs

@@ -386,5 +386,56 @@ namespace Aitex.Core.Common
 
 	        this.NextSequenceStep = 0;
 	    }
+
+		public WaferInfo Clone(WaferInfo source)
+		{
+			WaferInfo newValue = new WaferInfo();
+			newValue.InnerId = source.InnerId;
+
+			newValue.WaferID = source.waferID;
+			newValue.WaferOrigin = source.WaferOrigin;
+			newValue.LaserMarker = source.LaserMarker;
+			newValue.T7Code = source.T7Code;
+			newValue.Status = source.Status;
+			newValue.ProcessState = source.ProcessState;
+			newValue.ChuckState = source.ChuckState;
+			newValue.IsSource = source.IsSource;
+			newValue.IsDestination = source.IsDestination;
+
+			newValue.Station = source.Station;
+			newValue.Slot = source.Slot;
+			newValue.OriginStation = source.OriginStation;
+			newValue.OriginSlot = source.OriginSlot;
+			if (source.OriginCarrierID != null) newValue.OriginCarrierID = source.OriginCarrierID;
+			newValue.SourceStation = source.SourceStation;
+			newValue.SourceSlot = source.SourceSlot;
+			newValue.DestinationStation = source.DestinationStation;
+			newValue.DestinationSlot = source.DestinationSlot;
+			newValue.Notch = source.Notch;
+			newValue.Size = source.Size;
+			newValue.TransFlag = source.TransFlag;
+			newValue.LotId = source.LotId;
+			
+			newValue.NextSequenceStep = source.NextSequenceStep;
+			if(source.ProcessJob != null)
+            {
+				newValue.ProcessJob = new ProcessJobInfo();
+				if(source.ProcessJob.Sequence != null)
+                {
+					newValue.ProcessJob.Sequence = new SequenceInfo(source.ProcessJob.Sequence.Name);
+					newValue.ProcessJob.Sequence.InnerId = source.ProcessJob.Sequence.InnerId;
+					foreach(var step in source.ProcessJob.Sequence.Steps)
+                    {
+						var newStep = new SequenceStepInfo();
+						newStep.AlignAngle = step.AlignAngle;
+						newStep.StepModules = new List<MECF.Framework.Common.Equipment.ModuleName>(step.StepModules.ToArray());
+						newStep.StepParameter = new Dictionary<string, object>(step.StepParameter);
+						newValue.ProcessJob.Sequence.Steps.Add(newStep);
+                    }
+                }
+            }
+
+			return newValue;
+		}
 	}
 }

+ 19 - 3
Venus/Venus_RT/Modules/AutoCycle.cs

@@ -474,16 +474,27 @@ namespace Venus_RT.Modules
 
         public void Clear()
         {
+            _vacWaferTargets.Clear();
+            _atmWaferTargets.Clear();
+
+            _movingItems.Clear();
+            _efemMovingItems.Clear();
+
+            _vacMoveFinishTrig.RST = true;
+            _atmMoveFinishTrig.RST = true;
+
             _efemRobot.ResetTask();
             _tmRobot.ResetTask();
             foreach (var module in _vacSchedulers)
             {
                 module.Value.ResetTask();
+                _vacModules[module.Key].MovingStatus = MovingStatus.Idle;
             }
 
             foreach (var module in _atmSchedulers)
             {
                 module.Value.ResetTask();
+                _atmModules[module.Key].MovingStatus = MovingStatus.Idle;
             }
 
             _lstControlJobs.Clear();
@@ -1264,7 +1275,11 @@ namespace Venus_RT.Modules
                                 if (CheckWaferNeedProcessAndPMAvailable(pjSlotWafer.Item1, pjSlotWafer.Item2))
                                 {
                                     //return new SlotItem(pjSlotWafer.Item1, pjSlotWafer.Item2);
-                                    inSlots.Add(pjSlotWafer.Item2);
+                                    var wafer = WaferManager.Instance.GetWafer(pjSlotWafer.Item1, pjSlotWafer.Item2);
+                                    if(!wafer.IsEmpty && wafer.NextSequenceStep == 0)
+                                    {
+                                        inSlots.Add(pjSlotWafer.Item2);
+                                    }
                                 }
 
                             }
@@ -1570,7 +1585,7 @@ namespace Venus_RT.Modules
                     if(wafer.IsEmpty || wafer.ProcessJob == null)
                     {
                         // should not go here
-                        LOG.Write(eEvent.ERR_ROUTER, ModuleName.System, $"UpateSequenceStep() failed, location: {item.DestinationModule}:{item.DestinationSlot}, NextSequenceStep: {wafer.NextSequenceStep}");
+                        LOG.Write(eEvent.ERR_ROUTER, ModuleName.System, $"UpateSequenceStep() failed, location: {item.DestinationModule}:{item.DestinationSlot + 1}, NextSequenceStep: {wafer.NextSequenceStep}");
                     }
                 }
             }
@@ -1595,7 +1610,7 @@ namespace Venus_RT.Modules
                         {
                             // wafer arrive
                             _vacWaferTargets.Remove(tar.Key);
-
+                            LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"wafer {wafer.WaferOrigin}: {wafer.InnerId} arrived {tar.Key.Module}{tar.Key.Slot + 1}");
                             if (ModuleHelper.IsPm(tar.Key.Module))
                             {
                                 _vacModules[tar.Key.Module].MovingStatus = MovingStatus.WaitProcess;
@@ -1638,6 +1653,7 @@ namespace Venus_RT.Modules
 
                         if (wafer.InnerId == tar.Value)
                         {
+                            LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"wafer {wafer.WaferOrigin}: {wafer.InnerId} arrived {tar.Key.Module}{tar.Key.Slot + 1}");
                             // wafer arrive
                             _atmWaferTargets.Remove(tar.Key);
                         }

+ 13 - 3
Venus/Venus_RT/Modules/EFEM/EfemSwapRoutine.cs

@@ -37,6 +37,7 @@ namespace Venus_RT.Modules.EFEM
 
         Queue<MoveItem> _actionList = new Queue<MoveItem>();
         MoveItem _currentAction;
+        private int _actionCount = 0;
 
         public EfemSwapRoutine(EfemBase efem) : base(ModuleName.EfemRobot)
         {
@@ -52,7 +53,11 @@ namespace Venus_RT.Modules.EFEM
                 return RState.Failed;
             }
 
-            _actionList = (Queue<MoveItem>)objs[0];
+            foreach (var item in (Queue<MoveItem>)objs[0])
+            {
+                _actionList.Enqueue(new MoveItem(item.SourceModule, item.SourceSlot, item.DestinationModule, item.DestinationSlot, item.RobotHand));
+            }
+
             var firtItem = _actionList.Peek();
             if (ModuleHelper.IsLoadLock(firtItem.SourceModule))
                 _targetModule = firtItem.SourceModule;
@@ -80,7 +85,7 @@ namespace Venus_RT.Modules.EFEM
                 
 
             _moveTimeout = SC.GetValue<int>($"EFEM.MotionTimeout") * 1000;
-
+            _actionCount = _actionList.Count;
             return Runner.Start(Module, $"EFEM Swap with {_targetModule}");
         }
 
@@ -89,7 +94,7 @@ namespace Venus_RT.Modules.EFEM
             Runner.Wait((int)SwapStep.WaitModuleReady,  () => _llModule.IsIdle,     _delay_60s)
                 .Run((int)SwapStep.ModulePrepare,       ModulePrepare,              IsModulePrepareReady)
                 .Run((int)SwapStep.OpenSlitDoor,        OpenSlitDoor,               IsSlitDoorOpen)
-                .LoopStart((int)SwapStep.MoveWafer,     loopName(),                 _actionList.Count,      MoveWafer)
+                .LoopStart((int)SwapStep.MoveWafer,     loopName(),                 _actionCount,           MoveWafer)
                 .LoopEnd((int)SwapStep.WaitMaferMoved,  NullFun,                    WaitWaferMoved,         _moveTimeout)
                 .Run((int)SwapStep.CloseSlitDoor,       CloseSlitDoor,              IsSlitDoorClosed)
                 .End((int)SwapStep.NotifyDone,          NotifyLLDone,               _delay_50ms);
@@ -152,6 +157,11 @@ namespace Venus_RT.Modules.EFEM
 
         private bool MoveWafer()
         {
+            if(_actionList.Count <= 0)
+            {
+                Runner.Stop("no action");
+                return true;
+            }
             _currentAction = _actionList.Dequeue();
 
             if (!VerifyWaferExistence(_currentAction))

+ 1 - 0
Venus/Venus_RT/Modules/RouteManager.cs

@@ -707,6 +707,7 @@ namespace Venus_RT.Modules
         {
             _manualTransfer.Clear();
             _returnWafer.Clear();
+            _AutoCycle.Clear();
             return true;
         }
 

+ 1 - 1
Venus/Venus_RT/Modules/Schedulers/SchedulerEfemRobot.cs

@@ -191,7 +191,7 @@ namespace Venus_RT.Scheduler
             if(_currentScheduler != null)
             {
                 _currentScheduler.moveList.Clear();
-                _currentScheduler.Status = RState.Init;
+                _currentScheduler.Status = RState.End;
             }
         }
     }

+ 4 - 1
Venus/Venus_RT/Modules/TM/MFSwapRoutine.cs

@@ -54,7 +54,10 @@ namespace Venus_RT.Modules.TM
                 return RState.Failed;
             }
 
-            _actionList = (Queue<MoveItem>)objs[0];
+            foreach(var item in (Queue<MoveItem>)objs[0])
+            {
+                _actionList.Enqueue(new MoveItem(item.SourceModule, item.SourceSlot, item.DestinationModule, item.DestinationSlot, item.RobotHand));
+            }
             var firtItem = _actionList.Peek();
             if (ModuleHelper.IsLoadLock(firtItem.SourceModule))
                 _targetModule = firtItem.SourceModule;