SystemConfig.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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 CyberX8_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 bool isshow = true;
  35. public bool IsShow
  36. {
  37. get { return isshow; }
  38. set { isshow = value; RaisePropertyChanged("IsShow"); }
  39. }
  40. private List<ConfigNode> _subNodes = null;
  41. public List<ConfigNode> SubNodes
  42. {
  43. get { return _subNodes; }
  44. set { _subNodes = value; RaisePropertyChanged("SubNodes"); }
  45. }
  46. private List<ConfigItem> _items = null;
  47. public List<ConfigItem> Items
  48. {
  49. get { return _items; }
  50. set { _items = value; RaisePropertyChanged("Items"); }
  51. }
  52. }
  53. public class ConfigItem : BindableBase
  54. {
  55. private string name = string.Empty;
  56. public string Name
  57. {
  58. get { return name; }
  59. set { name = value; RaisePropertyChanged("Name"); }
  60. }
  61. private string description = string.Empty;
  62. public string Description
  63. {
  64. get { return description; }
  65. set { description = value; RaisePropertyChanged("Description"); }
  66. }
  67. private DataType type = DataType.Unknown;
  68. public DataType Type
  69. {
  70. get { return type; }
  71. set { type = value; RaisePropertyChanged("Type"); }
  72. }
  73. private string defaultValue = string.Empty;
  74. public string DefaultValue
  75. {
  76. get { return defaultValue; }
  77. set { defaultValue = value; RaisePropertyChanged("DefaultValue"); }
  78. }
  79. private double max = double.NaN;
  80. public double Max
  81. {
  82. get { return max; }
  83. set { max = value; RaisePropertyChanged("Max"); }
  84. }
  85. private double min = double.NaN;
  86. public double Min
  87. {
  88. get { return min; }
  89. set { min = value; RaisePropertyChanged("Min"); }
  90. }
  91. private string parameter = string.Empty;
  92. public string Parameter
  93. {
  94. get { return parameter; }
  95. set { parameter = value; RaisePropertyChanged("Parameter"); }
  96. }
  97. private string tag = string.Empty;
  98. public string Tag
  99. {
  100. get { return tag; }
  101. set { tag = value; RaisePropertyChanged("Tag"); }
  102. }
  103. private string unit = string.Empty;
  104. public string Unit
  105. {
  106. get { return unit; }
  107. set { unit = value; RaisePropertyChanged("Unit"); }
  108. }
  109. private bool visible = true;
  110. public bool Visible
  111. {
  112. get { return visible; }
  113. set { visible = value; RaisePropertyChanged("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; RaisePropertyChanged("CurrentValue"); }
  123. }
  124. #region setpoint value
  125. private bool _bvalue = false;
  126. public bool BoolValue
  127. {
  128. get { return _bvalue; }
  129. set { _bvalue = value; RaisePropertyChanged("BoolValue"); }
  130. }
  131. private string _sValue = string.Empty;
  132. public string StringValue
  133. {
  134. get { return _sValue; }
  135. set { _sValue = value; RaisePropertyChanged("StringValue"); }
  136. }
  137. private bool _textSaved = true;
  138. public bool TextSaved
  139. {
  140. get { return _textSaved; }
  141. set { _textSaved = value; RaisePropertyChanged("TextSaved"); }
  142. }
  143. #endregion
  144. }
  145. //}
  146. }