CellChamber.xaml.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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. /// CellChamber.xaml 的交互逻辑
  14. /// </summary>
  15. public partial class CellChamber : 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. PlatingCell1,
  36. PlatingCell2,
  37. PlatingCell3,
  38. PlatingCell4,
  39. VPW1_Place,
  40. VPW2_Place,
  41. PlatingCell1_Place,
  42. PlatingCell2_Place,
  43. PlatingCell3_Place,
  44. PlatingCell4_Place,
  45. }
  46. public CellChamber()
  47. {
  48. InitializeComponent();
  49. }
  50. public static readonly DependencyProperty RotateTransformValueProperty = DependencyProperty.Register(
  51. "RotateTransformValue", typeof(int), typeof(CellChamber));
  52. public int RotateTransformValue
  53. {
  54. get { return (int)this.GetValue(RotateTransformValueProperty); }
  55. set { this.SetValue(RotateTransformValueProperty, value); }
  56. }
  57. public static readonly DependencyProperty AlignActionValueProperty = DependencyProperty.Register(
  58. "AlignActionValue", typeof(int), typeof(CellChamber));
  59. public int AlignActionValue
  60. {
  61. get { return (int)this.GetValue(AlignActionValueProperty); }
  62. set { this.SetValue(AlignActionValueProperty, value); }
  63. }
  64. public static readonly DependencyProperty Aligner1WaferProperty = DependencyProperty.Register(
  65. "Aligner1Wafer", typeof(WaferInfo), typeof(CellChamber));
  66. public WaferInfo Aligner1Wafer
  67. {
  68. get => (WaferInfo)GetValue(Aligner1WaferProperty);
  69. set => SetValue(Aligner1WaferProperty, value);
  70. }
  71. public static readonly DependencyProperty Srd1WaferProperty = DependencyProperty.Register(
  72. "Srd1Wafer", typeof(WaferInfo), typeof(CellChamber));
  73. public WaferInfo Srd1Wafer
  74. {
  75. get => (WaferInfo)GetValue(Srd1WaferProperty);
  76. set => SetValue(Srd1WaferProperty, value);
  77. }
  78. public static readonly DependencyProperty Srd2WaferProperty = DependencyProperty.Register(
  79. "Srd2Wafer", typeof(WaferInfo), typeof(CellChamber));
  80. public WaferInfo Srd2Wafer
  81. {
  82. get => (WaferInfo)GetValue(Srd2WaferProperty);
  83. set => SetValue(Srd2WaferProperty, value);
  84. }
  85. public static readonly DependencyProperty VPW1WaferProperty = DependencyProperty.Register(
  86. "VPW1Wafer", typeof(WaferInfo), typeof(CellChamber));
  87. public WaferInfo VPW1Wafer
  88. {
  89. get => (WaferInfo)GetValue(VPW1WaferProperty);
  90. set => SetValue(VPW1WaferProperty, value);
  91. }
  92. public static readonly DependencyProperty VPW2WaferProperty = DependencyProperty.Register(
  93. "VPW2Wafer", typeof(WaferInfo), typeof(CellChamber));
  94. public WaferInfo VPW2Wafer
  95. {
  96. get => (WaferInfo)GetValue(VPW2WaferProperty);
  97. set => SetValue(VPW2WaferProperty, value);
  98. }
  99. public static readonly DependencyProperty PlatingCell1WaferProperty = DependencyProperty.Register(
  100. "PlatingCell1Wafer", typeof(WaferInfo), typeof(CellChamber));
  101. public WaferInfo PlatingCell1Wafer
  102. {
  103. get => (WaferInfo)GetValue(PlatingCell1WaferProperty);
  104. set => SetValue(PlatingCell1WaferProperty, value);
  105. }
  106. public static readonly DependencyProperty PlatingCell2WaferProperty = DependencyProperty.Register(
  107. "PlatingCell2Wafer", typeof(WaferInfo), typeof(CellChamber));
  108. public WaferInfo PlatingCell2Wafer
  109. {
  110. get => (WaferInfo)GetValue(PlatingCell2WaferProperty);
  111. set => SetValue(PlatingCell2WaferProperty, value);
  112. }
  113. public static readonly DependencyProperty PlatingCell3WaferProperty = DependencyProperty.Register(
  114. "PlatingCell3Wafer", typeof(WaferInfo), typeof(CellChamber));
  115. public WaferInfo PlatingCell3Wafer
  116. {
  117. get => (WaferInfo)GetValue(PlatingCell3WaferProperty);
  118. set => SetValue(PlatingCell3WaferProperty, value);
  119. }
  120. public static readonly DependencyProperty PlatingCell4WaferProperty = DependencyProperty.Register(
  121. "PlatingCell4Wafer", typeof(WaferInfo), typeof(CellChamber));
  122. public WaferInfo PlatingCell4Wafer
  123. {
  124. get => (WaferInfo)GetValue(PlatingCell4WaferProperty);
  125. set => SetValue(PlatingCell4WaferProperty, value);
  126. }
  127. public static readonly DependencyProperty LP1PresentedProperty = DependencyProperty.Register(
  128. "LP1Presented", typeof(bool), typeof(CellChamber),
  129. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  130. public bool LP1Presented
  131. {
  132. get { return (bool)this.GetValue(LP1PresentedProperty); }
  133. set { this.SetValue(LP1PresentedProperty, value); }
  134. }
  135. public static readonly DependencyProperty LP2PresentedProperty = DependencyProperty.Register(
  136. "LP2Presented", typeof(bool), typeof(CellChamber),
  137. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  138. public bool LP2Presented
  139. {
  140. get { return (bool)this.GetValue(LP2PresentedProperty); }
  141. set { this.SetValue(LP2PresentedProperty, value); }
  142. }
  143. public static readonly DependencyProperty LP3PresentedProperty = DependencyProperty.Register(
  144. "LP3Presented", typeof(bool), typeof(CellChamber),
  145. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  146. public bool LP3Presented
  147. {
  148. get { return (bool)this.GetValue(LP3PresentedProperty); }
  149. set { this.SetValue(LP3PresentedProperty, value); }
  150. }
  151. public static readonly DependencyProperty LP1LoadedProperty = DependencyProperty.Register(
  152. "LP1Loaded", typeof(bool), typeof(CellChamber),
  153. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  154. public bool LP1Loaded
  155. {
  156. get { return (bool)this.GetValue(LP1LoadedProperty); }
  157. set { this.SetValue(LP1LoadedProperty, value); }
  158. }
  159. public static readonly DependencyProperty LP2LoadedProperty = DependencyProperty.Register(
  160. "LP2Loaded", typeof(bool), typeof(CellChamber),
  161. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  162. public bool LP2Loaded
  163. {
  164. get { return (bool)this.GetValue(LP2LoadedProperty); }
  165. set { this.SetValue(LP2LoadedProperty, value); }
  166. }
  167. public static readonly DependencyProperty CurrentRobotPositionProperty = DependencyProperty.Register(
  168. "CurrentRobotPosition", typeof(RobotPosition), typeof(CellChamber),
  169. new PropertyMetadata(RobotPosition.Origin, PositionChangedCallback));
  170. public RobotPosition CurrentRobotPosition
  171. {
  172. get { return (RobotPosition)this.GetValue(CurrentRobotPositionProperty); }
  173. set
  174. {
  175. this.SetValue(CurrentRobotPositionProperty, value);
  176. }
  177. }
  178. private static void PositionChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
  179. {
  180. var newAct = (RobotPosition)e.NewValue;
  181. var control = d as CellChamber;
  182. GoToPosition(control,newAct);
  183. }
  184. public static readonly DependencyProperty RobotATActionProperty = DependencyProperty.Register(
  185. "RobotATAction", typeof(WaferRobotTAction), typeof(CellChamber),
  186. new FrameworkPropertyMetadata(WaferRobotTAction.T_Origin, FrameworkPropertyMetadataOptions.AffectsRender));
  187. public WaferRobotTAction RobotATAction
  188. {
  189. get { return (WaferRobotTAction)this.GetValue(RobotATActionProperty); }
  190. set { this.SetValue(RobotATActionProperty, value); }
  191. }
  192. public static readonly DependencyProperty RobotAXActionProperty = DependencyProperty.Register(
  193. "RobotAXAction", typeof(WaferRobotXAction), typeof(CellChamber),
  194. new FrameworkPropertyMetadata(WaferRobotXAction.X_Origin, FrameworkPropertyMetadataOptions.AffectsRender));
  195. public WaferRobotXAction RobotAXAction
  196. {
  197. get { return (WaferRobotXAction)this.GetValue(RobotAXActionProperty); }
  198. set { this.SetValue(RobotAXActionProperty, value); }
  199. }
  200. public static readonly DependencyProperty RobotBFActionProperty = DependencyProperty.Register(
  201. "RobotBFAction", typeof(WaferRobotFAction), typeof(CellChamber),
  202. new FrameworkPropertyMetadata(WaferRobotFAction.DownToUpper, FrameworkPropertyMetadataOptions.AffectsRender));
  203. public WaferRobotFAction RobotBFAction
  204. {
  205. get { return (WaferRobotFAction)this.GetValue(RobotBFActionProperty); }
  206. set { this.SetValue(RobotBFActionProperty, value); }
  207. }
  208. public static readonly DependencyProperty RobotAWaferInfoProperty = DependencyProperty.Register(
  209. "RobotAWaferInfo", typeof(WaferInfo), typeof(CellChamber));
  210. public WaferInfo RobotAWaferInfo
  211. {
  212. get { return (WaferInfo)this.GetValue(RobotAWaferInfoProperty); }
  213. set { this.SetValue(RobotAWaferInfoProperty, value); }
  214. }
  215. private static void GoToPosition(Control control,RobotPosition robotPosition)
  216. {
  217. VisualStateManager.GoToElementState(control, robotPosition.ToString(), true);
  218. }
  219. public static readonly DependencyProperty RobotBWaferInfoProperty = DependencyProperty.Register(
  220. "RobotBWaferInfo", typeof(WaferInfo), typeof(CellChamber));
  221. public WaferInfo RobotBWaferInfo
  222. {
  223. get { return (WaferInfo)this.GetValue(RobotBWaferInfoProperty); }
  224. set { this.SetValue(RobotBWaferInfoProperty, value); }
  225. }
  226. }
  227. }