AITLidData.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using System.Runtime.Serialization;
  2. namespace OldWorldData.CommonData.DeviceData
  3. {
  4. public enum LidState
  5. {
  6. Close = 0,
  7. Open = 1,
  8. Unknown = 2,
  9. Error = 3,
  10. }
  11. [DataContract]
  12. [Serializable]
  13. public class AITLidData
  14. {
  15. /// <summary>
  16. /// 阀的唯一名称,UI与RT交互的ID
  17. /// </summary>
  18. [DataMember]
  19. public string DeviceName { get; set; }
  20. /// <summary>
  21. /// 显示在界面上的名称
  22. /// </summary>
  23. [DataMember]
  24. public string DisplayName { get; set; }
  25. /// <summary>
  26. /// IO 表中定义的物理编号,物理追溯使用 比如: V122
  27. /// </summary>
  28. [DataMember]
  29. public string DeviceSchematicId { get; set; }
  30. /// <summary>
  31. /// 当前设定值
  32. /// </summary>
  33. [DataMember]
  34. public int SetPoint { get; set; }
  35. /// <summary>
  36. /// 实际反馈值
  37. /// </summary>
  38. [DataMember]
  39. public int Status { get; set; }
  40. public bool IsOpen
  41. {
  42. get { return Status == (int)LidState.Open; }
  43. }
  44. public bool IsClose
  45. {
  46. get
  47. {
  48. return Status == (int)LidState.Close;
  49. }
  50. }
  51. public AITLidData()
  52. {
  53. DisplayName = "Undefined Lid";
  54. }
  55. }
  56. public class AITLidOperation
  57. {
  58. public const string OpenLid = "OpenLid";
  59. public const string CloseLid = "CloseLid";
  60. }
  61. }