VpwMainEntity.cs 2.4 KB

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