using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Globalization; using Aitex.Core.RT.Log; using Aitex.Core.Common; using MECF.Framework.UI.Client.CenterViews.Editors.Recipe; using System.Collections.ObjectModel; using Caliburn.Micro; using MECF.Framework.Common.OperationCenter; using MECF.Framework.UI.Client.CenterViews.Editors.Sequence; namespace MECF.Framework.UI.Client.CenterViews.Editors { /// /// Interaction logic for InputDialogBox.xaml /// public partial class SlotEditorDialogBox : Window { public SlotEditorDialogBox() { InitializeComponent(); DataContext = this; } public static readonly DependencyProperty ModuleIDProperty = DependencyProperty.Register( "ModuleID", typeof(string), typeof(SlotEditorDialogBox), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender)); public static readonly DependencyProperty RecipeNameProperty = DependencyProperty.Register( "RecipeName", typeof(string), typeof(SlotEditorDialogBox), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender)); public static readonly DependencyProperty TrayProcessCountProperty = DependencyProperty.Register( "TrayProcessCount", typeof(int), typeof(SlotEditorDialogBox), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender)); public static readonly DependencyProperty SlotIDProperty = DependencyProperty.Register( "SlotID", typeof(int), typeof(SlotEditorDialogBox), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender)); public string ModuleID { get { return (string)this.GetValue(ModuleIDProperty); } set { this.SetValue(ModuleIDProperty, value); } } public int TrayProcessCount { get { return (int)this.GetValue(TrayProcessCountProperty); } set { this.SetValue(TrayProcessCountProperty, value); } } public string RecipeName { get { return (string)this.GetValue(RecipeNameProperty); } set { this.SetValue(RecipeNameProperty, value); } } public int SlotID { get { return (int)this.GetValue(SlotIDProperty); } set { this.SetValue(SlotIDProperty, value); } } private void RecipeSelect_Click(object sender, RoutedEventArgs e) { try { RecipeSelectDialogViewModel dialog = new RecipeSelectDialogViewModel(); dialog.DisplayName = "Select Recipe"; var ProcessTypeFileList = new ObservableCollection(); //var type = new ProcessTypeFileItem(); //type.ProcessType = "Process"; //ProcessTypeFileList.Add(type); //dialog.ProcessTypeFileList = ProcessTypeFileList; var recipeProvider = new RecipeProvider(); var type = new ProcessTypeFileItem(); type.ProcessType = "Process"; var prefix = $"Sic\\Process"; var recipes = recipeProvider.GetXmlRecipeList(prefix); type.FileListByProcessType = RecipeSequenceTreeBuilder.BuildFileNode(prefix, "", false, recipes)[0].Files; ProcessTypeFileList.Add(type); dialog.ProcessTypeFileList = ProcessTypeFileList; WindowManager wm = new WindowManager(); bool? bret = wm.ShowDialog(dialog); if ((bool)bret) { RecipeName = dialog.DialogResult; } } catch (Exception ex) { LOG.Error(ex.Message); } } private void ButtonSet_Click(object sender, RoutedEventArgs e) { try { int processCount = TrayProcessCount; Int32.TryParse(txtTrayProcessCount.Text, out processCount); InvokeClient.Instance.Service.DoOperation("AlterWaferInfo", ModuleID, SlotID, RecipeName, processCount); this.DialogResult = true; } catch (Exception ex) { LOG.Error(ex.Message); } } private void ButtonCancel_Click(object sender, RoutedEventArgs e) { Close(); } protected override void OnRender(DrawingContext drawingContext) { this.txtRecipeName.Text = RecipeName; this.txtTrayProcessCount.Text = TrayProcessCount.ToString(); base.OnRender(drawingContext); } } }