using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using OpenSEMI.ClientBase; using CyberX8_Themes.CustomControls; namespace CyberX8_Themes.UserControls { /// /// EFEMRight.xaml 的交互逻辑 /// public partial class EFEMRight : UserControl { public enum RobotPosition { None, Origin, Right, Left, Middle } public EFEMRight() { InitializeComponent(); } public static readonly DependencyProperty RotateTransformValueProperty = DependencyProperty.Register( "RotateTransformValue", typeof(int), typeof(EFEMRight)); public int RotateTransformValue { get { return (int)this.GetValue(RotateTransformValueProperty); } set { this.SetValue(RotateTransformValueProperty, value); } } public static readonly DependencyProperty Aligner1WaferProperty = DependencyProperty.Register( "Aligner1Wafer", typeof(WaferInfo), typeof(EFEMRight)); public WaferInfo Aligner1Wafer { get => (WaferInfo)GetValue(Aligner1WaferProperty); set => SetValue(Aligner1WaferProperty, value); } public static readonly DependencyProperty LP1PresentedProperty = DependencyProperty.Register( "LP1Presented", typeof(bool), typeof(EFEMRight), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)); public bool LP1Presented { get { return (bool)this.GetValue(LP1PresentedProperty); } set { this.SetValue(LP1PresentedProperty, value); } } public static readonly DependencyProperty LP2PresentedProperty = DependencyProperty.Register( "LP2Presented", typeof(bool), typeof(EFEMRight), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)); public bool LP2Presented { get { return (bool)this.GetValue(LP2PresentedProperty); } set { this.SetValue(LP2PresentedProperty, value); } } public static readonly DependencyProperty LP3PresentedProperty = DependencyProperty.Register( "LP3Presented", typeof(bool), typeof(EFEMRight), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)); public bool LP3Presented { get { return (bool)this.GetValue(LP3PresentedProperty); } set { this.SetValue(LP3PresentedProperty, value); } } public static readonly DependencyProperty LP1LoadedProperty = DependencyProperty.Register( "LP1Loaded", typeof(bool), typeof(EFEMRight), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)); public bool LP1Loaded { get { return (bool)this.GetValue(LP1LoadedProperty); } set { this.SetValue(LP1LoadedProperty, value); } } public static readonly DependencyProperty LP2LoadedProperty = DependencyProperty.Register( "LP2Loaded", typeof(bool), typeof(EFEMRight), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)); public bool LP2Loaded { get { return (bool)this.GetValue(LP2LoadedProperty); } set { this.SetValue(LP2LoadedProperty, value); } } public static readonly DependencyProperty LP3LoadedProperty = DependencyProperty.Register( "LP3Loaded", typeof(bool), typeof(EFEMRight), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)); public bool LP3Loaded { get { return (bool)this.GetValue(LP3LoadedProperty); } set { this.SetValue(LP3LoadedProperty, value); } } public static readonly DependencyProperty CurrentRobotPositionProperty = DependencyProperty.Register( "CurrentRobotPosition", typeof(RobotPosition), typeof(EFEMRight), new PropertyMetadata(RobotPosition.Origin, PositionChangedCallback)); public RobotPosition CurrentRobotPosition { get { return (RobotPosition)this.GetValue(CurrentRobotPositionProperty); } set { this.SetValue(CurrentRobotPositionProperty, value); } } private static void PositionChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { var newAct = (RobotPosition)e.NewValue; var control = d as EFEMRight; GoToPosition(control,newAct); } public static readonly DependencyProperty RobotATActionProperty = DependencyProperty.Register( "RobotATAction", typeof(WaferRobotTAction), typeof(EFEMRight), new FrameworkPropertyMetadata(WaferRobotTAction.T_Origin, FrameworkPropertyMetadataOptions.AffectsRender)); public WaferRobotTAction RobotATAction { get { return (WaferRobotTAction)this.GetValue(RobotATActionProperty); } set { this.SetValue(RobotATActionProperty, value); } } public static readonly DependencyProperty RobotAXActionProperty = DependencyProperty.Register( "RobotAXAction", typeof(WaferRobotXAction), typeof(EFEMRight), new FrameworkPropertyMetadata(WaferRobotXAction.X_Origin, FrameworkPropertyMetadataOptions.AffectsRender)); public WaferRobotXAction RobotAXAction { get { return (WaferRobotXAction)this.GetValue(RobotAXActionProperty); } set { this.SetValue(RobotAXActionProperty, value); } } public static readonly DependencyProperty RobotBTActionProperty = DependencyProperty.Register( "RobotBTAction", typeof(WaferRobotTAction), typeof(EFEMRight), new FrameworkPropertyMetadata(WaferRobotTAction.T_Origin, FrameworkPropertyMetadataOptions.AffectsRender)); public WaferRobotTAction RobotBTAction { get { return (WaferRobotTAction)this.GetValue(RobotBTActionProperty); } set { this.SetValue(RobotBTActionProperty, value); } } public static readonly DependencyProperty RobotBXActionProperty = DependencyProperty.Register( "RobotBXAction", typeof(WaferRobotXAction), typeof(EFEMRight), new FrameworkPropertyMetadata(WaferRobotXAction.X_Origin, FrameworkPropertyMetadataOptions.AffectsRender)); public WaferRobotXAction RobotBXAction { get { return (WaferRobotXAction)this.GetValue(RobotBXActionProperty); } set { this.SetValue(RobotBXActionProperty, value); } } public static readonly DependencyProperty RobotAWaferInfoProperty = DependencyProperty.Register( "RobotAWaferInfo", typeof(WaferInfo), typeof(EFEMRight)); public WaferInfo RobotAWaferInfo { get { return (WaferInfo)this.GetValue(RobotAWaferInfoProperty); } set { this.SetValue(RobotAWaferInfoProperty, value); } } public static readonly DependencyProperty RobotBWaferInfoProperty = DependencyProperty.Register( "RobotBWaferInfo", typeof(WaferInfo), typeof(EFEMRight)); public WaferInfo RobotBWaferInfo { get { return (WaferInfo)this.GetValue(RobotAWaferInfoProperty); } set { this.SetValue(RobotAWaferInfoProperty, value); } } private static void GoToPosition(Control control,RobotPosition robotPosition) { VisualStateManager.GoToElementState(control, robotPosition.ToString(), true); } } }