LoaderWaferHolderFlowControl.xaml.cs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. using LiveCharts;
  2. using MECF.Framework.Common.OperationCenter;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. namespace CyberX8_Themes.UserControls
  19. {
  20. /// <summary>
  21. /// LoaderWaferHolderFlowControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class LoaderWaferHolderFlowControl : UserControl
  24. {
  25. #region 属性
  26. public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register("ModuleName", typeof(string), typeof(LoaderWaferHolderFlowControl),
  27. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  28. /// <summary>
  29. /// 模块名称
  30. /// </summary>
  31. public string ModuleName
  32. {
  33. get
  34. {
  35. return (string)this.GetValue(ModuleNameProperty);
  36. }
  37. set
  38. {
  39. this.SetValue(ModuleNameProperty, value);
  40. }
  41. }
  42. public static readonly DependencyProperty LeakFlowProperty = DependencyProperty.Register(
  43. "LeakFlow", typeof(double), typeof(LoaderWaferHolderFlowControl), new FrameworkPropertyMetadata(0.00, FrameworkPropertyMetadataOptions.AffectsRender));
  44. /// <summary>
  45. /// LeakFlow
  46. /// </summary>
  47. public double LeakFlow
  48. {
  49. get
  50. {
  51. return (double)this.GetValue(LeakFlowProperty);
  52. }
  53. set
  54. {
  55. this.SetValue(LeakFlowProperty, value);
  56. }
  57. }
  58. public static readonly DependencyProperty LeakVacuumValueProperty = DependencyProperty.Register(
  59. "LeakVacuumValue", typeof(double), typeof(LoaderWaferHolderFlowControl), new FrameworkPropertyMetadata(0.00, FrameworkPropertyMetadataOptions.AffectsRender));
  60. /// <summary>
  61. /// LeakVacuumValue
  62. /// </summary>
  63. public double LeakVacuumValue
  64. {
  65. get
  66. {
  67. return (double)this.GetValue(LeakVacuumValueProperty);
  68. }
  69. set
  70. {
  71. this.SetValue(LeakVacuumValueProperty, value);
  72. }
  73. }
  74. public static readonly DependencyProperty LeakFlowClampProperty = DependencyProperty.Register(
  75. "LeakFlowClamp", typeof(bool), typeof(LoaderWaferHolderFlowControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  76. /// <summary>
  77. /// LeakFlowClamp
  78. /// </summary>
  79. public bool LeakFlowClamp
  80. {
  81. get
  82. {
  83. return (bool)this.GetValue(LeakFlowClampProperty);
  84. }
  85. set
  86. {
  87. this.SetValue(LeakFlowClampProperty, value);
  88. }
  89. }
  90. public static readonly DependencyProperty LeakVacuumProperty = DependencyProperty.Register(
  91. "LeakVacuum", typeof(bool), typeof(LoaderWaferHolderFlowControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  92. /// <summary>
  93. /// LeakVacuum
  94. /// </summary>
  95. public bool LeakVacuum
  96. {
  97. get
  98. {
  99. return (bool)this.GetValue(LeakVacuumProperty);
  100. }
  101. set
  102. {
  103. this.SetValue(LeakVacuumProperty, value);
  104. }
  105. }
  106. public static readonly DependencyProperty LeakStatusProperty = DependencyProperty.Register(
  107. "LeakStatus", typeof(string), typeof(LoaderWaferHolderFlowControl), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  108. /// <summary>
  109. /// LeakStatus
  110. /// </summary>
  111. public string LeakStatus
  112. {
  113. get
  114. {
  115. return (string)this.GetValue(LeakStatusProperty);
  116. }
  117. set
  118. {
  119. this.SetValue(LeakStatusProperty, value);
  120. }
  121. }
  122. public static readonly DependencyProperty LeakMajorProperty = DependencyProperty.Register("LeakMajor", typeof(double), typeof(LoaderWaferHolderFlowControl));
  123. /// <summary>
  124. /// LeakMajor
  125. /// </summary>
  126. public double LeakMajor
  127. {
  128. get
  129. {
  130. return (double)this.GetValue(LeakMajorProperty);
  131. }
  132. set
  133. {
  134. this.SetValue(LeakMajorProperty, value);
  135. }
  136. }
  137. public static readonly DependencyProperty LeakMinorProperty = DependencyProperty.Register("LeakMinor", typeof(double), typeof(LoaderWaferHolderFlowControl));
  138. /// <summary>
  139. /// LeakMinor
  140. /// </summary>
  141. public double LeakMinor
  142. {
  143. get
  144. {
  145. return (double)this.GetValue(LeakMinorProperty);
  146. }
  147. set
  148. {
  149. this.SetValue(LeakMinorProperty, value);
  150. }
  151. }
  152. public static readonly DependencyProperty ValueSeriesProperty = DependencyProperty.Register("ValueSeries", typeof(ChartValues<double>), typeof(LoaderWaferHolderFlowControl),
  153. new FrameworkPropertyMetadata(new ChartValues<double>(), FrameworkPropertyMetadataOptions.AffectsRender));
  154. /// <summary>
  155. /// ValueSeries
  156. /// </summary>
  157. public ChartValues<double> ValueSeries
  158. {
  159. get
  160. {
  161. return (ChartValues<double>)this.GetValue(ValueSeriesProperty);
  162. }
  163. set
  164. {
  165. this.SetValue(ValueSeriesProperty, value);
  166. }
  167. }
  168. public static readonly DependencyProperty LabelSeriesProperty = DependencyProperty.Register("LabelSeries", typeof(ChartValues<string>), typeof(LoaderWaferHolderFlowControl),
  169. new FrameworkPropertyMetadata(new ChartValues<string>(), FrameworkPropertyMetadataOptions.AffectsRender));
  170. /// <summary>
  171. /// LabelSeries
  172. /// </summary>
  173. public ChartValues<string> LabelSeries
  174. {
  175. get
  176. {
  177. return (ChartValues<string>)this.GetValue(LabelSeriesProperty);
  178. }
  179. set
  180. {
  181. this.SetValue(LabelSeriesProperty, value);
  182. }
  183. }
  184. public static readonly DependencyProperty IsFlowStartEnabledProperty = DependencyProperty.Register("IsFlowStartEnabled", typeof(bool), typeof(LoaderWaferHolderFlowControl),
  185. new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsRender));
  186. /// <summary>
  187. /// IsFlowStartEnabled
  188. /// </summary>
  189. public bool IsFlowStartEnabled
  190. {
  191. get
  192. {
  193. return (bool)this.GetValue(IsFlowStartEnabledProperty);
  194. }
  195. set
  196. {
  197. this.SetValue(IsFlowStartEnabledProperty, value);
  198. }
  199. }
  200. public static readonly DependencyProperty IsFlowStopEnabledProperty = DependencyProperty.Register("IsFlowStopEnabled", typeof(bool), typeof(LoaderWaferHolderFlowControl),
  201. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  202. /// <summary>
  203. /// IsFlowStopEnabled
  204. /// </summary>
  205. public bool IsFlowStopEnabled
  206. {
  207. get { return (bool)this.GetValue(IsFlowStopEnabledProperty);}
  208. set { this.SetValue(IsFlowStopEnabledProperty,value);}
  209. }
  210. #endregion
  211. public LoaderWaferHolderFlowControl()
  212. {
  213. InitializeComponent();
  214. }
  215. #region 按钮
  216. private void FlowClampOn_Click(object sender, RoutedEventArgs e)
  217. {
  218. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.LeakFlowClampOn");
  219. }
  220. private void FlowClampOff_Click(object sender, RoutedEventArgs e)
  221. {
  222. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.LeakFlowClampOff");
  223. }
  224. private void VacuumOn_Click(object sender, RoutedEventArgs e)
  225. {
  226. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.LeakVacuumOn");
  227. }
  228. private void VacuumOff_Click(object sender, RoutedEventArgs e)
  229. {
  230. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.LeakVacuumOff");
  231. }
  232. private void StartFlow_Click(object sender, RoutedEventArgs e)
  233. {
  234. ValueSeries.Clear();
  235. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StartFlowTest");
  236. }
  237. private void StopFlow_Click(object sender, RoutedEventArgs e)
  238. {
  239. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StopFlowTest");
  240. }
  241. #endregion
  242. }
  243. }