123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- using System;
- using Aitex.Core.Common.DeviceData;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using JetVirgoPM.Devices;
- namespace JetVirgoPM.PMs.Routines
- {
- class GasFlowRoutine : PMRoutineBase, IStepRoutine
- {
- private enum RoutineStep
- {
- CheckPressure,
- StartFlow,
- StopFlow,
- CheckStable,
- End,
- };
- public bool _gasStatus = false;
- private double _pressureAlarmRange;
- private double _pressureAlarmTime;
- //private double _gasFlowAlarmRange;
- //private double _gasFlowAlarmTime;
- private double[] _mfcSetPoint = new double[6];
- public GasFlowRoutine(JetDualPM chamber) : base(chamber)
- {
- Name = "Flow gas";
- bUINotify = true;
- }
- public RState Start(params object[] objs)
- {
- if (!_chamber.IsFastPumpOpened)
- {
- StopFlow2();
- Stop("Pump 阀没有打开");
- return RState.Failed;
- }
- Reset();
- _pressureAlarmRange = SC.GetValue<double>($"{Module}.GasFlowPressureAlarmRange");
- _pressureAlarmTime = SC.GetValue<double>($"{Module}.GasFlowPressureAlarmTime");
- // open process final valve and flow
- Notify("Open valve and flow mfc");
- if(!_chamber.IsPlus)
- _chamber.OpenValve(ValveType.PURGE, true);
- _chamber.OpenValve(ValveType.PROCESS, true);
- int i = 0;
- foreach (object o in objs)
- {
- _mfcSetPoint[i++] = (double)o;
- }
- FlowMfc2((int)RoutineStep.StartFlow, _mfcSetPoint);
- _gasStatus = true;
- return Runner.Start(_chamber.Module.ToString(), Name);
- }
- public RState Monitor()
- {
- if (_chamber.HasGasOutOfRange)
- {
- Stop("流气率越界");
- _gasStatus = false;
- return RState.Failed;
- }
- Runner.End(RoutineStep.End, EndFunc, _delay_50ms);
- return Runner.Status;
- }
- public void FlowMfc2(int id, double[] mfcValues)
- {
- string reason = string.Empty;
- for (int index = 0; index < mfcValues.Length; index++)
- {
- _chamber.FlowGas(index, mfcValues[index]);
- }
- }
- public void StopFlow2()
- {
- Notify("Close valve and stop to flow MFC");
- _chamber.OpenValve(ValveType.PURGE, false);
- _chamber.OpenValve(ValveType.PROCESS, false);
- _chamber.StopAllGases();
- }
- public override void Abort()
- {
- this.StopFlow2();
- _gasStatus = false;
- }
- }
- }
|