WaferAssociationUnit.xaml.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. using MECF.Framework.Common.DataCenter;
  2. using MECF.Framework.Common.Equipment;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. using Venus_MainPages.Unity;
  19. namespace Venus_MainPages.Views
  20. {
  21. /// <summary>
  22. /// WaferAssociationUnit.xaml 的交互逻辑
  23. /// </summary>
  24. public partial class WaferAssociationUnit : UserControl
  25. {
  26. public WaferAssociationUnit()
  27. {
  28. InitializeComponent();
  29. }
  30. public WaferAssociationInfo WAInfo
  31. {
  32. get { return (WaferAssociationInfo)GetValue(WAInfoProperty); }
  33. set { SetValue(WAInfoProperty, value); }
  34. }
  35. public static readonly DependencyProperty WAInfoProperty = DependencyProperty.Register("WAInfo", typeof(WaferAssociationInfo), typeof(WaferAssociationUnit));
  36. private void cb_DropDownOpened(object sender, EventArgs e)
  37. {
  38. cb.ItemsSource= GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "Sequence")).ToList();
  39. }
  40. private IEnumerable<string> GetFilesNames(string path)
  41. {
  42. return Directory.GetFiles(path, "*.seq")
  43. .Select(System.IO.Path.GetFileNameWithoutExtension);
  44. }
  45. private void cb_SelectionChanged(object sender, SelectionChangedEventArgs e)
  46. {
  47. WAInfo.SequenceName = cb.SelectedValue.ToString();
  48. }
  49. private void preComboBox_DropDownOpened(object sender, EventArgs e)
  50. {
  51. List<string> cleanRecipes=new List<string>();
  52. string installModules = (string)QueryDataClient.Instance.Service.GetConfig("System.InstalledModules");
  53. if (installModules.Contains("PMA"))
  54. {
  55. cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMA","Clean")).ToList());
  56. }
  57. if (installModules.Contains("PMB"))
  58. {
  59. cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMB", "Clean")).ToList());
  60. }
  61. if (installModules.Contains("PMC"))
  62. {
  63. cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMC", "Clean")).ToList());
  64. }
  65. if (installModules.Contains("PMD"))
  66. {
  67. cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMD", "Clean")).ToList());
  68. }
  69. cleanRecipes.Add("");
  70. preComboBox.ItemsSource = cleanRecipes.Distinct();
  71. }
  72. private void preComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  73. {
  74. WAInfo.PreCleanRecipeName= preComboBox.SelectedValue.ToString();
  75. }
  76. private void postComboBox_DropDownOpened(object sender, EventArgs e)
  77. {
  78. List<string> cleanRecipes = new List<string>();
  79. string installModules = (string)QueryDataClient.Instance.Service.GetConfig("System.InstalledModules");
  80. if (installModules.Contains("PMA"))
  81. {
  82. cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMA", "Clean")).ToList());
  83. }
  84. if (installModules.Contains("PMB"))
  85. {
  86. cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMB", "Clean")).ToList());
  87. }
  88. if (installModules.Contains("PMC"))
  89. {
  90. cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMC", "Clean")).ToList());
  91. }
  92. if (installModules.Contains("PMD"))
  93. {
  94. cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMD", "Clean")).ToList());
  95. }
  96. cleanRecipes.Add("");
  97. postComboBox.ItemsSource = cleanRecipes.Distinct();
  98. }
  99. private void postComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  100. {
  101. WAInfo.PostCleanRecipeName = postComboBox.SelectedValue.ToString();
  102. }
  103. }
  104. }