TemperatureControlRoutine.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using Aitex.Core.RT.Routine;
  3. using Aitex.Core.RT.SCCore;
  4. using Virgo_DRT.Devices;
  5. namespace Virgo_DRT.Modules.PMs
  6. {
  7. class TemperatureControlRoutine : PMRoutineBase, IRoutine
  8. {
  9. private enum TCSequence
  10. {
  11. kCheckTemperature,
  12. kEnd
  13. }
  14. private int _checkSubstrateTempTimeout = 60;
  15. private double _TargetTemp = 0.0f;
  16. private double _tolerance;
  17. public TemperatureControlRoutine(JetPM chamber) : base(chamber)
  18. {
  19. Name = "PreHeat";
  20. bUINotify = true;
  21. }
  22. public void Terminate()
  23. {
  24. }
  25. public Result Start(params object[] objs)
  26. {
  27. try
  28. {
  29. Reset();
  30. _TargetTemp = (double)objs[0];
  31. _checkSubstrateTempTimeout = SC.GetValue<int>($"{Module}.CheckSubstrateTempTimeout");
  32. _tolerance = SC.GetValue<double>($"System.MaxTemperatureToleranceToTarget");
  33. Notify($"开始, 目标 {_TargetTemp} ℃");
  34. return Result.RUN;
  35. }
  36. catch
  37. {
  38. return Result.FAIL;
  39. }
  40. }
  41. public Result Monitor()
  42. {
  43. try
  44. {
  45. CheckSubstrateTemp((int)TCSequence.kCheckTemperature, _TargetTemp, _checkSubstrateTempTimeout, _tolerance);
  46. End((int)TCSequence.kEnd);
  47. }
  48. catch (RoutineBreakException)
  49. {
  50. return Result.RUN;
  51. }
  52. catch (RoutineFaildException)
  53. {
  54. Notify("出错 ");
  55. return Result.FAIL;
  56. }
  57. catch (System.Exception ex)
  58. {
  59. Stop(ex.Message);
  60. return Result.FAIL;
  61. }
  62. Notify("结束");
  63. return Result.DONE;
  64. }
  65. public override void Abort() { }
  66. }
  67. }