using Aitex.Core.Common;
using Aitex.Core.UI.MVVM;
using FurnaceUI.Controls.Common;
using MECF.Framework.Common.Equipment;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading;
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.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CB = MECF.Framework.UI.Client.ClientBase;
namespace FurnaceUI.Controls.Parts
{
///
/// ATMDualArmRobot.xaml 的交互逻辑
///
public partial class BoatElevatorRobot : UserControl, INotifyPropertyChanged
{
protected readonly int MoveTime = 300;
private const int AnimationTimeout = 3000; // seconds
public int MinValue
{
get { return (int)GetValue(MinValueProperty); }
set { SetValue(MinValueProperty, value); }
}
// Using a DependencyProperty as the backing store for MinValue. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MinValueProperty =
DependencyProperty.Register("MinValue", typeof(int), typeof(BoatElevatorRobot), new PropertyMetadata(0));
public int MaxValue
{
get { return (int)GetValue(MaxValueProperty); }
set { SetValue(MaxValueProperty, value); }
}
// Using a DependencyProperty as the backing store for MaxValue. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MaxValueProperty =
DependencyProperty.Register("MaxValue", typeof(int), typeof(BoatElevatorRobot), new PropertyMetadata(1000));
public int CurrentValue
{
get { return (int)GetValue(CurrentValueProperty); }
set { SetValue(CurrentValueProperty, value); }
}
// Using a DependencyProperty as the backing store for CurrentValue. This enables animation, styling, binding, etc...
public static readonly DependencyProperty CurrentValueProperty =
DependencyProperty.Register("CurrentValue", typeof(int), typeof(BoatElevatorRobot), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
public int RotateAngle
{
get { return (int)GetValue(RotateAngleProperty); }
set { SetValue(RotateAngleProperty, value); }
}
// Using a DependencyProperty as the backing store for RotateAngel. This enables animation, styling, binding, etc...
public static readonly DependencyProperty RotateAngleProperty =
DependencyProperty.Register("RotateAngel", typeof(int), typeof(BoatElevatorRobot), new PropertyMetadata(0));
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(BoatElevatorRobot), new PropertyMetadata(ModuleName.Robot));
public ICommand Command
{
get { return (ICommand)GetValue(CommandProperty); }
set { SetValue(CommandProperty, value); }
}
// Using a DependencyProperty as the backing store for Command. This enables animation, styling, binding, etc...
public static readonly DependencyProperty CommandProperty =
DependencyProperty.Register("Command", typeof(ICommand), typeof(BoatElevatorRobot), new PropertyMetadata(null));
public string RobotTarget
{
get { return (string)GetValue(RobotTargetProperty); }
set { SetValue(RobotTargetProperty, value); }
}
public static readonly DependencyProperty RobotTargetProperty =
DependencyProperty.Register("RobotTarget", typeof(string), typeof(BoatElevatorRobot), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
public Dictionary StationPosition
{
get { return (Dictionary)GetValue(StationPositionProperty); }
set { SetValue(StationPositionProperty, value); }
}
// Using a DependencyProperty as the backing store for StationPosition. This enables animation, styling, binding, etc...
public static readonly DependencyProperty StationPositionProperty =
DependencyProperty.Register("StationPosition", typeof(Dictionary), typeof(BoatElevatorRobot), new PropertyMetadata(null, PropertyChangedCallback));
public string ArmAExtended
{
get { return (string)GetValue(ArmAExtendedProperty); }
set { SetValue(ArmAExtendedProperty, value); }
}
// Using a DependencyProperty as the backing store for ArmAExtended. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ArmAExtendedProperty =
DependencyProperty.Register("ArmAExtended", typeof(string), typeof(BoatElevatorRobot), new FrameworkPropertyMetadata(RobotConstant.RobotRetract, FrameworkPropertyMetadataOptions.AffectsRender));
public string ArmBExtended
{
get { return (string)GetValue(ArmBExtendedProperty); }
set { SetValue(ArmBExtendedProperty, value); }
}
// Using a DependencyProperty as the backing store for armBExtended. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ArmBExtendedProperty =
DependencyProperty.Register("ArmBExtended", typeof(string), typeof(BoatElevatorRobot), new FrameworkPropertyMetadata(RobotConstant.RobotRetract, FrameworkPropertyMetadataOptions.AffectsRender));
public WaferInfo[] RobotWafers
{
get { return (WaferInfo[])GetValue(RobotWafersProperty); }
set { SetValue(RobotWafersProperty, value); }
}
// Using a DependencyProperty as the backing store for RobotWafers. This enables animation, styling, binding, etc...
public static readonly DependencyProperty RobotWafersProperty =
DependencyProperty.Register("RobotWafers", typeof(WaferInfo[]), typeof(BoatElevatorRobot), new PropertyMetadata(null, PropertyChangedCallback));
public CB.WaferInfo Wafer1
{
get { return (CB.WaferInfo)GetValue(Wafer1Property); }
set { SetValue(Wafer1Property, value); }
}
// Using a DependencyProperty as the backing store for Wafer1. This enables animation, styling, binding, etc...
public static readonly DependencyProperty Wafer1Property =
DependencyProperty.Register("Wafer1", typeof(CB.WaferInfo), typeof(BoatElevatorRobot), new PropertyMetadata(null));
public CB.WaferInfo Wafer2
{
get { return (CB.WaferInfo)GetValue(Wafer2Property); }
set { SetValue(Wafer2Property, value); }
}
// Using a DependencyProperty as the backing store for Wafer2. This enables animation, styling, binding, etc...
public static readonly DependencyProperty Wafer2Property =
DependencyProperty.Register("Wafer2", typeof(CB.WaferInfo), typeof(BoatElevatorRobot), new PropertyMetadata(null));
private string CurrentPosition;
private string CurrentArmA;
private string CurrentArmB;
public string BoatStatus
{
get
{
return (string)GetValue(BoatStatusProperty);
}
set
{
SetValue(BoatStatusProperty, value);
}
}
// Using a DependencyProperty as the backing store for armBExtended. This enables animation, styling, binding, etc...
public static readonly DependencyProperty BoatStatusProperty =
DependencyProperty.Register("BoatStatus", typeof(string), typeof(BoatElevatorRobot), new FrameworkPropertyMetadata("Init", RobotStatusChangedCallback));
public string RootImagePath
{
get { return (string)GetValue(RootImagePathProperty); }
set { SetValue(RootImagePathProperty, value); }
}
// Using a DependencyProperty as the backing store for RootImagePath. This enables animation, styling, binding, etc...
public static readonly DependencyProperty RootImagePathProperty =
DependencyProperty.Register("RootImagePath", typeof(string), typeof(BoatElevatorRobot), new FrameworkPropertyMetadata("/FurnaceUI;component/Resources/Images/Controls3/02.png", FrameworkPropertyMetadataOptions.AffectsRender));
public string Canvas1ImagePath
{
get { return (string)GetValue(Canvas1ImagePathProperty); }
set { SetValue(Canvas1ImagePathProperty, value); }
}
// Using a DependencyProperty as the backing store for RootImagePath. This enables animation, styling, binding, etc...
public static readonly DependencyProperty Canvas1ImagePathProperty =
DependencyProperty.Register("Canvas1ImagePath", typeof(string), typeof(BoatElevatorRobot), new FrameworkPropertyMetadata("/FurnaceUI;component/Resources/Images/Controls3/lghg.png", FrameworkPropertyMetadataOptions.AffectsRender));
static void RobotStatusChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var self = (BoatElevatorRobot)d;
var test = d;
switch ((string)e.NewValue)
{
case "Homing":
self.Canvas1ImagePath = "/FurnaceUI;component/Resources/Images/Controls3/lghg.png";
break;
case "Error":
self.Canvas1ImagePath = "/FurnaceUI;component/Resources/Images/Controls3/lghg.png";
break;
default:
self.Canvas1ImagePath = "/FurnaceUI;component/Resources/Images/Controls3/lghg.png";
break;
}
}
private List