123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- using Aitex.Sorter.Common;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- 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.Navigation;
- using System.Windows.Shapes;
- using MECF.Framework.Common.Equipment;
- namespace Aitex.Sorter.UI.Controls
- {
- /// <summary>
- /// Foup6.xaml 的交互逻辑
- /// </summary>
- public partial class FoupItem : UserControl
- {
- public FoupItem()
- {
- InitializeComponent();
- root.DataContext = this;
- Slot.DataContext = this;
- }
- public static readonly DependencyProperty SlotsProperty = DependencyProperty.Register(
- "Slots", typeof(IEnumerable), typeof(FoupItem),
- new FrameworkPropertyMetadata(null));
- public IEnumerable Slots
- {
- get
- {
- return (IEnumerable)GetValue(SlotsProperty);
- }
- set
- {
- SetValue(SlotsProperty, value);
- }
- }
- public bool ShowControl
- {
- get { return (bool)GetValue(ShowControlProperty); }
- set
- {
- SetValue(ShowControlProperty, value);
- }
- }
- public static readonly DependencyProperty ShowControlProperty =
- DependencyProperty.Register("ShowControl", typeof(bool), typeof(FoupItem), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.None));
- public int SlotCount
- {
- get { return (int)GetValue(SlotCountProperty); }
- set { SetValue(SlotCountProperty, value); }
- }
- // Using a DependencyProperty as the backing store for SlotCount. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty SlotCountProperty =
- DependencyProperty.Register("SlotCount", typeof(int), typeof(FoupItem), new PropertyMetadata(25));
- public ModuleName Station
- {
- get { return (ModuleName)GetValue(StationProperty); }
- set { SetValue(StationProperty, value); }
- }
- // Using a DependencyProperty as the backing store for Station. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty StationProperty =
- DependencyProperty.Register("Station", typeof(ModuleName), typeof(FoupItem), new PropertyMetadata(ModuleName.System));
- public string Title
- {
- get { return (string)GetValue(TitleProperty); }
- set { SetValue(TitleProperty, value); }
- }
- // Using a DependencyProperty as the backing store for Title. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty TitleProperty =
- DependencyProperty.Register("Title", typeof(string), typeof(FoupItem), new PropertyMetadata(null));
- public ICommand WaferTransferCommand
- {
- get { return (ICommand)GetValue(WaferTransferCommandProperty); }
- set { SetValue(WaferTransferCommandProperty, value); }
- }
- // Using a DependencyProperty as the backing store for WaferMovementCommand. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty WaferTransferCommandProperty =
- DependencyProperty.Register("WaferTransferCommand", typeof(ICommand), typeof(FoupItem), new PropertyMetadata(null));
- public ICommand WaferTransferOptionCommand
- {
- get { return (ICommand)GetValue(WaferTransferOptionCommandProperty); }
- set { SetValue(WaferTransferOptionCommandProperty, value); }
- }
- // Using a DependencyProperty as the backing store for WaferTransferOptionCommand. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty WaferTransferOptionCommandProperty =
- DependencyProperty.Register("WaferTransferOptionCommand", typeof(ICommand), typeof(FoupItem), new PropertyMetadata(null));
- public LoadPortCarrierMode CarrierMode
- {
- get { return (LoadPortCarrierMode)GetValue(CarrierModeProperty); }
- set { SetValue(CarrierModeProperty, value); }
- }
- // Using a DependencyProperty as the backing store for CarrierMode. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty CarrierModeProperty =
- DependencyProperty.Register("CarrierMode", typeof(LoadPortCarrierMode), typeof(FoupItem), new PropertyMetadata(LoadPortCarrierMode.Both));
- }
- public class FoupModeConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- var mode = (LoadPortCarrierMode)value;
- var brush = Brushes.Gray;
- switch (mode)
- {
- case LoadPortCarrierMode.Loader:
- brush = Brushes.Cyan;
- break;
- case LoadPortCarrierMode.Unloader:
- brush = Brushes.DodgerBlue;
- break;
- case LoadPortCarrierMode.Both:
- brush = Brushes.LightBlue;
- break;
- default:
- break;
- }
- return brush;
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- public class ItemIndexConverter : IMultiValueConverter
- {
- public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
- {
- var index = (int)values[0];
- var count = (int)values[1];
- return count - index-1;
- }
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- public class ItemIndexConverter2 : IMultiValueConverter
- {
- public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
- {
- var index = (int)values[0];
- var count = 25;
- return count - index - 1;
- }
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- public class ShowSlotItemConverter : IMultiValueConverter
- {
- public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
- {
- var index = (int)values[0];
- var count = (int)values[1];
- return 25-index - 1 < count?true: false;
- }
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|