| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 | using Aitex.Core.RT.Routine;using Aitex.Core.RT.SCCore;using Venus_RT.Devices;using MECF.Framework.Common.Routine;using Venus_Core;namespace Venus_RT.Modules.PMs{    enum GasStep    {        kStartGas,        kEnd,    }    class GasFlowRoutine : PMRoutineBase, IRoutine    {        public bool _gasStatus = false;        private double[] _mfcSetPoint = new double[8];        public GasFlowRoutine(JetPMBase chamber) : base(chamber)        {            Name = "Gas Flow";        }        public RState Start(params object[] objs)        {            //if (!_chamber.IsFastPumpOpened)            //{            //    StopFlow();            //    Stop("Pump 阀没有打开");            //    return RState.Failed;            //}            if(!CheckTurboPump())            {                return RState.Failed;            }            if(_chamber.GetPVPosition() == 0)            {                Stop("钟摆阀没有打开");                return RState.Failed;            }            Reset();            // open process final valve and flow            Notify("Open valve and flow mfc");            _chamber.OpenValve(ValveType.GasFinal, true);            int i = 0;            foreach (object o in objs)            {                _mfcSetPoint[i++] = (double)o;            }            _gasStatus = true;            Reset();            return Runner.Start(Module, Name);        }        public RState Monitor()        {            Runner.Run((int)GasStep.kStartGas, FlowMfc, CheckRange, 6000000)                .End((int)GasStep.kEnd, NullFun, _delay_50ms);            return Runner.Status;        }        public void Abort()        {            StopFlow();        }        public bool FlowMfc()        {            for (int index = 0; index < _mfcSetPoint.Length; index++)            {                if (_mfcSetPoint[index] > 0)                    OpenPVNVlv(index, true);                _chamber.FlowGas(index, _mfcSetPoint[index]);            }            return true;        }        private void OpenPVNVlv(int mfcIndex, bool on)        {            ValveType[] vlvs = new ValveType[] { ValveType.PV11, ValveType.PV21, ValveType.PV31, ValveType.PV41 };            if (mfcIndex < 4)            {                _chamber.OpenValve(vlvs[mfcIndex], on);            }        }        private bool CheckRange()        {            if (_chamber.HasGasOutOfRange)            {                Stop("流气率越界");                _gasStatus = false;                return true;            }            return false;        }        public void StopFlow()        {            Notify("Close valve and stop to flow MFC");            _chamber.OpenValve(ValveType.GasFinal, false);            _chamber.StopAllGases();            OpenPVNVlv(0, false);            OpenPVNVlv(1, false);            OpenPVNVlv(2, false);            OpenPVNVlv(3, false);        }    }}
 |