修改一些Routine的Start方法和Monitor方法,改为重载基类的StartBody方法和MonitorBody方法。

This commit is contained in:
DESKTOP-1N1NK8A\auvkk 2023-04-20 16:52:42 +08:00
parent 70e11bc6b0
commit a4a739128f
21 changed files with 69 additions and 238 deletions

View File

@ -91,8 +91,6 @@ namespace SicModules.Aligners
get { return FsmState == (int)STATE.Idle && CheckAllMessageProcessed(); } get { return FsmState == (int)STATE.Idle && CheckAllMessageProcessed(); }
} }
public event Action<string> OnEnterError;
private bool _isInit; private bool _isInit;
public HwAlignerGuide _alignerDevice { get; set; } public HwAlignerGuide _alignerDevice { get; set; }
@ -233,8 +231,7 @@ namespace SicModules.Aligners
private bool FsmEnterError(object[] param) private bool FsmEnterError(object[] param)
{ {
if (OnEnterError != null) InvokeOnEnterError(Module);
OnEnterError(Module);
return true; return true;
} }

View File

@ -104,9 +104,6 @@ namespace SicModules.Buffers
return false; return false;
} }
} }
public event Action<string> OnEnterError;
private bool _isInit; private bool _isInit;
@ -256,8 +253,7 @@ namespace SicModules.Buffers
private bool FsmEnterError(object[] param) private bool FsmEnterError(object[] param)
{ {
if (OnEnterError != null) InvokeOnEnterError(Module);
OnEnterError(Module);
return true; return true;
} }

View File

@ -44,38 +44,16 @@ namespace SicModules.Buffers.Routines
} }
public Result Start(params object[] objs) protected override void MonitorBody()
{ {
Reset(); if (_coolingTypeIsTime)
_swTimer.Restart();
return Result.RUN;
}
public Result Monitor()
{
try
{ {
if (_coolingTypeIsTime) TimeDelay((int)RoutineStep.Cooling, _coolingValue);
{
TimeDelay((int)RoutineStep.Cooling, _coolingValue);
}
else
{
WaitBufferTempBelowSetValue((int)RoutineStep.Cooling, _coolingValue, _timeout);
}
} }
catch (RoutineBreakException) else
{ {
return Result.RUN; WaitBufferTempBelowSetValue((int)RoutineStep.Cooling, _coolingValue, _timeout);
} }
catch (RoutineFaildException)
{
return Result.FAIL;
}
Notify("Finished");
return Result.DONE;
} }
protected void WaitBufferTempBelowSetValue(int id,double tempValue,int timeout) protected void WaitBufferTempBelowSetValue(int id,double tempValue,int timeout)
@ -103,7 +81,7 @@ namespace SicModules.Buffers.Routines
} }
public void Abort() public override void Abort()
{ {
Notify("Abort"); Notify("Abort");
_swTimer.Stop(); _swTimer.Stop();

View File

@ -30,36 +30,13 @@ namespace SicModules.Buffers.Routines
{ {
return true; return true;
} }
public Result Start(params object[] objs) protected override void MonitorBody()
{ {
Reset(); Home((int)RoutineStep.Home, _buffer, 2);
Notify($"Start");
return Result.RUN;
} }
public Result Monitor()
{
try
{
Home((int)RoutineStep.Home, _buffer, 2);
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException)
{
return Result.FAIL;
}
Notify("Finished");
return Result.DONE;
}
public void Home(int id, SicBuffer buffer, int timeout) public void Home(int id, SicBuffer buffer, int timeout)
{ {
Tuple<bool, Result> ret = ExecuteAndWait(id, () => Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
@ -90,7 +67,7 @@ namespace SicModules.Buffers.Routines
} }
} }
public void Abort() public override void Abort()
{ {
} }

View File

@ -70,8 +70,6 @@ namespace SicModules.Cassettes
get { return FsmState == (int)STATE.Idle && CheckAllMessageProcessed(); } get { return FsmState == (int)STATE.Idle && CheckAllMessageProcessed(); }
} }
public event Action<string> OnEnterError;
private bool _isInit; private bool _isInit;
public SicCassette _cassetteDevice { get; set; } public SicCassette _cassetteDevice { get; set; }
@ -323,8 +321,7 @@ namespace SicModules.Cassettes
private bool FsmEnterError(object[] param) private bool FsmEnterError(object[] param)
{ {
if (OnEnterError != null) InvokeOnEnterError(Module);
OnEnterError(Module);
return true; return true;
} }

