|
@@ -17,6 +17,7 @@ using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
|
using Venus_Core;
|
|
|
using Venus_RT.Devices;
|
|
|
+using Venus_RT.Devices.SMIF;
|
|
|
using Venus_RT.Devices.VCE;
|
|
|
using Venus_RT.Modules.PMs;
|
|
|
using Venus_RT.Modules.TM;
|
|
@@ -37,7 +38,8 @@ namespace Venus_RT.Modules.VCE
|
|
|
Load,
|
|
|
UnLoad,
|
|
|
LoadPrepare,
|
|
|
- LoadWithoutSMIF,
|
|
|
+ LoadWithSMIF,
|
|
|
+ UnLoadWithSMIF,
|
|
|
Reset,
|
|
|
Goto,
|
|
|
GotoLP,
|
|
@@ -54,6 +56,8 @@ namespace Venus_RT.Modules.VCE
|
|
|
{
|
|
|
private ModuleName _modulename;
|
|
|
private readonly VceModuleBase _vce;
|
|
|
+ private readonly ISMIF _smif;
|
|
|
+ private bool _CassetteArrive;
|
|
|
|
|
|
public bool IsIdle => fsm.State == (int)VceSTATE.Idle;
|
|
|
|
|
@@ -64,24 +68,31 @@ namespace Venus_RT.Modules.VCE
|
|
|
public bool IsError => fsm.State == (int)VceSTATE.Error;
|
|
|
|
|
|
public bool VCEOutDoorClosed => !_vce.OutDoorIsOpen;
|
|
|
+ public bool CassetteArrive => _CassetteArrive;
|
|
|
|
|
|
private int currentSlot;
|
|
|
private int targetSlot;
|
|
|
private LoadRoutine _loadRoutine;
|
|
|
private LoadPrepareRoutine _prepareRoutine;
|
|
|
private UnloadRoutine _unloadRoutine;
|
|
|
+ private LoadWithSMIFRoutine _loadwithSMIFRoutine;
|
|
|
+ private UnloadWithSMIFRoutine _unloadwithSMIFRoutine;
|
|
|
|
|
|
private readonly SEMFPumpRoutine _pumpRoutine;
|
|
|
private readonly SEMFVentRoutine _ventRoutine;
|
|
|
public VceEntity(ModuleName moduleName)
|
|
|
{
|
|
|
- currentSlot = 0;
|
|
|
+ currentSlot = 0;
|
|
|
_modulename = moduleName;
|
|
|
_vce = new HongHuVce(25, _modulename);
|
|
|
+ _smif = new FortrendPLUS500(_modulename);
|
|
|
|
|
|
- _loadRoutine = new LoadRoutine(_modulename,_vce);
|
|
|
- _prepareRoutine = new LoadPrepareRoutine(_modulename,_vce);
|
|
|
+ _loadRoutine = new LoadRoutine(_modulename, _vce);
|
|
|
+ _prepareRoutine = new LoadPrepareRoutine(_modulename, _vce);
|
|
|
_unloadRoutine = new UnloadRoutine(_modulename, _vce);
|
|
|
+ _loadwithSMIFRoutine = new LoadWithSMIFRoutine(_modulename, _vce, _smif);
|
|
|
+ _unloadwithSMIFRoutine = new UnloadWithSMIFRoutine(_modulename, _vce, _smif);
|
|
|
+
|
|
|
_pumpRoutine = new SEMFPumpRoutine(DEVICE.GetDevice<HongHuTM>("SETM"), _modulename);
|
|
|
_ventRoutine = new SEMFVentRoutine(DEVICE.GetDevice<HongHuTM>("SETM"), _modulename);
|
|
|
InitFsmMap();
|
|
@@ -93,18 +104,18 @@ namespace Venus_RT.Modules.VCE
|
|
|
DATA.Subscribe($"{_modulename}.CurrentSlot", () => currentSlot);
|
|
|
|
|
|
DATA.Subscribe($"{_modulename}.FsmState", () => ((VceSTATE)fsm.State).ToString());
|
|
|
- //DATA.Subscribe($"{_modulename}.IsRunning", () => IsIdle);
|
|
|
+ DATA.Subscribe($"{_modulename}.CassetteArrive", () => CassetteArrive);
|
|
|
//DATA.Subscribe($"{_modulename}.IsRunning", () => IsIdle);
|
|
|
|
|
|
- OP.Subscribe($"{_modulename}.HOME", (cmd,args) => { PostMsg(VceMSG.Home);return true; });
|
|
|
- OP.Subscribe($"{_modulename}.DoorOpen", (cmd,args) => { PostMsg(VceMSG.DoorOpen);return true; });
|
|
|
- OP.Subscribe($"{_modulename}.DoorClose", (cmd,args) => { PostMsg(VceMSG.DoorClose);return true; });
|
|
|
- OP.Subscribe($"{_modulename}.Map", (cmd,args) => { PostMsg(VceMSG.Map);return true; });
|
|
|
- OP.Subscribe($"{_modulename}.ReadMap", (cmd,args) => { PostMsg(VceMSG.ReadMap);return true; });
|
|
|
- OP.Subscribe($"{_modulename}.Load", (cmd,args) => { PostMsg(VceMSG.Load);return true; });
|
|
|
- OP.Subscribe($"{_modulename}.UnLoad", (cmd,args) => { PostMsg(VceMSG.UnLoad);return true; });
|
|
|
- OP.Subscribe($"{_modulename}.Reset", (cmd,args) => { PostMsg(VceMSG.Reset);return true; });
|
|
|
- OP.Subscribe($"{_modulename}.Goto", (cmd,args) => { PostMsg(VceMSG.Goto, args[0]);return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.HOME", (cmd, args) => { PostMsg(VceMSG.Home); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.DoorOpen", (cmd, args) => { PostMsg(VceMSG.DoorOpen); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.DoorClose", (cmd, args) => { PostMsg(VceMSG.DoorClose); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.Map", (cmd, args) => { PostMsg(VceMSG.Map); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.ReadMap", (cmd, args) => { PostMsg(VceMSG.ReadMap); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.Load", (cmd, args) => { PostMsg(VceMSG.Load); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.UnLoad", (cmd, args) => { PostMsg(VceMSG.UnLoad); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.Reset", (cmd, args) => { PostMsg(VceMSG.Reset); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.Goto", (cmd, args) => { PostMsg(VceMSG.Goto, args[0]); return true; });
|
|
|
OP.Subscribe($"{_modulename}.GotoLP", (cmd, args) => { PostMsg(VceMSG.GotoLP); return true; });
|
|
|
OP.Subscribe($"{_modulename}.Abort", (cmd, args) => { PostMsg(VceMSG.Abort); return true; });
|
|
|
OP.Subscribe($"{_modulename}.PumpDown", (cmd, args) => { PostMsg(VceMSG.Pump); return true; });
|
|
@@ -114,6 +125,8 @@ namespace Venus_RT.Modules.VCE
|
|
|
OP.Subscribe($"{_modulename}.LoadPrepare", (cmd, args) => { PostMsg(VceMSG.LoadPrepare); return true; });
|
|
|
OP.Subscribe($"{_modulename}.SafeLoad", (cmd, args) => { PostMsg(VceMSG.SafeLoad); return true; });
|
|
|
OP.Subscribe($"{_modulename}.SafeUnload", (cmd, args) => { PostMsg(VceMSG.SafeUnload); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.LoadWithSMIF", (cmd, args) => { PostMsg(VceMSG.LoadWithSMIF); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.UnLoadWithSMIF", (cmd, args) => { PostMsg(VceMSG.UnLoadWithSMIF); return true; });
|
|
|
|
|
|
return true;
|
|
|
}
|
|
@@ -130,65 +143,71 @@ namespace Venus_RT.Modules.VCE
|
|
|
AnyStateTransition(VceMSG.Abort, fnAbort, VceSTATE.Idle);
|
|
|
AnyStateTransition(VceMSG.Home, fnStartHome, VceSTATE.Homing);
|
|
|
//HOME init->homing idle->homing
|
|
|
- Transition(VceSTATE.Init, VceMSG.Home, fnStartHome, VceSTATE.Homing);
|
|
|
- Transition(VceSTATE.Idle, VceMSG.Home, fnStartHome, VceSTATE.Homing);
|
|
|
- Transition(VceSTATE.Error, VceMSG.Home, fnStartHome, VceSTATE.Homing);
|
|
|
- Transition(VceSTATE.Homing, FSM_MSG.TIMER, fnHomeTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Init, VceMSG.Home, fnStartHome, VceSTATE.Homing);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.Home, fnStartHome, VceSTATE.Homing);
|
|
|
+ Transition(VceSTATE.Error, VceMSG.Home, fnStartHome, VceSTATE.Homing);
|
|
|
+ Transition(VceSTATE.Homing, FSM_MSG.TIMER, fnHomeTimeout, VceSTATE.Idle);
|
|
|
|
|
|
//Open Door 开门
|
|
|
- Transition(VceSTATE.Idle, VceMSG.DoorOpen, fnStartOpenDoor, VceSTATE.DoorOpenning);
|
|
|
- Transition(VceSTATE.DoorOpenning, FSM_MSG.TIMER, fnOpenDoorTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.DoorOpen, fnStartOpenDoor, VceSTATE.DoorOpenning);
|
|
|
+ Transition(VceSTATE.DoorOpenning, FSM_MSG.TIMER, fnOpenDoorTimeout, VceSTATE.Idle);
|
|
|
//Close Door 关门
|
|
|
- Transition(VceSTATE.Idle, VceMSG.DoorClose, fnStartCloseDoor, VceSTATE.DoorClosing);
|
|
|
- Transition(VceSTATE.DoorClosing, FSM_MSG.TIMER, fnCloseDoorTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.DoorClose, fnStartCloseDoor, VceSTATE.DoorClosing);
|
|
|
+ Transition(VceSTATE.DoorClosing, FSM_MSG.TIMER, fnCloseDoorTimeout, VceSTATE.Idle);
|
|
|
|
|
|
//Map 扫片
|
|
|
- Transition(VceSTATE.Idle, VceMSG.Map, fnStartMapping, VceSTATE.Mapping);
|
|
|
- Transition(VceSTATE.Mapping, FSM_MSG.TIMER, fnMappingTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.Map, fnStartMapping, VceSTATE.Mapping);
|
|
|
+ Transition(VceSTATE.Mapping, FSM_MSG.TIMER, fnMappingTimeout, VceSTATE.Idle);
|
|
|
|
|
|
//Load 取cassette
|
|
|
- Transition(VceSTATE.Idle, VceMSG.Load, fnStartLoading, VceSTATE.Loading);
|
|
|
- Transition(VceSTATE.Loading, FSM_MSG.TIMER, fnLoadingTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.Load, fnStartLoading, VceSTATE.Loading);
|
|
|
+ Transition(VceSTATE.Loading, FSM_MSG.TIMER, fnLoadingTimeout, VceSTATE.Idle);
|
|
|
|
|
|
//UnLoad 放cassette
|
|
|
- Transition(VceSTATE.Idle, VceMSG.UnLoad, fnStartUnLoading, VceSTATE.UnLoading);
|
|
|
- Transition(VceSTATE.UnLoading, FSM_MSG.TIMER, fnUnLoadingTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.UnLoad, fnStartUnLoading, VceSTATE.UnLoading);
|
|
|
+ Transition(VceSTATE.UnLoading, FSM_MSG.TIMER, fnUnLoadingTimeout, VceSTATE.Idle);
|
|
|
|
|
|
//Goto 指定槽对准窗口
|
|
|
- Transition(VceSTATE.Idle, VceMSG.Goto, fnStartGoto, VceSTATE.Goting);
|
|
|
- Transition(VceSTATE.Goting, FSM_MSG.TIMER, fnGotingTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.Goto, fnStartGoto, VceSTATE.Goting);
|
|
|
+ Transition(VceSTATE.Goting, FSM_MSG.TIMER, fnGotingTimeout, VceSTATE.Idle);
|
|
|
|
|
|
//ReadMap
|
|
|
- Transition(VceSTATE.Idle, VceMSG.ReadMap, fnStartReadingMap, VceSTATE.ReadingMap);
|
|
|
- Transition(VceSTATE.ReadingMap, FSM_MSG.TIMER, fnReadingMapTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.ReadMap, fnStartReadingMap, VceSTATE.ReadingMap);
|
|
|
+ Transition(VceSTATE.ReadingMap, FSM_MSG.TIMER, fnReadingMapTimeout, VceSTATE.Idle);
|
|
|
|
|
|
//Load Prepare
|
|
|
- Transition(VceSTATE.Idle, VceMSG.LoadPrepare,fnStartLoadPrepare,VceSTATE.LoadPreparing) ;
|
|
|
- Transition(VceSTATE.LoadPreparing, FSM_MSG.TIMER, fnLoadingPrepareTimeout,VceSTATE.Idle) ;
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.LoadPrepare, fnStartLoadPrepare, VceSTATE.LoadPreparing);
|
|
|
+ Transition(VceSTATE.LoadPreparing, FSM_MSG.TIMER, fnLoadingPrepareTimeout,VceSTATE.Idle);
|
|
|
|
|
|
//Safe Load
|
|
|
- Transition(VceSTATE.Idle,VceMSG.SafeLoad,fnStartSafeLoad,VceSTATE.SafeLoading) ;
|
|
|
- Transition(VceSTATE.SafeLoading, FSM_MSG.TIMER,fnSafeLoadTimeout,VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.SafeLoad, fnStartSafeLoad, VceSTATE.SafeLoading);
|
|
|
+ Transition(VceSTATE.SafeLoading, FSM_MSG.TIMER, fnSafeLoadTimeout, VceSTATE.Idle);
|
|
|
+
|
|
|
+ //LoadWithSMIF => LoadPrepare & SMIF Load & Load
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.LoadWithSMIF, fnStartLoadWithSMIF, VceSTATE.LoadingWithSMIF);
|
|
|
+ Transition(VceSTATE.LoadingWithSMIF, FSM_MSG.TIMER, fnLoadWithSMIFTimeout, VceSTATE.Idle);
|
|
|
|
|
|
//Safe UnLoad
|
|
|
- Transition(VceSTATE.Idle, VceMSG.SafeUnload, fnStartSafeUnLoad, VceSTATE.SafeUnloading);
|
|
|
- Transition(VceSTATE.SafeUnloading, FSM_MSG.TIMER, fnSafeUnLoadTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.SafeUnload, fnStartSafeUnLoad, VceSTATE.SafeUnloading);
|
|
|
+ Transition(VceSTATE.SafeUnloading, FSM_MSG.TIMER, fnSafeUnLoadTimeout, VceSTATE.Idle);
|
|
|
|
|
|
- //Goto LP
|
|
|
- Transition(VceSTATE.Idle, VceMSG.GotoLP, fnStartGotoLP, VceSTATE.GotingLP);
|
|
|
- Transition(VceSTATE.GotingLP, FSM_MSG.TIMER, fnGotoLPTimeout, VceSTATE.Idle);
|
|
|
+ //UnLoad With SMIF => UnLoad with smif
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.UnLoadWithSMIF, fnStartUnLoadWithSMIF, VceSTATE.UnLoadingWithSMIF);
|
|
|
+ Transition(VceSTATE.UnLoadingWithSMIF, FSM_MSG.TIMER, fnUnLoadWithSMIFTimeout,VceSTATE.Idle);
|
|
|
|
|
|
- //Pump down
|
|
|
+ //Goto LP
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.GotoLP, fnStartGotoLP, VceSTATE.GotingLP);
|
|
|
+ Transition(VceSTATE.GotingLP, FSM_MSG.TIMER, fnGotoLPTimeout, VceSTATE.Idle);
|
|
|
|
|
|
//Pump
|
|
|
- Transition(VceSTATE.Idle, VceMSG.Pump, fnStartPump, VceSTATE.Pumping);
|
|
|
- Transition(VceSTATE.Pumping, FSM_MSG.TIMER, fnPumpTimeout, VceSTATE.Idle);
|
|
|
- Transition(VceSTATE.Pumping, VceMSG.Abort, fnAbortPump, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.Pump, fnStartPump, VceSTATE.Pumping);
|
|
|
+ Transition(VceSTATE.Pumping, FSM_MSG.TIMER, fnPumpTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Pumping, VceMSG.Abort, fnAbortPump, VceSTATE.Idle);
|
|
|
|
|
|
//Vent
|
|
|
- Transition(VceSTATE.Idle, VceMSG.Vent, fnStartVent, VceSTATE.Venting);
|
|
|
- Transition(VceSTATE.Venting, FSM_MSG.TIMER, fnVentTimeout, VceSTATE.Idle);
|
|
|
- Transition(VceSTATE.Venting, VceMSG.Abort, fnAbortVent, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.Vent, fnStartVent, VceSTATE.Venting);
|
|
|
+ Transition(VceSTATE.Venting, FSM_MSG.TIMER, fnVentTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.Venting, VceMSG.Abort, fnAbortVent, VceSTATE.Idle);
|
|
|
|
|
|
EnumLoop<VceSTATE>.ForEach((item) => { fsm.MapState((int)item, item.ToString()); });
|
|
|
|
|
@@ -257,7 +276,7 @@ namespace Venus_RT.Modules.VCE
|
|
|
|
|
|
private bool fnStartGotoLP(object[] param)
|
|
|
{
|
|
|
- if (_vce.GotoLP())
|
|
|
+ if (_vce.GotoLP())
|
|
|
{
|
|
|
targetSlot = -1;
|
|
|
return true;
|
|
@@ -275,6 +294,13 @@ namespace Venus_RT.Modules.VCE
|
|
|
PostMsg(VceMSG.Error);
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ if (ret == RState.End)
|
|
|
+ {
|
|
|
+ _CassetteArrive = false;
|
|
|
+ WaferManager.Instance.DeleteWafer(_modulename, 0, 25);
|
|
|
+ }
|
|
|
+
|
|
|
return ret == RState.End;
|
|
|
}
|
|
|
|
|
@@ -291,6 +317,55 @@ namespace Venus_RT.Modules.VCE
|
|
|
PostMsg(VceMSG.Error);
|
|
|
return false;
|
|
|
}
|
|
|
+ if (ret == RState.End)
|
|
|
+ {
|
|
|
+ _CassetteArrive = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return ret == RState.End;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnStartLoadWithSMIF(object[] param)
|
|
|
+ {
|
|
|
+ return _loadwithSMIFRoutine.Start(param) == RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnLoadWithSMIFTimeout(object[] param)
|
|
|
+ {
|
|
|
+ RState ret = _loadwithSMIFRoutine.Monitor();
|
|
|
+ if (ret == RState.Timeout || ret == RState.Failed)
|
|
|
+ {
|
|
|
+ PostMsg(VceMSG.Error);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ret == RState.End)
|
|
|
+ {
|
|
|
+ _CassetteArrive = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return ret == RState.End;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnStartUnLoadWithSMIF(object[] param)
|
|
|
+ {
|
|
|
+ return _unloadwithSMIFRoutine.Start(param) == RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnUnLoadWithSMIFTimeout(object[] param)
|
|
|
+ {
|
|
|
+ RState ret = _unloadwithSMIFRoutine.Monitor();
|
|
|
+ if (ret == RState.Timeout || ret == RState.Failed)
|
|
|
+ {
|
|
|
+ PostMsg(VceMSG.Error);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ret == RState.End)
|
|
|
+ {
|
|
|
+ _CassetteArrive = false;
|
|
|
+ WaferManager.Instance.DeleteWafer(_modulename, 0, 25);
|
|
|
+ }
|
|
|
return ret == RState.End;
|
|
|
}
|
|
|
|