123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- 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
- {
- /// <summary>
- /// WaferTransferDialog.xaml 的交互逻辑
- /// </summary>
- 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();
- }
- }
- }
|