123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using VirgoRT.Devices;
- namespace VirgoRT.Modules.PMs
- {
- class StartPumpRoutine : PMRoutineBase, IRoutine
- {
- private enum StartPumpSequence
- {
- kCheckForelinePressure,
- kCloseSoftPumpValve,
- kFastPumpValve,
- kCloseValves,
- kEnd
- }
- private double _chamberForelinePressureThreshold;
- private int _chamberForelinePressureTimeout;
- public StartPumpRoutine(JetPM chamber) : base(chamber)
- {
- Name = "LaunchPump";
- bUINotify = true;
- }
- public void Terminate()
- {
- }
- public Result Start(params object[] objs)
- {
- try
- {
- if (_chamber.IsPumpRunning)
- {
- Stop("泵已经运行");
- return Result.FAIL;
- }
- Reset();
- _chamberForelinePressureThreshold = SC.GetValue<double>($"{Module}.DryPump.ChamberForelinePressureThreshold");
- _chamberForelinePressureTimeout = SC.GetValue<int>($"{Module}.DryPump.ChamberForelinePressureTimeout");
- _chamber.StartPump(true);
- _chamber.SetValveOnOff(ValveType.FAST_PUMP, false);
- _chamber.SetValveOnOff(ValveType.SOFT_PUMP, false);
- Notify("开始");
- return Result.RUN;
- }
- catch
- {
- return Result.FAIL;
- }
- }
- public Result Monitor()
- {
- try
- {
- CheckForeline((int)StartPumpSequence.kCheckForelinePressure, (uint)_chamberForelinePressureThreshold, _chamberForelinePressureTimeout);
- End((int)StartPumpSequence.kEnd);
- }
- catch (RoutineBreakException)
- {
- return Result.RUN;
- }
- catch (RoutineFaildException)
- {
- Notify("出错 ");
- return Result.FAIL;
- }
- catch (System.Exception ex)
- {
- Stop(ex.Message);
- return Result.FAIL;
- }
- Notify("结束");
- return Result.DONE;
- }
- public override void Abort()
- {
- _chamber.CloseValves();
- _chamber.StartPump(false);
- }
- }
- }
|