MfcItem.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Runtime.Serialization;
  6. using System.Text;
  7. namespace Aitex.Core.UI.ControlDataContext
  8. {
  9. [DataContract]
  10. [Serializable]
  11. public class MfcItem : INotifyPropertyChanged
  12. {
  13. public event PropertyChangedEventHandler PropertyChanged;
  14. public void InvokePropertyChanged(string propertyName)
  15. {
  16. if (PropertyChanged != null)
  17. {
  18. PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  19. }
  20. }
  21. /// <summary>
  22. /// 设备的唯一名称,UI与RT交互的ID
  23. /// </summary>
  24. [DataMember]
  25. public string DeviceName { get; set; }
  26. /// <summary>
  27. /// 显示在界面上的名称
  28. /// </summary>
  29. [DataMember]
  30. public string DisplayName { get; set; }
  31. /// <summary>
  32. /// IO 表中定义的物理编号,物理追溯使用 比如: M122
  33. /// </summary>
  34. [DataMember]
  35. public string DeviceId { get; set; }
  36. [DataMember]
  37. public string Unit { get; set; }
  38. [DataMember]
  39. public string Description { get; set; }
  40. /// <summary>
  41. /// 量程
  42. /// </summary>
  43. [DataMember]
  44. public double Scale { get; set; }
  45. /// <summary>
  46. /// 设定值
  47. /// </summary>
  48. [DataMember]
  49. public double SetPoint { get; set; }
  50. public double _feedback;
  51. public double FeedBack
  52. {
  53. get
  54. {
  55. return _feedback;
  56. }
  57. set
  58. {
  59. _feedback = value;
  60. InvokePropertyChanged("FeedBack");
  61. }
  62. }
  63. /// <summary>
  64. /// 默认值
  65. /// </summary>
  66. [DataMember]
  67. public double DefaultValue { get; set; }
  68. /// <summary>
  69. /// 是否有报警
  70. /// </summary>
  71. [DataMember]
  72. public bool IsWarning { get; set; }
  73. /// <summary>
  74. /// alarm或是erro时显示的信息
  75. /// </summary>
  76. [DataMember]
  77. public string ErroMessage { get; set; }
  78. /// <summary>
  79. /// MFC,PC
  80. /// </summary>
  81. [DataMember]
  82. public string Type { get; set; }
  83. private double _factor = 1.0;
  84. [DataMember]
  85. public double Factor
  86. {
  87. get { return _factor; }
  88. set { _factor = value; }
  89. }
  90. public MfcItem()
  91. {
  92. DisplayName = "Undefined";
  93. }
  94. }
  95. public class MfcOperation
  96. {
  97. public const string Ramp = "Ramp";
  98. }
  99. }