WaferAssociationUnit.xaml.cs 4.7 KB

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