BufferCoolingRoutine.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. using System.Diagnostics;
  3. using Aitex.Core.RT.Device;
  4. using Aitex.Core.RT.Routine;
  5. using Aitex.Core.RT.SCCore;
  6. using MECF.Framework.Common.Equipment;
  7. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Aligners;
  8. namespace JetEfemLib.Buffers
  9. {
  10. public class BufferCoolingRoutine : ModuleRoutineBase, IStepRoutine
  11. {
  12. enum RoutineStep
  13. {
  14. Cooling,
  15. End,
  16. }
  17. private int _timeout = 3600;
  18. public float _coolingValue = 0.0f;
  19. public bool _coolingTypeIsTime = true;
  20. private Stopwatch _swTimer = new Stopwatch();
  21. public int ElapsedTime
  22. {
  23. get { return _swTimer.IsRunning ? (int)(_swTimer.ElapsedMilliseconds / 1000) : 0; }
  24. }
  25. public BufferCoolingRoutine(ModuleName module) : base(module.ToString())
  26. {
  27. Name = "Cooling";
  28. }
  29. public bool Initalize()
  30. {
  31. return true;
  32. }
  33. public void Init(bool coolingTypeIsTime,float coolingTime)
  34. {
  35. _coolingTypeIsTime = coolingTypeIsTime;
  36. _coolingValue = coolingTime;
  37. }
  38. public RState Start(params object[] objs)
  39. {
  40. Reset();
  41. _swTimer.Restart();
  42. return Runner.Start(Module, Name);
  43. }
  44. public RState Monitor()
  45. {
  46. Runner.Delay(RoutineStep.Cooling, (int)_coolingValue * 1000)
  47. .End(RoutineStep.End, NullFun, _delay_50ms);
  48. return Runner.Status;
  49. }
  50. public void Abort()
  51. {
  52. Notify("Abort");
  53. _swTimer.Stop();
  54. }
  55. }
  56. }