12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using System;
- using Aitex.Core.RT.Routine;
- using Venus_RT.Devices;
- using MECF.Framework.Common.Routine;
- using Venus_Core;
- using Aitex.Core.RT.SCCore;
- namespace Venus_RT.Modules.PMs
- {
- class PMHomeRoutine : PMRoutineBase, IRoutine
- {
- enum RoutineStep
- {
- Home,
- End,
- }
- public PMHomeRoutine(JetPMBase chamber) : base(chamber)
- {
- Name = "PM Home";
- }
- public RState Init()
- {
- return RState.End;
- }
- public RState Start(params object[] objs)
- {
- Reset();
- if (RtInstance.ConfigType == ConfigType.Kepler2200)
- {
- SC.SetItemValue($"{Module}.{VenusDevice.PendulumValve}.NoCheck", false);
- }
- return Runner.Start(Module, Name);
- }
- public RState Monitor()
- {
- Runner.Run(RoutineStep.Home, HOFs.WrapAction(_chamber.Home), IsHomed, 50000)
- .End(RoutineStep.End, () => { return true; });
- return Runner.Status;
- }
- public void Abort()
- {
- }
- private bool IsHomed()
- {
- if (_chamber.ChamberType == JetChamber.Kepler2300)
- {
- return _chamber.IsSlitDoorClosed && _chamber.LiftPinPosition == Venus_Core.MovementPosition.Down;
- }
- else if (_chamber.ChamberType == JetChamber.Kepler2200A || _chamber.ChamberType == JetChamber.Kepler2200B)
- {
- return _chamber.HomeIsOK(out string reason);
- }
- else if (_chamber.ChamberType == JetChamber.VenusSE)
- {
- return _chamber.IsSlitDoorClosed && _chamber.LiftPinPosition == Venus_Core.MovementPosition.Down;
- }
- else if (_chamber.ChamberType == JetChamber.VenusDE)
- {
- return _chamber.IsSlitDoorClosed && _chamber.LiftPinPosition == Venus_Core.MovementPosition.Down && _chamber.IsLinerDoorClosed;
- }
- return false;
- }
- }
- }
|