KeplerWaferAssociationUnit.xaml.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. using MECF.Framework.Common.DataCenter;
  2. using OpenSEMI.Ctrlib.Controls;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Diagnostics;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Input;
  11. using Venus_Core;
  12. using Venus_MainPages.Unity;
  13. namespace Venus_MainPages.Views
  14. {
  15. /// <summary>
  16. /// WaferAssociationUnit.xaml 的交互逻辑
  17. /// </summary>
  18. public partial class KeplerWaferAssociationUnit : UserControl
  19. {
  20. public KeplerWaferAssociationUnit()
  21. {
  22. InitializeComponent();
  23. }
  24. public WaferAssociationInfo WAInfo
  25. {
  26. get { return (WaferAssociationInfo)GetValue(WAInfoProperty); }
  27. set { SetValue(WAInfoProperty, value); }
  28. }
  29. public static readonly DependencyProperty WAInfoProperty = DependencyProperty.Register("WAInfo", typeof(WaferAssociationInfo), typeof(KeplerWaferAssociationUnit));
  30. public string SequenceName
  31. {
  32. get { return (string)GetValue(SequenceNameProperty); }
  33. set { SetValue(SequenceNameProperty, value); }
  34. }
  35. public static readonly DependencyProperty SequenceNameProperty = DependencyProperty.Register("SequenceName", typeof(string), typeof(KeplerWaferAssociationUnit));
  36. public string CarrierId
  37. {
  38. get { return (string)GetValue(CarrierIdProperty); }
  39. set { SetValue(CarrierIdProperty, value); }
  40. }
  41. public static readonly DependencyProperty CarrierIdProperty = DependencyProperty.Register("CarrierId", typeof(string), typeof(KeplerWaferAssociationUnit));
  42. public int SelectedIndex
  43. {
  44. get { return (int)GetValue(SelectedIndexProperty); }
  45. set { SetValue(SelectedIndexProperty, value); }
  46. }
  47. public static readonly DependencyProperty SelectedIndexProperty = DependencyProperty.Register("SelectedIndex", typeof(int), typeof(KeplerWaferAssociationUnit),new PropertyMetadata(1));
  48. public string CycleInfo
  49. {
  50. get { return (string)GetValue(CycleInfoProperty); }
  51. set { SetValue(CycleInfoProperty, value); }
  52. }
  53. public static readonly DependencyProperty CycleInfoProperty = DependencyProperty.Register("CycleInfo", typeof(string), typeof(KeplerWaferAssociationUnit));
  54. public bool ButtonIsEnable
  55. {
  56. get { return (bool)GetValue(ButtonIsEnableProperty); }
  57. set { SetValue(ButtonIsEnableProperty, value); }
  58. }
  59. public static readonly DependencyProperty ButtonIsEnableProperty = DependencyProperty.Register("ButtonIsEnable", typeof(bool), typeof(KeplerWaferAssociationUnit), new PropertyMetadata(true));
  60. private void cb_DropDownOpened(object sender, EventArgs e)
  61. {
  62. cb.ItemsSource = GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "Sequence")).ToList();
  63. }
  64. private void cb_SelectionChanged(object sender, SelectionChangedEventArgs e)
  65. {
  66. WAInfo.SequenceName = cb.SelectedValue?.ToString();
  67. }
  68. //private void preComboBox_DropDownOpened(object sender, EventArgs e)
  69. //{
  70. // List<string> cleanRecipes=new List<string>();
  71. // string installModules = (string)QueryDataClient.Instance.Service.GetConfig("System.InstalledModules");
  72. // if (installModules.Contains("PMA"))
  73. // {
  74. // cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMA","Clean")).ToList());
  75. // }
  76. // if (installModules.Contains("PMB"))
  77. // {
  78. // cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMB", "Clean")).ToList());
  79. // }
  80. // if (installModules.Contains("PMC"))
  81. // {
  82. // cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMC", "Clean")).ToList());
  83. // }
  84. // if (installModules.Contains("PMD"))
  85. // {
  86. // cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMD", "Clean")).ToList());
  87. // }
  88. // cleanRecipes.Add("");
  89. // //preComboBox.ItemsSource = cleanRecipes.Distinct();
  90. //}
  91. //private void preComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  92. //{
  93. // WAInfo.PreCleanRecipeName= preComboBox.SelectedValue.ToString();
  94. //}
  95. //private void postComboBox_DropDownOpened(object sender, EventArgs e)
  96. //{
  97. // List<string> cleanRecipes = new List<string>();
  98. // string installModules = (string)QueryDataClient.Instance.Service.GetConfig("System.InstalledModules");
  99. // if (installModules.Contains("PMA"))
  100. // {
  101. // cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMA", "Clean")).ToList());
  102. // }
  103. // if (installModules.Contains("PMB"))
  104. // {
  105. // cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMB", "Clean")).ToList());
  106. // }
  107. // if (installModules.Contains("PMC"))
  108. // {
  109. // cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMC", "Clean")).ToList());
  110. // }
  111. // if (installModules.Contains("PMD"))
  112. // {
  113. // cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMD", "Clean")).ToList());
  114. // }
  115. // cleanRecipes.Add("");
  116. // //postComboBox.ItemsSource = cleanRecipes.Distinct();
  117. //}
  118. //private void postComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  119. //{
  120. // //WAInfo.PostCleanRecipeName = postComboBox.SelectedValue.ToString();
  121. //}
  122. private IEnumerable<string> GetFilesNames(string path)
  123. {
  124. if (Directory.Exists(path))
  125. {
  126. return Directory.GetFiles(path, "*.seq")
  127. .Select(System.IO.Path.GetFileNameWithoutExtension);
  128. }
  129. else
  130. {
  131. return new List<string>();
  132. }
  133. }
  134. private void SelectAllButton_Click(object sender, RoutedEventArgs e)
  135. {
  136. SelectedIndex = 0;
  137. }
  138. private void UnSelectAllButton_Click(object sender, RoutedEventArgs e)
  139. {
  140. SelectedIndex = 1;
  141. }
  142. private void IsEnableCycleCheckBox_Unchecked(object sender, RoutedEventArgs e)
  143. {
  144. CycleNumTextbox.IsEnabled = false;
  145. CycleNumTextbox.Text = "1";
  146. WAInfo.CycleNumber = 1;
  147. }
  148. private void IsEnableCycleCheckBox_Checked(object sender, RoutedEventArgs e)
  149. {
  150. CycleNumTextbox.IsEnabled = true;
  151. }
  152. private void Slot_SlotMouseButtonDown(object sender, MouseButtonEventArgs e)
  153. {
  154. VenusGlobalEvents.OnSlotRightClickChanged(sender as Slot);
  155. }
  156. private void Slot_WaferTransferStarted(object sender, DragDropEventArgs e)
  157. {
  158. try
  159. {
  160. VenusGlobalEvents.OnSlotWaferTransfer(e);
  161. }
  162. catch (Exception ex)
  163. {
  164. Trace.WriteLine(ex);
  165. }
  166. }
  167. }
  168. }