| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 | using System;using System.Diagnostics;using Aitex.Core.RT.Event;using Aitex.Core.RT.Routine;using Aitex.Core.RT.SCCore;using VirgoRT.Devices;namespace VirgoRT.Modules.PMs{    class PumpDownRoutine : PMRoutineBase, IRoutine    {        private enum PumpSequence        {            kCheckLidSignal,            kCheckSlitDoor,            kCheckDryPumpStatus,            kCloseValves,            kOpenPumpingValve,            kDelay,            kCheckVAC,            kCheckForelinePressure,            kCheckThrottleValveStatus,            kCheckATM,            kOpenSoftPumpValve,            kCloseSoftPumpValve,            kFastPumpValve,            kCloseFastPumpValve,            kCheckChamberPressure,            kCheckVACSignal,            kEnd        }        private int _basePressure;        private int _pumpValveDelay;        private double _pumpTimeLimit;        private readonly uint FORELINE_TARGET = 500;        private Stopwatch _pumpDownStopwatch = new Stopwatch();        public double PumpDownOnTime => _pumpDownStopwatch.Elapsed.TotalSeconds;        public PumpDownRoutine(JetPM chamber) : base(chamber)        {            Name = "PumpDown";            bUINotify = true;        }        public void Terminate()        {        }        public Result Start(params object[] objs)        {            // 预检查,必须关盖子            if (CheckLid() == Result.RUN &&                CheckSlitDoor() == Result.RUN)                //&& CheckDryPump() == Result.RUN)            {                Reset();                //关闭所有阀门                _chamber.CloseValves();                //_PressureTrip1 = SC.GetValue<int>($"{Module}.Pump.PressureTrip1") * 1000;                _basePressure = (objs.Length == 1) ? Convert.ToInt32(objs[0]) : SC.GetValue<int>($"{Module}.Pump.PumpBasePressure");                _pumpTimeLimit = SC.GetValue<double>($"{Module}.Pump.PumpTimeLimit");                _pumpValveDelay = SC.GetValue<int>($"{Module}.Pump.PumpValveDelay");                _pumpDownStopwatch.Restart();                Notify("开始");                return Result.RUN;            }            return Result.FAIL;        }        public Result Monitor()        {            try            {                CheckForeline((int)PumpSequence.kCheckForelinePressure, FORELINE_TARGET, 15);                CheckThrottleValveFullOpen((int)PumpSequence.kCheckThrottleValveStatus);                // open pumping valve                SetValve((int)PumpSequence.kOpenSoftPumpValve, ValveType.SOFT_PUMP, true);                TimeDelay((int)PumpSequence.kDelay, _pumpValveDelay);                SetValve((int)PumpSequence.kFastPumpValve, ValveType.FAST_PUMP, true);                SetValve((int)PumpSequence.kCloseFastPumpValve, ValveType.SOFT_PUMP, false);                CheckATM2((int)PumpSequence.kCheckATM, false, 30);                //CheckPressure((int)PumpSequence.kCheckChamberPressure, _PressureTrip1, false, 50);                //OpenValve((int)PumpSequence.kCloseSoftPumpValve, ValveType.SOFT_PUMP, false);                //检查VAC                CheckVAC((int)PumpSequence.kCheckVACSignal, 90);                CheckPressure((int)PumpSequence.kCheckVAC, _basePressure, false, (int)_pumpTimeLimit);                End((int)PumpSequence.kEnd);            }            catch (RoutineBreakException)            {                return Result.RUN;            }            catch (RoutineFaildException)            {                Stop("出错");                return Result.FAIL;            }            catch (Exception ex)            {                Stop(ex.Message);                return Result.FAIL;            }            _pumpDownStopwatch.Stop();            Notify("结束");            return Result.DONE;        }        public override void Abort()        {            _chamber.CloseValves();        }    }}
 |