PMEntity.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.Diagnostics;
  5. using System.Linq;
  6. using Aitex.Core.Common;
  7. using Aitex.Core.RT.DataCenter;
  8. using Aitex.Core.RT.Device;
  9. using Aitex.Core.RT.Event;
  10. using Aitex.Core.RT.Fsm;
  11. using Aitex.Core.RT.OperationCenter;
  12. using Aitex.Core.RT.Routine;
  13. using Aitex.Core.RT.SCCore;
  14. using Aitex.Core.Util;
  15. using Aitex.Sorter.Common;
  16. using MECF.Framework.Common.DataCenter;
  17. using MECF.Framework.Common.Equipment;
  18. using MECF.Framework.Common.Schedulers;
  19. using MECF.Framework.Common.SubstrateTrackings;
  20. using Venus_Core;
  21. using Venus_RT.Devices;
  22. using Venus_RT.Modules;
  23. using Venus_RT.Modules.PMs;
  24. namespace Venus_RT.Modules.PMs
  25. {
  26. public class RecipeRunningInfo
  27. {
  28. public Guid InnerId { get; set; }
  29. public RecipeHead Head { get; set; }
  30. public List<RecipeStep> RecipeStepList { get; set; }
  31. public string RecipeName { get; set; }
  32. public DateTime BeginTime { get; set; }
  33. public DateTime EndTime { get; set; }
  34. public int StepNumber { get; set; }
  35. public string StepName { get; set; }
  36. public double StepTime { get; set; }
  37. public double StepElapseTime { get; set; }
  38. public double TotalTime { get; set; }
  39. public double TotalElapseTime { get; set; }
  40. }
  41. public class PMEntity : Entity, IModuleEntity
  42. {
  43. public enum MSG
  44. {
  45. Home,
  46. Transfer,
  47. PrepareTransfer,
  48. PostTransfer,
  49. Reset,
  50. Abort,
  51. Error,
  52. LaunchPump,
  53. Pump,
  54. Vent,
  55. CyclePurge,
  56. Heat,
  57. TransferHandoff,
  58. StartTransfer,
  59. LeakCheck,
  60. MoveLiftPin,
  61. MoveGuidePin,
  62. Process,
  63. RunRecipe,
  64. PostProcess,
  65. RecipeSkipStep,
  66. RecipeUpdate,
  67. RecipeResume,
  68. RecipePause,
  69. RecipeAbort,
  70. PreProcess,
  71. AutoMode,
  72. ManualMode,
  73. LockLid,
  74. Online,
  75. Offline,
  76. GasFlow,
  77. StopGasFlow,
  78. RfPower,
  79. MaxMsg
  80. }
  81. public ModuleName Module { get; }
  82. public Action<bool, bool> TransferPrepared;
  83. public bool IsIdle
  84. {
  85. get;
  86. }
  87. public bool IsError
  88. {
  89. get;
  90. }
  91. public bool IsInit
  92. {
  93. get;// { return fsm.State == (int)PMState.Init; }
  94. }
  95. public bool IsBusy
  96. {
  97. get { return !IsInit && !IsError && !IsIdle; }
  98. }
  99. public bool Check(int msg, out string reason, object[] objs)
  100. {
  101. reason = "";
  102. return true;
  103. }
  104. public int Invoke(string function, params object[] args)
  105. {
  106. //switch (function)
  107. //{
  108. // //case "Home":
  109. // // CheckToPostMessage((int)MSG.Home);
  110. // // return (int)MSG.Home;
  111. //}
  112. return (int)FSM_MSG.NONE;
  113. }
  114. public bool CheckAcked(int msg)
  115. {
  116. return fsm.CheckExecuted(msg);
  117. }
  118. public PMEntity(ModuleName module)
  119. {
  120. fsm = new StateMachine<PMEntity>(Module.ToString(), (int)PMState.Init, 100);
  121. }
  122. }
  123. }