VenusSETM.xaml.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using OpenSEMI.ClientBase;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. using Venus_Core;
  17. namespace Venus_Themes.UserControls
  18. {
  19. /// <summary>
  20. /// VenusSETM.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class VenusSETM : UserControl
  23. {
  24. public VenusSETM()
  25. {
  26. InitializeComponent();
  27. }
  28. public static readonly DependencyProperty VCEIsInstalledProperty = DependencyProperty.Register(
  29. "VCEIsInstalled", typeof(bool), typeof(VenusSETM));
  30. public bool VCEIsInstalled
  31. {
  32. get => (bool)GetValue(VCEIsInstalledProperty);
  33. set =>SetValue(VCEIsInstalledProperty, value);
  34. }
  35. public static readonly DependencyProperty PMAIsInstalledProperty = DependencyProperty.Register(
  36. "PMAIsInstalled", typeof(bool), typeof(VenusSETM));
  37. public bool PMAIsInstalled
  38. {
  39. get => (bool)GetValue(PMAIsInstalledProperty);
  40. set => SetValue(PMAIsInstalledProperty, value);
  41. }
  42. public static readonly DependencyProperty PMBIsInstalledProperty = DependencyProperty.Register(
  43. "PMBIsInstalled", typeof(bool), typeof(VenusSETM));
  44. public bool PMBIsInstalled
  45. {
  46. get => (bool)GetValue(PMBIsInstalledProperty);
  47. set => SetValue(PMBIsInstalledProperty, value);
  48. }
  49. public static readonly DependencyProperty PMCIsInstalledProperty = DependencyProperty.Register(
  50. "PMCIsInstalled", typeof(bool), typeof(VenusSETM), new PropertyMetadata(true, OnDataPropertyChanged));
  51. public static readonly DependencyProperty PAWaferProperty = DependencyProperty.Register(
  52. "PAWafer", typeof(WaferInfo), typeof(VenusSETM));
  53. public WaferInfo PAWafer
  54. {
  55. get => (WaferInfo)GetValue(PAWaferProperty);
  56. set => SetValue(PAWaferProperty, value);
  57. }
  58. private static void OnDataPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  59. {
  60. if (d is VenusSETM setm)
  61. {
  62. if ((bool)e.NewValue)
  63. {
  64. setm.VPAligner.SetValue(Canvas.LeftProperty, 84.0);
  65. setm.VPAligner.SetValue(Canvas.TopProperty, 240.0);
  66. }
  67. else
  68. {
  69. setm.VPAligner.SetValue(Canvas.LeftProperty, 222.0);
  70. setm.VPAligner.SetValue(Canvas.TopProperty, 75.0);
  71. }
  72. }
  73. }
  74. public bool PMCIsInstalled
  75. {
  76. get => (bool)GetValue(PMCIsInstalledProperty);
  77. set
  78. {
  79. SetValue(PMCIsInstalledProperty, value);
  80. }
  81. }
  82. public static readonly DependencyProperty VPAIsShowProperty = DependencyProperty.Register(
  83. "VPAIsShow", typeof(bool), typeof(VenusSETM));
  84. public bool VPAIsShow
  85. {
  86. get => (bool)GetValue(VPAIsShowProperty);
  87. set => SetValue(VPAIsShowProperty, value);
  88. }
  89. public static readonly DependencyProperty PMADoorIsOpenProperty = DependencyProperty.Register(
  90. "PMADoorIsOpen", typeof(bool), typeof(VenusSETM));
  91. public bool PMADoorIsOpen
  92. {
  93. get => (bool)GetValue(PMADoorIsOpenProperty);
  94. set => SetValue(PMADoorIsOpenProperty, value);
  95. }
  96. public static readonly DependencyProperty PMBDoorIsOpenProperty = DependencyProperty.Register(
  97. "PMBDoorIsOpen", typeof(bool), typeof(VenusSETM));
  98. public bool PMBDoorIsOpen
  99. {
  100. get => (bool)GetValue(PMBDoorIsOpenProperty);
  101. set => SetValue(PMBDoorIsOpenProperty, value);
  102. }
  103. public static readonly DependencyProperty PMCDoorIsOpenProperty = DependencyProperty.Register(
  104. "PMCDoorIsOpen", typeof(bool), typeof(VenusSETM));
  105. public bool PMCDoorIsOpen
  106. {
  107. get => (bool)GetValue(PMCDoorIsOpenProperty);
  108. set => SetValue(PMCDoorIsOpenProperty, value);
  109. }
  110. public static readonly DependencyProperty VCEDoorIsOpenProperty = DependencyProperty.Register(
  111. "VCEDoorIsOpen", typeof(bool), typeof(VenusSETM));
  112. public bool VCEDoorIsOpen
  113. {
  114. get => (bool)GetValue(VCEDoorIsOpenProperty);
  115. set => SetValue(VCEDoorIsOpenProperty, value);
  116. }
  117. }
  118. public class Door : DependencyObject
  119. {
  120. public static bool GetIsOpen(DependencyObject obj) => (bool)obj.GetValue(IsOpenProperty);
  121. public static void SetIsOpen(DependencyObject obj, bool value) => obj.SetValue(IsOpenProperty, value);
  122. public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register(
  123. "IsOpen", typeof(bool), typeof(Door));
  124. }
  125. }