123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Venus_Core;
- using Venus_RT.Devices;
- namespace Venus_RT.Modules.PMs
- {
- class PMVATPerformanceRoutine : PMRoutineBase, IRoutine
- {
- int gasIndex;
- //int GasMaxScale;
- public int counter;
- int gasTime;
- int gasSetPoint;
- ValveType[] valveTypes = new ValveType[4] { ValveType.PV11, ValveType.PV21, ValveType.PV31, ValveType.PV41 };
- List<int> Positions = new List<int>() {50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1000};
- private enum VATPerformanceStep
- {
- kDelay_1s,
- kStartGas,
- kReadChamberPressure,
- kEnd,
- }
- public PMVATPerformanceRoutine(JetPM chamber) : base(chamber)
- {
- Name = "PMVATPerformance";
- }
- public RState Start(params object[] objs)
- {
- if (!CheckTurboPump())
- {
- return RState.Failed;
- }
- if (_chamber.GetPVPosition() == 0)
- {
- Stop("钟摆阀没有打开");
- return RState.Failed;
- }
- _chamber.OpenValve(ValveType.Guage, true);
- _chamber.OpenValve(ValveType.TurboPumpPumping, true);
- _chamber.OpenValve(ValveType.TurboPumpPurge, true);
- counter = 1;
- Reset();
- gasIndex = (int)objs[0];
- gasTime = (int)objs[1];
- gasSetPoint = (int)objs[2];
- //_chamber.CloseValves();
- //_chamber.SetPVPostion(25);
- return Runner.Start(Module, Name);
- }
- public RState Monitor()
- {
- Runner.Delay((int)VATPerformanceStep.kDelay_1s, 1000 * 1)
- .LoopStart((int)VATPerformanceStep.kStartGas, "VAT Performance Test", Positions.Count, () => SetPositionGas(), gasTime)
- .LoopEnd((int)VATPerformanceStep.kReadChamberPressure, ReadChamberPressure, _delay_1s)
- .End((int)VATPerformanceStep.kEnd, () =>
- {
- _chamber.CloseValves();
- return true;
- }, 500);
- return Runner.Status;
- }
- private bool SetPositionGas()
- {
- if (!_chamber.SetPVPostion(Positions[counter - 1]))
- {
- return false;
- }
- if (gasIndex <= 4)
- {
- _chamber.OpenValve(valveTypes[gasIndex - 1], true);
- }
- _chamber.OpenValve(ValveType.GasFinal, true);
- _chamber.FlowGas(gasIndex - 1, gasSetPoint);
- return true;
- }
- private bool ReadChamberPressure()
- {
- counter += 1;
- return true;
- }
- public void Abort()
- {
- _chamber.CloseValves();
- }
- }
- }
|