SystemConfig.cs 4.6 KB

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