View File

@ -75,8 +75,6 @@ namespace SicModules.EFEMs
} }
} }
public event Action<string> OnEnterError;
private EfemSlitValveRoutine _slitValveRoutine; private EfemSlitValveRoutine _slitValveRoutine;
private bool _isInit; private bool _isInit;
@ -217,8 +215,7 @@ namespace SicModules.EFEMs
private bool FsmEnterError(object[] param) private bool FsmEnterError(object[] param)
{ {
if (OnEnterError != null) InvokeOnEnterError(Module);
OnEnterError(Module);
return true; return true;
} }

View File

@ -79,22 +79,7 @@ namespace SicModules.EFEMs.Routines.Base
_loadWaferClaw = DEVICE.GetDevice<IoClaw>($"LoadLock.LLWaferClaw"); _loadWaferClaw = DEVICE.GetDevice<IoClaw>($"LoadLock.LLWaferClaw");
_unLoadWaferClaw = DEVICE.GetDevice<IoClaw>($"UnLoad.UnLoadWaferClaw"); _unLoadWaferClaw = DEVICE.GetDevice<IoClaw>($"UnLoad.UnLoadWaferClaw");
} }
public virtual Result Start(params object[] objs)
{
return Result.DONE;
}
public virtual Result Monitor()
{
return Result.DONE;
}
public virtual void Abort()
{
}
protected void CheckTraySensor(int id) protected void CheckTraySensor(int id)
{ {
Tuple<bool, Result> ret = Execute(id, () => Tuple<bool, Result> ret = Execute(id, () =>

View File

@ -80,8 +80,6 @@ namespace SicModules.EFEMs
} }
} }
public event Action<string> OnEnterError;
private TrayRobotPickRoutine _trayRobotPickRoutine; private TrayRobotPickRoutine _trayRobotPickRoutine;
private TrayRobotPlaceRoutine _trayRobotPlaceRoutine; private TrayRobotPlaceRoutine _trayRobotPlaceRoutine;
private TrayRobotHomeRoutine _trayRobotHomeRoutine; private TrayRobotHomeRoutine _trayRobotHomeRoutine;
@ -233,8 +231,7 @@ namespace SicModules.EFEMs
private bool FsmEnterError(object[] param) private bool FsmEnterError(object[] param)
{ {
if (OnEnterError != null) InvokeOnEnterError(Module);
OnEnterError(Module);
return true; return true;
} }

View File

@ -80,8 +80,6 @@ namespace SicModules.EFEMs
} }
} }
public event Action<string> OnEnterError;
private WaferRobotHomeRoutine _waferRobotHomeRoutine; private WaferRobotHomeRoutine _waferRobotHomeRoutine;
private WaferRobotPlaceRoutine _waferRobotPlaceRoutine; private WaferRobotPlaceRoutine _waferRobotPlaceRoutine;
private WaferRobotPickRoutine _waferRobotPickRoutine; private WaferRobotPickRoutine _waferRobotPickRoutine;
@ -234,8 +232,7 @@ namespace SicModules.EFEMs
private bool FsmEnterError(object[] param) private bool FsmEnterError(object[] param)
{ {
if (OnEnterError != null) InvokeOnEnterError(Module);
OnEnterError(Module);
return true; return true;
} }

View File

@ -137,8 +137,6 @@ namespace SicModules.LLs
} }
} }
public event Action<string> OnEnterError;
private bool _isInit; private bool _isInit;
public SicLoadLock _llDevice { get; set; } public SicLoadLock _llDevice { get; set; }
@ -430,8 +428,7 @@ namespace SicModules.LLs
private bool FsmEnterError(object[] param) private bool FsmEnterError(object[] param)
{ {
if (OnEnterError != null) InvokeOnEnterError(Module);
OnEnterError(Module);
return true; return true;
} }

View File

