TMView.xaml.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. using System;
  2. using System.Collections.Concurrent;
  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_Themes.CustomControls;
  17. namespace Venus_MainPages.Views
  18. {
  19. /// <summary>
  20. /// TMView.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class TMView : UserControl
  23. {
  24. BlockingCollection<WaferRobotTAction> blockingCollection = new BlockingCollection<WaferRobotTAction>();
  25. public TMView()
  26. {
  27. InitializeComponent();
  28. //消费
  29. //Task.Run(() =>
  30. //{
  31. // while (true)
  32. // {
  33. // if (blockingCollection.Count > 0)
  34. // {
  35. // this.Dispatcher.Invoke(new Action(() =>
  36. // {
  37. // WaferRobotTAction waferRobotTAction=blockingCollection.Take();
  38. // robot.RobotTAction = waferRobotTAction;
  39. // }));
  40. // }
  41. // System.Threading.Thread.Sleep(1000);
  42. // }
  43. //});
  44. }
  45. //private void XCWButton_Click(object sender, RoutedEventArgs e)
  46. //{
  47. // robot.RobotXAction = WaferRobotXAction.Extend;
  48. //}
  49. //private void XCCWButton_Click(object sender, RoutedEventArgs e)
  50. //{
  51. // robot.RobotXAction = WaferRobotXAction.Retract;
  52. //}
  53. //private void TCWButton_Click(object sender, RoutedEventArgs e)
  54. //{
  55. // robot.RobotTAction = WaferRobotTAction.PMA;
  56. //}
  57. //private void TCCWButton_Click(object sender, RoutedEventArgs e)
  58. //{
  59. // robot.RobotTAction = WaferRobotTAction.PMB;
  60. //}
  61. //private async void AutoButton_Click(object sender, RoutedEventArgs e)
  62. //{
  63. // robot.RobotTAction = WaferRobotTAction.LLA;
  64. // await Task.Delay(1000);
  65. // robot.RobotXAction = WaferRobotXAction.Extend;
  66. // await Task.Delay(2000);
  67. // //robot.Wafer = 1;
  68. // await Task.Delay(200);
  69. // robot.RobotXAction = WaferRobotXAction.Retract;
  70. // await Task.Delay(2000);
  71. // robot.RobotTAction = WaferRobotTAction.PMC;
  72. // await Task.Delay(1000);
  73. // robot.RobotXAction = WaferRobotXAction.Extend;
  74. // await Task.Delay(2000);
  75. // //robot.Wafer = 0;
  76. // await Task.Delay(200);
  77. // robot.RobotXAction = WaferRobotXAction.Retract;
  78. // await Task.Delay(2000);
  79. // robot.RobotTAction = WaferRobotTAction.T_Origin;
  80. // //blockingCollection.Add(WaferRobotTAction.PMA);
  81. // //blockingCollection.Add(WaferRobotTAction.PMB);
  82. // //blockingCollection.Add(WaferRobotTAction.PMC);
  83. // //blockingCollection.Add(WaferRobotTAction.PMD);
  84. // //blockingCollection.Add(WaferRobotTAction.PMC);
  85. // //blockingCollection.Add(WaferRobotTAction.PMB);
  86. // //blockingCollection.Add(WaferRobotTAction.PMA);
  87. // //blockingCollection.Add(WaferRobotTAction.PMB);
  88. // //blockingCollection.Add(WaferRobotTAction.PMC);
  89. // //blockingCollection.Add(WaferRobotTAction.PMD);
  90. //}
  91. //private void Button_Click(object sender, RoutedEventArgs e)
  92. //{
  93. // robot.RobotTAction = WaferRobotTAction.PMC;
  94. //}
  95. //private void Button_Click_1(object sender, RoutedEventArgs e)
  96. //{
  97. // robot.RobotTAction = WaferRobotTAction.PMD;
  98. //}
  99. //private void Button_Click_2(object sender, RoutedEventArgs e)
  100. //{
  101. // robot.RobotTAction = WaferRobotTAction.LLA;
  102. //}
  103. //private void Button_Click_3(object sender, RoutedEventArgs e)
  104. //{
  105. // robot.RobotTAction = WaferRobotTAction.LLB;
  106. //}
  107. //private void Original_Click(object sender, RoutedEventArgs e)
  108. //{
  109. // robot.RobotTAction = WaferRobotTAction.T_Origin;
  110. // //await Task.Delay(1000);
  111. // robot.RobotXAction = WaferRobotXAction.Retract;
  112. //}
  113. //private void Button_Click_4(object sender, RoutedEventArgs e)
  114. //{
  115. // //PMA.DoorIsOpen = !PMA.DoorIsOpen;
  116. //}
  117. }
  118. }