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 PunkHPX8_Themes.CustomControls; namespace PunkHPX8_Themes.UserControls { /// /// CellChamber.xaml 的交互逻辑 /// public partial class CellChamber : UserControl { public enum RobotPosition { None, Origin, Right, Left, Middle, Aligner, SRD, Dummy, Right_Place, Left_Place, Middle_Place, Aligner_Place, SRD_Place, Dummy_Place, VPW1, VPW2, PlatingCell1, PlatingCell2, PlatingCell3, PlatingCell4, VPW1_Place, VPW2_Place, PlatingCell1_Place, PlatingCell2_Place, PlatingCell3_Place, PlatingCell4_Place, } public CellChamber() { InitializeComponent(); } public static readonly DependencyProperty RotateTransformValueProperty = DependencyProperty.Register( "RotateTransformValue", typeof(int), typeof(CellChamber)); public int RotateTransformValue { get { return (int)this.GetValue(RotateTransformValueProperty); } set { this.SetValue(RotateTransformValueProperty, value); } } public static readonly DependencyProperty AlignActionValueProperty = DependencyProperty.Register( "AlignActionValue", typeof(int), typeof(CellChamber)); public int AlignActionValue { get { return (int)this.GetValue(AlignActionValueProperty); } set { this.SetValue(AlignActionValueProperty, value); } } public static readonly DependencyProperty Aligner1WaferProperty = DependencyProperty.Register( "Aligner1Wafer", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo Aligner1Wafer { get => (WaferInfo)GetValue(Aligner1WaferProperty); set => SetValue(Aligner1WaferProperty, value); } public static readonly DependencyProperty Srd1WaferProperty = DependencyProperty.Register( "Srd1Wafer", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo Srd1Wafer { get => (WaferInfo)GetValue(Srd1WaferProperty); set => SetValue(Srd1WaferProperty, value); } public static readonly DependencyProperty Srd2WaferProperty = DependencyProperty.Register( "Srd2Wafer", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo Srd2Wafer { get => (WaferInfo)GetValue(Srd2WaferProperty); set => SetValue(Srd2WaferProperty, value); } public static readonly DependencyProperty VPW1WaferProperty = DependencyProperty.Register( "VPW1Wafer", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo VPW1Wafer { get => (WaferInfo)GetValue(VPW1WaferProperty); set => SetValue(VPW1WaferProperty, value); } public static readonly DependencyProperty VPW2WaferProperty = DependencyProperty.Register( "VPW2Wafer", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo VPW2Wafer { get => (WaferInfo)GetValue(VPW2WaferProperty); set => SetValue(VPW2WaferProperty, value); } public static readonly DependencyProperty PlatingCell1WaferProperty = DependencyProperty.Register( "PlatingCell1Wafer", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo PlatingCell1Wafer { get => (WaferInfo)GetValue(PlatingCell1WaferProperty); set => SetValue(PlatingCell1WaferProperty, value); } public static readonly DependencyProperty PlatingCell2WaferProperty = DependencyProperty.Register( "PlatingCell2Wafer", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo PlatingCell2Wafer { get => (WaferInfo)GetValue(PlatingCell2WaferProperty); set => SetValue(PlatingCell2WaferProperty, value); } public static readonly DependencyProperty PlatingCell3WaferProperty = DependencyProperty.Register( "PlatingCell3Wafer", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo PlatingCell3Wafer { get => (WaferInfo)GetValue(PlatingCell3WaferProperty); set => SetValue(PlatingCell3WaferProperty, value); } public static readonly DependencyProperty PlatingCell4WaferProperty = DependencyProperty.Register( "PlatingCell4Wafer", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo PlatingCell4Wafer { get => (WaferInfo)GetValue(PlatingCell4WaferProperty); set => SetValue(PlatingCell4WaferProperty, value); } public static readonly DependencyProperty LP1PresentedProperty = DependencyProperty.Register( "LP1Presented", typeof(bool), typeof(CellChamber), 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(CellChamber), 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(CellChamber), 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(CellChamber), 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(CellChamber), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)); public bool LP2Loaded { get { return (bool)this.GetValue(LP2LoadedProperty); } set { this.SetValue(LP2LoadedProperty, value); } } public static readonly DependencyProperty CurrentRobotPositionProperty = DependencyProperty.Register( "CurrentRobotPosition", typeof(RobotPosition), typeof(CellChamber), 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 CellChamber; GoToPosition(control,newAct); } public static readonly DependencyProperty RobotATActionProperty = DependencyProperty.Register( "RobotATAction", typeof(WaferRobotTAction), typeof(CellChamber), 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(CellChamber), 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 RobotBFActionProperty = DependencyProperty.Register( "RobotBFAction", typeof(WaferRobotFAction), typeof(CellChamber), new FrameworkPropertyMetadata(WaferRobotFAction.DownToUpper, FrameworkPropertyMetadataOptions.AffectsRender)); public WaferRobotFAction RobotBFAction { get { return (WaferRobotFAction)this.GetValue(RobotBFActionProperty); } set { this.SetValue(RobotBFActionProperty, value); } } public static readonly DependencyProperty RobotAWaferInfoProperty = DependencyProperty.Register( "RobotAWaferInfo", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo RobotAWaferInfo { 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); } public static readonly DependencyProperty RobotBWaferInfoProperty = DependencyProperty.Register( "RobotBWaferInfo", typeof(WaferInfo), typeof(CellChamber)); public WaferInfo RobotBWaferInfo { get { return (WaferInfo)this.GetValue(RobotBWaferInfoProperty); } set { this.SetValue(RobotBWaferInfoProperty, value); } } } }