AITRfData.cs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. using System;
  2. using System.ComponentModel;
  3. using System.Reflection;
  4. using System.Runtime.Serialization;
  5. using System.Windows.Input;
  6. using Aitex.Core.UI.MVVM;
  7. using MECF.Framework.Common.CommonData;
  8. namespace Aitex.Core.Common.DeviceData
  9. {
  10. [Serializable]
  11. [DataContract]
  12. public enum RfMode
  13. {
  14. [EnumMember]
  15. ContinuousWaveMode = 1,
  16. [EnumMember]
  17. PulsingMode = 2,
  18. }
  19. public enum PatronRfMatchMode
  20. {
  21. Manual = 1,
  22. Auto = 2,
  23. }
  24. public enum TritonRfMatchMode
  25. {
  26. Manual = 0,
  27. Auto = 1,
  28. }
  29. public enum RfMatchModeProcess
  30. {
  31. TritonPresetMode = 0,
  32. TritonAutoMode = 1,
  33. }
  34. public enum BiasRfMatchMode
  35. {
  36. Hold = 0,
  37. Preset = 1,
  38. }
  39. [DataContract]
  40. [Serializable]
  41. public class AITRfData : NotifiableItem, IDeviceData
  42. {
  43. [DataMember]
  44. public string Module { get; set; }
  45. [DataMember]
  46. public string DeviceName { get; set; }
  47. /// <summary>
  48. /// 显示在界面上的名称
  49. /// </summary>
  50. [DataMember]
  51. public string DisplayName { get; set; }
  52. /// <summary>
  53. /// IO 表中定义的物理编号,物理追溯使用 比如: M122
  54. /// </summary>
  55. [DataMember]
  56. public string DeviceSchematicId { get; set; }
  57. [DataMember]
  58. public string Description { get; set; }
  59. [DataMember]
  60. public string UnitPower { get; set; }
  61. [DataMember]
  62. public string UnitFrequency { get; set; }
  63. [DataMember]
  64. public string UnitDuty { get; set; }
  65. [DataMember]
  66. public double ScalePower { get; set; }
  67. [DataMember]
  68. public double ScaleFrequency { get; set; }
  69. [DataMember]
  70. public double ScaleDuty { get; set; }
  71. [DataMember]
  72. public float PowerSetPoint { get; set; }
  73. [DataMember]
  74. public float FrequencySetPoint { get; set; }
  75. [DataMember]
  76. public float DutySetPoint { get; set; }
  77. [DataMember]
  78. public bool IsInterlockOk { get; set; }
  79. [DataMember]
  80. public bool IsRfOn { get; set; }
  81. [DataMember]
  82. public bool IsMatchOn { get; set; }
  83. [DataMember]
  84. public bool IsRfAlarm { get; set; }
  85. [DataMember]
  86. public float ForwardPower { get; set; }
  87. [DataMember]
  88. public float ReflectPower { get; set; }
  89. [DataMember]
  90. public int WorkMode { get; set; }
  91. [DataMember]
  92. public string PowerOnElapsedTime
  93. {
  94. get;
  95. set;
  96. }
  97. [DataMember]
  98. public bool EnablePulsing
  99. {
  100. get;
  101. set;
  102. }
  103. [DataMember]
  104. public bool EnableC1C2Position
  105. {
  106. get;
  107. set;
  108. }
  109. [DataMember]
  110. public bool EnableReflectPower
  111. {
  112. get;
  113. set;
  114. }
  115. [DataMember]
  116. public bool EnableVoltageCurrent
  117. {
  118. get;
  119. set;
  120. }
  121. [DataMember]
  122. public int MatchMode
  123. {
  124. get;
  125. set;
  126. }
  127. [DataMember]
  128. public int MatchPresetMode
  129. {
  130. get;
  131. set;
  132. }
  133. [DataMember]
  134. public float MatchPositionC1
  135. {
  136. get;
  137. set;
  138. }
  139. [DataMember]
  140. public float MatchPositionC2
  141. {
  142. get;
  143. set;
  144. }
  145. [DataMember]
  146. public float MatchPositionC1SetPoint
  147. {
  148. get;
  149. set;
  150. }
  151. [DataMember]
  152. public float MatchPositionC2SetPoint
  153. {
  154. get;
  155. set;
  156. }
  157. [DataMember]
  158. public float MatchVPP
  159. {
  160. get;
  161. set;
  162. }
  163. [DataMember]
  164. public float Voltage
  165. {
  166. get;
  167. set;
  168. }
  169. [DataMember]
  170. public float Current
  171. {
  172. get;
  173. set;
  174. }
  175. public string TextWorkMode
  176. {
  177. get
  178. {
  179. return WorkMode == (int)RfMode.ContinuousWaveMode ? "Continuous" : "Pulsing";
  180. }
  181. }
  182. public string TextOnOff
  183. {
  184. get
  185. {
  186. return IsRfOn ? "On" : "Off";
  187. }
  188. }
  189. public string PatronTextMatchMode
  190. {
  191. get
  192. {
  193. return MatchMode == (int)PatronRfMatchMode.Manual ? "Manual" : "Auto";
  194. }
  195. }
  196. public string TritonTextMatchMode
  197. {
  198. get
  199. {
  200. return MatchMode == (int)TritonRfMatchMode.Manual ? "Manual" : "Auto";
  201. }
  202. }
  203. public string TritonMatchProcessModeDisplay
  204. {
  205. get
  206. {
  207. return MatchPresetMode == (int)BiasRfMatchMode.Preset ? "Preset" : "Hold";
  208. }
  209. }
  210. public bool HasError { get; set; }
  211. public AITRfData()
  212. {
  213. DisplayName = "Undefined";
  214. }
  215. public void Update(IDeviceData data)
  216. {
  217. throw new NotImplementedException();
  218. }
  219. }
  220. public enum AITRfOperation
  221. {
  222. SetPowerOnOff,
  223. SetMode,
  224. SetContinuousPower,
  225. SetPulsingPower,
  226. SetPower,
  227. SetPulsingFrequency,
  228. SetPulsingDuty,
  229. SetMatchMode,
  230. SetMatchProcessMode,
  231. SetMatchPosition, //同时设置2个
  232. SetMatchPositionC1,
  233. SetMatchPositionC2,
  234. }
  235. public class AITRfProperty
  236. {
  237. public const string RFEnable = "RFEnable";
  238. public const string RFSetPoint = "RFSetPoint";
  239. public const string RFForwardPower = "RFForwardPower";
  240. public const string RFReflectPower = "RFReflectPower";
  241. public const string RFRatio = "RFRatio";
  242. public const string RFInterlock = "RFInterlock";
  243. public const string RFDuty = "RFDuty";
  244. public const string RFFrequency = "RFFrequency";
  245. public const string RFMode = "RFMode";
  246. public const string RFMatchPositionC1Feedback = "RFMatchPositionC1Feedback";
  247. public const string RFMatchPositionC2Feedback = "RFMatchPositionC2Feedback";
  248. public const string RFMatchPositionC1SetPoint = "RFMatchPositionC1SetPoint";
  249. public const string RFMatchPositionC2SetPoint = "RFMatchPositionC2SetPoint";
  250. public const string RFMatchVPP = "RFMatchVPP";
  251. public const string RFAlarm = "RFAlarm";
  252. public const string Voltage = "Voltage";
  253. public const string Current = "Current";
  254. public const string IsOverTemp = "IsOverTemp";
  255. }
  256. }