1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.RT.Core.Equipments;
- using MECF.Framework.RT.ModuleLibrary.VceModules;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Venus_Core;
- using Venus_RT.Devices.VCE;
- namespace Venus_RT.Modules.VCE
- {
- public class UnloadRoutine : ModuleRoutineBase, IRoutine
- {
- public enum UnloadStep
- {
- Vent,
- GotoUnload,
- OpenOutDoor,
- NotifyOver
- }
- VceModuleBase _vce;
- int _timeout;
- public UnloadRoutine(ModuleName module,VceModuleBase vce) : base(module)
- {
- _vce = vce;
- }
- public RState Start(params object[] objs)
- {
- _timeout = SC.GetValue<int>($"{Module}.MotionTimeout");
- Reset();
- return Runner.Start(Module,"VCE Unload Routine");
- }
- public RState Monitor()
- {
- Runner.Run(UnloadStep.Vent, Vent, CheckVentOver)
- .Run(UnloadStep.GotoUnload, GotoUnload, CheckVceIdle, _timeout)
- .Run(UnloadStep.OpenOutDoor, OpenOutDoor, CheckVceIdle, _timeout)
- .End(UnloadStep.NotifyOver, NullFun, 100);
- return Runner.Status;
- }
- private bool CheckVentOver()
- {
- return true;
- }
- private bool Vent()
- {
- return true;
- }
- private bool OpenOutDoor()
- {
- return _vce.OpenDoor();
- }
- private bool GotoUnload()
- {
- return _vce.GotoLP();
- }
- private bool CheckVceIdle()
- {
- if (_vce.Status == RState.Failed || _vce.Status == RState.Timeout)
- {
- Singleton<RouteManager>.Instance.GetVCE(Module).PostMsg(VceMSG.Error);
- return false;
- }
- return _vce.Status == RState.End;
- }
- public void Abort()
- {
- }
- }
- }
|