ReservoirDevice.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Log;
  3. using MECF.Framework.Common.Persistent.Reservoirs;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace PunkHPX8_RT.Devices.Reservoir
  10. {
  11. public class ReservoirDevice : BaseDevice, IDevice
  12. {
  13. #region 常量
  14. private const string AUTO = "Auto";
  15. private const string MANUAL = "Manual";
  16. private const string DISABLE = "Disable";
  17. #endregion
  18. #region 内部变量
  19. /// <summary>
  20. /// Prewet 持久性数值对象
  21. /// </summary>
  22. private ReservoirsPersistentValue _persistentValue;
  23. #endregion
  24. #region 属性
  25. /// <summary>
  26. /// 操作模式
  27. /// </summary>
  28. public string OperationMode { get { return _persistentValue.OperatingMode; } }
  29. /// <summary>
  30. /// 工程模式
  31. /// </summary>
  32. public string EngineerMode { get { return _persistentValue.RecipeOperatingMode; } }
  33. /// <summary>
  34. /// 是否自动
  35. /// </summary>
  36. public bool IsAuto { get { return _persistentValue.OperatingMode == AUTO; } }
  37. #endregion
  38. /// <summary>
  39. /// 构造函数
  40. /// </summary>
  41. /// <param name="moduleName"></param>
  42. /// <param name="name"></param>
  43. public ReservoirDevice(string moduleName) : base(moduleName, moduleName, moduleName, moduleName)
  44. {
  45. }
  46. /// <summary>
  47. /// 初始化
  48. /// </summary>
  49. /// <returns></returns>
  50. public bool Initialize()
  51. {
  52. InitializeParameter();
  53. return true;
  54. }
  55. /// <summary>
  56. /// 初始化参数
  57. /// </summary>
  58. public void InitializeParameter()
  59. {
  60. _persistentValue = ReservoirsPersistentManager.Instance.GetReservoirsPersistentValue(Module.ToString());
  61. if (_persistentValue == null)
  62. {
  63. LOG.WriteLog(eEvent.ERR_RESERVOIR, Module.ToString(), "Persistent Value Object is not exist");
  64. }
  65. }
  66. /// <summary>
  67. /// 监控
  68. /// </summary>
  69. public void Monitor()
  70. {
  71. }
  72. public void Reset()
  73. {
  74. }
  75. public void Terminate()
  76. {
  77. }
  78. }
  79. }