VpwMainEntity.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. using Aitex.Core.RT.Fsm;
  2. using Aitex.Core.RT.Log;
  3. using MECF.Framework.Common.Equipment;
  4. using PunkHPX8_Core;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace PunkHPX8_RT.Modules.VpwMain
  11. {
  12. public class VpwMainEntity : Entity, IEntity, IModuleEntity
  13. {
  14. public enum MSG
  15. {
  16. Home
  17. }
  18. #region 内部变量
  19. #endregion
  20. #region 属性
  21. public ModuleName Module { get; private set; }
  22. /// <summary>
  23. /// 初始化状态
  24. /// </summary>
  25. public bool IsInit
  26. {
  27. get { return false; }
  28. }
  29. /// <summary>
  30. /// 空闲状态
  31. /// </summary>
  32. public bool IsIdle
  33. {
  34. get
  35. {
  36. return true;
  37. }
  38. }
  39. /// <summary>
  40. /// 是否发生错误
  41. /// </summary>
  42. public bool IsError
  43. {
  44. get { return false; }
  45. }
  46. /// <summary>
  47. /// 是否正在作业
  48. /// </summary>
  49. public bool IsBusy
  50. {
  51. get { return false; }
  52. }
  53. public bool IsAuto { get; } = true;
  54. /// <summary>
  55. /// 是否为工程模式
  56. /// </summary>
  57. public bool IsEngineering { get; } = false;
  58. /// <summary>
  59. /// 是否为产品模式
  60. /// </summary>
  61. public bool IsProduction { get; } = true;
  62. /// <summary>
  63. /// 是否禁用
  64. /// </summary>
  65. public bool IsDisable { get; internal set; } = false;
  66. #endregion
  67. /// <summary>
  68. /// 构造函数
  69. /// </summary>
  70. /// <param name="module"></param>
  71. public VpwMainEntity(ModuleName module)
  72. {
  73. this.Module = module;
  74. }
  75. public bool Check(int msg, out string reason, params object[] args)
  76. {
  77. reason = "";
  78. return false;
  79. }
  80. public bool CheckAcked(int msg)
  81. {
  82. return false;
  83. }
  84. /// <summary>
  85. /// EnterInit
  86. /// </summary>
  87. public void EnterInit()
  88. {
  89. //if ((VpwMainState)fsm.State != PrewetState.Idle) return;
  90. //else
  91. //{
  92. // CheckToPostMessage<PrewetState, PrewetMsg>(eEvent.ERR_PREWET, Module.ToString(), (int)PrewetMsg.Init);
  93. //}
  94. }
  95. public int Invoke(string function, params object[] args)
  96. {
  97. switch (function)
  98. {
  99. case "HomeAll":
  100. return (int)MSG.Home;
  101. }
  102. return (int)FSM_MSG.NONE;
  103. }
  104. }
  105. }