SystemConfigItem.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. using System.Collections.Generic;
  2. using Caliburn.Micro.Core;
  3. namespace VirgoUI.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 nameView = string.Empty;
  23. public string NameView
  24. {
  25. get { return nameView; }
  26. set { nameView = value; NotifyOfPropertyChange("NameView"); }
  27. }
  28. private string path = string.Empty;
  29. public string Path
  30. {
  31. get { return path; }
  32. set { path = value; NotifyOfPropertyChange("Path"); }
  33. }
  34. private List<ConfigNode> _subNodes = null;
  35. public List<ConfigNode> SubNodes
  36. {
  37. get { return _subNodes; }
  38. set { _subNodes = value; NotifyOfPropertyChange("SubNodes"); }
  39. }
  40. private List<ConfigItem> _items = null;
  41. public List<ConfigItem> Items
  42. {
  43. get { return _items; }
  44. set { _items = value; NotifyOfPropertyChange("Items"); }
  45. }
  46. }
  47. public class ConfigItem : PropertyChangedBase
  48. {
  49. private string name = string.Empty;
  50. public string Name
  51. {
  52. get { return name; }
  53. set { name = value; NotifyOfPropertyChange("Name"); }
  54. }
  55. private string nameView = string.Empty;
  56. public string NameView
  57. {
  58. get { return nameView; }
  59. set { nameView = value; NotifyOfPropertyChange("NameView"); }
  60. }
  61. private string description = string.Empty;
  62. public string Description
  63. {
  64. get { return description; }
  65. set { description = value; NotifyOfPropertyChange("Description"); }
  66. }
  67. private DataType type = DataType.Unknown;
  68. public DataType Type
  69. {
  70. get { return type; }
  71. set { type = value; NotifyOfPropertyChange("Type"); }
  72. }
  73. private string defaultValue = string.Empty;
  74. public string DefaultValue
  75. {
  76. get { return defaultValue; }
  77. set { defaultValue = value; NotifyOfPropertyChange("DefaultValue"); }
  78. }
  79. private double max = double.NaN;
  80. public double Max
  81. {
  82. get { return max; }
  83. set { max = value; NotifyOfPropertyChange("Max"); }
  84. }
  85. private double min = double.NaN;
  86. public double Min
  87. {
  88. get { return min; }
  89. set { min = value; NotifyOfPropertyChange("Min"); }
  90. }
  91. private string parameter = string.Empty;
  92. public string Parameter
  93. {
  94. get { return parameter; }
  95. set { parameter = value; NotifyOfPropertyChange("Parameter"); }
  96. }
  97. private string tag = string.Empty;
  98. public string Tag
  99. {
  100. get { return tag; }
  101. set { tag = value; NotifyOfPropertyChange("Tag"); }
  102. }
  103. private string unit = string.Empty;
  104. public string Unit
  105. {
  106. get { return unit; }
  107. set { unit = value; NotifyOfPropertyChange("Unit"); }
  108. }
  109. private bool visible = true;
  110. public bool Visible
  111. {
  112. get { return visible; }
  113. set { visible = value; NotifyOfPropertyChange("Visible"); }
  114. }
  115. /// <summary>
  116. /// current value from interface, ready only
  117. /// </summary>
  118. private string cvalue = string.Empty;
  119. public string CurrentValue
  120. {
  121. get { return cvalue; }
  122. set { cvalue = value; NotifyOfPropertyChange("CurrentValue"); }
  123. }
  124. #region setpoint value
  125. private bool _bvalue = false;
  126. public bool BoolValue
  127. {
  128. get { return _bvalue; }
  129. set { _bvalue = value; NotifyOfPropertyChange("BoolValue"); }
  130. }
  131. private string _sValue = string.Empty;
  132. public string StringValue
  133. {
  134. get { return _sValue; }
  135. set { _sValue = value; NotifyOfPropertyChange("StringValue"); }
  136. }
  137. private bool _textSaved = true;
  138. public bool TextSaved
  139. {
  140. get { return _textSaved; }
  141. set { _textSaved = value; NotifyOfPropertyChange("TextSaved"); }
  142. }
  143. #endregion
  144. }
  145. }