using OpenSEMI.ClientBase; using System; using System.Collections.Generic; using System.Windows; using System.Windows.Controls; using System.Windows.Media.Animation; using System.Windows.Shapes; using Venus_Core; using Venus_Themes.Unity; namespace Venus_Themes.UserControls { /// /// TMChamber.xaml 的交互逻辑 /// public partial class TMChamber : UserControl { public TMChamber() { InitializeComponent(); } public static readonly DependencyProperty RotateTransformValueProperty = DependencyProperty.Register( "RotateTransformValue", typeof(int), typeof(TMChamber)); public int RotateTransformValue { get { return (int)this.GetValue(RotateTransformValueProperty); } set { this.SetValue(RotateTransformValueProperty, value); } } public static readonly DependencyProperty IsVentingProperty = DependencyProperty.Register( "IsVenting", typeof(bool), typeof(TMChamber)); public bool IsVenting { get { return (bool)this.GetValue(IsVentingProperty); } set { this.SetValue(IsVentingProperty, value); } } public static readonly DependencyProperty DoorIsOpenProperty = DependencyProperty.Register( "DoorIsOpen", typeof(bool), typeof(TMChamber)); public bool DoorIsOpen { get { return (bool)this.GetValue(DoorIsOpenProperty); } set { this.SetValue(DoorIsOpenProperty, value); } } public static readonly DependencyProperty RobotWaferProperty = DependencyProperty.Register( "RobotWafer",typeof(WaferInfo),typeof(TMChamber)); public WaferInfo RobotWafer { get => (WaferInfo)GetValue(RobotWaferProperty); set => SetValue(RobotWaferProperty, value); } public static readonly DependencyProperty PMVisibilityProperty = DependencyProperty.Register( "PMVisibility", typeof(Visibility), typeof(TMChamber)); public Visibility PMVisibility { get => (Visibility)GetValue(PMVisibilityProperty); set => SetValue(PMVisibilityProperty, value); } public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register( "ModuleName", typeof(string), typeof(TMChamber)); public string ModuleName { get { return (string)this.GetValue(ModuleNameProperty); } set { this.SetValue(ModuleNameProperty, value); } } public static readonly DependencyProperty PressureValueProperty = DependencyProperty.Register( "PressureValue", typeof(double), typeof(TMChamber)); public double PressureValue { get { return (double)this.GetValue(PressureValueProperty); } set { this.SetValue(PressureValueProperty, value); } } public static readonly DependencyProperty PercentValueProperty = DependencyProperty.Register( "PercentValue", typeof(double), typeof(TMChamber),new PropertyMetadata(0.0,OnDataChanged)); private static void OnDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is TMChamber chamber) { DoubleAnimation doubleAnimation = new DoubleAnimation((double)e.OldValue, (double)e.NewValue, new Duration(TimeSpan.FromSeconds(1))); chamber.rec_Water.BeginAnimation(HeightProperty, doubleAnimation); } } public double PercentValue { get { return (double)this.GetValue(PercentValueProperty); } set { this.SetValue(PercentValueProperty, value); } } public static readonly DependencyProperty IsShowPressureValueProperty = DependencyProperty.Register( "IsShowPressureValue", typeof(bool), typeof(TMChamber), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)); public bool IsShowPressureValue { get { return (bool)this.GetValue(IsShowPressureValueProperty); } set { this.SetValue(IsShowPressureValueProperty, value); } } public static readonly DependencyProperty UnitProperty = DependencyProperty.Register( "Unit", typeof(string), typeof(TMChamber),new PropertyMetadata("mTorr")); public string Unit { get { return (string)this.GetValue(UnitProperty); } set { this.SetValue(UnitProperty, value); } } private void OpenDoor_Click(object sender, RoutedEventArgs e) { //var t = ((((this.Parent as Canvas).Parent as Canvas).Parent as UserControl).DataContext).; UIEvents.OnPMDoorRaiseChanged(new DoorPara() { ModuleName = ModuleName, IsOpen = "Open" }); } private void CloseDoor_Click(object sender, RoutedEventArgs e) { UIEvents.OnPMDoorRaiseChanged(new DoorPara() { ModuleName = ModuleName, IsOpen = "Close" }); } } }