|
@@ -1,73 +1,115 @@
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+using Aitex.Core.RT.Routine;
|
|
|
+using Aitex.Core.RT.SCCore;
|
|
|
+using MECF.Framework.Common.Equipment;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Diagnostics;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using Venus_Core;
|
|
|
+using Venus_RT.Devices;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+namespace Venus_RT.Modules.TM
|
|
|
+{
|
|
|
+ class MFCoolingRoutine : ModuleRoutineBase, IRoutine
|
|
|
+ {
|
|
|
+ private enum CoolingStep
|
|
|
+ {
|
|
|
+ kDelay,
|
|
|
+ kStopVent,
|
|
|
+ kStartCooling,
|
|
|
+ kWaitCoolingEnd,
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ kEndCooling,
|
|
|
+ }
|
|
|
+ private int _coolingTime;
|
|
|
+ private double _coolingMFCFlow;
|
|
|
+ private readonly JetTM _JetTM;
|
|
|
+ private Stopwatch _coolingStopWatch = new Stopwatch();
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ public MFCoolingRoutine(JetTM jetTM, ModuleName mod) : base(mod)
|
|
|
+ {
|
|
|
+ _JetTM = jetTM;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
+ public RState Start(params object[] objs)
|
|
|
+ {
|
|
|
+ _coolingMFCFlow = SC.GetValue<double>($"{Module}.Cooling.MFCFlow");
|
|
|
+ _coolingTime = SC.GetValue<int>($"{Module}.Cooling.CoolingTime");
|
|
|
|
|
|
-
|
|
|
-
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ return Runner.Start(Module, Name);
|
|
|
+ }
|
|
|
+
|
|
|
+ public RState Monitor()
|
|
|
+ {
|
|
|
+ Runner .Delay(CoolingStep.kDelay, 1000)
|
|
|
+ .Run(CoolingStep.kStopVent, StopVent)
|
|
|
+ .Run(CoolingStep.kStartCooling, StartCooling)
|
|
|
+ .Wait(CoolingStep.kWaitCoolingEnd, CoolingIsEnd)
|
|
|
+ .End(CoolingStep.kEndCooling, ResetCooling, NullFun);
|
|
|
+
|
|
|
+ return Runner.Status;
|
|
|
+ }
|
|
|
+ private bool StopVent()
|
|
|
+ {
|
|
|
+ _JetTM.TurnVentValve(Module, false);
|
|
|
+ _JetTM.TurnExhaustValve(Module, false);
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private bool StartCooling()
|
|
|
+ {
|
|
|
+ _JetTM.TurnPurgeValve(Module, true);
|
|
|
+ _JetTM.TurnExhaustValve(Module, true);
|
|
|
+
|
|
|
+ if (Module == ModuleName.LLA)
|
|
|
+ {
|
|
|
+ _JetTM.SetLLAFlow((int)_coolingMFCFlow);
|
|
|
+ }
|
|
|
+ else if (Module == ModuleName.LLB)
|
|
|
+ {
|
|
|
+ _JetTM.SetLLBFlow((int)_coolingMFCFlow);
|
|
|
+ }
|
|
|
+ _coolingStopWatch.Start();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private bool CoolingIsEnd()
|
|
|
+ {
|
|
|
+ return _coolingStopWatch.ElapsedMilliseconds > _coolingTime * 1000;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool ResetCooling()
|
|
|
+ {
|
|
|
+ _coolingStopWatch.Reset();
|
|
|
+ if (Module == ModuleName.LLA)
|
|
|
+ {
|
|
|
+ _JetTM.SetLLAFlow(0);
|
|
|
+ }
|
|
|
+ else if (Module == ModuleName.LLB)
|
|
|
+ {
|
|
|
+ _JetTM.SetLLBFlow(0);
|
|
|
+ }
|
|
|
+ _JetTM.TurnPurgeValve(Module, false);
|
|
|
+ _JetTM.TurnExhaustValve(Module, false);
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ public void Abort()
|
|
|
+ {
|
|
|
+ _coolingStopWatch.Reset();
|
|
|
+ if (Module == ModuleName.LLA)
|
|
|
+ {
|
|
|
+ _JetTM.SetLLAFlow(0);
|
|
|
+ }
|
|
|
+ else if (Module == ModuleName.LLB)
|
|
|
+ {
|
|
|
+ _JetTM.SetLLBFlow(0);
|
|
|
+ }
|
|
|
+ _JetTM.TurnPurgeValve(Module, false);
|
|
|
+ _JetTM.TurnExhaustValve(Module, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|