@ -69,17 +69,14 @@ namespace SicModules.LLs.Routines.Base
_loadWaferPlaced = DEVICE.GetDevice<IoSensor>($"TM.LLWaferPlaced"); _loadWaferPlaced = DEVICE.GetDevice<IoSensor>($"TM.LLWaferPlaced");
_loadTrayPlaced = DEVICE.GetDevice<IoSensor>($"TM.LLTrayPresence"); _loadTrayPlaced = DEVICE.GetDevice<IoSensor>($"TM.LLTrayPresence");
} }
public virtual Result Start(params object[] objs) protected override Result StartBody(params object[] args)
{ {
return Result.DONE; Notify("Start");
} return Result.RUN;
public virtual Result Monitor()
{
return Result.DONE;
} }
public override void Abort() public override void Abort()
{ {
LoadLockDevice.SetSlowPumpValve(false, out _); LoadLockDevice.SetSlowPumpValve(false, out _);

View File

@ -323,9 +323,6 @@ namespace SicModules.PMs
SetRotationServo(0, 0); SetRotationServo(0, 0);
} }
public event Action<string> OnEnterError;
//private PMPumpRoutine _pumpRoutine; //private PMPumpRoutine _pumpRoutine;
//private PMVentRoutine _ventRoutine; //private PMVentRoutine _ventRoutine;
private PMChamberMoveBodyRoutine _chamberMoveBodyRoutine; private PMChamberMoveBodyRoutine _chamberMoveBodyRoutine;
@ -759,9 +756,7 @@ namespace SicModules.PMs
private bool FsmEnterError(object[] param) private bool FsmEnterError(object[] param)
{ {
if (OnEnterError != null) InvokeOnEnterError(Module);
OnEnterError(Module);
if (IsOnline) if (IsOnline)
{ {
EV.PostWarningLog(Module, $"{Module}"); EV.PostWarningLog(Module, $"{Module}");

View File

@ -102,18 +102,13 @@ namespace SicModules.PMs.Routines.Base
_pm = pm1; _pm = pm1;
} }
protected override Result StartBody(params object[] args)
public virtual Result Start(params object[] objs)
{ {
Notify("Start");
return Result.DONE; return Result.DONE;
} }
public virtual Result Monitor() public override void Abort()
{
return Result.DONE;
}
public virtual void Abort()
{ {
_pm.SetMfcToDefaultByGroup(MfcGroupName.M27toM40); _pm.SetMfcToDefaultByGroup(MfcGroupName.M27toM40);
} }

View File

@ -52,10 +52,9 @@ namespace SicModules.PMs.Routines
return Result.DONE; return Result.DONE;
} }
public Result Start(params object[] objs)
protected override Result StartBody(params object[] objs)
{ {
Reset();
if (_paramWithWafer && !WaferManager.Instance.CheckHasWafer(_pm.Module, 0)) if (_paramWithWafer && !WaferManager.Instance.CheckHasWafer(_pm.Module, 0))
{ {
EV.PostWarningLog(Module, $"can not run process, No wafer at {Module}"); EV.PostWarningLog(Module, $"can not run process, No wafer at {Module}");
@ -96,35 +95,16 @@ namespace SicModules.PMs.Routines
} }
public Result Monitor() protected override void MonitorBody()
{ {
try Process((int)RoutineStep.Process, _pm, _paramRecipeName, _recipeContent, _timeout);
{ NoteInProcess((int)RoutineStep.NoteInProcess, _pm.Module, 0);
Process((int)RoutineStep.Process, _pm, _paramRecipeName, _recipeContent, _timeout); WaitProcess((int)RoutineStep.WaitProcess, _pm, _timeout);
NoteProcessComplete((int)RoutineStep.NoteProcessComplete, _pm.Module, 0);
NoteInProcess((int) RoutineStep.NoteInProcess, _pm.Module, 0);
WaitProcess((int)RoutineStep.WaitProcess, _pm,_timeout);
NoteProcessComplete((int)RoutineStep.NoteProcessComplete, _pm.Module, 0);
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException)
{
NoteProcessFailed((int) RoutineStep.NoteProcessFailed, _pm.Module, 0);
return Result.FAIL;
}
Notify("Finished");
SetRoutineRuningDo(); SetRoutineRuningDo();
return Result.DONE;
} }
public void Abort() public override void Abort()
{ {
SetRoutineRuningDo(); SetRoutineRuningDo();
} }

View File

@ -81,17 +81,14 @@ namespace SicModules.TMs.Routines.Base
_reactorSuspectorCheckPM2 = DEVICE.GetDevice<IoSensor>($"PM2.SensorReactorSuspectorCheck"); _reactorSuspectorCheckPM2 = DEVICE.GetDevice<IoSensor>($"PM2.SensorReactorSuspectorCheck");
} }
public virtual Result Start(params object[] objs) protected override Result StartBody(params object[] args)
{ {
return Result.DONE; Notify("Start");
return Result.RUN;
} }
public virtual Result Monitor()
{ public override void Abort()
return Result.DONE;
}
public virtual void Abort()
{ {
_tm.SetAllValvesClose(out string reason); _tm.SetAllValvesClose(out string reason);
} }
@ -1545,7 +1542,7 @@ namespace SicModules.TMs.Routines.Base
} }
} }
public void CloseSlowPump(int id, TM tm) public virtual void CloseSlowPump(int id, TM tm)
{ {
Tuple<bool, Result> ret = Execute(id, () => Tuple<bool, Result> ret = Execute(id, () =>
{ {

View File

@ -95,13 +95,9 @@ namespace SicModules.TMs.Routines
_paramLeakCheckTime = SC.GetValue<int>("TM.LeakCheck.LeakCheckDelayTime"); ; _paramLeakCheckTime = SC.GetValue<int>("TM.LeakCheck.LeakCheckDelayTime"); ;
} }
protected override Result StartBody(params object[] args)
public Result Start(params object[] objs)
{ {
Reset(); _pumpRoutine.Init(SC.GetValue<double>("TM.LeakCheck.PumpBasePressure"), SC.GetValue<int>("TM.LeakCheck.PumpDelayTime"));
_swTimer.Restart();
_pumpRoutine.Init(SC.GetValue<double>("TM.LeakCheck.PumpBasePressure"), SC.GetValue<int>("TM.LeakCheck.PumpDelayTime"));
_ventRoutine.Init(SC.GetValue<double>("TM.LeakCheck.VentBasePressure"), SC.GetValue<int>("TM.LeakCheck.VentDelayTime")); _ventRoutine.Init(SC.GetValue<double>("TM.LeakCheck.VentBasePressure"), SC.GetValue<int>("TM.LeakCheck.VentDelayTime"));
string reason; string reason;
@ -170,50 +166,33 @@ namespace SicModules.TMs.Routines
EV.PostAlarmLog(Module, $"can not leakCheck,{reason}"); EV.PostAlarmLog(Module, $"can not leakCheck,{reason}");
return Result.FAIL; return Result.FAIL;
} }
Notify("Start"); Notify("Start");
return Result.RUN; return Result.RUN;
} }
public Result Monitor() protected override void MonitorBody()
{ {
try CheckRoutineTimeOut();
{
CheckRoutineTimeOut();
Loop((int)RoutineStep.StartLoop, _purgeCount); Loop((int)RoutineStep.StartLoop, _purgeCount);
ExecuteRoutine((int)RoutineStep.LoopPump, _pumpRoutine); ExecuteRoutine((int)RoutineStep.LoopPump, _pumpRoutine);
ExecuteRoutine((int)RoutineStep.LoopVent, _ventRoutine); ExecuteRoutine((int)RoutineStep.LoopVent, _ventRoutine);
EndLoop((int)RoutineStep.StopLoop); EndLoop((int)RoutineStep.StopLoop);
OpenSlowPump((int)RoutineStep.SlowPump, _tm, _slowFastPumpSwitchPressure, _slowPumpTimeout); OpenSlowPump((int)RoutineStep.SlowPump, _tm, _slowFastPumpSwitchPressure, _slowPumpTimeout);
OpenFastPump((int)RoutineStep.FastPump, _tm, _pumpBasePressure, _fastPumpTime); OpenFastPump((int)RoutineStep.FastPump, _tm, _pumpBasePressure, _fastPumpTime);
TimeDelay((int)RoutineStep.VaccumDelay, _paramContinuePumpTime); TimeDelay((int)RoutineStep.VaccumDelay, _paramContinuePumpTime);
CloseFastPump((int)RoutineStep.CloseValves, _tm); CloseFastPump((int)RoutineStep.CloseValves, _tm);
CloseSlowPump((int)RoutineStep.CLoseSlowValue, _tm); CloseSlowPump((int)RoutineStep.CLoseSlowValue, _tm);
DoLeakCheck((int)RoutineStep.DoLeakCheck, _paramLeakCheckTime); DoLeakCheck((int)RoutineStep.DoLeakCheck, _paramLeakCheckTime);
CalcLeackCheckPerMinute(_paramLeakCheckTime); CalcLeackCheckPerMinute(_paramLeakCheckTime);
//CalcLeakCheck((int)RoutineStep.CalcLeakCheck, _paramLeakCheckTime); //CalcLeakCheck((int)RoutineStep.CalcLeakCheck, _paramLeakCheckTime);
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException)
{
return Result.FAIL;
}
Notify($"Finished ! Elapsed time: {(int)(_swTimer.ElapsedMilliseconds / 1000)} s");
_tmIoInterLock.DoTmLeakCheckRoutineRunning = false;
_swTimer.Stop();
return Result.DONE;
} }
public void Abort() public override void Abort()
{ {
Stop("Leak check aborted"); Stop("Leak check aborted");
_tmIoInterLock.DoTmLeakCheckRoutineRunning = false; _tmIoInterLock.DoTmLeakCheckRoutineRunning = false;

View File

@ -582,7 +582,7 @@ namespace SicModules.TMs.Routines
} }
} }
public void CloseSlowPump(int id, TM tm) public override void CloseSlowPump(int id, TM tm)
{ {
Tuple<bool, Result> ret = Execute(id, () => Tuple<bool, Result> ret = Execute(id, () =>
{ {

View File

@ -32,41 +32,17 @@ namespace SicModules.TMs.Routines
} }
public Result Start(params object[] objs) protected override Result StartBody(params object[] args)
{ {
Reset();
Notify("Start"); Notify("Start");
return Result.RUN; return Result.RUN;
} }
protected override void MonitorBody()
public Result Monitor()
{ {
try VerifySlitValve((int)RoutineStep.VerifySlitValve, _tm);
{
VerifySlitValve((int)RoutineStep.VerifySlitValve, _tm);
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException)
{
return Result.FAIL;
}
Notify("Finished");
return Result.DONE;
} }
public void Abort()
{
}
public void VerifySlitValve(int id, TM tm) public void VerifySlitValve(int id, TM tm)
{ {
Tuple<bool, Result> ret = Execute(id, () => Tuple<bool, Result> ret = Execute(id, () =>

View File

@ -169,8 +169,6 @@ namespace SicModules.TMs
} }
} }
public event Action<string> OnEnterError;
public SicTMRobot RobotDevice { get; set; } public SicTMRobot RobotDevice { get; set; }
public SicTM TMDevice { get; set; } public SicTM TMDevice { get; set; }
@ -671,8 +669,7 @@ namespace SicModules.TMs
private bool FsmEnterError(object[] param) private bool FsmEnterError(object[] param)
{ {
if (OnEnterError != null) InvokeOnEnterError(Module);
OnEnterError(Module);
return true; return true;
} }

View File

@ -131,9 +131,7 @@ namespace SicModules.UnLoads
return 0; return 0;
} }
} }
public event Action<string> OnEnterError;
private bool _isInit; private bool _isInit;
public SicUnLoad _unLoadDevice { get; set; } public SicUnLoad _unLoadDevice { get; set; }
@ -389,8 +387,7 @@ namespace SicModules.UnLoads
private bool FsmEnterError(object[] param) private bool FsmEnterError(object[] param)
{ {
if (OnEnterError != null) InvokeOnEnterError(Module);
OnEnterError(Module);
return true; return true;
} }

View File

@ -1204,7 +1204,7 @@ namespace SicRT.Equipments.Systems
#endregion #endregion
private void OnModuleError(string module) private void OnModuleError(object sender, string module)
{ {
if (FsmState == (int)RtState.AutoRunning) if (FsmState == (int)RtState.AutoRunning)
{ {