123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- //using Aitex.Core.RT.Routine;
- //using Aitex.Core.RT.SCCore;
- //using Venus_RT.Devices;
- //using MECF.Framework.Common.Equipment;
- //using Venus_Core;
- //using System.Runtime.InteropServices.WindowsRuntime;
- //namespace Venus_RT.Modules.TM
- //{
- // class MFVentRoutine : ModuleRoutineBase, IRoutine
- // {
- // private enum VentStep
- // {
- // Venting,
- // OpenSoftVent,
- // SwitchFastVent,
- // PrepareOverVent,
- // CloseVentValves,
- // Delay,
- // CloseExhaustValve,
- // PrepareCooling,
- // StartCooling,
- // Cooling,
- // End,
- // }
- // private int _ventingTimeout;
- // private int _SoftVentEndPressure;
- // private readonly JetTM _JetTM;
- // private int _ventTimeDelay = 1;
- // private bool _needCooling = false;
- // private double _coolingMFCFlow = 0;
- // private bool _skipRepeatVent = false;
- // private int _exhaustValveWaitDelayTime;
- // private int _overVentFlow;
- // public MFVentRoutine(JetTM jetTM, ModuleName mod) : base(mod)
- // {
- // _JetTM = jetTM;
- // Name = "Vent ";
- // }
- // public RState Start(params object[] objs)
- // {
- // bool isLoadLock = (ModuleHelper.IsLoadLock(Module));
- // if (objs.Length > 0 && isLoadLock)
- // {
- // _needCooling = (bool)objs[0];
- // _coolingMFCFlow = SC.GetValue<double>($"{Module}.Cooling.MFCFlow");
- // }
- // _skipRepeatVent = false;
- // if (isLoadLock && !_needCooling && IsPressureReady())
- // _skipRepeatVent = true; ;
- // _JetTM.TurnSoftPumpValve(Module, false);
- // _JetTM.TurnFastPumpValve(Module, false);
- // _JetTM.TurnPurgeValve(Module, false);
- // if (_JetTM.CheckLidClosed(Module) &&
- // _JetTM.CheckPumpValveClosed(Module) &&
- // _JetTM.CheckPurgeValveClosed(Module))
- // {
- // Reset();
- // _ventingTimeout = SC.GetValue<int>($"{Module}.VentingTimeout") * 1000;
- // _SoftVentEndPressure = SC.GetValue<int>($"{Module}.SoftVentEndPressure");
- // _ventTimeDelay = SC.GetValue<int>($"{Module}.OverVentTime");
- // _exhaustValveWaitDelayTime = SC.GetValue<int>($"{Module}.ExhaustValveOffDelayTime");
- // _overVentFlow = SC.GetValue<int>($"{Module}.OverVentFlow");
- // return Runner.Start(Module, Name);
- // }
- // return RState.Failed;
- // }
- // public RState Monitor()
- // {
- // if (_skipRepeatVent)
- // {
- // Notify($" pressure: {_JetTM.GetModulePressure(Module)} is ready, skip the the venting routine.");
- // CloseVentValve();
- // CloseExhaustValve();
- // return RState.End;
- // }
- // if (_needCooling)
- // {
- // Runner.Run(VentStep.OpenSoftVent, OpenSoftVentValve, IsSoftVentEnd)
- // .Run(VentStep.SwitchFastVent, SwitchFastVentValve, IsPressureReady, _ventingTimeout)
- // .Delay(VentStep.Delay, _ventTimeDelay)
- // .Run(VentStep.CloseVentValves, CloseVentValve, _delay_1s)
- // .RunIf(VentStep.PrepareCooling, _needCooling, StopVent)
- // .RunIf(VentStep.StartCooling, _needCooling, StartCooling, 3600000)
- // .End(VentStep.CloseExhaustValve, CloseExhaustValve);
- // }
- // else
- // {
- // Runner.Run(VentStep.OpenSoftVent, OpenSoftVentValve, IsSoftVentEnd)
- // .Run(VentStep.SwitchFastVent, SwitchFastVentValve, IsPressureReady, _ventingTimeout)
- // .Run(VentStep.PrepareOverVent, PrepareOverVent)
- // .Delay(VentStep.Delay, _ventTimeDelay)
- // .Run(VentStep.CloseExhaustValve, CloseExhaustValve, _exhaustValveWaitDelayTime)
- // .End(VentStep.CloseVentValves, CloseVentValve);
- // }
- // return Runner.Status;
- // }
- // private bool OpenSoftVentValve()
- // {
- // _JetTM.TurnN2Valve(true);
- // _JetTM.TurnPurgeValve(Module, true);
- // switch (Module)
- // {
- // case ModuleName.LLA:
- // _JetTM.SetLLAFlow(2000);
- // break;
- // case ModuleName.LLB:
- // _JetTM.SetLLBFlow(2000);
- // break;
- // case ModuleName.TM:
- // _JetTM.SetTMFlow(100);
- // break;
- // }
- // return true;
- // }
- // private bool PrepareOverVent()
- // {
- // _JetTM.TurnVentValve(Module, false);
- // _JetTM.TurnN2Valve(true);
- // _JetTM.TurnPurgeValve(Module, true);
- // switch (Module)
- // {
- // case ModuleName.LLA:
- // _JetTM.SetLLAFlow(_overVentFlow);
- // break;
- // case ModuleName.LLB:
- // _JetTM.SetLLBFlow(_overVentFlow);
- // break;
- // case ModuleName.TM:
- // _JetTM.SetTMFlow(100);
- // break;
- // }
- // _JetTM.TurnExhaustValve(Module, true);
- // return true;
- // }
- // private bool CloseExhaustValve()
- // {
- // _JetTM.TurnExhaustValve(Module, false);
- // return true;
- // }
- // private bool IsSoftVentEnd()
- // {
- // return _JetTM.GetModulePressure(Module) > _SoftVentEndPressure;
- // }
- // private bool SwitchFastVentValve()
- // {
- // switch (Module)
- // {
- // case ModuleName.LLA:
- // _JetTM.SetLLAFlow(0);
- // break;
- // case ModuleName.LLB:
- // _JetTM.SetLLBFlow(0);
- // break;
- // case ModuleName.TM:
- // _JetTM.SetTMFlow(0);
- // break;
- // }
- // _JetTM.TurnPurgeValve(Module, false);
- // //_JetTM.TurnExhaustValve(Module, true);
- // _JetTM.TurnVentValve(Module, true);
- // return true;
- // }
- // private bool CloseVentValve()
- // {
- // switch (Module)
- // {
- // case ModuleName.LLA:
- // _JetTM.SetLLAFlow(0);
- // break;
- // case ModuleName.LLB:
- // _JetTM.SetLLBFlow(0);
- // break;
- // case ModuleName.TM:
- // _JetTM.SetTMFlow(0);
- // break;
- // }
- // _JetTM.TurnPurgeValve(Module, false);
- // //_JetTM.TurnExhaustValve(Module, false);
- // _JetTM.TurnVentValve(Module, false);
- // return true;
- // }
- // private bool StopVent()
- // {
- // _JetTM.TurnVentValve(Module, false);
- // _JetTM.TurnExhaustValve(Module, false);
- // return true;
- // }
- // private bool StartCooling()
- // {
- // _JetTM.TurnPurgeValve(Module, true);
- // _JetTM.TurnExhaustValve(Module, true);
- // if (Module == ModuleName.LLA)
- // {
- // _JetTM.SetLLAFlow(_coolingMFCFlow);
- // }
- // else if (Module == ModuleName.LLB)
- // {
- // _JetTM.SetLLBFlow(_coolingMFCFlow);
- // }
- // return true;
- // }
- // private bool IsPressureReady()
- // {
- // return _JetTM.IsModuleATM(Module);
- // }
- // public void Abort()
- // {
- // CloseVentValve();
- // if (_needCooling)
- // {
- // if (Module == ModuleName.LLA)
- // {
- // _JetTM.SetLLAFlow(0);
- // }
- // else if (Module == ModuleName.LLB)
- // {
- // _JetTM.SetLLBFlow(0);
- // }
- // _JetTM.TurnPurgeValve(Module, false);
- // _JetTM.TurnExhaustValve(Module, false);
- // Notify("Cooling done");
- // }
- // }
- // }
- //}
|