AITValveData.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Reflection;
  6. using System.Runtime.Serialization;
  7. using System.Text;
  8. using System.Windows.Input;
  9. using Aitex.Core.UI.MVVM;
  10. using MECF.Framework.Common.CommonData;
  11. namespace Aitex.Core.Common.DeviceData
  12. {
  13. [DataContract]
  14. [Serializable]
  15. public class AITValveData : NotifiableItem, IDeviceData
  16. {
  17. [DataMember]
  18. public string UniqueName { get; set; }
  19. [DataMember]
  20. public string DeviceName { get; set; }
  21. /// <summary>
  22. /// 显示在界面上的名称
  23. /// </summary>
  24. [DataMember]
  25. public string DisplayName { get; set; }
  26. /// <summary>
  27. /// IO 表中定义的物理编号,物理追溯使用 比如: V122
  28. /// </summary>
  29. [DataMember]
  30. public string DeviceSchematicId { get; set; }
  31. /// <summary>
  32. /// 当前设定值
  33. /// </summary>
  34. [DataMember]
  35. public bool SetPoint { get; set; }
  36. [DataMember]
  37. public bool ILKDiValue { get; set; }
  38. [DataMember]
  39. public bool IsILKOK { get; set; }
  40. /// <summary>
  41. /// 默认值
  42. /// </summary>
  43. [DataMember]
  44. public bool DefaultValue { get; set; }
  45. /// <summary>
  46. /// 实际反馈值
  47. /// </summary>
  48. [DataMember]
  49. public bool Feedback { get; set; }
  50. /// <summary>
  51. /// 虚拟反馈值
  52. /// </summary>
  53. [DataMember]
  54. public bool VirtualFeedback { get; set; }
  55. public bool IsOpen {
  56. get { return Feedback; }
  57. }
  58. public AITValveData()
  59. {
  60. DisplayName = "未定义阀门";
  61. }
  62. public void Update(IDeviceData data)
  63. {
  64. AITValveData item = data as AITValveData;
  65. if (item == null)
  66. return;
  67. this.DefaultValue = item.DefaultValue;
  68. this.DeviceSchematicId = item.DeviceSchematicId;
  69. this.DeviceName = item.DeviceName;
  70. this.DisplayName = item.DisplayName;
  71. this.Feedback = item.Feedback;
  72. this.SetPoint = item.SetPoint;
  73. this.IsILKOK= item.IsILKOK;
  74. this.VirtualFeedback = item.VirtualFeedback;
  75. InvokePropertyChanged();
  76. }
  77. public override bool Equals(object obj)
  78. {
  79. if (obj == null || GetType() != obj.GetType())
  80. {
  81. return false;
  82. }
  83. AITValveData objAIT = (AITValveData)obj;
  84. if (IsOpen == objAIT.IsOpen && Feedback == objAIT.Feedback && SetPoint == objAIT.SetPoint && VirtualFeedback == objAIT.VirtualFeedback)
  85. {
  86. return true;
  87. }
  88. return false;
  89. }
  90. }
  91. public class AITValveOperation
  92. {
  93. public const string GVTurnValve = "GVTurnValve";
  94. public const string GVVirtualTurnValve = "GVVirtualTurnValve";
  95. }
  96. public class AITValveDataPropertyName
  97. {
  98. public const string Status = "Status";
  99. public const string SetPoint = "SetPoint";
  100. }
  101. }