1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using System.Diagnostics;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Aligners;
- namespace JetEfemLib.Buffers
- {
- public class BufferCoolingRoutine : ModuleRoutineBase, IStepRoutine
- {
- enum RoutineStep
- {
- Cooling,
- End,
- }
- private int _timeout = 3600;
- public float _coolingValue = 0.0f;
- public bool _coolingTypeIsTime = true;
- private Stopwatch _swTimer = new Stopwatch();
- public int ElapsedTime
- {
- get { return _swTimer.IsRunning ? (int)(_swTimer.ElapsedMilliseconds / 1000) : 0; }
- }
- public BufferCoolingRoutine(ModuleName module) : base(module.ToString())
- {
- Name = "Cooling";
- }
- public bool Initalize()
- {
- return true;
- }
- public void Init(bool coolingTypeIsTime,float coolingTime)
- {
- _coolingTypeIsTime = coolingTypeIsTime;
- _coolingValue = coolingTime;
-
- }
- public RState Start(params object[] objs)
- {
- Reset();
- _swTimer.Restart();
- return Runner.Start(Module, Name);
- }
- public RState Monitor()
- {
- Runner.Delay(RoutineStep.Cooling, (int)_coolingValue * 1000)
- .End(RoutineStep.End, NullFun, _delay_50ms);
- return Runner.Status;
- }
- public void Abort()
- {
- Notify("Abort");
- _swTimer.Stop();
- }
- }
- }
|