XinSongRobot.xaml.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using OpenSEMI.ClientBase;
  2. using System.Windows;
  3. using System.Windows.Controls;
  4. using System.Windows.Input;
  5. using static Venus_Core.NiceRobotAction;
  6. namespace Venus_Themes.UserControls
  7. {
  8. /// <summary>
  9. /// XinSongRobot.xaml 的交互逻辑
  10. /// </summary>
  11. public partial class XinSongRobot : UserControl
  12. {
  13. public XinSongRobot()
  14. {
  15. InitializeComponent();
  16. }
  17. public static readonly DependencyProperty Blade1RobotWaferProperty = DependencyProperty.Register(
  18. "Blade1RobotWafer",
  19. typeof(WaferInfo),
  20. typeof(XinSongRobot));
  21. public WaferInfo Blade1RobotWafer
  22. {
  23. get => (WaferInfo)GetValue(Blade1RobotWaferProperty);
  24. set => SetValue(Blade1RobotWaferProperty, value);
  25. }
  26. public static readonly DependencyProperty Blade2RobotWaferProperty = DependencyProperty.Register(
  27. "Blade2RobotWafer",
  28. typeof(WaferInfo),
  29. typeof(XinSongRobot));
  30. public WaferInfo Blade2RobotWafer
  31. {
  32. get => (WaferInfo)GetValue(Blade2RobotWaferProperty);
  33. set => SetValue(Blade2RobotWaferProperty, value);
  34. }
  35. public static readonly DependencyProperty Blade1RobotXActionProperty = DependencyProperty.Register(
  36. "Blade1RobotXAction",
  37. typeof(NiceXinSongWaferRobotXAction),
  38. typeof(XinSongRobot),
  39. new PropertyMetadata(NiceXinSongWaferRobotXAction.Retract1, Blade1RobotXActionPropertyChangedCallback));
  40. public NiceXinSongWaferRobotXAction Blade1RobotXAction
  41. {
  42. get => (NiceXinSongWaferRobotXAction)GetValue(Blade1RobotXActionProperty);
  43. set => SetValue(Blade1RobotXActionProperty, value);
  44. }
  45. private static void Blade1RobotXActionPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
  46. {
  47. var control = d as XinSongRobot;
  48. var oldAct = (NiceXinSongWaferRobotXAction)e.OldValue;
  49. var newAct = (NiceXinSongWaferRobotXAction)e.NewValue;
  50. if (oldAct != newAct)
  51. {
  52. VisualStateManager.GoToState(control, newAct.ToString(), true);
  53. }
  54. }
  55. public static readonly DependencyProperty Blade2RobotXActionProperty = DependencyProperty.Register(
  56. "Blade2RobotXAction",
  57. typeof(NiceXinSongWaferRobotXAction),
  58. typeof(XinSongRobot),
  59. new PropertyMetadata(NiceXinSongWaferRobotXAction.Retract2, Blade2RobotXActionPropertyChangedCallback));
  60. public NiceXinSongWaferRobotXAction Blade2RobotXAction
  61. {
  62. get => (NiceXinSongWaferRobotXAction)GetValue(Blade2RobotXActionProperty);
  63. set => SetValue(Blade2RobotXActionProperty, value);
  64. }
  65. private static void Blade2RobotXActionPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
  66. {
  67. var control = d as XinSongRobot;
  68. var oldAct = (NiceXinSongWaferRobotXAction)e.OldValue;
  69. var newAct = (NiceXinSongWaferRobotXAction)e.NewValue;
  70. if (oldAct != newAct)
  71. {
  72. VisualStateManager.GoToState(control, newAct.ToString(), true);
  73. }
  74. }
  75. //private void Canvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  76. //{
  77. // VisualStateManager.GoToState(this, NiceXinSongWaferRobotTAction.LLA.ToString(), true);
  78. //}
  79. public static readonly DependencyProperty Blade1RobotTActionProperty = DependencyProperty.Register(
  80. "BladeRobotTAction",
  81. typeof(NiceXinSongWaferRobotTAction),
  82. typeof(XinSongRobot),
  83. new PropertyMetadata(NiceXinSongWaferRobotTAction.T_Origin, BladeRobotTActionPropertyChangedCallback));
  84. public NiceXinSongWaferRobotTAction BladeRobotTAction
  85. {
  86. get => (NiceXinSongWaferRobotTAction)GetValue(Blade1RobotTActionProperty);
  87. set => SetValue(Blade1RobotTActionProperty, value);
  88. }
  89. private static void BladeRobotTActionPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
  90. {
  91. var control = d as XinSongRobot;
  92. var oldAct = (NiceXinSongWaferRobotTAction)e.OldValue;
  93. var newAct = (NiceXinSongWaferRobotTAction)e.NewValue;
  94. if (oldAct != newAct)
  95. {
  96. VisualStateManager.GoToState(control, newAct.ToString(), true);
  97. }
  98. }
  99. }
  100. }