| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Log;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.RecipeCenter;
- using MECF.Framework.Common.Routine;
- using MECF.Framework.Common.SubstrateTrackings;
- using PunkHPX8_Core;
- using PunkHPX8_RT.Devices.AXIS;
- using PunkHPX8_RT.Devices.VpwCell;
- using PunkHPX8_RT.Devices.VpwMain;
- using PunkHPX8_RT.Modules.VpwMain;
- using PunkHPX8_RT.Schedulers;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PunkHPX8_RT.Modules.VpwCell
- {
- public class VpwChamberUpRoutine : RoutineBase, IRoutine
- {
- private enum PrepareStep
- {
- CheckPreCondition,
- ChamerUp,
- Delay,
- End
- }
- #region 内部变量
- /// <summary>
- /// Main设备
- /// </summary>
- private VpwMainDevice _mainDevice;
- #endregion
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="module"></param>
- public VpwChamberUpRoutine(string module) : base(module)
- {
- }
- /// <summary>
- /// 中止
- /// </summary>
- public void Abort()
- {
- Runner.Stop("Manual abort");
- }
- /// <summary>
- /// 监控
- /// </summary>
- /// <returns></returns>
- public RState Monitor()
- {
- Runner.Run(PrepareStep.CheckPreCondition,CheckPreCondition,_delay_1ms)
- .Run(PrepareStep.ChamerUp, ChamberUp, CheckChamberClosed,_delay_10s)
- .End(PrepareStep.End,NullFun,_delay_1ms);
- return Runner.Status;
- }
- /// <summary>
- /// 打开 Chamber
- /// </summary>
- /// <returns></returns>
- private bool ChamberUp()
- {
- return _mainDevice.ChamberUp();
- }
- /// <summary>
- /// 检验Chamber是否关闭
- /// </summary>
- /// <returns></returns>
- private bool CheckChamberClosed()
- {
- return !_mainDevice.CommonData.ChamberOpened && _mainDevice.CommonData.ChamberClosed;
- }
- /// <summary>
- /// 检验前置条件
- /// </summary>
- /// <returns></returns>
- private bool CheckPreCondition()
- {
- string matcher = ModuleMatcherManager.Instance.GetMatcherByModule(Module);
- VpwCellEntity vpwCellEntity = Singleton<RouteManager>.Instance.GetModule<VpwCellEntity>(matcher);
- if (vpwCellEntity == null)
- {
- return true;
- }
- if (vpwCellEntity.IsDisable)
- {
- return true;
- }
- if (!vpwCellEntity.IsAuto)
- {
- return true;
- }
- bool result= vpwCellEntity.IsIdle;
- if (!result)
- {
- NotifyError(eEvent.ERR_PLATINGCELL, $"{vpwCellEntity.Module} is not idle,cannot chamber up",0);
- }
- return result;
- }
- /// <summary>
- /// 启动
- /// </summary>
- /// <param name="objs"></param>
- /// <returns></returns>
- public RState Start(params object[] objs)
- {
- _mainDevice = DEVICE.GetDevice<VpwMainDevice>(ModuleName.VPWMain1.ToString());
- return Runner.Start(Module, $"{Module} chamber up");
- }
- }
- }
|