12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using Venus_RT.Devices;
- using MECF.Framework.Common.Routine;
- using MECF.Framework.Common.Equipment;
- using Venus_Core;
- namespace Venus_RT.Modules.TM
- {
- class MFVentRoutine : ModuleRoutineBase, IRoutine
- {
- private enum VentStep
- {
- kVenting,
- kCloseVentValves,
- }
- private int _ventingTimeout;
- private readonly JetTM _JetTM;
- public MFVentRoutine(JetTM jetTM, ModuleName mod) : base(mod)
- {
- _JetTM = jetTM;
- Name = "Vent";
- }
- public RState Start(params object[] objs)
- {
- if (_JetTM.CheckLidClosed(Module) &&
- _JetTM.CheckPumpValveClosed(Module) &&
- _JetTM.CheckPurgeValveClosed(Module))
- {
- Reset();
- _ventingTimeout = SC.GetValue<int>($"{Module}.VentingTimeout") * 1000;
- return Runner.Start(Module, Name);
- }
- return RState.Failed;
- }
- public RState Monitor()
- {
- Runner.Run((int)VentStep.kVenting, OpenVentValve, IsPressureReady, _ventingTimeout)
- .End((int)VentStep.kCloseVentValves, CloseVentValve, _delay_50ms);
- return Runner.Status;
- }
- private bool OpenVentValve()
- {
- if(!IsPressureReady())
- {
- _JetTM.TurnVentValve(Module, true);
- }
- return true;
- }
- private bool CloseVentValve()
- {
- _JetTM.TurnVentValve(Module, false);
- return true;
- }
- private bool IsPressureReady()
- {
- return _JetTM.IsModuleATM(Module);
- }
- public void Abort()
- {
- CloseVentValve();
- }
- }
- }
|