using Aitex.Core.Common; using Aitex.Sorter.Common; 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 MECF.Framework.Common.Equipment; using MECF.Framework.Common.OperationCenter; namespace Aitex.Sorter.UI.Controls { /// /// WaferTransferDialog.xaml 的交互逻辑 /// public partial class WaferTransferDialog : Window { public WaferTransferDialog(WaferInfo waferInfo, ModuleName sourceStation, int sourceSlot, ModuleName destinationStation, int destinationSlot, WaferTransferOption option = null) { InitializeComponent(); if (waferInfo.Status == WaferStatus.Dummy) { grid.RowDefinitions[7].Height = new GridLength(0); } else { grid.RowDefinitions[8].Height = new GridLength(0); if (destinationStation == ModuleName.Robot) { if (destinationSlot == 0) { chkBlade1.IsChecked = true; if (option != null) option.Blade = 0; } else if (destinationSlot == 1) { chkBlade2.IsChecked = true; if (option != null) option.Blade = 1; } chkBlade1.IsEnabled = false; chkBlade2.IsEnabled = false; } if (sourceStation == ModuleName.Robot) { if (sourceSlot == 0) { chkBlade1.IsChecked = true; if (option != null) option.Blade = 0; } else if (sourceSlot == 1) { chkBlade2.IsChecked = true; if (option != null) option.Blade = 1; } chkBlade1.IsEnabled = false; chkBlade2.IsEnabled = false; } if (ModuleHelper.IsLoadLock(sourceStation) || ModuleHelper.IsLoadLock(destinationStation)) { //chkBlade3.IsEnabled = false; } } if (option != null) { if (!option.Setting.ShowAlign) { grid.RowDefinitions[4].Height = new GridLength(0); grid.RowDefinitions[8].Height = new GridLength(0); } if (!option.Setting.ShowLaserMarker) { grid.RowDefinitions[5].Height = new GridLength(0); } if (!option.Setting.ShowT7Code) { grid.RowDefinitions[6].Height = new GridLength(0); } if (!option.Setting.ShowBlade) { grid.RowDefinitions[7].Height = new GridLength(0); } if (!option.Setting.ShowTurnOver) { grid.RowDefinitions[9].Height = new GridLength(0); } chkAligner.IsChecked = option.Align; chkReadID.IsChecked = option.ReadLaserMarker; chkReadID2.IsChecked = option.ReadT7Code; chkTurnOver.IsChecked = option.TurnOver; if (option.Blade == 0) { chkBlade1.IsChecked = true; } else { chkBlade2.IsChecked = true; } tbAngle.Text = option.AlignerAngle.ToString(); } //else //{ // grid.RowDefinitions[9].Height = new GridLength(0); //} //chkAligner.IsChecked = true; lbSource.Content = sourceStation; lbSourceSlot.Content = sourceSlot+1; lbDest.Content = destinationStation; lblDestSlot.Content = destinationSlot+1; _sourceModule = sourceStation; _sourceSlotIndex = sourceSlot; _destModule = destinationStation; _destSlotIndex = destinationSlot; } private ModuleName _sourceModule; private int _sourceSlotIndex; private ModuleName _destModule; private int _destSlotIndex; public bool Aligner { get { return chkAligner.IsChecked.Value; } } public bool TurnOver => chkTurnOver.IsChecked != null && chkTurnOver.IsChecked.Value; public bool ReadLaserMarker { get { return chkReadID.IsChecked.Value; } } public bool ReadT7Code { get { return chkReadID2.IsChecked.Value; } } public int Blade { get { // if (chkBlade3.IsChecked != null && chkBlade3.IsChecked.Value) // { // return 2; // } // else // { return chkBlade1.IsChecked.Value ? 0 : 1; // } } } public double AlignerAngle { get { double value = 0d; double.TryParse(tbAngle.Text, out value); return value; } } public void SetControlShow(bool isShow) { if (isShow) { grid.RowDefinitions[6].Height = new GridLength(40); grid.RowDefinitions[7].Height = new GridLength(40); grid.RowDefinitions[8].Height = new GridLength(0); } else { grid.RowDefinitions[6].Height = new GridLength(0); grid.RowDefinitions[7].Height = new GridLength(0); grid.RowDefinitions[8].Height = new GridLength(0); } } private void btnOK_Click(object sender, RoutedEventArgs e) { DialogResult = true; Close(); } private void btnCancel_Click(object sender, RoutedEventArgs e) { DialogResult = false; Close(); } private void btnMoveWaferInfo_Click(object sender, RoutedEventArgs e) { InvokeClient.Instance.Service.DoOperation("WaferManagerMoveWaferInfo", new object[] { _sourceModule,_sourceSlotIndex,_destModule,_destSlotIndex}); DialogResult = false; Close(); } } }