TMChamber.xaml.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. using OpenSEMI.ClientBase;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Windows;
  5. using System.Windows.Controls;
  6. using System.Windows.Media.Animation;
  7. using System.Windows.Shapes;
  8. using Venus_Core;
  9. using Venus_Themes.Unity;
  10. namespace Venus_Themes.UserControls
  11. {
  12. /// <summary>
  13. /// TMChamber.xaml 的交互逻辑
  14. /// </summary>
  15. public partial class TMChamber : UserControl
  16. {
  17. public TMChamber()
  18. {
  19. InitializeComponent();
  20. }
  21. public static readonly DependencyProperty RotateTransformValueProperty = DependencyProperty.Register(
  22. "RotateTransformValue", typeof(int), typeof(TMChamber));
  23. public int RotateTransformValue
  24. {
  25. get { return (int)this.GetValue(RotateTransformValueProperty); }
  26. set { this.SetValue(RotateTransformValueProperty, value); }
  27. }
  28. public static readonly DependencyProperty IsVentingProperty = DependencyProperty.Register(
  29. "IsVenting", typeof(bool), typeof(TMChamber));
  30. public bool IsVenting
  31. {
  32. get { return (bool)this.GetValue(IsVentingProperty); }
  33. set
  34. {
  35. this.SetValue(IsVentingProperty, value);
  36. }
  37. }
  38. public static readonly DependencyProperty DoorIsOpenProperty = DependencyProperty.Register(
  39. "DoorIsOpen", typeof(bool), typeof(TMChamber));
  40. public bool DoorIsOpen
  41. {
  42. get { return (bool)this.GetValue(DoorIsOpenProperty); }
  43. set
  44. {
  45. this.SetValue(DoorIsOpenProperty, value);
  46. }
  47. }
  48. public static readonly DependencyProperty RobotWaferProperty = DependencyProperty.Register(
  49. "RobotWafer",typeof(WaferInfo),typeof(TMChamber));
  50. public WaferInfo RobotWafer
  51. {
  52. get => (WaferInfo)GetValue(RobotWaferProperty);
  53. set => SetValue(RobotWaferProperty, value);
  54. }
  55. public static readonly DependencyProperty PMVisibilityProperty = DependencyProperty.Register(
  56. "PMVisibility", typeof(Visibility), typeof(TMChamber));
  57. public Visibility PMVisibility
  58. {
  59. get => (Visibility)GetValue(PMVisibilityProperty);
  60. set => SetValue(PMVisibilityProperty, value);
  61. }
  62. public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
  63. "ModuleName", typeof(string), typeof(TMChamber));
  64. public string ModuleName
  65. {
  66. get { return (string)this.GetValue(ModuleNameProperty); }
  67. set
  68. {
  69. this.SetValue(ModuleNameProperty, value);
  70. }
  71. }
  72. public static readonly DependencyProperty PressureValueProperty = DependencyProperty.Register(
  73. "PressureValue", typeof(double), typeof(TMChamber));
  74. public double PressureValue
  75. {
  76. get { return (double)this.GetValue(PressureValueProperty); }
  77. set { this.SetValue(PressureValueProperty, value); }
  78. }
  79. public static readonly DependencyProperty PercentValueProperty = DependencyProperty.Register(
  80. "PercentValue", typeof(double), typeof(TMChamber),new PropertyMetadata(0.0,OnDataChanged));
  81. private static void OnDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  82. {
  83. if (d is TMChamber chamber)
  84. {
  85. DoubleAnimation doubleAnimation = new DoubleAnimation((double)e.OldValue, (double)e.NewValue, new Duration(TimeSpan.FromSeconds(1)));
  86. chamber.rec_Water.BeginAnimation(HeightProperty, doubleAnimation);
  87. }
  88. }
  89. public double PercentValue
  90. {
  91. get { return (double)this.GetValue(PercentValueProperty); }
  92. set
  93. {
  94. this.SetValue(PercentValueProperty, value);
  95. }
  96. }
  97. public static readonly DependencyProperty IsShowPressureValueProperty = DependencyProperty.Register(
  98. "IsShowPressureValue", typeof(bool), typeof(TMChamber),
  99. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  100. public bool IsShowPressureValue
  101. {
  102. get { return (bool)this.GetValue(IsShowPressureValueProperty); }
  103. set { this.SetValue(IsShowPressureValueProperty, value); }
  104. }
  105. public static readonly DependencyProperty UnitProperty = DependencyProperty.Register(
  106. "Unit", typeof(string), typeof(TMChamber),new PropertyMetadata("mTorr"));
  107. public string Unit
  108. {
  109. get { return (string)this.GetValue(UnitProperty); }
  110. set
  111. {
  112. this.SetValue(UnitProperty, value);
  113. }
  114. }
  115. private void OpenDoor_Click(object sender, RoutedEventArgs e)
  116. {
  117. //var t = ((((this.Parent as Canvas).Parent as Canvas).Parent as UserControl).DataContext).;
  118. UIEvents.OnPMDoorRaiseChanged(new DoorPara() { ModuleName = ModuleName, IsOpen = "Open" });
  119. }
  120. private void CloseDoor_Click(object sender, RoutedEventArgs e)
  121. {
  122. UIEvents.OnPMDoorRaiseChanged(new DoorPara() { ModuleName = ModuleName, IsOpen = "Close" });
  123. }
  124. }
  125. }