PlatingCellStatusControl.xaml.cs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. using Aitex.Core.Common;
  2. using MECF.Framework.Common.OperationCenter;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Reflection;
  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 PunkHPX8_Themes.UserControls
  19. {
  20. /// <summary>
  21. /// PlatingCellStatusControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class PlatingCellStatusControl : UserControl
  24. {
  25. public PlatingCellStatusControl()
  26. {
  27. InitializeComponent();
  28. }
  29. public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
  30. "ModuleName", typeof(string), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  31. /// <summary>
  32. /// 模块名称
  33. /// </summary>
  34. public string ModuleName
  35. {
  36. get
  37. {
  38. return (string)this.GetValue(ModuleNameProperty);
  39. }
  40. set
  41. {
  42. this.SetValue(ModuleNameProperty, value);
  43. }
  44. }
  45. public static readonly DependencyProperty ChemistryProperty = DependencyProperty.Register(
  46. "Chemistry", typeof(string), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  47. /// <summary>
  48. /// Chemistry
  49. /// </summary>
  50. public string Chemistry
  51. {
  52. get
  53. {
  54. return (string)this.GetValue(ChemistryProperty);
  55. }
  56. set
  57. {
  58. this.SetValue(ChemistryProperty, value);
  59. }
  60. }
  61. public static readonly DependencyProperty VerticalStationProperty = DependencyProperty.Register(
  62. "VerticalStation", typeof(string), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  63. /// <summary>
  64. /// VerticalStation
  65. /// </summary>
  66. public string VerticalStation
  67. {
  68. get
  69. {
  70. return (string)this.GetValue(VerticalStationProperty);
  71. }
  72. set
  73. {
  74. this.SetValue(VerticalStationProperty, value);
  75. }
  76. }
  77. public static readonly DependencyProperty WaferSizeListProperty = DependencyProperty.Register(
  78. "WaferSizeList", typeof(List<int>), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
  79. /// <summary>
  80. ///WaferSizeList
  81. /// </summary>
  82. public List<int> WaferSizeList
  83. {
  84. get
  85. {
  86. return (List<int>)this.GetValue(WaferSizeListProperty);
  87. }
  88. set
  89. {
  90. this.SetValue(WaferSizeListProperty, value);
  91. }
  92. }
  93. public static readonly DependencyProperty SelectedWaferSizeProperty = DependencyProperty.Register(
  94. "SelectedWaferSize", typeof(int), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata(150, FrameworkPropertyMetadataOptions.AffectsRender));
  95. /// <summary>
  96. ///SelectedWaferSize
  97. /// </summary>
  98. public int SelectedWaferSize
  99. {
  100. get
  101. {
  102. return (int)this.GetValue(SelectedWaferSizeProperty);
  103. }
  104. set
  105. {
  106. this.SetValue(SelectedWaferSizeProperty, value);
  107. }
  108. }
  109. public static readonly DependencyProperty ClamshellSensorProperty = DependencyProperty.Register(
  110. "ClamshellSensor", typeof(double), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
  111. /// <summary>
  112. /// ClamshellSensor
  113. /// </summary>
  114. public double ClamshellSensor
  115. {
  116. get
  117. {
  118. return (double)this.GetValue(ClamshellSensorProperty);
  119. }
  120. set
  121. {
  122. this.SetValue(ClamshellSensorProperty, value);
  123. }
  124. }
  125. public static readonly DependencyProperty IsClamshellOpenProperty = DependencyProperty.Register(
  126. "IsClamshellOpen", typeof(bool), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  127. /// <summary>
  128. /// IsClamshellOpen
  129. /// </summary>
  130. public bool IsClamshellOpen
  131. {
  132. get
  133. {
  134. return (bool)this.GetValue(IsClamshellOpenProperty);
  135. }
  136. set
  137. {
  138. this.SetValue(IsClamshellOpenProperty, value);
  139. }
  140. }
  141. public static readonly DependencyProperty IsClamshellCloseProperty = DependencyProperty.Register(
  142. "IsClamshellClose", typeof(bool), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  143. /// <summary>
  144. /// IsClamshellClose
  145. /// </summary>
  146. public bool IsClamshellClose
  147. {
  148. get
  149. {
  150. return (bool)this.GetValue(IsClamshellCloseProperty);
  151. }
  152. set
  153. {
  154. this.SetValue(IsClamshellCloseProperty, value);
  155. }
  156. }
  157. public static readonly DependencyProperty IsAngleTiltProperty = DependencyProperty.Register(
  158. "IsAngleTilt", typeof(bool), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  159. /// <summary>
  160. /// IsAngleTilt
  161. /// </summary>
  162. public bool IsAngleTilt
  163. {
  164. get
  165. {
  166. return (bool)this.GetValue(IsAngleTiltProperty);
  167. }
  168. set
  169. {
  170. this.SetValue(IsAngleTiltProperty, value);
  171. }
  172. }
  173. public static readonly DependencyProperty IsAngleVerticalProperty = DependencyProperty.Register(
  174. "IsAngleVertical", typeof(bool), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  175. /// <summary>
  176. /// IsAngleVertical
  177. /// </summary>
  178. public bool IsAngleVertical
  179. {
  180. get
  181. {
  182. return (bool)this.GetValue(IsAngleVerticalProperty);
  183. }
  184. set
  185. {
  186. this.SetValue(IsAngleVerticalProperty, value);
  187. }
  188. }
  189. public static readonly DependencyProperty InputRotationSpeedProperty = DependencyProperty.Register(
  190. "InputRotationSpeed", typeof(int), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
  191. /// <summary>
  192. /// InputRotationSpeed
  193. /// </summary>
  194. public int InputRotationSpeed
  195. {
  196. get
  197. {
  198. return (int)this.GetValue(InputRotationSpeedProperty);
  199. }
  200. set
  201. {
  202. this.SetValue(InputRotationSpeedProperty, value);
  203. }
  204. }
  205. public static readonly DependencyProperty InputRotationTimeProperty = DependencyProperty.Register(
  206. "InputRotationTime", typeof(int), typeof(PlatingCellStatusControl), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
  207. /// <summary>
  208. /// InputRotationTime
  209. /// </summary>
  210. public int InputRotationTime
  211. {
  212. get
  213. {
  214. return (int)this.GetValue(InputRotationTimeProperty);
  215. }
  216. set
  217. {
  218. this.SetValue(InputRotationTimeProperty, value);
  219. }
  220. }
  221. private void ClamshellOpen_Click(object sender, RoutedEventArgs e)
  222. {
  223. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ClamShellOpen");
  224. }
  225. private void ClamshellClose_Click(object sender, RoutedEventArgs e)
  226. {
  227. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ClamShellClose");
  228. }
  229. private void AngleTilt_Click(object sender, RoutedEventArgs e)
  230. {
  231. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.HeadtTilt");
  232. }
  233. private void AngleVertical_Click(object sender, RoutedEventArgs e)
  234. {
  235. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.HeadVertical");
  236. }
  237. private void RotationStart_Click(object sender, RoutedEventArgs e)
  238. {
  239. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StartRotation", InputRotationSpeed, InputRotationTime);
  240. }
  241. private void RotationStop_Click(object sender, RoutedEventArgs e)
  242. {
  243. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StopRotation");
  244. }
  245. }
  246. }