| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 | using MECF.Framework.Common.DataCenter;using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Windows;using System.Windows.Controls;using Venus_MainPages.Unity;namespace Venus_MainPages.Views{    /// <summary>    /// WaferAssociationUnit.xaml 的交互逻辑    /// </summary>    public partial class WaferAssociationUnit : UserControl    {        public WaferAssociationUnit()        {            InitializeComponent();        }        public WaferAssociationInfo WAInfo        {            get { return (WaferAssociationInfo)GetValue(WAInfoProperty); }            set { SetValue(WAInfoProperty, value); }        }        public static readonly DependencyProperty WAInfoProperty = DependencyProperty.Register("WAInfo", typeof(WaferAssociationInfo), typeof(WaferAssociationUnit));        public string SequenceName        {            get { return (string)GetValue(SequenceNameProperty); }            set { SetValue(SequenceNameProperty, value); }        }        public static readonly DependencyProperty SequenceNameProperty = DependencyProperty.Register("SequenceName", typeof(string), typeof(WaferAssociationUnit));        public int SelectedIndex        {            get { return (int)GetValue(SelectedIndexProperty); }            set { SetValue(SelectedIndexProperty, value); }        }        public static readonly DependencyProperty SelectedIndexProperty = DependencyProperty.Register("SelectedIndex", typeof(int), typeof(WaferAssociationUnit),new PropertyMetadata(1));        private void cb_DropDownOpened(object sender, EventArgs e)        {            cb.ItemsSource=GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "Sequence")).ToList();        }                private void cb_SelectionChanged(object sender, SelectionChangedEventArgs e)        {            WAInfo.SequenceName = cb.SelectedValue.ToString();        }        private void preComboBox_DropDownOpened(object sender, EventArgs e)        {            List<string> cleanRecipes=new List<string>();            string installModules = (string)QueryDataClient.Instance.Service.GetConfig("System.InstalledModules");            if (installModules.Contains("PMA"))            {                cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMA","Clean")).ToList());            }            if (installModules.Contains("PMB"))            {                cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMB", "Clean")).ToList());            }            if (installModules.Contains("PMC"))            {                cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMC", "Clean")).ToList());            }            if (installModules.Contains("PMD"))            {                cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMD", "Clean")).ToList());            }            cleanRecipes.Add("");            preComboBox.ItemsSource = cleanRecipes.Distinct();        }        private void preComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)        {            WAInfo.PreCleanRecipeName= preComboBox.SelectedValue.ToString();        }        private void postComboBox_DropDownOpened(object sender, EventArgs e)        {            List<string> cleanRecipes = new List<string>();            string installModules = (string)QueryDataClient.Instance.Service.GetConfig("System.InstalledModules");            if (installModules.Contains("PMA"))            {                cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMA", "Clean")).ToList());            }            if (installModules.Contains("PMB"))            {                cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMB", "Clean")).ToList());            }            if (installModules.Contains("PMC"))            {                cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMC", "Clean")).ToList());            }            if (installModules.Contains("PMD"))            {                cleanRecipes.AddRange(CommonFunction.GetFilesNames(System.IO.Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", "PMD", "Clean")).ToList());            }            cleanRecipes.Add("");            postComboBox.ItemsSource = cleanRecipes.Distinct();        }        private void postComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)        {            WAInfo.PostCleanRecipeName = postComboBox.SelectedValue.ToString();        }        private IEnumerable<string> GetFilesNames(string path)        {            if (Directory.Exists(path))            {                return Directory.GetFiles(path, "*.seq")      .Select(System.IO.Path.GetFileNameWithoutExtension);            }            else            {                return new List<string>();            }        }        private void SelectAllButton_Click(object sender, RoutedEventArgs e)        {            SelectedIndex = 0;        }        private void UnSelectAllButton_Click(object sender, RoutedEventArgs e)        {            SelectedIndex = 1;        }    }}
 |