SystemConfigItem.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. using System.Collections.Generic;
  2. using Caliburn.Micro.Core;
  3. namespace Virgo_DUI.Client.Models.Utility.SystemConfig
  4. {
  5. public enum DataType
  6. {
  7. Unknown,
  8. Int,
  9. Enum,
  10. Double,
  11. Bool,
  12. String
  13. };
  14. public class ConfigNode : PropertyChangedBase
  15. {
  16. private string name = string.Empty;
  17. public string Name
  18. {
  19. get { return name; }
  20. set { name = value; NotifyOfPropertyChange("Name"); }
  21. }
  22. private string path = string.Empty;
  23. public string Path
  24. {
  25. get { return path; }
  26. set { path = value; NotifyOfPropertyChange("Path"); }
  27. }
  28. private List<ConfigNode> _subNodes = null;
  29. public List<ConfigNode> SubNodes
  30. {
  31. get { return _subNodes; }
  32. set { _subNodes = value; NotifyOfPropertyChange("SubNodes"); }
  33. }
  34. private List<ConfigItem> _items = null;
  35. public List<ConfigItem> Items
  36. {
  37. get { return _items; }
  38. set { _items = value; NotifyOfPropertyChange("Items"); }
  39. }
  40. }
  41. public class ConfigItem : PropertyChangedBase
  42. {
  43. private string name = string.Empty;
  44. public string Name
  45. {
  46. get { return name; }
  47. set { name = value; NotifyOfPropertyChange("Name"); }
  48. }
  49. private string description = string.Empty;
  50. public string Description
  51. {
  52. get { return description; }
  53. set { description = value; NotifyOfPropertyChange("Description"); }
  54. }
  55. private DataType type = DataType.Unknown;
  56. public DataType Type
  57. {
  58. get { return type; }
  59. set { type = value; NotifyOfPropertyChange("Type"); }
  60. }
  61. private string defaultValue = string.Empty;
  62. public string DefaultValue
  63. {
  64. get { return defaultValue; }
  65. set { defaultValue = value; NotifyOfPropertyChange("DefaultValue"); }
  66. }
  67. private double max = double.NaN;
  68. public double Max
  69. {
  70. get { return max; }
  71. set { max = value; NotifyOfPropertyChange("Max"); }
  72. }
  73. private double min = double.NaN;
  74. public double Min
  75. {
  76. get { return min; }
  77. set { min = value; NotifyOfPropertyChange("Min"); }
  78. }
  79. private string parameter = string.Empty;
  80. public string Parameter
  81. {
  82. get { return parameter; }
  83. set { parameter = value; NotifyOfPropertyChange("Parameter"); }
  84. }
  85. private string tag = string.Empty;
  86. public string Tag
  87. {
  88. get { return tag; }
  89. set { tag = value; NotifyOfPropertyChange("Tag"); }
  90. }
  91. private string unit = string.Empty;
  92. public string Unit
  93. {
  94. get { return unit; }
  95. set { unit = value; NotifyOfPropertyChange("Unit"); }
  96. }
  97. private bool visible = true;
  98. public bool Visible
  99. {
  100. get { return visible; }
  101. set { visible = value; NotifyOfPropertyChange("Visible"); }
  102. }
  103. /// <summary>
  104. /// current value from interface, ready only
  105. /// </summary>
  106. private string cvalue = string.Empty;
  107. public string CurrentValue
  108. {
  109. get { return cvalue; }
  110. set { cvalue = value; NotifyOfPropertyChange("CurrentValue"); }
  111. }
  112. #region setpoint value
  113. private bool _bvalue = false;
  114. public bool BoolValue
  115. {
  116. get { return _bvalue; }
  117. set { _bvalue = value; NotifyOfPropertyChange("BoolValue"); }
  118. }
  119. private string _sValue = string.Empty;
  120. public string StringValue
  121. {
  122. get { return _sValue; }
  123. set { _sValue = value; NotifyOfPropertyChange("StringValue"); }
  124. }
  125. private bool _textSaved = true;
  126. public bool TextSaved
  127. {
  128. get { return _textSaved; }
  129. set { _textSaved = value; NotifyOfPropertyChange("TextSaved"); }
  130. }
  131. #endregion
  132. }
  133. }