EFEMRight.xaml.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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 CyberX8_Themes.CustomControls;
  10. namespace CyberX8_Themes.UserControls
  11. {
  12. /// <summary>
  13. /// EFEMRight.xaml 的交互逻辑
  14. /// </summary>
  15. public partial class EFEMRight : UserControl
  16. {
  17. public enum RobotPosition
  18. {
  19. None,
  20. Origin,
  21. Right,
  22. Left,
  23. Middle
  24. }
  25. public EFEMRight()
  26. {
  27. InitializeComponent();
  28. }
  29. public static readonly DependencyProperty RotateTransformValueProperty = DependencyProperty.Register(
  30. "RotateTransformValue", typeof(int), typeof(EFEMRight));
  31. public int RotateTransformValue
  32. {
  33. get { return (int)this.GetValue(RotateTransformValueProperty); }
  34. set { this.SetValue(RotateTransformValueProperty, value); }
  35. }
  36. public static readonly DependencyProperty Aligner1WaferProperty = DependencyProperty.Register(
  37. "Aligner1Wafer", typeof(WaferInfo), typeof(EFEMRight));
  38. public WaferInfo Aligner1Wafer
  39. {
  40. get => (WaferInfo)GetValue(Aligner1WaferProperty);
  41. set => SetValue(Aligner1WaferProperty, value);
  42. }
  43. public static readonly DependencyProperty LP1PresentedProperty = DependencyProperty.Register(
  44. "LP1Presented", typeof(bool), typeof(EFEMRight),
  45. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  46. public bool LP1Presented
  47. {
  48. get { return (bool)this.GetValue(LP1PresentedProperty); }
  49. set { this.SetValue(LP1PresentedProperty, value); }
  50. }
  51. public static readonly DependencyProperty LP2PresentedProperty = DependencyProperty.Register(
  52. "LP2Presented", typeof(bool), typeof(EFEMRight),
  53. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  54. public bool LP2Presented
  55. {
  56. get { return (bool)this.GetValue(LP2PresentedProperty); }
  57. set { this.SetValue(LP2PresentedProperty, value); }
  58. }
  59. public static readonly DependencyProperty LP3PresentedProperty = DependencyProperty.Register(
  60. "LP3Presented", typeof(bool), typeof(EFEMRight),
  61. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  62. public bool LP3Presented
  63. {
  64. get { return (bool)this.GetValue(LP3PresentedProperty); }
  65. set { this.SetValue(LP3PresentedProperty, value); }
  66. }
  67. public static readonly DependencyProperty LP1LoadedProperty = DependencyProperty.Register(
  68. "LP1Loaded", typeof(bool), typeof(EFEMRight),
  69. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  70. public bool LP1Loaded
  71. {
  72. get { return (bool)this.GetValue(LP1LoadedProperty); }
  73. set { this.SetValue(LP1LoadedProperty, value); }
  74. }
  75. public static readonly DependencyProperty LP2LoadedProperty = DependencyProperty.Register(
  76. "LP2Loaded", typeof(bool), typeof(EFEMRight),
  77. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  78. public bool LP2Loaded
  79. {
  80. get { return (bool)this.GetValue(LP2LoadedProperty); }
  81. set { this.SetValue(LP2LoadedProperty, value); }
  82. }
  83. public static readonly DependencyProperty LP3LoadedProperty = DependencyProperty.Register(
  84. "LP3Loaded", typeof(bool), typeof(EFEMRight),
  85. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  86. public bool LP3Loaded
  87. {
  88. get { return (bool)this.GetValue(LP3LoadedProperty); }
  89. set { this.SetValue(LP3LoadedProperty, value); }
  90. }
  91. public static readonly DependencyProperty CurrentRobotPositionProperty = DependencyProperty.Register(
  92. "CurrentRobotPosition", typeof(RobotPosition), typeof(EFEMRight),
  93. new PropertyMetadata(RobotPosition.Origin, PositionChangedCallback));
  94. public RobotPosition CurrentRobotPosition
  95. {
  96. get { return (RobotPosition)this.GetValue(CurrentRobotPositionProperty); }
  97. set
  98. {
  99. this.SetValue(CurrentRobotPositionProperty, value);
  100. }
  101. }
  102. private static void PositionChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
  103. {
  104. var newAct = (RobotPosition)e.NewValue;
  105. var control = d as EFEMRight;
  106. GoToPosition(control,newAct);
  107. }
  108. public static readonly DependencyProperty RobotATActionProperty = DependencyProperty.Register(
  109. "RobotATAction", typeof(WaferRobotTAction), typeof(EFEMRight),
  110. new FrameworkPropertyMetadata(WaferRobotTAction.T_Origin, FrameworkPropertyMetadataOptions.AffectsRender));
  111. public WaferRobotTAction RobotATAction
  112. {
  113. get { return (WaferRobotTAction)this.GetValue(RobotATActionProperty); }
  114. set { this.SetValue(RobotATActionProperty, value); }
  115. }
  116. public static readonly DependencyProperty RobotAXActionProperty = DependencyProperty.Register(
  117. "RobotAXAction", typeof(WaferRobotXAction), typeof(EFEMRight),
  118. new FrameworkPropertyMetadata(WaferRobotXAction.X_Origin, FrameworkPropertyMetadataOptions.AffectsRender));
  119. public WaferRobotXAction RobotAXAction
  120. {
  121. get { return (WaferRobotXAction)this.GetValue(RobotAXActionProperty); }
  122. set { this.SetValue(RobotAXActionProperty, value); }
  123. }
  124. public static readonly DependencyProperty RobotBTActionProperty = DependencyProperty.Register(
  125. "RobotBTAction", typeof(WaferRobotTAction), typeof(EFEMRight),
  126. new FrameworkPropertyMetadata(WaferRobotTAction.T_Origin, FrameworkPropertyMetadataOptions.AffectsRender));
  127. public WaferRobotTAction RobotBTAction
  128. {
  129. get { return (WaferRobotTAction)this.GetValue(RobotBTActionProperty); }
  130. set { this.SetValue(RobotBTActionProperty, value); }
  131. }
  132. public static readonly DependencyProperty RobotBXActionProperty = DependencyProperty.Register(
  133. "RobotBXAction", typeof(WaferRobotXAction), typeof(EFEMRight),
  134. new FrameworkPropertyMetadata(WaferRobotXAction.X_Origin, FrameworkPropertyMetadataOptions.AffectsRender));
  135. public WaferRobotXAction RobotBXAction
  136. {
  137. get { return (WaferRobotXAction)this.GetValue(RobotBXActionProperty); }
  138. set { this.SetValue(RobotBXActionProperty, value); }
  139. }
  140. public static readonly DependencyProperty RobotAWaferInfoProperty = DependencyProperty.Register(
  141. "RobotAWaferInfo", typeof(WaferInfo), typeof(EFEMRight));
  142. public WaferInfo RobotAWaferInfo
  143. {
  144. get { return (WaferInfo)this.GetValue(RobotAWaferInfoProperty); }
  145. set { this.SetValue(RobotAWaferInfoProperty, value); }
  146. }
  147. public static readonly DependencyProperty RobotBWaferInfoProperty = DependencyProperty.Register(
  148. "RobotBWaferInfo", typeof(WaferInfo), typeof(EFEMRight));
  149. public WaferInfo RobotBWaferInfo
  150. {
  151. get { return (WaferInfo)this.GetValue(RobotAWaferInfoProperty); }
  152. set { this.SetValue(RobotAWaferInfoProperty, value); }
  153. }
  154. private static void GoToPosition(Control control,RobotPosition robotPosition)
  155. {
  156. VisualStateManager.GoToElementState(control, robotPosition.ToString(), true);
  157. }
  158. }
  159. }