EFEM.xaml.cs 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using OpenSEMI.ClientBase;
  9. using PunkHPX8_Themes.CustomControls;
  10. namespace PunkHPX8_Themes.UserControls
  11. {
  12. /// <summary>
  13. /// EFEM.xaml 的交互逻辑
  14. /// </summary>
  15. public partial class EFEM : UserControl
  16. {
  17. public enum RobotPosition
  18. {
  19. None,
  20. Origin,
  21. Right,
  22. Left,
  23. Middle,
  24. Aligner,
  25. SRD,
  26. Dummy,
  27. Right_Place,
  28. Left_Place,
  29. Middle_Place,
  30. Aligner_Place,
  31. SRD_Place,
  32. Dummy_Place,
  33. VPW1,
  34. VPW2,
  35. }
  36. public EFEM()
  37. {
  38. InitializeComponent();
  39. }
  40. public static readonly DependencyProperty RotateTransformValueProperty = DependencyProperty.Register(
  41. "RotateTransformValue", typeof(int), typeof(EFEM));
  42. public int RotateTransformValue
  43. {
  44. get { return (int)this.GetValue(RotateTransformValueProperty); }
  45. set { this.SetValue(RotateTransformValueProperty, value); }
  46. }
  47. public static readonly DependencyProperty AlignActionValueProperty = DependencyProperty.Register(
  48. "AlignActionValue", typeof(int), typeof(EFEM));
  49. public int AlignActionValue
  50. {
  51. get { return (int)this.GetValue(AlignActionValueProperty); }
  52. set { this.SetValue(AlignActionValueProperty, value); }
  53. }
  54. public static readonly DependencyProperty Aligner1WaferProperty = DependencyProperty.Register(
  55. "Aligner1Wafer", typeof(WaferInfo), typeof(EFEM));
  56. public WaferInfo Aligner1Wafer
  57. {
  58. get => (WaferInfo)GetValue(Aligner1WaferProperty);
  59. set => SetValue(Aligner1WaferProperty, value);
  60. }
  61. public static readonly DependencyProperty VPW1WaferProperty = DependencyProperty.Register(
  62. "VPW1Wafer", typeof(WaferInfo), typeof(EFEM));
  63. public WaferInfo VPW1Wafer
  64. {
  65. get => (WaferInfo)GetValue(VPW1WaferProperty);
  66. set => SetValue(VPW1WaferProperty, value);
  67. }
  68. public static readonly DependencyProperty VPW2WaferProperty = DependencyProperty.Register(
  69. "VPW2Wafer", typeof(WaferInfo), typeof(EFEM));
  70. public WaferInfo VPW2Wafer
  71. {
  72. get => (WaferInfo)GetValue(VPW2WaferProperty);
  73. set => SetValue(VPW2WaferProperty, value);
  74. }
  75. public static readonly DependencyProperty PlatingCell1WaferProperty = DependencyProperty.Register(
  76. "PlatingCell1Wafer", typeof(WaferInfo), typeof(EFEM));
  77. public WaferInfo PlatingCell1Wafer
  78. {
  79. get => (WaferInfo)GetValue(PlatingCell1WaferProperty);
  80. set => SetValue(PlatingCell1WaferProperty, value);
  81. }
  82. public static readonly DependencyProperty PlatingCell2WaferProperty = DependencyProperty.Register(
  83. "PlatingCell2Wafer", typeof(WaferInfo), typeof(EFEM));
  84. public WaferInfo PlatingCell2Wafer
  85. {
  86. get => (WaferInfo)GetValue(PlatingCell2WaferProperty);
  87. set => SetValue(PlatingCell2WaferProperty, value);
  88. }
  89. public static readonly DependencyProperty PlatingCell3WaferProperty = DependencyProperty.Register(
  90. "PlatingCell3Wafer", typeof(WaferInfo), typeof(EFEM));
  91. public WaferInfo PlatingCell3Wafer
  92. {
  93. get => (WaferInfo)GetValue(PlatingCell3WaferProperty);
  94. set => SetValue(PlatingCell3WaferProperty, value);
  95. }
  96. public static readonly DependencyProperty PlatingCell4WaferProperty = DependencyProperty.Register(
  97. "PlatingCell4Wafer", typeof(WaferInfo), typeof(EFEM));
  98. public WaferInfo PlatingCell4Wafer
  99. {
  100. get => (WaferInfo)GetValue(PlatingCell4WaferProperty);
  101. set => SetValue(PlatingCell4WaferProperty, value);
  102. }
  103. public static readonly DependencyProperty LP1PresentedProperty = DependencyProperty.Register(
  104. "LP1Presented", typeof(bool), typeof(EFEM),
  105. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  106. public bool LP1Presented
  107. {
  108. get { return (bool)this.GetValue(LP1PresentedProperty); }
  109. set { this.SetValue(LP1PresentedProperty, value); }
  110. }
  111. public static readonly DependencyProperty LP2PresentedProperty = DependencyProperty.Register(
  112. "LP2Presented", typeof(bool), typeof(EFEM),
  113. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  114. public bool LP2Presented
  115. {
  116. get { return (bool)this.GetValue(LP2PresentedProperty); }
  117. set { this.SetValue(LP2PresentedProperty, value); }
  118. }
  119. public static readonly DependencyProperty LP3PresentedProperty = DependencyProperty.Register(
  120. "LP3Presented", typeof(bool), typeof(EFEM),
  121. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  122. public bool LP3Presented
  123. {
  124. get { return (bool)this.GetValue(LP3PresentedProperty); }
  125. set { this.SetValue(LP3PresentedProperty, value); }
  126. }
  127. public static readonly DependencyProperty LP1LoadedProperty = DependencyProperty.Register(
  128. "LP1Loaded", typeof(bool), typeof(EFEM),
  129. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  130. public bool LP1Loaded
  131. {
  132. get { return (bool)this.GetValue(LP1LoadedProperty); }
  133. set { this.SetValue(LP1LoadedProperty, value); }
  134. }
  135. public static readonly DependencyProperty LP2LoadedProperty = DependencyProperty.Register(
  136. "LP2Loaded", typeof(bool), typeof(EFEM),
  137. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  138. public bool LP2Loaded
  139. {
  140. get { return (bool)this.GetValue(LP2LoadedProperty); }
  141. set { this.SetValue(LP2LoadedProperty, value); }
  142. }
  143. public static readonly DependencyProperty LP3LoadedProperty = DependencyProperty.Register(
  144. "LP3Loaded", typeof(bool), typeof(EFEM),
  145. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  146. public bool LP3Loaded
  147. {
  148. get { return (bool)this.GetValue(LP3LoadedProperty); }
  149. set { this.SetValue(LP3LoadedProperty, value); }
  150. }
  151. public static readonly DependencyProperty CurrentRobotPositionProperty = DependencyProperty.Register(
  152. "CurrentRobotPosition", typeof(RobotPosition), typeof(EFEM),
  153. new PropertyMetadata(RobotPosition.Origin, PositionChangedCallback));
  154. public RobotPosition CurrentRobotPosition
  155. {
  156. get { return (RobotPosition)this.GetValue(CurrentRobotPositionProperty); }
  157. set
  158. {
  159. this.SetValue(CurrentRobotPositionProperty, value);
  160. }
  161. }
  162. private static void PositionChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
  163. {
  164. var newAct = (RobotPosition)e.NewValue;
  165. var control = d as EFEM;
  166. GoToPosition(control,newAct);
  167. }
  168. public static readonly DependencyProperty RobotATActionProperty = DependencyProperty.Register(
  169. "RobotATAction", typeof(WaferRobotTAction), typeof(EFEM),
  170. new FrameworkPropertyMetadata(WaferRobotTAction.T_Origin, FrameworkPropertyMetadataOptions.AffectsRender));
  171. public WaferRobotTAction RobotATAction
  172. {
  173. get { return (WaferRobotTAction)this.GetValue(RobotATActionProperty); }
  174. set { this.SetValue(RobotATActionProperty, value); }
  175. }
  176. public static readonly DependencyProperty RobotAXActionProperty = DependencyProperty.Register(
  177. "RobotAXAction", typeof(WaferRobotXAction), typeof(EFEM),
  178. new FrameworkPropertyMetadata(WaferRobotXAction.X_Origin, FrameworkPropertyMetadataOptions.AffectsRender));
  179. public WaferRobotXAction RobotAXAction
  180. {
  181. get { return (WaferRobotXAction)this.GetValue(RobotAXActionProperty); }
  182. set { this.SetValue(RobotAXActionProperty, value); }
  183. }
  184. public static readonly DependencyProperty RobotAWaferInfoProperty = DependencyProperty.Register(
  185. "RobotAWaferInfo", typeof(WaferInfo), typeof(EFEM));
  186. public WaferInfo RobotAWaferInfo
  187. {
  188. get { return (WaferInfo)this.GetValue(RobotAWaferInfoProperty); }
  189. set { this.SetValue(RobotAWaferInfoProperty, value); }
  190. }
  191. private static void GoToPosition(Control control,RobotPosition robotPosition)
  192. {
  193. VisualStateManager.GoToElementState(control, robotPosition.ToString(), true);
  194. }
  195. }
  196. }