首次上传

This commit is contained in:
hanqiangqiang
2026-03-24 15:04:02 +08:00
commit 2e080a8764
1392 changed files with 406579 additions and 0 deletions
+125
View File
@@ -0,0 +1,125 @@
<UserControl
x:Class="SicUI.Controls.AITPumpSIC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Aitex.Core.UI.Converters;assembly=MECF.Framework.UI.Core"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="Self"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="110" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<StackPanel
x:Name="StackPanelDryPump"
Margin="0,0,10,0"
HorizontalAlignment="Right"
Orientation="Vertical"
Visibility="{Binding ElementName=Self, Path=IsShowSensor, Converter={StaticResource BoolVisibilityConverter}, Mode=OneWay}">
<StackPanel
x:Name="StackPanelWaterFlow"
Height="22.5"
HorizontalAlignment="Right"
Orientation="Horizontal">
<TextBlock Padding="0,0,5,0" Text="Water Flow" />
<Ellipse
Width="15"
Height="15"
HorizontalAlignment="Left"
Fill="{Binding ElementName=Self, Path=WaterFlowStatusColor, Mode=OneWay}"
Stroke="Gray"
StrokeThickness="2"
Style="{x:Null}" />
</StackPanel>
<StackPanel
x:Name="StackPanelN2Pressure"
Height="22.5"
HorizontalAlignment="Right"
Orientation="Horizontal">
<TextBlock Padding="0,0,5,0" Text="N2 Purge" />
<Ellipse
Width="15"
Height="15"
HorizontalAlignment="Left"
Fill="{Binding ElementName=Self, Path=N2PressureStatusColor, Mode=OneWay}"
Stroke="Gray"
StrokeThickness="2"
Style="{x:Null}" />
</StackPanel>
</StackPanel>
<Image
x:Name="imagePicture"
Grid.Column="1"
Width="109"
Height="45"
Source="/MECF.Framework.Common;component/Resources/Pump/pump_off.png" />
<!-- <Image.ContextMenu>
<ContextMenu Visibility="{Binding ElementName=Self, Path=EnableControl,Converter= {StaticResource BoolVisibilityConverter}, Mode=OneWay}">
<MenuItem Header="Pump On" IsEnabled="{Binding ElementName=Self, Path=EnableControl,Mode=OneWay}" Click="PumpOn"/>
<MenuItem Header="Pump Off" IsEnabled="{Binding ElementName=Self, Path=EnableControl,Mode=OneWay}" Click="PumpOff" />
<MenuItem Header="Pump Utility" IsEnabled="{Binding ElementName=Self, Path=EnableControl,Mode=OneWay}" Click="PumpUtility" />
</ContextMenu>
</Image.ContextMenu>-->
<StackPanel
Grid.Column="2"
Margin="0,5,5,0"
HorizontalAlignment="Left"
Orientation="Vertical"
Visibility="{Binding ElementName=Self, Path=IsShowSpeed, Converter={StaticResource BoolVisibilityConverter}, Mode=OneWay}">
<Border BorderBrush="black" BorderThickness="1,1,1,1">
<StackPanel
Height="18"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Border
Background="DarkGray"
BorderBrush="black"
BorderThickness="0,0,1,0">
<TextBlock
Width="80"
Padding="0,0,5,0"
VerticalAlignment="Center"
Text="Speed(rpm):" />
</Border>
<TextBlock
x:Name="txtSpeed"
Width="60"
Padding="0,0,5,0"
VerticalAlignment="Stretch"
Text="{Binding ElementName=Self, Path=DeviceData.Speed, Mode=OneWay}" />
</StackPanel>
</Border>
<Border BorderBrush="black" BorderThickness="1,0,1,1">
<StackPanel
Height="18"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal">
<Border
Background="DarkGray"
BorderBrush="black"
BorderThickness="0,0,1,0">
<TextBlock
Width="80"
Padding="0,0,5,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="Temp.(°C):" />
</Border>
<TextBlock
x:Name="txtTemp"
Width="60"
Padding="0,0,5,0"
VerticalAlignment="Center"
Text="{Binding ElementName=Self, Path=DeviceData.Temperature, Mode=OneWay}" />
</StackPanel>
</Border>
</StackPanel>
</Grid>
</UserControl>
+211
View File
@@ -0,0 +1,211 @@
using Aitex.Core.Common.DeviceData;
using Aitex.Core.UI.ControlDataContext;
using System;
using System.Collections.Generic;
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;
namespace SicUI.Controls
{
/// <summary>
/// AITPump.xaml 的交互逻辑
/// </summary>
public partial class AITPumpSIC : UserControl
{
public static readonly DependencyProperty DeviceDataProperty = DependencyProperty.Register(
"DeviceData", typeof(AITPumpData), typeof(AITPumpSIC),
new FrameworkPropertyMetadata(new AITPumpData(), FrameworkPropertyMetadataOptions.AffectsRender));
public AITPumpData DeviceData
{
get
{
return (AITPumpData)this.GetValue(DeviceDataProperty);
}
set
{
this.SetValue(DeviceDataProperty, value);
}
}
public static readonly DependencyProperty EnableControlProperty = DependencyProperty.Register(
"EnableControl", typeof(bool), typeof(AITPumpSIC),
new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
public bool EnableControl
{
get
{
return (bool)this.GetValue(EnableControlProperty);
}
set
{
this.SetValue(EnableControlProperty, value);
}
}
public static readonly DependencyProperty IsShowSpeedProperty = DependencyProperty.Register(
"IsShowSpeed", typeof(bool), typeof(AITPumpSIC),
new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
public bool IsShowSpeed
{
get
{
return (bool)this.GetValue(IsShowSpeedProperty);
}
set
{
this.SetValue(IsShowSpeedProperty, value);
}
}
public static readonly DependencyProperty IsShowSensorProperty = DependencyProperty.Register(
"IsShowSensor", typeof(bool), typeof(AITPumpSIC),
new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsRender));
public bool IsShowSensor
{
get
{
return (bool)this.GetValue(IsShowSensorProperty);
}
set
{
this.SetValue(IsShowSensorProperty, value);
}
}
public static readonly DependencyProperty WaterFlowStatusColorProperty = DependencyProperty.Register(
"WaterFlowStatusColor", typeof(SolidColorBrush), typeof(AITPumpSIC),
new FrameworkPropertyMetadata(Brushes.DarkGray, FrameworkPropertyMetadataOptions.AffectsRender));
public SolidColorBrush WaterFlowStatusColor
{
get
{
return (SolidColorBrush)this.GetValue(WaterFlowStatusColorProperty);
}
set
{
this.SetValue(WaterFlowStatusColorProperty, value);
}
}
public static readonly DependencyProperty N2PressureStatusColorProperty = DependencyProperty.Register(
"N2PressureStatusColor", typeof(SolidColorBrush), typeof(AITPumpSIC),
new FrameworkPropertyMetadata(Brushes.DarkGray, FrameworkPropertyMetadataOptions.AffectsRender));
public SolidColorBrush N2PressureStatusColor
{
get
{
return (SolidColorBrush)this.GetValue(N2PressureStatusColorProperty);
}
set
{
this.SetValue(N2PressureStatusColorProperty, value);
}
}
public AITPumpSIC()
{
InitializeComponent();
this.Background = Brushes.Transparent;
}
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
try
{
if (DeviceData == null)
return;
if (DeviceData.IsError || DeviceData.IsOverLoad)
imagePicture.Source = new BitmapImage(new Uri("pack://application:,,,/MECF.Framework.Common;component/Resources/Pump/pump_error.png"));
else if (DeviceData.IsWarning)
imagePicture.Source = new BitmapImage(new Uri("pack://application:,,,/MECF.Framework.Common;component/Resources/Pump/pump_warning.png"));
else if (DeviceData.IsOn)
imagePicture.Source = new BitmapImage(new Uri("pack://application:,,,/MECF.Framework.Common;component/Resources/Pump/pump_on.png"));
else
imagePicture.Source = new BitmapImage(new Uri("pack://application:,,,/MECF.Framework.Common;component/Resources/Pump/pump_off.png"));
StackPanelN2Pressure.Visibility = (DeviceData.IsN2PressureEnable && IsShowSensor) ? Visibility.Visible : Visibility.Hidden;
StackPanelWaterFlow.Visibility = (DeviceData.IsWaterFlowEnable && IsShowSensor) ? Visibility.Visible : Visibility.Hidden;
StackPanelDryPump.Visibility = (DeviceData.IsDryPumpEnable && IsShowSensor) ? Visibility.Visible : Visibility.Hidden;
WaterFlowStatusColor = DeviceData.WaterFlowAlarm
? Brushes.Red
: (DeviceData.WaterFlowWarning ? Brushes.Yellow : Brushes.Lime);
N2PressureStatusColor = DeviceData.N2PressureAlarm
? Brushes.Red
: (DeviceData.N2PressureWarning ? Brushes.Yellow : Brushes.Lime);
txtSpeed.Background = DeviceData.AtSpeed ? Brushes.Transparent : Brushes.LimeGreen;
txtTemp.Background = DeviceData.OverTemp ? Brushes.OrangeRed : Brushes.Transparent;
//if (imagePicture.ContextMenu != null && imagePicture.ContextMenu.Items.Count == 3)
//{
// ((MenuItem)imagePicture.ContextMenu.Items[0]).IsEnabled = !DeviceData25.IsOn;
// ((MenuItem)imagePicture.ContextMenu.Items[1]).IsEnabled = DeviceData25.IsOn;
// ((MenuItem)imagePicture.ContextMenu.Items[2]).IsEnabled = DeviceData25.IsOn;
//}
}
catch( Exception ex)
{
string str = ex.ToString();
}
}
private void Grid_MouseEnter(object sender, MouseEventArgs e)
{
if (DeviceData != null)
{
//string tooltipValue =
// string.Format("{0}:{1}\r\n\r\nID:{2} ",
// "",
// DeviceData.DisplayName,
// DeviceData.DeviceSchematicId);
//ToolTip = tooltipValue;
}
}
private void PumpOn(object sender, RoutedEventArgs e)
{
if (EnableControl)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.DeviceModule}.{DeviceData.DeviceName}.PumpStart");
}
}
private void PumpOff(object sender, RoutedEventArgs e)
{
if (EnableControl)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.DeviceModule}.{DeviceData.DeviceName}.PumpStop");
}
}
private void PumpUtility(object sender, RoutedEventArgs e)
{
if (EnableControl)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.DeviceModule}.{DeviceData.DeviceName}.PumpUtility");
}
}
}
}
+46
View File
@@ -0,0 +1,46 @@
<UserControl
x:Class="SicUI.Controls.AnalogControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Width="45"
Height="20"
BorderThickness="1"
mc:Ignorable="d">
<Grid>
<Grid
Height="20"
Margin="-2"
Cursor="Hand"
MouseEnter="Grid_MouseEnter"
MouseLeftButtonUp="Grid_MouseLeftButtonUp"
MouseRightButtonUp="Grid_MouseRightButtonUp"
Opacity="1">
<Border
x:Name="bdRectangle"
Background="Transparent"
BorderThickness="1">
<Rectangle
Name="rectBkground"
Margin="1"
Fill="Green"
Opacity="1"
RadiusX="2"
RadiusY="2"
Stroke="Gray"
StrokeThickness="1" />
</Border>
<TextBlock
x:Name="labelValue"
Margin="0,-2,-2,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="Arial,SimSun"
FontSize="9"
Foreground="LightYellow"
Text="0.0" />
</Grid>
</Grid>
</UserControl>
+342
View File
@@ -0,0 +1,342 @@
using Aitex.Core.Common.DeviceData;
using Aitex.Core.UI.ControlDataContext;
using System;
using System.Collections.Generic;
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;
namespace SicUI.Controls
{
/// <summary>
/// AnalogControl.xaml 的交互逻辑
/// </summary>
public partial class AnalogControl : UserControl
{
public AnalogControl()
{
InitializeComponent();
}
// define dependency properties
public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
"Command", typeof(ICommand), typeof(AnalogControl),
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DeviceDataProperty = DependencyProperty.Register(
"DeviceData", typeof(AITPressureMeterData), typeof(AnalogControl),
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender,
new PropertyChangedCallback(OnDeviceDataChanged)));
public static readonly DependencyProperty OperationNameProperty = DependencyProperty.Register(
"OperationName", typeof(string), typeof(AnalogControl),
new FrameworkPropertyMetadata(AnalogDeviceOperation.Ramp, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty BackColorProperty = DependencyProperty.Register(
"BackColor", typeof(Brush), typeof(AnalogControl),
new FrameworkPropertyMetadata(Brushes.Green, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty HideDialogProperty = DependencyProperty.Register(
"HideDialog", typeof(bool), typeof(AnalogControl),
new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
private static void OnDeviceDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
}
/// <summary>
/// 输入值是否百分比,默认否
/// </summary>
public bool IsPercent { get; set; }
public ICommand Command
{
get
{
return (ICommand)this.GetValue(CommandProperty);
}
set
{
this.SetValue(CommandProperty, value);
}
}
/// <summary>
/// set, get current progress value AnalogDeviceData
/// </summary>
public AITPressureMeterData DeviceData
{
get
{
return (AITPressureMeterData)this.GetValue(DeviceDataProperty);
}
set
{
this.SetValue(DeviceDataProperty, value);
}
}
public Brush BackColor
{
get
{
return (Brush)this.GetValue(BackColorProperty);
}
set
{
this.SetValue(BackColorProperty, value);
}
}
public string OperationName
{
get
{
return (string)this.GetValue(OperationNameProperty);
}
set
{
this.SetValue(OperationNameProperty, value);
}
}
public bool HideDialog
{
get
{
return (bool)this.GetValue(HideDialogProperty);
}
set
{
this.SetValue(HideDialogProperty, value);
}
}
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
//draw background color
rectBkground.Fill = BackColor;
if (DeviceData != null)
{
//draw red board if mfc meets a warning
rectBkground.Stroke = DeviceData.IsWarning ? Brushes.Orange : Brushes.Gray;
rectBkground.Stroke = DeviceData.IsError ? Brushes.Red : Brushes.Gray;
//draw reading value
if (IsPercent)
labelValue.Text = (DeviceData.FeedBack * 100).ToString(DeviceData.FormatString);
else
labelValue.Text = DeviceData.FeedBack.ToString(DeviceData.FormatString);
labelValue.Foreground = DeviceData.IsWarning ? Brushes.Pink : Brushes.LightYellow;
labelValue.Foreground = DeviceData.IsError ? Brushes.Red : Brushes.LightYellow;
rectBkground.StrokeThickness = (DeviceData.IsWarning | DeviceData.IsError) ? 2 : 1;
if (dialogBox != null)
{
if (IsPercent)
dialogBox.RealValue = (DeviceData.FeedBack * 100).ToString(DeviceData.FormatString) + "%";
else
dialogBox.RealValue = DeviceData.FeedBack.ToString(DeviceData.FormatString);
}
}
}
private InputDialogBox dialogBox;
public Window AnalogOwner { get; set; }
private void Grid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (DeviceData == null)
return;
if (HideDialog)
return;
if (DeviceData.ActMode != (double)PcCtrlMode.Normal)
{
MessageBox.Show("Not normal mode,Click mouse right buttom to change!");
return;
}
dialogBox = new InputDialogBox
{
CommandDelegate = Execute,
DeviceName = string.Format("{0}: {1}", DeviceData.Type, DeviceData.DisplayName),
DeviceId = DeviceData.DeviceSchematicId,
DefaultValue = DeviceData.DefaultValue,
RealValue = DeviceData.FeedBack.ToString(DeviceData.FormatString),
SetPoint = Math.Round(DeviceData.SetPoint, 1),
MaxValue = DeviceData.Scale,
Unit = DeviceData.Unit,
};
dialogBox.IsPercent = IsPercent;
if (IsPercent)
dialogBox.SetPoint = Math.Round(DeviceData.SetPoint * 100.0, 1);
if (AnalogOwner != null)
dialogBox.Owner = AnalogOwner;
dialogBox.Topmost = true;
dialogBox.WindowStartupLocation = WindowStartupLocation.CenterScreen;
dialogBox.FocasAll();
dialogBox.ShowDialog();
dialogBox = null;
}
#region MouseRightButton
private void Grid_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
if (HideDialog)
return;
ContextMenu mouseClickMenu = new ContextMenu();
MenuItem item = new MenuItem();
item.Header = "_" + DeviceData.DeviceName;
item.IsEnabled = false;
mouseClickMenu.Items.Add(item);
addNormalMenu(mouseClickMenu, item);
addCloseMenu(mouseClickMenu, item);
addOpenMenu(mouseClickMenu, item);
addHoldMenu(mouseClickMenu, item);
mouseClickMenu.IsOpen = true;
}
void addNormalMenu(ContextMenu mouseClickMenu, MenuItem item)
{
item = new MenuItem();
item.Header = "Normal";
item.Click += NormalMode;
item.Tag = this.Tag;
mouseClickMenu.Items.Add(item);
}
private void NormalMode(object sender, RoutedEventArgs e)
{
SetNormalMode(PcCtrlMode.Normal);
}
void addCloseMenu(ContextMenu mouseClickMenu, MenuItem item)
{
item = new MenuItem();
item.Header = "Close";
item.Click += CloseMode;
item.Tag = this.Tag;
mouseClickMenu.Items.Add(item);
}
private void CloseMode(object sender, RoutedEventArgs e)
{
SetCloseMode(PcCtrlMode.Close);
}
void addOpenMenu(ContextMenu mouseClickMenu, MenuItem item)
{
item = new MenuItem();
item.Header = "Open";
item.Click += OpenMode;
item.Tag = this.Tag;
mouseClickMenu.Items.Add(item);
}
private void OpenMode(object sender, RoutedEventArgs e)
{
SetOpenMode(PcCtrlMode.Open);
}
void addHoldMenu(ContextMenu mouseClickMenu, MenuItem item)
{
item = new MenuItem();
item.Header = "Hold";
item.Click += HoldMode;
item.Tag = this.Tag;
mouseClickMenu.Items.Add(item);
}
private void HoldMode(object sender, RoutedEventArgs e)
{
SetHoldMode(PcCtrlMode.Hold);
}
private void SetNormalMode(PcCtrlMode value)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.SetMode", value.ToString());
}
private void SetCloseMode(PcCtrlMode value)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.SetMode", value.ToString());
}
private void SetOpenMode(PcCtrlMode value)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.SetMode", value.ToString());
}
private void SetHoldMode(PcCtrlMode value)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.SetMode", value.ToString());
}
#endregion
private void Execute(double value)
{
//Command.Execute(new object[] { $"{DeviceData.Module}.{DeviceData.DeviceName}", OperationName, value });
InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.Ramp", value);
}
private void Grid_MouseEnter(object sender, MouseEventArgs e)
{
if (DeviceData != null)
{
//string tooltipValue =
// string.Format("{0}:{1}\r\n\r\nID:{2}\r\nScale:{3} {4}\r\nSetPoint:{5} {4} \r\nFeedback:{6} {4}\r\nTolerance:{7}%\r\nStatus:{8}",
// DeviceData.Type,
// DeviceData.DisplayName,
// DeviceData.DeviceSchematicId,
// DeviceData.Scale,
// DeviceData.Unit,
// IsPercent ? (DeviceData.SetPoint * 100).ToString(DeviceData.FormatString) + "%" : DeviceData.SetPoint.ToString(DeviceData.FormatString),
// IsPercent ? (DeviceData.FeedBack * 100).ToString(DeviceData.FormatString) + "%" : DeviceData.FeedBack.ToString(DeviceData.FormatString),
// DeviceData.Scale > 0 ? ((DeviceData.FeedBack - DeviceData.SetPoint) / DeviceData.Scale * 100).ToString(DeviceData.FormatString) : "0",
// DeviceData.IsWarning ? "Tolerance Warning" : "Normal");
//ToolTip = tooltipValue;
string tooltipValue =
string.Format("Scale:{3} {4}\r\nSetPoint:{5} {4} \r\nFeedback:{6} {4} \r\nOpenDegree: {9}%",
DeviceData.Type,
DeviceData.DisplayName,
DeviceData.DeviceSchematicId,
DeviceData.Scale,
DeviceData.Unit,
IsPercent ? (DeviceData.SetPoint * 100).ToString(DeviceData.FormatString) + "%" : DeviceData.SetPoint.ToString(DeviceData.FormatString),
IsPercent ? (DeviceData.FeedBack * 100).ToString(DeviceData.FormatString) + "%" : DeviceData.FeedBack.ToString(DeviceData.FormatString),
DeviceData.Scale > 0 ? ((DeviceData.FeedBack - DeviceData.SetPoint) / DeviceData.Scale * 100).ToString(DeviceData.FormatString) : "0",
DeviceData.IsWarning ? "Tolerance Warning" : "Normal",
DeviceData.OpenDegree.ToString("0.0"));
ToolTip = tooltipValue;
}
}
}
}
+64
View File
@@ -0,0 +1,64 @@
<UserControl
x:Class="SicUI.Controls.AnalogControl2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Width="45"
Height="38"
BorderThickness="1"
mc:Ignorable="d">
<Grid
Height="38"
Cursor="Hand"
MouseEnter="Grid_MouseEnter"
MouseLeftButtonUp="Grid_MouseLeftButtonUp"
MouseRightButtonUp="Grid_MouseRightButtonUp"
Opacity="1">
<Grid Height="20" Margin="0,-20,0,0">
<Border
x:Name="bdRectangle"
Background="Transparent"
BorderThickness="1">
<Rectangle
Name="rectBkground"
Margin="1"
Fill="Green"
Opacity="1"
RadiusX="2"
RadiusY="2"
Stroke="Gray"
StrokeThickness="1" />
</Border>
<TextBlock
x:Name="labelValue"
Margin="0,-1,-2,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="Arial,SimSun"
FontSize="10"
Foreground="LightYellow"
Text="0.0" />
</Grid>
<Grid Height="18" Margin="1,14,1,1">
<Rectangle
Name="rectSetPoint"
Margin="1"
Fill="#999999"
Opacity="1"
RadiusX="2"
RadiusY="2"
Stroke="Gray"
StrokeThickness="1" />
<TextBlock
x:Name="labelSetPoint"
Margin="0,-1,-2,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="Arial,SimSun"
FontSize="10"
Foreground="LightYellow"
Text="0.0" />
</Grid>
</Grid>
</UserControl>
+403
View File
@@ -0,0 +1,403 @@
using Aitex.Core.Common.DeviceData;
using Aitex.Core.UI.ControlDataContext;
using Caliburn.Micro;
using MECF.Framework.UI.Client.Ctrlib.UnitControls;
using System;
using System.Collections.Generic;
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;
namespace SicUI.Controls
{
/// <summary>
/// AnalogControl2.xaml 的交互逻辑
/// </summary>
public partial class AnalogControl2 : UserControl
{
public AnalogControl2()
{
InitializeComponent();
// LabelSet = "0.0";
}
public event Action<string, string> clickAct;
// define dependency properties
public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
"Command", typeof(ICommand), typeof(AnalogControl2),
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DeviceDataProperty = DependencyProperty.Register(
"DeviceData", typeof(AITMfcData), typeof(AnalogControl2),
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender,
new PropertyChangedCallback(OnDeviceDataChanged)));
public static readonly DependencyProperty OperationNameProperty = DependencyProperty.Register(
"OperationName", typeof(string), typeof(AnalogControl2),
new FrameworkPropertyMetadata(AnalogDeviceOperation.Ramp, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty BackColorProperty = DependencyProperty.Register(
"BackColor", typeof(Brush), typeof(AnalogControl2),
new FrameworkPropertyMetadata(Brushes.Green, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty HideDialogProperty = DependencyProperty.Register(
"HideDialog", typeof(bool), typeof(AnalogControl2),
new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty LabelSetProperty = DependencyProperty.Register(
"LabelSet", typeof(object), typeof(AnalogControl2),
new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
private static void OnDeviceDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
}
/// <summary>
/// 输入值是否百分比,默认否
/// </summary>
public bool IsPercent { get; set; }
public ICommand Command
{
get
{
return (ICommand)this.GetValue(CommandProperty);
}
set
{
this.SetValue(CommandProperty, value);
}
}
/// <summary>
/// set, get current progress value AnalogDeviceData
/// </summary>
public AITMfcData DeviceData
{
get
{
return (AITMfcData)this.GetValue(DeviceDataProperty);
}
set
{
this.SetValue(DeviceDataProperty, value);
}
}
public Brush BackColor
{
get
{
return (Brush)this.GetValue(BackColorProperty);
}
set
{
this.SetValue(BackColorProperty, value);
}
}
public string OperationName
{
get
{
return (string)this.GetValue(OperationNameProperty);
}
set
{
this.SetValue(OperationNameProperty, value);
}
}
public bool HideDialog
{
get
{
return (bool)this.GetValue(HideDialogProperty);
}
set
{
this.SetValue(HideDialogProperty, value);
}
}
public object LabelSet
{
get
{
return (object)this.GetValue(LabelSetProperty);
}
set
{
this.SetValue(LabelSetProperty, value);
}
}
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
//draw background color
rectBkground.Fill = BackColor;
if (DeviceData != null)
{
string format = "0.0";
#region FeedBack
//draw red board if mfc meets a warning
rectBkground.Stroke = DeviceData.IsWarning ? Brushes.Orange : Brushes.Gray;
rectBkground.Stroke = DeviceData.IsError ? Brushes.Red : Brushes.Gray;
//draw reading value
if (IsPercent)
labelValue.Text = (DeviceData.FeedBack * 100).ToString(format);
else
labelValue.Text = DeviceData.FeedBack.ToString(format);
labelValue.Foreground = DeviceData.IsWarning ? Brushes.Pink : Brushes.LightYellow;
labelValue.Foreground = DeviceData.IsError ? Brushes.Red : Brushes.LightYellow;
rectBkground.StrokeThickness = (DeviceData.IsWarning | DeviceData.IsError) ? 2 : 1;
if (dialogBox != null)
{
dialogBox.DeviceData = DeviceData;
dialogBox.DeviceData.InvokePropertyChanged();
}
#endregion
#region SetPoint
//draw red board if mfc meets a warning
rectSetPoint.Stroke = DeviceData.IsWarning ? Brushes.Orange : Brushes.Gray;
rectBkground.Stroke = DeviceData.IsError ? Brushes.Red : Brushes.Gray;
////draw reading value
if (IsPercent)
// LabelSet = (DeviceData.SetPoint * 100).ToString("F1");
labelSetPoint.Text = (DeviceData.SetPoint * 100).ToString(format);
else
//LabelSet = (object)DeviceData.SetPoint.ToString("F1");
labelSetPoint.Text = DeviceData.SetPoint.ToString(format);
//VerticalContentAlignment = "Center" HorizontalContentAlignment = "Center"
labelSetPoint.Foreground = DeviceData.IsWarning ? Brushes.Pink : Brushes.LightYellow;
labelValue.Foreground = DeviceData.IsError ? Brushes.Red : Brushes.LightYellow;
rectSetPoint.StrokeThickness = (DeviceData.IsWarning | DeviceData.IsError) ? 2 : 1;
#endregion
}
}
private MfcSettingDialogViewModel dialogBox;
public Window AnalogOwner { get; set; }
private void Grid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (DeviceData == null)
return;
if (HideDialog)
return;
if (DeviceData.ActMode != (double)MfcCtrlMode.Normal)
{
MessageBox.Show("Not normal mode,Click mouse right buttom to change!");
return;
}
//dialogBox = new InputDialogBox
//{
// CommandDelegate = Execute,
// DeviceName = string.Format("{0}: {1}", DeviceData.Type, DeviceData.DisplayName),
// DeviceId = DeviceData.DeviceSchematicId,
// DefaultValue = DeviceData.DefaultValue,
// RealValue = DeviceData.FeedBack.ToString("F1"),
// SetPoint = Math.Round(DeviceData.SetPoint, 1),
// MaxValue = DeviceData.Scale,
// Unit = DeviceData.Unit,
//};
//dialogBox.IsPercent = IsPercent;
//if (IsPercent)
// dialogBox.SetPoint = Math.Round(DeviceData.SetPoint * 100.0, 1);
//if (AnalogOwner != null)
// dialogBox.Owner = AnalogOwner;
//dialogBox.Topmost = true;
//dialogBox.WindowStartupLocation = WindowStartupLocation.CenterScreen;
//dialogBox.FocasAll();
//dialogBox.ShowDialog();
//dialogBox = null;
dialogBox = new MfcSettingDialogViewModel($"MFC {DeviceData.DisplayName} Setting");
dialogBox.DeviceData = DeviceData;
dialogBox.InputSetPoint = DeviceData.SetPoint.ToString("F1");
WindowManager wm = new WindowManager();
Window owner = Application.Current.MainWindow;
if (owner != null)
{
Mouse.Capture(owner);
Point pointToWindow = Mouse.GetPosition(owner);
Point pointToScreen = owner.PointToScreen(pointToWindow);
pointToScreen.X = pointToScreen.X + 50;
pointToScreen.Y = pointToScreen.Y - 150;
Mouse.Capture(null);
//wm.ShowDialog(dialogBox, pointToScreen);
wm.ShowDialog(dialogBox);
}
else
{
wm.ShowDialog(dialogBox);
}
}
#region MouseRightButton
private void Grid_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
ContextMenu mouseClickMenu = new ContextMenu();
MenuItem item = new MenuItem();
item.Header = "_" + DeviceData.DeviceName;
item.IsEnabled = false;
mouseClickMenu.Items.Add(item);
addNormalMenu(mouseClickMenu, item);
addCloseMenu(mouseClickMenu, item);
addOpenMenu(mouseClickMenu, item);
addHoldMenu(mouseClickMenu, item);
mouseClickMenu.IsOpen = true;
}
void addNormalMenu(ContextMenu mouseClickMenu, MenuItem item)
{
item = new MenuItem();
item.Header = "Normal";
item.Click += NormalMode;
item.Tag = this.Tag;
mouseClickMenu.Items.Add(item);
}
private void NormalMode(object sender, RoutedEventArgs e)
{
SetNormalMode(MfcCtrlMode.Normal);
}
void addCloseMenu(ContextMenu mouseClickMenu, MenuItem item)
{
item = new MenuItem();
item.Header = "Close";
item.Click += CloseMode;
item.Tag = this.Tag;
mouseClickMenu.Items.Add(item);
}
private void CloseMode(object sender, RoutedEventArgs e)
{
SetCloseMode(MfcCtrlMode.Close);
}
void addOpenMenu(ContextMenu mouseClickMenu, MenuItem item)
{
item = new MenuItem();
item.Header = "Open";
item.Click += OpenMode;
item.Tag = this.Tag;
mouseClickMenu.Items.Add(item);
}
private void OpenMode(object sender, RoutedEventArgs e)
{
SetOpenMode(MfcCtrlMode.Open);
}
void addHoldMenu(ContextMenu mouseClickMenu, MenuItem item)
{
item = new MenuItem();
item.Header = "Hold";
item.Click += HoldMode;
item.Tag = this.Tag;
mouseClickMenu.Items.Add(item);
}
private void HoldMode(object sender, RoutedEventArgs e)
{
SetHoldMode(MfcCtrlMode.Hold);
}
private void SetNormalMode(MfcCtrlMode value)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.SetMode", value.ToString());
}
private void SetCloseMode(MfcCtrlMode value)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.SetMode", value.ToString());
}
private void SetOpenMode(MfcCtrlMode value)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.SetMode", value.ToString());
}
private void SetHoldMode(MfcCtrlMode value)
{
InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.SetMode", value.ToString());
}
#endregion
private void Execute(double value)
{
Command.Execute(new object[] {DeviceData.UniqueName, OperationName, value });
}
private void Grid_MouseEnter(object sender, MouseEventArgs e)
{
string format = "0.0";
if (DeviceData != null)
{
string tooltipValue =
string.Format("{0}:{1}\r\n\r\nID:{2}\r\nScale:{3} {4}\r\nSetPoint:{5} {4} \r\nFeedback:{6} {4}\r\nTolerance:{7}%\r\nStatus:{8}",
DeviceData.Type,
DeviceData.DisplayName,
DeviceData.DeviceSchematicId,
DeviceData.Scale,
DeviceData.Unit,
IsPercent ? (DeviceData.SetPoint * 100).ToString(format) + "%" : DeviceData.SetPoint.ToString(format),
IsPercent ? (DeviceData.FeedBack * 100).ToString(format) + "%" : DeviceData.FeedBack.ToString(format),
DeviceData.Scale > 0 ? ((DeviceData.FeedBack - DeviceData.SetPoint) / DeviceData.Scale * 100).ToString(format) : "0",
DeviceData.IsWarning ? "Tolerance Warning" : "Normal") ;
ToolTip = tooltipValue;
}
if (DeviceData != null)
{
string tooltipValue =
$"{DeviceData.Type}:{DeviceData.DisplayName}\r\n\r\nID:{DeviceData.DeviceSchematicId}\r\nScale:{DeviceData.Scale} {DeviceData.Unit}\r\nSetPoint:{DeviceData.SetPoint.ToString(format)} {DeviceData.Unit} \r\nFeedback:{DeviceData.FeedBack.ToString(format)} {DeviceData.Unit}";
ToolTip = tooltipValue;
}
}
}
}
+109
View File
@@ -0,0 +1,109 @@
<UserControl
x:Class="SicUI.Controls.BodyBottom"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:common="clr-namespace:SicUI.Controls.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="666"
d:DesignWidth="666"
mc:Ignorable="d">
<Canvas Width="666" Height="666">
<Canvas
Canvas.Left="335"
Canvas.Top="403"
Width="330"
Height="263">
<common:AxisCanvas
x:Name="canvasButtom"
Canvas.Top="0"
Width="327"
Height="170">
<Image
x:Name="PicB21"
Canvas.Left="78"
Canvas.Top="30"
Width="18"
Height="160"
Source="/SicUI;component/Themes/Images/parts/bodymove/bottom4.png" />
<Image
x:Name="PicB22"
Canvas.Left="229"
Canvas.Top="30"
Width="18"
Height="160"
Source="/SicUI;component/Themes/Images/parts/bodymove/bottom4.png" />
<Image
x:Name="PicBottom"
Canvas.Left="0"
Canvas.Top="0"
Width="327"
Height="54"
Source="/SicUI;component/Themes/Images/parts/bodymove/Bottom.png" />
</common:AxisCanvas>
<Image
x:Name="PicB31"
Canvas.Left="67"
Canvas.Top="160"
Width="42"
Height="106"
Source="/SicUI;component/Themes/Images/parts/bodymove/bottom3.png" />
<Image
x:Name="PicB32"
Canvas.Left="217"
Canvas.Top="160"
Width="42"
Height="106"
Source="/SicUI;component/Themes/Images/parts/bodymove/bottom3.png" />
</Canvas>
<Canvas Canvas.Left="395" Canvas.Top="337">
<common:AxisCanvas x:Name="canvasRing2">
<Image
Width="206"
Height="58"
Source="/SicUI;component/Themes/Images/parts/bodymove/ht2.png" />
</common:AxisCanvas>
</Canvas>
<Image
Canvas.Left="335"
Canvas.Top="316"
Width="327"
Height="123"
Source="/SicUI;component/Themes/Images/parts/bodymove/Fixed.png" />
<Canvas Canvas.Left="395" Canvas.Top="357">
<common:AxisCanvas x:Name="canvasRing">
<Image
Width="206"
Height="58"
Source="/SicUI;component/Themes/Images/parts/bodymove/ht1.png" />
</common:AxisCanvas>
<Image
x:Name="PicBR"
Canvas.Left="212"
Canvas.Top="40"
Width="35"
Height="35"
Source="/SicUI;component/Themes/Images/parts/bodymove/khr.png" />
<Image
x:Name="PicBL"
Canvas.Left="-38"
Canvas.Top="40"
Width="35"
Height="35"
Source="/SicUI;component/Themes/Images/parts/bodymove/khl.png" />
</Canvas>
</Canvas>
</UserControl>
+268
View File
@@ -0,0 +1,268 @@
using System;
using System.Collections.Generic;
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;
namespace SicUI.Controls
{
/// <summary>
/// BodyBottom.xaml 的交互逻辑
/// </summary>
public partial class BodyBottom : UserControl
{
//private bool _isSectionDown = false;
//private bool _isSectionUp = false;
private bool _isRingDown = false;
//private bool _canMoveButton = false;
public BodyBottom()
{
InitializeComponent();
}
//public int SectionUpTime
//{
// get { return (int)GetValue(SectionUpTimeProperty); }
// set { SetValue(SectionUpTimeProperty, value); }
//}
//public static readonly DependencyProperty SectionUpTimeProperty = DependencyProperty.Register("SectionUpTime", typeof(int), typeof(BodyBottom), new FrameworkPropertyMetadata(5000));
//public int SwingTime
//{
// get { return (int)GetValue(SwingTimeProperty); }
// set { SetValue(SwingTimeProperty, value); }
//}
//public static readonly DependencyProperty SwingTimeProperty = DependencyProperty.Register("SwingTime", typeof(int), typeof(BodyBottom), new FrameworkPropertyMetadata(5000));
public int RingTime
{
get { return (int)GetValue(RingTimeProperty); }
set { SetValue(RingTimeProperty, value); }
}
public static readonly DependencyProperty RingTimeProperty = DependencyProperty.Register("RingTime", typeof(int), typeof(BodyBottom), new FrameworkPropertyMetadata(5000));
//public bool MovingSectionUp
//{
// get { return (Boolean)GetValue(MovingSectionUpProperty); }
// set { SetValue(MovingSectionUpProperty, value); }
//}
//public static readonly DependencyProperty MovingSectionUpProperty =
// DependencyProperty.Register("MovingSectionUp", typeof(bool), typeof(BodyBottom), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
//public bool MovingSectionDown
//{
// get { return (Boolean)GetValue(MovingSectionDownProperty); }
// set { SetValue(MovingSectionDownProperty, value); }
//}
//public static readonly DependencyProperty MovingSectionDownProperty =
// DependencyProperty.Register("MovingSectionDown", typeof(bool), typeof(BodyBottom), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
//public bool SectionUpFeedBack
//{
// get { return (Boolean)GetValue(SectionUpFeedBackProperty); }
// set { SetValue(SectionUpFeedBackProperty, value); }
//}
//public static readonly DependencyProperty SectionUpFeedBackProperty =
// DependencyProperty.Register("SectionUpFeedBack", typeof(bool), typeof(BodyBottom), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
//public bool SectionDownFeedBack
//{
// get { return (Boolean)GetValue(SectionDownFeedBackProperty); }
// set { SetValue(SectionDownFeedBackProperty, value); }
//}
//public static readonly DependencyProperty SectionDownFeedBackProperty =
// DependencyProperty.Register("SectionDownFeedBack", typeof(bool), typeof(BodyBottom), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool MovingRingUp
{
get { return (Boolean)GetValue(MovingRingUpProperty); }
set { SetValue(MovingRingUpProperty, value); }
}
public static readonly DependencyProperty MovingRingUpProperty =
DependencyProperty.Register("MovingRingUp", typeof(bool), typeof(BodyBottom), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool MovingRingDown
{
get { return (Boolean)GetValue(MovingRingDownProperty); }
set { SetValue(MovingRingDownProperty, value); }
}
public static readonly DependencyProperty MovingRingDownProperty =
DependencyProperty.Register("MovingRingDown", typeof(bool), typeof(BodyBottom), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool RingUpFeedBack
{
get { return (Boolean)GetValue(RingUpFeedBackProperty); }
set { SetValue(RingUpFeedBackProperty, value); }
}
public static readonly DependencyProperty RingUpFeedBackProperty =
DependencyProperty.Register("RingUpFeedBack", typeof(bool), typeof(BodyBottom), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool RingDownFeedBack
{
get { return (Boolean)GetValue(RingDownFeedBackProperty); }
set { SetValue(RingDownFeedBackProperty, value); }
}
public static readonly DependencyProperty RingDownFeedBackProperty =
DependencyProperty.Register("RingDownFeedBack", typeof(bool), typeof(BodyBottom), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
//public bool TightenBotton
//{
// get { return (Boolean)GetValue(TightenBottonProperty); }
// set { SetValue(TightenBottonProperty, value); }
//}
//public static readonly DependencyProperty TightenBottonProperty =
// DependencyProperty.Register("TightenBotton", typeof(bool), typeof(BodyBottom), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
//public bool SwingLockBotton
//{
// get { return (Boolean)GetValue(SwingLockBottonProperty); }
// set { SetValue(SwingLockBottonProperty, value); }
//}
//public static readonly DependencyProperty SwingLockBottonProperty =
// DependencyProperty.Register("SwingLockBotton", typeof(bool), typeof(BodyBottom), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
//初始位置
//if (_isSectionDown != SectionDownFeedBack || _isSectionUp != SectionUpFeedBack)
//{
// _isSectionUp = SectionUpFeedBack;
// _isSectionDown = SectionDownFeedBack;
// Dispatcher.Invoke(() => MoveSectionDown(SectionDownFeedBack, 0));
//}
if (_isRingDown != MovingRingDown)
{
Dispatcher.Invoke(() => MoveRingDown(true, 0));
}
//SetPicVisble();
//SetBodyImage();
//按钮移动
//if (MovingSectionUp && _canMoveButton && SectionDownFeedBack)
//{
// Dispatcher.Invoke(() => MoveSectionDown(false, SectionUpTime));
//}
//else if (MovingSectionDown && _canMoveButton && SectionUpFeedBack)
//{
// Dispatcher.Invoke(() => MoveSectionDown(true, SectionUpTime));
//}
if (MovingRingDown && RingUpFeedBack)
{
Dispatcher.Invoke(() => MoveRingDown(true, RingTime));
}
else if (MovingRingUp && RingDownFeedBack)
{
Dispatcher.Invoke(() => MoveRingDown(false, RingTime));
}
}
//private void SetPicVisble()
//{
// if (TightenBotton)
// {
// PicBL.Visibility = Visibility.Visible;
// PicBR.Visibility = Visibility.Visible;
// }
// else
// {
// PicBL.Visibility = Visibility.Collapsed;
// PicBR.Visibility = Visibility.Collapsed;
// }
//}
//private void SetBodyImage()
//{
// if (!TightenBotton && !SwingLockBotton)
// {
// this.PicBottom.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/Bottom2.png"));
// this.PicB21.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/bottom4f.png"));
// this.PicB22.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/bottom4f.png"));
// _canMoveButton = true;
// }
// else
// {
// this.PicBottom.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/Bottom.png"));
// this.PicB21.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/bottom4.png"));
// this.PicB22.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/bottom4.png"));
// _canMoveButton = false;
// }
//}
//private void MoveSectionDown(bool down,int time, Action onComplete = null)
//{
// this.canvasButtom.Stop();
// int orgYPoint = 0;
// int desYPoint = 0;
// if (down)
// {
// orgYPoint = 0;
// desYPoint = 30;
// }
// else
// {
// orgYPoint = 30;
// desYPoint = 0;
// }
// this.canvasButtom.MoveToUpDown(orgYPoint, desYPoint, time,onComplete);
//}
private void MoveRingDown(bool down, int time, Action onComplete = null)
{
this.canvasRing.Stop();
this.canvasRing2.Stop();
int orgYPoint = 0;
int desYPoint = 0;
if (down)
{
orgYPoint = 0;
desYPoint = 18;
}
else
{
orgYPoint = 18;
desYPoint = 0;
}
this.canvasRing.MoveToUpDown(orgYPoint, desYPoint, time, onComplete);
this.canvasRing2.MoveToUpDown(orgYPoint, desYPoint, time, onComplete);
}
}
}
+156
View File
@@ -0,0 +1,156 @@
<UserControl
x:Class="SicUI.Controls.BodyLid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:common="clr-namespace:SicUI.Controls.Common"
xmlns:converters="clr-namespace:SicUI.Converter"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="320"
d:DesignWidth="666"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/MECF.Framework.UI.Client;component/Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Canvas>
<!-- 底部区域 -->
<!--
<Canvas Canvas.Left="335" Canvas.Top="353">
<common:AxisBorder x:Name="bdButton" Width="327" Height="170" Canvas.Top="0" >
<Canvas Width="327" Height="170" Canvas.Top="0" >
<Image Width="160" Height="34" Source="/SicUI;component/Themes/Images/parts/bodymove/hx1.png" Canvas.Left="95" Canvas.Top="0" >
<Image.RenderTransform>
<RotateTransform Angle="90"/>
</Image.RenderTransform>
</Image>
<Image Width="160" Height="34" Source="/SicUI;component/Themes/Images/parts/bodymove/hx1.png" Canvas.Left="245" Canvas.Top="0" >
<Image.RenderTransform>
<RotateTransform Angle="90"/>
</Image.RenderTransform>
</Image>
<Image Width="327" Height="54" Source="/SicUI;component/Themes/Images/parts/bodymove/Bottom.png" Canvas.Left="0" Canvas.Top="0" />
</Canvas>
</common:AxisBorder>
<Image Width="42" Height="106" Source="/SicUI;component/Themes/Images/parts/bodymove/bottom3.png" Canvas.Left="67" Canvas.Top="160" />
<Image Width="42" Height="106" Source="/SicUI;component/Themes/Images/parts/bodymove/bottom3.png" Canvas.Left="217" Canvas.Top="160" />
</Canvas>
-->
<!-- 固定层和Ring -->
<!--
<Image Width="327" Height="123" Source="/SicUI;component/Themes/Images/parts/bodymove/Fixed.png" Canvas.Left="335" Canvas.Top="266" />
<Canvas Canvas.Left="335" Canvas.Top="248">
<common:AxisBorder x:Name="bdRing" Width="327" Height="170" Canvas.Top="0" >
<Image Width="206" Height="58" Source="/SicUI;component/Themes/Images/parts/bodymove/ht1.png" />
</common:AxisBorder>
</Canvas>-->
<!-- 顶部三层和架子 -->
<Canvas Canvas.Left="335" Canvas.Top="60">
<common:AxisBorder
x:Name="bdhtm"
Width="327"
Height="260">
<Canvas Width="327" Height="260">
<Image
x:Name="picMiddle"
Canvas.Top="99"
Width="327"
Height="160"
Source="/SicUI;component/Themes/Images/parts/bodymove/Middle.png" />
<common:AxisBorder
x:Name="bdht"
Canvas.Top="0"
Width="327"
Height="200">
<Canvas Width="327" Height="160">
<Image
x:Name="PicTop"
Canvas.Top="69"
Width="327"
Height="85"
Source="/SicUI;component/Themes/Images/parts/bodymove/Showerhead2.png" />
<Image
x:Name="picShx"
Canvas.Top="27"
Width="327"
Height="60"
Source="/SicUI;component/Themes/Images/parts/bodymove/hx3.png" />
</Canvas>
</common:AxisBorder>
<Image
x:Name="PicTR"
Canvas.Left="277"
Canvas.Top="122"
Width="35"
Height="35"
Source="/SicUI;component/Themes/Images/parts/bodymove/khr.png" />
<Image
x:Name="PicTL"
Canvas.Left="15"
Canvas.Top="122"
Width="35"
Height="35"
Source="/SicUI;component/Themes/Images/parts/bodymove/khl.png" />
</Canvas>
</common:AxisBorder>
<Image
x:Name="PicMR"
Canvas.Left="274"
Canvas.Top="218"
Width="35"
Height="35"
Source="/SicUI;component/Themes/Images/parts/bodymove/khr.png"
Visibility="{Binding TightenMiddle, Converter={StaticResource BoolVisibilityConverter}}" />
<Image
x:Name="PicML"
Canvas.Left="20"
Canvas.Top="218"
Width="35"
Height="35"
Source="/SicUI;component/Themes/Images/parts/bodymove/khl.png"
Visibility="{Binding TightenMiddle, Converter={StaticResource BoolVisibilityConverter}}" />
</Canvas>
<common:AxisCanvas
x:Name="canvashx"
Canvas.Left="35"
Canvas.Top="40"
AxisLeft="11">
<Image
Canvas.Left="187"
Canvas.Top="5"
Width="306"
Height="123"
Source="/SicUI;component/Themes/Images/parts/bodymove/hx.png" />
<Image
Canvas.Left="449"
Canvas.Top="31"
Width="32"
Height="54"
Source="/SicUI;component/Themes/Images/parts/bodymove/hx4.png"
Visibility="Visible" />
<Image
Canvas.Left="201"
Canvas.Top="41"
Width="32"
Height="54"
RenderTransformOrigin="2.573,0.503"
Source="/SicUI;component/Themes/Images/parts/bodymove/hx4.png"
Visibility="Visible" />
</common:AxisCanvas>
</Canvas>
</UserControl>
+374
View File
@@ -0,0 +1,374 @@
using SicUI.Controls.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
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.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace SicUI.Controls
{
/// <summary>
/// BodyLid.xaml 的交互逻辑
/// </summary>
public partial class BodyLid : UserControl //, INotifyPropertyChanged
{
private bool _isEnd = false;
private bool _isUp = false;
private bool _isFront = true;
private bool _isDown = true;
AxisBorder bd;
//public event PropertyChangedEventHandler PropertyChanged;
public BodyLid()
{
InitializeComponent();
}
public int MovingUpTime
{
get { return (int)GetValue(MovingUpTimeProperty); }
set { SetValue(MovingUpTimeProperty, value); }
}
public static readonly DependencyProperty MovingUpTimeProperty = DependencyProperty.Register("MovingUpTime", typeof(int), typeof(BodyLid), new FrameworkPropertyMetadata(5000));
public int MovingEndTime
{
get { return (int)GetValue(MovingEndTimeProperty); }
set { SetValue(MovingEndTimeProperty, value); }
}
public static readonly DependencyProperty MovingEndTimeProperty = DependencyProperty.Register("MovingEndTime", typeof(int), typeof(BodyLid), new FrameworkPropertyMetadata(5000));
public int MovingSwingTime
{
get { return (int)GetValue(MovingSwingTimeProperty); }
set { SetValue(MovingSwingTimeProperty, value); }
}
public static readonly DependencyProperty MovingSwingTimeProperty = DependencyProperty.Register("MovingSwingTime", typeof(int), typeof(BodyLid), new FrameworkPropertyMetadata(5000));
public string ChamberBodyGroup
{
get { return (string)GetValue(ChamberBodyInfoProperty); }
set { SetValue(ChamberBodyInfoProperty, value); }
}
public static readonly DependencyProperty ChamberBodyInfoProperty = DependencyProperty.Register(
"ChamberBodyGroup", typeof(string), typeof(BodyLid),
new PropertyMetadata(default(string)));
public bool MovingUp
{
get { return (Boolean)GetValue(MovingUpProperty); }
set { SetValue(MovingUpProperty, value); }
}
public static readonly DependencyProperty MovingUpProperty =
DependencyProperty.Register("MovingUp", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool MovingDown
{
get { return (Boolean)GetValue(MovingDownProperty); }
set { SetValue(MovingDownProperty, value); }
}
public static readonly DependencyProperty MovingDownProperty =
DependencyProperty.Register("MovingDown", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool MovingEnd
{
get { return (Boolean)GetValue(MovingEndProperty); }
set { SetValue(MovingEndProperty, value); }
}
public static readonly DependencyProperty MovingEndProperty =
DependencyProperty.Register("MovingEnd", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool MovingFront
{
get { return (Boolean)GetValue(MovingFrontProperty); }
set { SetValue(MovingFrontProperty, value); }
}
public static readonly DependencyProperty MovingFrontProperty =
DependencyProperty.Register("MovingFront", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool MovingSHSwingLoseen
{
get { return (Boolean)GetValue(MovingSHSwingLoseenProperty); }
set { SetValue(MovingSHSwingLoseenProperty, value); }
}
public static readonly DependencyProperty MovingSHSwingLoseenProperty =
DependencyProperty.Register("MovingSHSwingLoseen", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool MovingSHSwingTighten
{
get { return (Boolean)GetValue(MovingSHSwingTightenProperty); }
set { SetValue(MovingSHSwingTightenProperty, value); }
}
public static readonly DependencyProperty MovingSHSwingTightenProperty =
DependencyProperty.Register("MovingSHSwingTighten", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool MovingMiddleSwingLoseen
{
get { return (Boolean)GetValue(MovingMiddleSwingLoseenProperty); }
set { SetValue(MovingMiddleSwingLoseenProperty, value); }
}
public static readonly DependencyProperty MovingMiddleSwingLoseenProperty =
DependencyProperty.Register("MovingMiddleSwingLoseen", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool MovingMiddleSwingTighten
{
get { return (Boolean)GetValue(MovingMiddleSwingTightenProperty); }
set { SetValue(MovingMiddleSwingTightenProperty, value); }
}
public static readonly DependencyProperty MovingMiddleSwingTightenProperty =
DependencyProperty.Register("MovingMiddleSwingTighten", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool ChamberIsUp
{
get { return (Boolean)GetValue(ChamberIsUpProperty); }
set { SetValue(ChamberIsUpProperty, value); }
}
public static readonly DependencyProperty ChamberIsUpProperty =
DependencyProperty.Register("ChamberIsUp", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool ChamberIsDown
{
get { return (Boolean)GetValue(ChamberIsDownProperty); }
set { SetValue(ChamberIsDownProperty, value); }
}
public static readonly DependencyProperty ChamberIsDownProperty =
DependencyProperty.Register("ChamberIsDown", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool ChamberIsEnd
{
get { return (Boolean)GetValue(ChamberIsEndProperty); }
set { SetValue(ChamberIsEndProperty, value); }
}
public static readonly DependencyProperty ChamberIsEndProperty =
DependencyProperty.Register("ChamberIsEnd", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool ChamberIsFront
{
get { return (Boolean)GetValue(ChamberIsFrontProperty); }
set { SetValue(ChamberIsFrontProperty, value); }
}
public static readonly DependencyProperty ChamberIsFrontProperty =
DependencyProperty.Register("ChamberIsFront", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool ChamberIsUpLeach
{
get { return (Boolean)GetValue(ChamberIsUpLeachProperty); }
set { SetValue(ChamberIsUpLeachProperty, value); }
}
public static readonly DependencyProperty ChamberIsUpLeachProperty =
DependencyProperty.Register("ChamberIsUpLeach", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool TightenSH
{
get { return (Boolean)GetValue(TightenSHProperty); }
set { SetValue(TightenSHProperty, value); }
}
public static readonly DependencyProperty TightenSHProperty =
DependencyProperty.Register("TightenSH", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool TightenMiddle
{
get { return (Boolean)GetValue(TightenMiddleProperty); }
set { SetValue(TightenMiddleProperty, value); }
}
public static readonly DependencyProperty TightenMiddleProperty =
DependencyProperty.Register("TightenMiddle", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool SwingLockSH
{
get { return (Boolean)GetValue(SwingLockSHProperty); }
set { SetValue(SwingLockSHProperty, value); }
}
public static readonly DependencyProperty SwingLockSHProperty =
DependencyProperty.Register("SwingLockSH", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
public bool SwingLockMiddle
{
get { return (Boolean)GetValue(SwingLockMiddleProperty); }
set { SetValue(SwingLockMiddleProperty, value); }
}
public static readonly DependencyProperty SwingLockMiddleProperty =
DependencyProperty.Register("SwingLockMiddle", typeof(bool), typeof(BodyLid), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender));
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
bd = null;
if (DesignerProperties.GetIsInDesignMode(this))
{
return;
}
SetPicVisble();
SetBodyImage();
if (bd == null)
{
return;
}
//初始位置
if (ChamberIsUp != _isUp || ChamberIsDown != _isDown)
{
_isUp = ChamberIsUp;
_isDown = ChamberIsDown;
Dispatcher.Invoke(() => MoveBodyUp(ChamberIsUp, 0));
}
if (ChamberIsEnd != _isEnd || ChamberIsFront != _isFront)
{
_isEnd = ChamberIsEnd;
_isFront = ChamberIsFront;
Dispatcher.Invoke(() => MoveBodyEnd(ChamberIsEnd, 0));
}
//按钮移动
if (MovingUp && !ChamberIsEnd && ChamberIsDown)
{
Dispatcher.Invoke(() => MoveBodyUp(true, MovingUpTime));
}
else if (MovingDown && !ChamberIsEnd && ChamberIsUp)
{
Dispatcher.Invoke(() => MoveBodyUp(false, MovingUpTime));
}
else if (MovingEnd && ChamberIsUp && !ChamberIsEnd)
{
Dispatcher.Invoke(() => MoveBodyEnd(true, MovingEndTime));
}
else if (MovingFront && ChamberIsUp && ChamberIsEnd)
{
Dispatcher.Invoke(() => MoveBodyEnd(false, MovingEndTime));
}
}
private void SetPicVisble()
{
if (TightenSH)
{
PicTL.Visibility = Visibility.Visible;
PicTR.Visibility = Visibility.Visible;
}
else
{
PicTL.Visibility = Visibility.Collapsed;
PicTR.Visibility = Visibility.Collapsed;
}
if (TightenMiddle)
{
PicML.Visibility = Visibility.Visible;
PicMR.Visibility = Visibility.Visible;
}
else
{
PicML.Visibility = Visibility.Collapsed;
PicMR.Visibility = Visibility.Collapsed;
}
}
private void SetBodyImage()
{
this.PicTop.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/Showerhead2.png"));
this.picMiddle.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/Middle.png"));
this.PicTR.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/khr.png"));
this.PicTL.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/khl.png"));
this.PicTR.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/khr.png"));
this.PicTL.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/khl.png"));
if (!TightenSH && !SwingLockSH)
{
this.PicTop.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/Showerhead.png"));
bd = this.bdht;
}
else if (TightenSH && SwingLockSH && !TightenMiddle && !SwingLockMiddle)
{
this.PicTop.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/Showerhead.png"));
this.picMiddle.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/Middle2.png"));
this.PicTR.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/khr2.png"));
this.PicTL.Source = new BitmapImage(new Uri("pack://application:,,,/SicUI;component/Themes/Images/parts/bodymove/khl2.png"));
bd = this.bdhtm;
}
}
private void MoveBodyUp(bool up, int time, Action onComplete = null)
{
bd.Stop();
bd.MoveToUp(up, time, onComplete);
}
private void MoveBodyEnd(bool end, int time, Action onComplete = null)
{
bd.Stop();
bd.MoveToEnd(end, time, onComplete);
}
private void Stop()
{
this.bdht.Stop();
this.bdht.Stop();
this.bdhtm.Stop();
}
private void Invoke(Action action)
{
Dispatcher.Invoke(action);
}
}
}
+40
View File
@@ -0,0 +1,40 @@
<UserControl x:Class="SicUI.Controls.ChooseDialogBoxView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:cal="http://www.caliburn.org"
xmlns:local="clr-namespace:SicUI.Controls"
mc:Ignorable="d"
Height="auto" Width="400">
<Border BorderBrush="Gray" BorderThickness="0,1,0,0" Background="{DynamicResource Tab_BG}">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Content_Highlight}">-->
<TextBlock Text="{Binding InfoStr}" TextWrapping="WrapWithOverflow" LineHeight="28" Foreground="{DynamicResource FG_Black}" FontSize="14" FontFamily="Arial" Margin="10,10,10,6" ></TextBlock>
<!--</Border>-->
<StackPanel Grid.Row="1" Margin="0,10,0,10" Orientation="Horizontal" HorizontalAlignment="Center" >
<Button Content="OK" Width="90" Height="30">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cal:ActionMessage MethodName="OK">
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button Content="Cancel" Margin="10,0,0,0" Width="90" Height="30">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cal:ActionMessage MethodName="Cancel">
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
</Grid>
</Border>
</UserControl>
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
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;
namespace SicUI.Controls
{
/// <summary>
/// ChooseDialogBox.xaml 的交互逻辑
/// </summary>
public partial class ChooseDialogBoxView : UserControl
{
public ChooseDialogBoxView()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,23 @@
using System.Collections.ObjectModel;
using System.Windows.Forms.VisualStyles;
using OpenSEMI.ClientBase;
namespace SicUI.Controls
{
public class ChooseDialogBoxViewModel : DialogViewModel<string>
{
public string InfoStr { get; set; }
public void OK()
{
IsCancel = false;
TryClose(true);
}
public void Cancel()
{
IsCancel = true;
TryClose(false);
}
}
}
+65
View File
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace SicUI.Controls.Common
{
public class AnimationHelper
{
public static void TranslateX(TranslateTransform translation, int targetX, int ms, Action actionComplete = null)
{
var time = TimeSpan.FromMilliseconds(ms);
var oldValue = translation.X;
var animation = new DoubleAnimation(oldValue, targetX, time);
animation.Completed += (s, e) =>
{
actionComplete?.Invoke();
};
translation.BeginAnimation(TranslateTransform.XProperty, animation);
}
public static void TranslateX(UIElement uIElement, int startX, int targetX, int ms, Action actionComplete = null)
{
var transform = new TranslateTransform();
uIElement.RenderTransform = transform;
var time = TimeSpan.FromMilliseconds(ms);
var animation = new DoubleAnimation(startX, targetX, time);
animation.AutoReverse = false;
animation.Completed += (s, e) =>
{
actionComplete?.Invoke();
};
transform.BeginAnimation(TranslateTransform.XProperty, animation);
}
public static void TranslateY(TranslateTransform translation, int targetY, int ms, Action actionComplete = null)
{
var time = TimeSpan.FromMilliseconds(ms);
var animation = new DoubleAnimation(targetY, time);
animation.Completed += (s, e) =>
{
actionComplete?.Invoke();
};
translation.BeginAnimation(TranslateTransform.YProperty, animation);
}
public static void TranslateYRelative(TranslateTransform translation, int y, int ms, Action actionComplete = null)
{
var currentY = translation.Y;
var time = TimeSpan.FromMilliseconds(ms);
var animation = new DoubleAnimation(currentY + y, time);
animation.Completed += (s, e) =>
{
actionComplete?.Invoke();
};
translation.BeginAnimation(TranslateTransform.YProperty, animation);
}
}
}
+103
View File
@@ -0,0 +1,103 @@
using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
namespace SicUI.Controls.Common
{
public class AnimationQueue
{
private ConcurrentQueue<AnimationParameter> queue;
private AutoResetEvent eventHandler;
public event EventHandler<StatusUpdateArgs> StatusUpdated;
private bool idle;
private ReaderWriterLockSlim idleLocker;
private readonly string name;
public AnimationQueue(string name)
{
idleLocker = new ReaderWriterLockSlim();
eventHandler = new AutoResetEvent(false);
queue = new ConcurrentQueue<AnimationParameter>();
idle = true;
this.name = name;
Task.Run(() => Consume());
}
public void EnqueueStatus(AnimationParameter parameter)
{
queue.Enqueue(parameter);
try
{
idleLocker.EnterReadLock();
if (idle)
{
eventHandler.Set();
idle = false;
}
}
finally
{
idleLocker.ExitReadLock();
}
}
public AnimationParameter LastStatus
{
get;
private set;
}
private void Consume()
{
Thread.CurrentThread.Name = name;
while (true)
{
eventHandler.WaitOne();
AnimationParameter parameter = null;
if (queue.TryDequeue(out parameter))
{
LastStatus = parameter;
if (StatusUpdated != null)
{
try
{
idleLocker.EnterWriteLock();
idle = false;
}
finally
{
idleLocker.ExitWriteLock();
}
StatusUpdated(this, new StatusUpdateArgs() { Event = eventHandler, Parameter = parameter });
}
}
else
{
try
{
idleLocker.EnterWriteLock();
idle = true;
}
finally
{
idleLocker.ExitWriteLock();
}
}
}
}
}
public class StatusUpdateArgs : EventArgs
{
public AutoResetEvent Event { get; set; }
public AnimationParameter Parameter { get; set; }
}
public class AnimationParameter
{
public string Target { get; set; }
public string ArmA { get; set; }
public string ArmB { get; set; }
}
}
+128
View File
@@ -0,0 +1,128 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SicUI.Controls.Common
{
public class AxisBorder:Border
{
private Storyboard currentStoryboard;
public void Stop()
{
if (currentStoryboard != null)
{
currentStoryboard.Stop(this);
currentStoryboard = null;
}
}
public void MoveToUp(bool isUp, double times, Action onComplete = null)
{
Storyboard storyboard = new Storyboard(); //创建Storyboard对象
int desYPoint = 0;
int orgYPoint = 0;
if (isUp)
{
orgYPoint = 0;
desYPoint = -10;
}
else
{
orgYPoint = -10;
desYPoint = 0;
}
DoubleAnimation doubleAnimation = new DoubleAnimation(orgYPoint, desYPoint, new Duration(TimeSpan.FromMilliseconds(times)));
Storyboard.SetTarget(doubleAnimation, this);
Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath("(Canvas.Top)"));
storyboard.Children.Add(doubleAnimation);
storyboard.Completed += (s, e) =>
{
InvalidateVisual();
currentStoryboard = null;
onComplete?.Invoke();
};
currentStoryboard = storyboard;
storyboard.Begin();
}
public void MoveToEnd(bool frontToEnd, int times, Action onComplete = null)
{
Path path1 = new Path();
if (frontToEnd)
{
path1.Data = Geometry.Parse("M 0,0 A 300,160 0 0 0 -250,13");
}
else
{
path1.Data = Geometry.Parse("M -250,13 A 300,160 0 0 1 0,0");
}
TranslateTransform translate = new TranslateTransform();
this.RenderTransform = translate;
NameScope.SetNameScope(this, new NameScope());
this.RegisterName("translate", translate);
DoubleAnimationUsingPath animationX = new DoubleAnimationUsingPath();
animationX.PathGeometry = path1.Data.GetFlattenedPathGeometry();
animationX.Source = PathAnimationSource.X;
animationX.Duration = new Duration(TimeSpan.FromMilliseconds(times));
animationX.FillBehavior = FillBehavior.HoldEnd;
DoubleAnimationUsingPath animationY = new DoubleAnimationUsingPath();
animationY.PathGeometry = path1.Data.GetFlattenedPathGeometry();
animationY.Source = PathAnimationSource.Y;
animationY.Duration = animationX.Duration;
animationY.FillBehavior = FillBehavior.HoldEnd;
Storyboard storyboard = new Storyboard();
storyboard.AutoReverse = false;
storyboard.Children.Add(animationX);
storyboard.Children.Add(animationY);
Storyboard.SetTargetName(animationX, "translate");
Storyboard.SetTargetName(animationY, "translate");
Storyboard.SetTargetProperty(animationX, new PropertyPath(TranslateTransform.XProperty));
Storyboard.SetTargetProperty(animationY, new PropertyPath(TranslateTransform.YProperty));
storyboard.Completed += (s, e) =>
{
InvalidateVisual();
currentStoryboard = null;
onComplete?.Invoke();
};
currentStoryboard = storyboard;
storyboard.Begin(this);
}
public void MoveToUpDown(bool toUp,int orgYPoint, int desYPoint, double times, Action onComplete = null)
{
Storyboard storyboard = new Storyboard(); //创建Storyboard对象
DoubleAnimation doubleAnimation = new DoubleAnimation(orgYPoint, desYPoint, new Duration(TimeSpan.FromMilliseconds(times)));
Storyboard.SetTarget(doubleAnimation, this);
Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath("(Canvas.Top)"));
storyboard.Children.Add(doubleAnimation);
storyboard.Completed += (s, e) =>
{
InvalidateVisual();
currentStoryboard = null;
onComplete?.Invoke();
};
currentStoryboard = storyboard;
storyboard.Begin();
}
}
}
+163
View File
@@ -0,0 +1,163 @@
using System;
using System.Globalization;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace SicUI.Controls.Common
{
public class AxisCanvas : Canvas
{
private Storyboard currentStoryboard;
public bool ShowAxisPoint
{
get { return (bool)GetValue(ShowAxisPointProperty); }
set { SetValue(ShowAxisPointProperty, value); }
}
// Using a DependencyProperty as the backing store for ShowAxisPoint. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ShowAxisPointProperty =
DependencyProperty.Register("ShowAxisPoint", typeof(bool), typeof(AxisCanvas), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty AxisLeftProperty;
static AxisCanvas()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(AxisCanvas), new FrameworkPropertyMetadata(typeof(AxisCanvas)));
AxisLeftProperty = DependencyProperty.Register("AxisLeft", typeof(int), typeof(AxisCanvas), new UIPropertyMetadata(8));
}
public int AxisLeft
{
get
{
return (int)GetValue(AxisLeftProperty);
}
set
{
SetValue(AxisLeftProperty, value);
}
}
protected override void OnRender(DrawingContext dc)
{
base.OnRender(dc);
if (ShowAxisPoint)
{
dc.DrawEllipse(Brushes.Black, new Pen(Brushes.White, 2), new Point(AxisLeft, Height / 2), 5, 5);
}
// var text = new FormattedText(
//CurrentAngle.ToString(),
//CultureInfo.GetCultureInfo("en-us"),
//FlowDirection.LeftToRight,
//new Typeface("Verdana"),
//14,
//Brushes.Black);
// dc.DrawText(text, new Point(AxisLeft, 60));
}
public double CurrentAngle
{
get
{
if (RenderTransform is RotateTransform)
{
return (RenderTransform as RotateTransform).Angle;
}
return 0;
}
}
public void Rotate(int angle, bool absolute = true, int ms = 0, double accelerationRatio = 0, double decelerationRatio = 0, Action onComplete = null)
{
var storyboard = new Storyboard();
storyboard.Completed += (s, e) => onComplete?.Invoke();
if (Rotate(storyboard, angle, absolute, ms, accelerationRatio, decelerationRatio, onComplete))
{
storyboard.Begin();
}
else
{
onComplete?.Invoke();
}
}
public bool Rotate(Storyboard storyboard, int angle, bool absolute = true, int ms = 0, double accelerationRatio = 0, double decelerationRatio = 0, Action onComplete = null)
{
var oldAngle = 0d;
if (RenderTransform is RotateTransform)
{
oldAngle = (RenderTransform as RotateTransform).Angle;
}
var newAngle = absolute ? angle : oldAngle + angle;
if (newAngle == oldAngle)
{
return false;
}
var top = Height / 2;
var leftPoint = new Point(AxisLeft, top);
if (ms <= 0)
{
RenderTransform = new RotateTransform(newAngle, leftPoint.X, leftPoint.Y);
return false;
//InvalidateVisual();
}
else
{
var rotateTransform = new RotateTransform();
rotateTransform.CenterX = leftPoint.X;
rotateTransform.CenterY = leftPoint.Y;
RenderTransform = rotateTransform;
var animation = new DoubleAnimation(oldAngle, newAngle, TimeSpan.FromMilliseconds(ms));
animation.AccelerationRatio = accelerationRatio;
animation.DecelerationRatio = decelerationRatio;
storyboard.Children.Add(animation);
Storyboard.SetTarget(animation, this);
Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Angle"));
return true;
}
}
public void MoveToUpDown(int orgYPoint, int desYPoint, double times, Action onComplete = null)
{
Storyboard storyboard = new Storyboard(); //创建Storyboard对象
DoubleAnimation doubleAnimation = new DoubleAnimation(orgYPoint, desYPoint, new Duration(TimeSpan.FromMilliseconds(times)));
Storyboard.SetTarget(doubleAnimation, this);
Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath("(Canvas.Top)"));
storyboard.Children.Add(doubleAnimation);
storyboard.Completed += (s, e) =>
{
InvalidateVisual();
currentStoryboard = null;
onComplete?.Invoke();
};
currentStoryboard = storyboard;
storyboard.Begin();
}
public void Stop()
{
if (currentStoryboard != null)
{
currentStoryboard.Stop(this);
currentStoryboard = null;
}
}
}
}
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SicUI.Controls.Common
{
public class BodyMovePoint
{
public int LidX;
public int LidY;
}
public class BodyMovePosition
{
public BodyMovePoint StartPosition;
public BodyMovePoint EndPosition;
}
public enum ChamberBodyInfo
{
Head,
TopHead,
MiddleTopHead,
}
}
+49
View File
@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace SicUI.Controls.Common
{
public class RelayCommand : ICommand
{
private readonly Func<Object, Boolean> canExecute;
private readonly Action<Object> execute;
public RelayCommand(Action<Object> execute) : this(execute, null)
{
}
public RelayCommand(Action<Object> execute, Func<Object, Boolean> canExecute)
{
this.execute = execute ?? throw new ArgumentNullException("execute");
this.canExecute = canExecute;
}
public event EventHandler CanExecuteChanged
{
add
{
if (canExecute != null)
CommandManager.RequerySuggested += value;
}
remove
{
if (canExecute != null)
CommandManager.RequerySuggested -= value;
}
}
public Boolean CanExecute(Object parameter)
{
return canExecute == null ? true : canExecute(parameter);
}
public void Execute(Object parameter)
{
execute(parameter);
}
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SicUI.Controls.Common
{
public class RobotConstant
{
public const string RobotRetract = "0";
public const string RobotExtend = "1";
public const string UnknownTarget = "Unknown";
}
}
+10
View File
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SicUI.Controls.Common
{
}
+23
View File
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SicUI.Controls.Common
{
public class RobotPosition
{
public int X;
public int Z;
public int Root;
public int Arm;
public int Hand;
}
public class StationPosition
{
public RobotPosition StartPosition;
public RobotPosition EndPosition;
}
}
+43
View File
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Input;
using Aitex.Core.UI.MVVM;
using Aitex.Core.Util;
using Aitex.Core.Utilities;
namespace SicUI.Controls.Common
{
public class ViewModelControl : UserControl, INotifyPropertyChanged, IViewModelControl
{
public event PropertyChangedEventHandler PropertyChanged;
public void SubscribeKeys(SubscriptionViewModelBase baseModel)
{
baseModel.SubscribeKeys(this);
}
public void InvokePropertyChanged()
{
if (PropertyChanged != null)
{
var ps = this.GetType().GetProperties();
foreach (var p in ps)
{
if (!p.GetCustomAttributes(false).Any(attribute => attribute is IgnorePropertyChangeAttribute))
PropertyChanged(this, new PropertyChangedEventArgs(p.Name));
if (p.PropertyType == typeof(ICommand))
{
if (p.GetValue(this, null) is IDelegateCommand cmd)
cmd.RaiseCanExecuteChanged();
}
}
}
}
}
}
+46
View File
@@ -0,0 +1,46 @@
<UserControl x:Class="SicUI.Controls.Door"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls"
mc:Ignorable="d"
d:DesignHeight="20" d:DesignWidth="100">
<UserControl.Resources>
<Storyboard x:Key="Door_Open">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" >
<EasingDoubleKeyFrame KeyTime="0" Value="55"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="15"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="Door_Close">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" >
<EasingDoubleKeyFrame KeyTime="0" Value="15"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="55"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Style TargetType="{x:Type Rectangle}" x:Key="Door_Animation" >
<Style.Triggers>
<DataTrigger Binding="{Binding IsDoorOpen}" Value="true">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource Door_Open}"/>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource Door_Close}"/>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Rectangle x:Name="Door_Top" Style="{StaticResource Door_Animation}" Fill="DimGray" />
<Rectangle x:Name="Door_Bottom" Grid.Column="1" Style="{StaticResource Door_Animation}" Fill="DimGray" />
</Grid>
</UserControl>
+37
View File
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
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;
namespace SicUI.Controls
{
/// <summary>
/// Door.xaml 的交互逻辑
/// </summary>
public partial class Door : UserControl
{
public bool IsDoorOpen
{
get { return (bool)GetValue(IsDoorOpenProperty); }
set { SetValue(IsDoorOpenProperty, value); }
}
public static readonly DependencyProperty IsDoorOpenProperty =
DependencyProperty.Register("IsDoorOpen", typeof(bool), typeof(Door), new FrameworkPropertyMetadata(false));
public Door()
{
InitializeComponent();
}
}
}
+40
View File
@@ -0,0 +1,40 @@
<UserControl
x:Class="SicUI.Controls.HandValve"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="11"
d:DesignWidth="21"
mc:Ignorable="d">
<Canvas Background="Transparent" Opacity="1">
<!--<Canvas Name="nopass" Visibility="Hidden" Cursor="Hand" MouseLeftButtonDown="nopass_MouseLeftButtonDown"></Canvas>-->
<Line
Stroke="Gray"
StrokeThickness="1.5"
X1="5.2"
X2="15"
Y1="-1"
Y2="-1" />
<Line
Stroke="Gray"
StrokeThickness="1.5"
X1="10.1"
X2="10.1"
Y1="-1"
Y2="6" />
<Polygon
Points="1,1 1,10 10,5.5"
Stroke="Gray"
StrokeThickness="1.5" />
<Polygon
Points="10,5.5 20,1 20,10"
Stroke="Gray"
StrokeThickness="1.5" />
</Canvas>
</UserControl>
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
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;
namespace SicUI.Controls
{
/// <summary>
/// HandValve.xaml 的交互逻辑
/// </summary>
public partial class HandValve : UserControl
{
public HandValve()
{
InitializeComponent();
}
}
}
+65
View File
@@ -0,0 +1,65 @@
<Window x:Class="SicUI.Controls.InputDialogBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:Aitex.Core.UI.Control;assembly=MECF.Framework.UI.Core"
Height="265" Width="260" MaxHeight="265" MinHeight="265" MaxWidth="300" MinWidth="300" WindowStyle="ToolWindow"
WindowStartupLocation="CenterOwner"
KeyDown="OnEnterKeyIsHit"
Title="{Binding DeviceTitle}">
<Window.Resources>
<Style TargetType="Button">
<Setter Property="FontSize" Value="12" />
<Setter Property="Height" Value="23" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Width" Value="50" />
</Style>
<Style TargetType="Label">
<Setter Property="FontFamily" Value="Arial,SimSun" />
<Setter Property="FontSize" Value="13" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Height" Value="25" />
</Style>
<Style x:Key="textBoxInError" TargetType="{x:Type TextBox}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
</Trigger>
</Style.Triggers>
</Style>
<my:DoubleConverter x:Key="doubleConverter"/>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="1" Content="DeviceName" />
<Label Grid.Row="1" Grid.Column="1" Content="Unit" />
<Label Grid.Row="2" Grid.Column="1" Content="Max" />
<Label Grid.Row="3" Grid.Column="1" Content="Default" />
<Label Grid.Row="4" Grid.Column="1" Content="Feedback" />
<Label Grid.Row="5" Grid.Column="1" Content="SetPoint" />
<Label Grid.Row="0" Grid.Column="2" Content="{Binding Path=DeviceName}" Width="150" Height="28" HorizontalAlignment="Left" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" VerticalContentAlignment="Center" />
<Label Grid.Row="1" Grid.Column="2" Content="{Binding Path=Unit}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
<Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=MaxValue}" ContentStringFormat="F1" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
<Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=DefaultValue}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
<Label Grid.Row="4" Grid.Column="2" Content="{Binding Path=RealValue}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
<TextBox Grid.Row="5" Grid.Column="2" x:Name="inputBox" BorderBrush="Green" BorderThickness="0,0,0,1" Style="{StaticResource textBoxInError}" TextChanged="InputTextBox_TextChanged" Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center" />
<Button Grid.Row="6" Grid.ColumnSpan="2" Content="Set" x:Name="buttonSet" Click="ButtonSet_Click" Width="80" Height="26" VerticalAlignment="Top" Grid.Column="1" Margin="5,3,0,0" />
<Button Grid.Row="6" Grid.Column="2" Content="Cancel" Click="ButtonCancel_Click" Width="80" Height="26" VerticalAlignment="Top" Margin="44,3,0,0" />
</Grid>
</Window>
+217
View File
@@ -0,0 +1,217 @@
using Aitex.Core.RT.Log;
using System;
using System.Collections.Generic;
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;
namespace SicUI.Controls
{
/// <summary>
/// Interaction logic for InputDialogBox.xaml
/// </summary>
public partial class InputDialogBox : Window
{
public InputDialogBox()
{
InitializeComponent();
DataContext = this;
WindowStartupLocation = WindowStartupLocation.CenterOwner;
}
public void FocasAll()
{
inputBox.Text = Math.Round(SetPoint, 2).ToString();
inputBox.Focus();
inputBox.SelectAll();
}
/// <summary>
/// Vilidate input range
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void InputTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
double input;
if (!double.TryParse(inputBox.Text, out input)) buttonSet.IsEnabled = false;
else if (input < 0 || input > MaxValue) buttonSet.IsEnabled = false;
else buttonSet.IsEnabled = true;
inputBox.Foreground = buttonSet.IsEnabled ?
System.Windows.Media.Brushes.Black : System.Windows.Media.Brushes.Red;
}
public static readonly DependencyProperty DeviceNameProperty = DependencyProperty.Register(
"DeviceName", typeof(string), typeof(InputDialogBox),
new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DeviceIdProperty = DependencyProperty.Register(
"DeviceId", typeof(string), typeof(InputDialogBox),
new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty MaxValueProperty = DependencyProperty.Register(
"MaxValue", typeof(double), typeof(InputDialogBox),
new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register(
"DefaultValue", typeof(double), typeof(InputDialogBox),
new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty RealValueProperty = DependencyProperty.Register(
"RealValue", typeof(string), typeof(InputDialogBox),
new FrameworkPropertyMetadata("0.0", FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty UnitProperty = DependencyProperty.Register(
"Unit", typeof(string), typeof(InputDialogBox),
new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty SetPointProperty = DependencyProperty.Register(
"SetPoint", typeof(double), typeof(InputDialogBox),
new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
/// <summary>
/// 是否百分比显示
/// </summary>
public bool IsPercent { get; set; }
public string DeviceName
{
get
{
return (string)this.GetValue(DeviceNameProperty);
}
set
{
if (!string.IsNullOrEmpty(value) && !value.StartsWith("_"))
value = "_" + value;
this.SetValue(DeviceNameProperty, value);
}
}
public string DeviceTitle
{
get
{
return string.Format("{0} {1}", Application.Current.Resources["GlobalLableSetPointTitle"], DeviceId);
}
}
public string DeviceId
{
get
{
return (string)this.GetValue(DeviceIdProperty);
}
set
{
this.SetValue(DeviceIdProperty, value);
}
}
public double MaxValue
{
get
{
return (double)this.GetValue(MaxValueProperty);
}
set
{
this.SetValue(MaxValueProperty, value);
// validationRule.MaxInput = value;
}
}
public double DefaultValue
{
get
{
return (double)this.GetValue(DefaultValueProperty);
}
set
{
this.SetValue(DefaultValueProperty, value);
}
}
public string RealValue
{
get
{
return (string)this.GetValue(RealValueProperty);
}
set
{
this.SetValue(RealValueProperty, value);
}
}
public string Unit
{
get
{
return (string)this.GetValue(UnitProperty);
}
set
{
this.SetValue(UnitProperty, value);
}
}
public double SetPoint
{
get
{
return (double)this.GetValue(SetPointProperty);
}
set
{
this.SetValue(SetPointProperty, value);
}
}
public Action<double> CommandDelegate;
private void ButtonSet_Click(object sender, RoutedEventArgs e)
{
try
{
if (CommandDelegate != null)
{
double setp = Convert.ToDouble(inputBox.Text);
if (IsPercent)
setp = setp / 100.0;
CommandDelegate(setp);
}
//Close();
}
catch (Exception ex)
{
LOG.Error(ex.Message);
}
}
private void OnEnterKeyIsHit(object sender, KeyEventArgs e)
{
try
{
if (!buttonSet.IsEnabled) return;
if (e.Key == Key.Return)
{
ButtonSet_Click(null, null);
}
}
catch (Exception ex)
{
LOG.Error(ex.Message);
}
}
private void ButtonCancel_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}
@@ -0,0 +1,79 @@
<UserControl
x:Class="SicUI.Controls.M2C4Parts.AtmRobotMultiLP"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Common="clr-namespace:SicUI.Controls.Common"
xmlns:controls="clr-namespace:SicUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:extendedControls="clr-namespace:MECF.Framework.UI.Core.ExtendedControls;assembly=MECF.Framework.UI.Core"
xmlns:local="clr-namespace:SicUI.Controls.M2C4Parts"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="38"
d:DesignWidth="416"
mc:Ignorable="d">
<UserControl.Resources>
<extendedControls:BindingProxy x:Key="proxy" Data="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" />
</UserControl.Resources>
<Viewbox Stretch="Uniform">
<Canvas
x:Name="root"
Width="416"
Height="38">
<!--<Canvas.ContextMenu>
<ContextMenu ItemsSource="{Binding Menu}" />
</Canvas.ContextMenu>-->
<Image
Width="75"
Height="80"
Margin="-20,-24"
Source="Images/AtmRobotMultiLP/dock.png"
Visibility="{Binding ShowDock, Converter={StaticResource BoolVisibilityConverter}}" />
<!--<Image Width="38" Height="38" Source="Images/AtmRobotMultiLP/robotDock.png" />-->
<Common:AxisCanvas
x:Name="canvas1"
Canvas.Left="10"
Canvas.Top="10"
Width="68"
Height="21">
<Image Source="Images/AtmRobotMultiLP/dq01.png" />
<Common:AxisCanvas
x:Name="canvas2"
Canvas.Left="36"
Width="46"
Height="21">
<Image Source="Images/AtmRobotMultiLP/dq01.png" />
<Common:AxisCanvas
x:Name="canvas3"
Canvas.Left="36"
Canvas.Top="-8"
Width="80"
Height="38">
<Image Source="Images/AtmRobotMultiLP/dq02.png" />
<!--<Image Source="Images/pm2.png" Canvas.Left="3" Canvas.Top="-41" Visibility="{Binding IsArmWater}"/>-->
<!--<Image Source="Images/pm2.png" Visibility="{Binding HasWafer}" Canvas.Top="-40" Canvas.Left="27" />-->
<Image
Canvas.Left="8"
Canvas.Top="-17"
Width="70"
Source="Images/pm52.png"
Visibility="{Binding HasTray}" />
<controls:WaferCtrl
Canvas.Left="22"
Canvas.Top="-3"
Width="42"
Height="42"
WaferData="{Binding Wafer1}" />
</Common:AxisCanvas>
</Common:AxisCanvas>
</Common:AxisCanvas>
<Canvas.RenderTransform>
<TransformGroup>
<RotateTransform Angle="{Binding Source={StaticResource proxy}, Path=Data.RotateAngle}" CenterY="30" />
<TranslateTransform x:Name="translate" X="{Binding Source={StaticResource proxy}, Path=Data.TranslateX}" />
</TransformGroup>
</Canvas.RenderTransform>
</Canvas>
</Viewbox>
</UserControl>
@@ -0,0 +1,536 @@
using SicUI.Controls.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace SicUI.Controls.M2C4Parts
{
/// <summary>
/// AtmRobotMultiLP.xaml 的交互逻辑
/// </summary>
public partial class AtmRobotMultiLP : UserControl, INotifyPropertyChanged
{
private int moveTime = 300;
private const int AnimationTimeout = 3000; // ms
private string CurrentPosition
{
get; set;
}
private RobotAction CurrentAction
{
get; set;
}
public int MoveTime
{
get => moveTime;
set
{
moveTime = value;
}
}
public bool ShowDock
{
get { return (bool)GetValue(ShowDockProperty); }
set { SetValue(ShowDockProperty, value); }
}
// Using a DependencyProperty as the backing store for ShowDock. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ShowDockProperty =
DependencyProperty.Register("ShowDock", typeof(bool), typeof(AtmRobotMultiLP), new PropertyMetadata(false));
public double RotateAngle
{
get { return (double)GetValue(RotateAngleProperty); }
set { SetValue(RotateAngleProperty, value); }
}
// Using a DependencyProperty as the backing store for RotateAngle. This enables animation, styling, binding, etc...
public static readonly DependencyProperty RotateAngleProperty =
DependencyProperty.Register("RotateAngle", typeof(double), typeof(AtmRobotMultiLP), new PropertyMetadata(0.0));
public double TranslateX
{
get { return (double)GetValue(TranslateXProperty); }
set { SetValue(TranslateXProperty, value); }
}
// Using a DependencyProperty as the backing store for TranslateX. This enables animation, styling, binding, etc...
public static readonly DependencyProperty TranslateXProperty =
DependencyProperty.Register("TranslateX", typeof(double), typeof(AtmRobotMultiLP), new PropertyMetadata(0.0));
public MECF.Framework.UI.Client.ClientBase.WaferInfo Wafer1
{
get { return (MECF.Framework.UI.Client.ClientBase.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(MECF.Framework.UI.Client.ClientBase.WaferInfo), typeof(AtmRobotMultiLP), new PropertyMetadata(null));
//public Visibility IsArmWater => Wafer1 == null ? Visibility.Hidden : Wafer1.IsVisibility;
public MECF.Framework.UI.Client.ClientBase.WaferInfo Wafer2
{
get { return (MECF.Framework.UI.Client.ClientBase.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(MECF.Framework.UI.Client.ClientBase.WaferInfo), typeof(AtmRobotMultiLP), new PropertyMetadata(null));
public string Station
{
get { return (string)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(string), typeof(AtmRobotMultiLP), new PropertyMetadata("Robot"));
public RobotMoveInfo RobotMoveInfo
{
get { return (RobotMoveInfo)GetValue(RobotMoveInfoProperty); }
set { SetValue(RobotMoveInfoProperty, value); }
}
public static readonly DependencyProperty RobotMoveInfoProperty =
DependencyProperty.Register("RobotMoveInfo", typeof(RobotMoveInfo), typeof(AtmRobotMultiLP), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
public bool WaferPresentA
{
get { return (bool)GetValue(WaferPresentAProperty); }
set { SetValue(WaferPresentAProperty, value); }
}
// Using a DependencyProperty as the backing store for WaferPresent. This enables animation, styling, binding, etc...
public static readonly DependencyProperty WaferPresentAProperty =
DependencyProperty.Register("WaferPresentA", typeof(bool), typeof(AtmRobotMultiLP), new PropertyMetadata(false));
public bool WaferPresentB
{
get { return (bool)GetValue(WaferPresentBProperty); }
set { SetValue(WaferPresentBProperty, value); }
}
// Using a DependencyProperty as the backing store for WaferPresent. This enables animation, styling, binding, etc...
public static readonly DependencyProperty WaferPresentBProperty =
DependencyProperty.Register("WaferPresentB", typeof(bool), typeof(AtmRobotMultiLP), new PropertyMetadata(false));
public ICommand CreateDeleteWaferCommand
{
get { return (ICommand)GetValue(CreateDeleteWaferCommandProperty); }
set { SetValue(CreateDeleteWaferCommandProperty, value); }
}
// Using a DependencyProperty as the backing store for CreateDeleteWaferCommand. This enables animation, styling, binding, etc...
public static readonly DependencyProperty CreateDeleteWaferCommandProperty =
DependencyProperty.Register("CreateDeleteWaferCommand", typeof(ICommand), typeof(AtmRobotMultiLP), new PropertyMetadata(null));
public ICommand MoveWaferCommand
{
get { return (ICommand)GetValue(MoveWaferCommandProperty); }
set { SetValue(MoveWaferCommandProperty, value); }
}
// Using a DependencyProperty as the backing store for MoveWaferCommand. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MoveWaferCommandProperty =
DependencyProperty.Register("MoveWaferCommand", typeof(ICommand), typeof(AtmRobotMultiLP), new PropertyMetadata(null));
public Dictionary<string, StationPosition> StationPosition
{
get { return (Dictionary<string, StationPosition>)GetValue(StationPositionProperty); }
set { SetValue(StationPositionProperty, value); }
}
// Using a DependencyProperty as the backing store for StationPosition. This enables animation, styling, binding, etc... new PropertyMetadata(null, StationPositionChangedCallback)
public static readonly DependencyProperty StationPositionProperty =
DependencyProperty.Register("StationPosition", typeof(Dictionary<string, StationPosition>), typeof(AtmRobotMultiLP), new PropertyMetadata(null, StationPositionChangedCallback));
public Visibility HasWafer
{
get { return (Visibility)GetValue(HasWaferProperty); }
set { SetValue(HasWaferProperty, value); }
}
// Using a DependencyProperty as the backing store for Station. This enables animation, styling, binding, etc...
public static readonly DependencyProperty HasWaferProperty =
DependencyProperty.Register("HasWafer", typeof(Visibility), typeof(AtmRobotMultiLP), new PropertyMetadata(Visibility.Hidden));
public Visibility HasTray
{
get { return (Visibility)GetValue(HasTrayProperty); }
set { SetValue(HasTrayProperty, value); }
}
// Using a DependencyProperty as the backing store for Station. This enables animation, styling, binding, etc...
public static readonly DependencyProperty HasTrayProperty =
DependencyProperty.Register("HasTray", typeof(Visibility), typeof(AtmRobotMultiLP), new PropertyMetadata(Visibility.Hidden));
private List<MenuItem> menu;
public event PropertyChangedEventHandler PropertyChanged;
public List<MenuItem> Menu
{
get
{
return menu;
}
set
{
menu = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Menu"));
}
}
private ICommand MoveCommand
{
get; set;
}
private void MoveTo(object target)
{
MoveRobot((RobotMoveInfo)target);
}
public AtmRobotMultiLP()
{
InitializeComponent();
root.DataContext = this;
MoveCommand = new RelayCommand(MoveTo);
CurrentPosition = "ArmA.System";
canvas1.Rotate(45);
canvas2.Rotate(120);
canvas3.Rotate(120);
StationPosition = new Dictionary<string, StationPosition>
{
{ "ArmA.System",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root=45,
Arm=120,
Hand=120
},
EndPosition= new RobotPosition()
{
Root=45,
Arm=120,
Hand=120
}
}
},
{ "ArmA.PM1",new StationPosition() //ArmA.ReactorA
{
StartPosition= new RobotPosition()
{
Z=0,
Root = 99,
Arm = 240,
Hand = 240
},
EndPosition= new RobotPosition()
{
Root = 239,
Arm = 0,
Hand = 360
}
}
},
{ "ArmA.PM2",new StationPosition() //ArmA.ReactorB
{
StartPosition= new RobotPosition()
{
Z=0,
Root = 10,
Arm = 194,
Hand = 99
},
EndPosition= new RobotPosition()
{
Root = -58,
Arm = 360,
Hand = 0
}
}
},
{ "ArmA.Buffer",new StationPosition() //ArmA.Buffer
{
StartPosition= new RobotPosition()
{
Z=0,
Root = 80,
Arm = 190,
Hand = 100
},
EndPosition= new RobotPosition()
{
Root = 13,
Arm = 360,
Hand = 0
}
}
},
{ "ArmA.UnLoad",new StationPosition() //ArmA.PerHeat
{
StartPosition= new RobotPosition()
{
Z=0,
Root =27,
Arm = 240,
Hand = 240
},
EndPosition= new RobotPosition()
{
Root = 168,
Arm = 0,
Hand = 360
}
}
},
{ "ArmA.LoadLock",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root =-45,
Arm = 240,
Hand = 240
},
EndPosition= new RobotPosition()
{
Root = 90,
Arm = 0,
Hand = 360
}
}
},
};
}
static void StationPositionChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var self = (AtmRobotMultiLP)d;
var positions = (Dictionary<string, StationPosition>)e.NewValue;
var menus = new List<MenuItem>();
foreach (var position in positions)
{
var m = new MenuItem() { Header = position.Key };
Enum.TryParse<RobotArm>(position.Key.Split('.')[0], out RobotArm arm);
m.Items.Add(new MenuItem() { Header = "Pick", Command = self.MoveCommand, CommandParameter = new RobotMoveInfo() { BladeTarget = position.Key, Action = RobotAction.Picking, ArmTarget = arm } });
m.Items.Add(new MenuItem() { Header = "Place", Command = self.MoveCommand, CommandParameter = new RobotMoveInfo() { BladeTarget = position.Key, Action = RobotAction.Placing, ArmTarget = arm } });
m.Items.Add(new MenuItem() { Header = "Move", Command = self.MoveCommand, CommandParameter = new RobotMoveInfo() { BladeTarget = position.Key, Action = RobotAction.Moving, ArmTarget = arm } });
menus.Add(m);
}
//self.Menu = menus;
self.MoveTo(new RobotMoveInfo() { BladeTarget = positions.First().Key, Action = RobotAction.None });
}
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
if (DesignerProperties.GetIsInDesignMode(this))
{
return;
}
if (RobotMoveInfo != null)
{
var needMove = CurrentPosition != RobotMoveInfo.BladeTarget || CurrentAction != RobotMoveInfo.Action;
if (needMove)
{
LogMsg($" RobotMoveInfo, action:{RobotMoveInfo.Action} armTarget:{RobotMoveInfo.ArmTarget} bladeTarget:{RobotMoveInfo.BladeTarget}");
Invoke(() => MoveRobot(RobotMoveInfo));
CurrentAction = RobotMoveInfo.Action;
CurrentPosition = RobotMoveInfo.BladeTarget;
}
}
}
private void Invoke(Action action)
{
Dispatcher.Invoke(action);
}
private void LogMsg(string msg)
{
var source = "ATM Robot";
Console.WriteLine("{0} {1}", source, msg);
}
private void MoveRobot(RobotMoveInfo moveInfo)
{
canvas1.Stop();
canvas2.Stop();
canvas3.Stop();
//canvas21.Stop();
//canvas22.Stop();
//canvas23.Stop();
var target = moveInfo.BladeTarget;
var arm = moveInfo.ArmTarget;
MoveToStart(arm, CurrentPosition
,
() => TranslateTo(target, () => MoveToStart(arm, target, () =>
{
if (moveInfo.Action != RobotAction.Moving)
{
MoveToEnd(arm, target, () => UpdateWafer(moveInfo));
}
})));
}
private void RotateTo(string station, Action onComplete = null)
{
var position = StationPosition[station];
LogMsg($"Rotate to {position.StartPosition.X}");
}
private void TranslateTo(string station, Action onComplete = null)
{
var position = StationPosition[station];
LogMsg($"Translate to {position.StartPosition.Z}");
Translate(StationPosition[CurrentPosition].StartPosition.Z, position.StartPosition.Z, onComplete);
}
private void MoveToStart(RobotArm arm, string station, Action onComplete = null)
{
LogMsg($"{arm} Move to start {station}");
var position = StationPosition[station];
var storyboard = new Storyboard();
storyboard.Completed += (s, e) => onComplete?.Invoke();
var needRotate = new List<bool>();
//if (arm == RobotArm.ArmA)
{
needRotate.Add(canvas1.Rotate(storyboard, position.StartPosition.Root, true, MoveTime));
needRotate.Add(canvas2.Rotate(storyboard, position.StartPosition.Arm, true, MoveTime));
needRotate.Add(canvas3.Rotate(storyboard, position.StartPosition.Hand, true, MoveTime));
}
//else if (arm == RobotArm.ArmB)
{
//needRotate.Add(canvas21.Rotate(storyboard, position.StartPosition.Root, true, MoveTime));
//needRotate.Add(canvas22.Rotate(storyboard, position.StartPosition.Arm, true, MoveTime));
//needRotate.Add(canvas23.Rotate(storyboard, position.StartPosition.Hand, true, MoveTime));
}
if (needRotate.Any(x => x))
{
storyboard.Begin();
}
else
{
onComplete?.Invoke();
}
CurrentPosition = station;
}
private void MoveToEnd(RobotArm arm, string station, Action onComplete = null)
{
LogMsg($"{arm} move to end {station}");
var position = StationPosition[station];
var storyboard = new Storyboard();
storyboard.Completed += (s, e) => onComplete?.Invoke();
var needRotate = new List<bool>();
if (arm == RobotArm.ArmA || arm == RobotArm.Both)
{
needRotate.Add(canvas1.Rotate(storyboard, position.EndPosition.Root, true, MoveTime));
needRotate.Add(canvas2.Rotate(storyboard, position.EndPosition.Arm, true, MoveTime));
needRotate.Add(canvas3.Rotate(storyboard, position.EndPosition.Hand, true, MoveTime));
}
if (arm == RobotArm.ArmB || arm == RobotArm.Both)
{
//needRotate.Add(canvas21.Rotate(storyboard, position.EndPosition.Root, true, MoveTime));
//needRotate.Add(canvas22.Rotate(storyboard, position.EndPosition.Arm, true, MoveTime));
//needRotate.Add(canvas23.Rotate(storyboard, position.EndPosition.Hand, true, MoveTime));
}
if (needRotate.Any(x => x))
{
storyboard.Begin();
}
else
{
onComplete?.Invoke();
}
CurrentPosition = station;
}
private void UpdateWafer(RobotMoveInfo moveInfo)
{
var waferPresent = false;
switch (moveInfo.Action)
{
case RobotAction.None:
case RobotAction.Moving:
return;
case RobotAction.Picking:
waferPresent = true;
break;
case RobotAction.Placing:
waferPresent = false;
break;
default:
break;
}
switch (moveInfo.ArmTarget)
{
case RobotArm.ArmA:
WaferPresentA = waferPresent;
break;
case RobotArm.ArmB:
WaferPresentB = waferPresent;
break;
case RobotArm.Both:
WaferPresentA = waferPresent;
WaferPresentB = waferPresent;
break;
default:
break;
}
}
private void Translate(int start, int target, Action onComplete = null)
{
AnimationHelper.TranslateX(root, start, target, MoveTime, onComplete);
}
}
}
+31
View File
@@ -0,0 +1,31 @@
<UserControl x:Class="SicUI.Controls.Parts.Chamber"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls.Parts"
xmlns:controls="clr-namespace:SicUI.Controls"
mc:Ignorable="d"
Height="135" Width="121">
<Grid x:Name="root" Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ActualWidth}" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ActualHeight}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="14" />
</Grid.RowDefinitions>
<local:Door Grid.Row="1" State="{Binding DoorState,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="0,-10,0,0"/>
<Grid Grid.Row="0" VerticalAlignment="Top">
<Image Source="/SicUI;component/Themes/images/parts/pmbg.png"/>
<!--<local:Wafer WaferStyle="Eclipse" WaferItem="{Binding Wafer}" Station ="{Binding Station}" Slot="{Binding Slot}" Margin="25" />-->
<controls:WaferCtrl x:Name="local_Wafer" WaferData="{Binding WaferData,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" RenderTransformOrigin="0.5,0.5">
<controls:WaferCtrl.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="0.1"/>
<TranslateTransform/>
</TransformGroup>
</controls:WaferCtrl.RenderTransform>
</controls:WaferCtrl>
</Grid>
</Grid>
</UserControl>
+143
View File
@@ -0,0 +1,143 @@
using Aitex.Core.Common;
using Aitex.Sorter.Common;
using MECF.Framework.Common.Equipment;
using System;
using System.Collections.Generic;
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 CB = MECF.Framework.UI.Client.ClientBase;
namespace SicUI.Controls.Parts
{
/// <summary>
/// Chamber.xaml 的交互逻辑
/// </summary>
public partial class Chamber : UserControl
{
private double PM1 = 127;
private double PM2 = 75;
private double PM3 = -25;
private double PM4 = -129;
public Chamber()
{
InitializeComponent();
}
public CB.WaferInfo WaferData
{
get { return (CB.WaferInfo)GetValue(WaferDataProperty); }
set { SetValue(WaferDataProperty, value); }
}
public static readonly DependencyProperty WaferDataProperty =
DependencyProperty.Register("WaferData", typeof(CB.WaferInfo), typeof(Chamber), new PropertyMetadata(null));
// public WaferInfo Wafer
// {
// get { return (WaferInfo)GetValue(WaferProperty); }
// set { SetValue(WaferProperty, value); }
// }
// // Using a DependencyProperty as the backing store for WaferItem. This enables animation, styling, binding, etc...
// public static readonly DependencyProperty WaferProperty =
// DependencyProperty.Register("Wafer", typeof(WaferInfo), typeof(Chamber), new PropertyMetadata(null));
// public ModuleName Station
// {
// get { return (ModuleName)GetValue(StationProperty); }
// set { SetValue(StationProperty, value); }
// }
// // Using a DependencyProperty as the backing store for WaferItem. This enables animation, styling, binding, etc...
// public static readonly DependencyProperty SlotProperty =
// DependencyProperty.Register("Slot", typeof(int), typeof(Chamber), new PropertyMetadata(0));
// public int Slot
// {
// get { return (int)GetValue(SlotProperty); }
// set { SetValue(SlotProperty, 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(Chamber), new PropertyMetadata(ModuleName.System));
public FoupDoorState DoorState
{
get { return (FoupDoorState)GetValue(DoorStateProperty); }
set { SetValue(DoorStateProperty, value); }
}
// Using a DependencyProperty as the backing store for DoorState. This enables animation, styling, binding, etc...
public static readonly DependencyProperty DoorStateProperty =
DependencyProperty.Register("DoorState", typeof(FoupDoorState), typeof(Chamber), new PropertyMetadata(FoupDoorState.Unknown));
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(Chamber), new PropertyMetadata(null));
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
var cmd = ((MenuItem)sender).Tag;
Command.Execute(new[] { WaferData.ModuleID, cmd });
}
#region wafer 角度
public static readonly DependencyProperty WaferAngleProperty =
DependencyProperty.Register("WaferAngleChanged", typeof(string), typeof(Chamber), new PropertyMetadata(WaferAngleCurrentStsChanged));
public static void WaferAngleCurrentStsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Chamber control = (Chamber)d;
if (e.Property == WaferAngleProperty)
{
control.WaferAngleChanged = (string)e.NewValue;
}
}
public string WaferAngleChanged
{
get { return (string)GetValue(WaferAngleProperty); }
set
{
SetValue(WaferAngleProperty, value);
RotateTransform rotateTransform = null;
switch (WaferAngleChanged)
{
case "PM1":
rotateTransform = new RotateTransform(PM1);
break;
case "PM2":
rotateTransform = new RotateTransform(PM2);
break;
case "PM3":
rotateTransform = new RotateTransform(PM3);
break;
case "PM4":
rotateTransform = new RotateTransform(PM4);
break;
}
//local_Wafer.RenderTransform = rotateTransform;
this.UpdateLayout();
}
}
#endregion
}
}
+29
View File
@@ -0,0 +1,29 @@
<UserControl x:Class="SicUI.Controls.Parts.Door"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls.Parts"
xmlns:common="clr-namespace:Aitex.Sorter.Common;assembly=MECF.Framework.Common"
mc:Ignorable="d"
d:DesignHeight="11" d:DesignWidth="94">
<Border BorderThickness="0" x:Name="root">
<Image x:Name="image" Width="94" Height="11">
<Image.Resources>
<Style TargetType="Image" >
<Style.Triggers>
<DataTrigger Binding="{Binding State}" Value="{x:Static common:FoupDoorState.Unknown}">
<Setter Property="Source" Value="/SicUI;component/Themes/images/parts/doorunknown.png" />
</DataTrigger>
<DataTrigger Binding="{Binding State}" Value="{x:Static common:FoupDoorState.Open}">
<Setter Property="Source" Value="/SicUI;component/Themes/images/parts/dooropen.png" />
</DataTrigger>
<DataTrigger Binding="{Binding State}" Value="{x:Static common:FoupDoorState.Close}">
<Setter Property="Source" Value="/SicUI;component/Themes/images/parts/doorclose.png" />
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Resources>
</Image>
</Border>
</UserControl>
+42
View File
@@ -0,0 +1,42 @@
using Aitex.Sorter.Common;
using System;
using System.Collections.Generic;
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;
namespace SicUI.Controls.Parts
{
/// <summary>
/// Door.xaml 的交互逻辑
/// </summary>
public partial class Door : UserControl
{
public Door()
{
InitializeComponent();
root.DataContext = this;
}
public FoupDoorState State
{
get { return (FoupDoorState)GetValue(StateProperty); }
set { SetValue(StateProperty, value); }
}
// Using a DependencyProperty as the backing store for State. This enables animation, styling, binding, etc...
public static readonly DependencyProperty StateProperty =
DependencyProperty.Register("State", typeof(FoupDoorState), typeof(Door), new FrameworkPropertyMetadata(FoupDoorState.Unknown));
}
}
+264
View File
@@ -0,0 +1,264 @@
<UserControl
x:Class="SicUI.Controls.Mainframe.EFEMControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:SicUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls.M2C4Parts"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:unitControls="clr-namespace:MECF.Framework.UI.Client.Ctrlib.UnitControls;assembly=MECF.Framework.UI.Client"
d:DesignHeight="360"
d:DesignWidth="660"
mc:Ignorable="d">
<Canvas>
<Path
Canvas.Left="427.2"
Canvas.Top="151.041"
Width="167.8"
Height="160.959"
Data="M573,221 L571,215 595,244 553,312 531,297 522,282 C522,282 495,283 482,279 471.19749,275.67615 450.72801,257.85184 444.11644,247.90441 442.99887,246.22296 430,241 430,241 L427.1997,170.99239 433.04081,170.57377 455,169 466,162 485,154 C485,154 493,149 505,152 517,155 555,152.00043 570,198.0003"
Fill="Silver"
Stretch="Fill" />
<Path
Canvas.Left="134"
Canvas.Top="112"
Width="208"
Height="198"
Data="M134,155 L196,152 192,134 276,112 283,145 293,150 300,157 304,162 308,168 342,168 339,250 335,274 278,310 256,278 244,299 235,309 166,278 186,254 145,252"
Fill="Silver"
Stretch="Fill" />
<Image
Canvas.Left="179"
Canvas.Top="129"
Height="150"
Source="Images/tm.png" />
<Image
Canvas.Left="430"
Canvas.Top="142"
Height="150"
Source="Images/tm.png" />
<Canvas Visibility="{Binding IsLLInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<unitControls:Door
Canvas.Left="333"
Canvas.Top="155"
Width="92"
Height="8"
IsDoorOpen="{Binding IsLLDoorOpen}"
RenderTransformOrigin="0.5,0.5" />
<Image
Canvas.Left="327"
Canvas.Top="158"
Height="100"
Source="Images/wf.png" />
<unitControls:Door
Canvas.Left="288"
Canvas.Top="200"
Width="80"
Height="8"
IsDoorOpen="{Binding IsEfemLLLeftDoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="90" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
<unitControls:Door
Canvas.Left="391"
Canvas.Top="200"
Width="80"
Height="8"
IsDoorOpen="{Binding IsEfemLLRightDoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="90" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<Canvas Visibility="{Binding IsUnLoadInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="173"
Canvas.Top="37"
Height="100"
RenderTransformOrigin="0.5,0.5"
Source="Images/wf.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="-13.5" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<unitControls:Door
Canvas.Left="192"
Canvas.Top="131"
Width="92"
Height="8"
IsDoorOpen="{Binding IsEfemUnLoadDoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="-13.873" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
<unitControls:Door
Canvas.Left="232"
Canvas.Top="72"
Width="82"
Height="8"
IsDoorOpen="{Binding IsUnLoadDoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="76.127" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<Canvas Visibility="{Binding IsAlignerInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="75"
Canvas.Top="129"
Width="90"
Source="Images/Alinger.png" />
</Canvas>
<local:RobotEfemTray
Canvas.Left="482"
Canvas.Top="189"
Height="40"
HasTray="{Binding TrayRobotHaveTray}"
HasWafer="{Binding TrayRobotIsArmWater}"
RobotMoveInfo="{Binding TrayRobotMoveInfo}"
ShowDock="False"
Wafer1="{Binding TrayRobotWafer}" />
<Canvas Visibility="{Binding IsLLInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="331"
Canvas.Top="161"
Width="95"
Source="Images/pm52.png"
Visibility="{Binding LoadLockHaveTray}" />
</Canvas>
<local:RobotEfemWafer
Canvas.Left="232"
Canvas.Top="183"
Height="40"
HasWafer="{Binding WaferRobotIsArmWater}"
RobotMoveInfo="{Binding WaferRobotMoveInfo}"
ShowDock="False"
Wafer1="{Binding WaferRobotWafer}" />
<Canvas>
<Image
Canvas.Left="269"
Canvas.Top="251"
RenderTransformOrigin="0.5,0.5"
Source="Images/Layout07.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="145.128" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image
Canvas.Left="145"
Canvas.Top="253"
RenderTransformOrigin="0.5,0.5"
Source="Images/Layout07.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="212.156" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image
Canvas.Left="542"
Canvas.Top="238"
RenderTransformOrigin="0.5,0.5"
Source="Images/Layout08.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="128.669" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
</Canvas>
<Canvas Visibility="{Binding IsUnLoadInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="178"
Canvas.Top="40"
Width="95"
Source="Images/pm52.png"
Visibility="{Binding UnLoadHaveTray}" />
</Canvas>
<Canvas Visibility="{Binding IsUnLoadInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<controls:WaferCtrl
Canvas.Left="196"
Canvas.Top="58"
Width="60"
Height="60"
IsEnabled="{Binding EnableWaferClick}"
WaferData="{Binding UnLoadWafer}" />
</Canvas>
<Canvas Visibility="{Binding IsLLInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<controls:WaferCtrl
Canvas.Left="349"
Canvas.Top="180"
Width="60"
Height="60"
IsEnabled="{Binding LLEnableWaferClick}"
WaferData="{Binding LoadLockWafer}" />
</Canvas>
<Canvas Visibility="{Binding IsAlignerInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<controls:WaferCtrl
Canvas.Left="92"
Canvas.Top="167"
Width="60"
Height="60"
IsEnabled="{Binding EnableWaferClick}"
WaferData="{Binding AlignerWafer}" />
</Canvas>
</Canvas>
</UserControl>
@@ -0,0 +1,15 @@
using System.Windows.Controls;
namespace SicUI.Controls.Mainframe
{
/// <summary>
/// EFEMControl.xaml 的交互逻辑
/// </summary>
public partial class EFEMControl : UserControl
{
public EFEMControl()
{
InitializeComponent();
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+231
View File
@@ -0,0 +1,231 @@
<UserControl x:Class="SicUI.Controls.LoadLock"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:cal="http://www.caliburn.org"
xmlns:controls="http://OpenSEMI.Ctrlib.com/presentation"
xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation"
mc:Ignorable="d">
<UserControl.Resources>
<Storyboard x:Key="Door_Open">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" >
<EasingDoubleKeyFrame KeyTime="0" Value="29"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="Door_Close">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" >
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="29"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="Door_Unknown">
<DoubleAnimation Storyboard.TargetProperty="(FrameworkElement.Height)" To="20" >
</DoubleAnimation>
<ColorAnimation Storyboard.TargetProperty="(Fill).(SolidColorBrush.Color)" To="Red" >
</ColorAnimation>
</Storyboard>
<Storyboard x:Key="Wafer_Up">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)" >
<EasingDoubleKeyFrame KeyTime="0" Value="13"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-5"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="Wafer_Down">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)" >
<EasingDoubleKeyFrame KeyTime="0" Value="-5"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="13"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Style TargetType="{x:Type Rectangle}" x:Key="ATM_Animation" >
<Style.Triggers>
<DataTrigger Binding="{Binding ATMDoorStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Value="Open">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource Door_Open}"/>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource Door_Close}"/>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type Rectangle}" x:Key="SlitValve_Animation" >
<Style.Triggers>
<DataTrigger Binding="{Binding SlitValveStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Value="Open">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource Door_Open}"/>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource Door_Close}"/>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type TextBlock}" x:Key="Text_Online" >
<Style.Triggers>
<DataTrigger Binding="{Binding UnitData.IsOnline, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Value="True">
<Setter Property="Foreground" Value="{DynamicResource FG_Green}" />
</DataTrigger>
<DataTrigger Binding="{Binding UnitData.IsOnline, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Value="False">
<Setter Property="Foreground" Value="{DynamicResource FG_Black}" />
</DataTrigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="100"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15"/>
<ColumnDefinition />
<ColumnDefinition Width="15"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.ColumnSpan="3" FontFamily="Arial" FontSize="14" Style="{StaticResource Text_Online}" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed">
<Run Text="{Binding UnitData.ModuleID, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"/>
<Run Text=" Front View"/>
</TextBlock>
<TextBlock Grid.Row="1" Text="ATM Door" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Arial" FontSize="12" Foreground="{DynamicResource FG_Black}">
<TextBlock.LayoutTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-90"/>
<TranslateTransform/>
</TransformGroup>
</TextBlock.LayoutTransform>
</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="2" Text="Slit Valve" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Arial" FontSize="12" Foreground="{DynamicResource FG_Black}">
<TextBlock.LayoutTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="90"/>
<TranslateTransform/>
</TransformGroup>
</TextBlock.LayoutTransform>
</TextBlock>
<Border Grid.Column="1" Grid.Row="1" BorderThickness="1" BorderBrush="{DynamicResource FOUP_OuterBD}" Background="{DynamicResource FOUP_OuterBG}" Width="150">
<Grid>
<Rectangle Fill="{DynamicResource FOUP_InnerBG}" Margin="15,5,10,5"/>
<Rectangle Fill="{DynamicResource FOUP_InnerBG}" Margin="0,25,0,15"/>
<Rectangle Fill="{DynamicResource FOUP_InnerGrow}" Margin="18,8,13,8">
<Rectangle.Effect>
<BlurEffect Radius="15"/>
</Rectangle.Effect>
</Rectangle>
<Rectangle Fill="{DynamicResource FOUP_InnerGrow}" Margin="3,28,3,18">
<Rectangle.Effect>
<BlurEffect Radius="15"/>
</Rectangle.Effect>
</Rectangle>
<Grid Margin="15,10,10,10">
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid>
<TextBlock TextWrapping="NoWrap" Text="" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Arial" FontSize="12" TextAlignment="Center" />
</Grid>
<Canvas Grid.Row="1">
<StackPanel x:Name="LoadLock_Body" Grid.Row="1" Width="123" Canvas.Left="0" Canvas.Top="-5">
<Grid Height="22">
<Rectangle Height="4" Width="20" HorizontalAlignment="Left" Fill="{DynamicResource FOUP_PathBG}" VerticalAlignment="Bottom" >
<Rectangle.Effect>
<DropShadowEffect Direction="270" BlurRadius="0" ShadowDepth="1"/>
</Rectangle.Effect>
</Rectangle>
<Rectangle Height="4" Width="30" HorizontalAlignment="Right" Fill="{DynamicResource FOUP_PathBG}" VerticalAlignment="Bottom" >
<Rectangle.Effect>
<DropShadowEffect Direction="270" BlurRadius="0" ShadowDepth="1"/>
</Rectangle.Effect>
</Rectangle>
<ctrl:Slot ViewType="Front" x:Name="LL2" DataContext="{Binding UnitData.WaferManager.Wafers[1], RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" WaferStatus="{Binding WaferStatus}" SlotID="{Binding SlotID}" ModuleID="{Binding ModuleID}" SourceName="{Binding SourceName}" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,6,11,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SlotMouseButtonDown">
<cal:ActionMessage MethodName="OnMouseUp">
<cal:Parameter Value="$source" />
<cal:Parameter Value="$eventargs" />
</cal:ActionMessage>
</i:EventTrigger>
<i:EventTrigger EventName="WaferTransferStarted">
<cal:ActionMessage MethodName="OnWaferTransfer">
<cal:Parameter Value="$eventargs" />
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</ctrl:Slot>
<TextBlock x:Name="LL_Text1" HorizontalAlignment="Right" Margin="0,0,0,4" TextWrapping="NoWrap" Text="2" Background="#FF646464" Foreground="White" VerticalAlignment="Bottom" FontFamily="Arial" FontSize="10" Width="13" TextAlignment="Center">
</TextBlock>
</Grid>
<Grid Height="22">
<Rectangle Height="4" Width="20" HorizontalAlignment="Left" Fill="{DynamicResource FOUP_PathBG}" VerticalAlignment="Bottom" >
<Rectangle.Effect>
<DropShadowEffect Direction="270" BlurRadius="0" ShadowDepth="1"/>
</Rectangle.Effect>
</Rectangle>
<Rectangle Height="4" Width="30" HorizontalAlignment="Right" Fill="{DynamicResource FOUP_PathBG}" VerticalAlignment="Bottom" >
<Rectangle.Effect>
<DropShadowEffect Direction="270" BlurRadius="0" ShadowDepth="1"/>
</Rectangle.Effect>
</Rectangle>
<ctrl:Slot ViewType="Front" DataContext="{Binding UnitData.WaferManager.Wafers[0], RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" WaferStatus="{Binding WaferStatus}" SlotID="{Binding SlotID}" ModuleID="{Binding ModuleID}" SourceName="{Binding SourceName}" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,6,11,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SlotMouseButtonDown">
<cal:ActionMessage MethodName="OnMouseUp">
<cal:Parameter Value="$source" />
<cal:Parameter Value="$eventargs" />
</cal:ActionMessage>
</i:EventTrigger>
<i:EventTrigger EventName="WaferTransferStarted">
<cal:ActionMessage MethodName="OnWaferTransfer">
<cal:Parameter Value="$eventargs" />
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</ctrl:Slot>
<TextBlock x:Name="LL_Text2" HorizontalAlignment="Right" Margin="0,0,0,4" TextWrapping="NoWrap" Text="1" Background="#FF646464" Foreground="White" VerticalAlignment="Bottom" FontFamily="Arial" FontSize="10" Width="13" TextAlignment="Center">
</TextBlock>
</Grid>
<StackPanel.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding CurrentSlot, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Value="1">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource Wafer_Down}"/>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource Wafer_Up}"/>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
</StackPanel>
</Canvas>
</Grid>
<Grid Margin="1,25,1,15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="8"/>
<ColumnDefinition />
<ColumnDefinition Width="4"/>
</Grid.ColumnDefinitions>
<Grid x:Name="ATM_Door">
<Rectangle x:Name="ATMDoor_Top" Style="{StaticResource ATM_Animation}" Fill="Black" Width="8" VerticalAlignment="Top" Height="29" />
<Rectangle x:Name="ATMDoor_Bottom" Style="{StaticResource ATM_Animation}" Fill="Black" Width="8" VerticalAlignment="Bottom" Height="29" />
</Grid>
<Grid x:Name="Slit_valve" Grid.Column="2">
<Rectangle x:Name="SlitValve_Top" Style="{StaticResource SlitValve_Animation}" Fill="Black" Width="8" VerticalAlignment="Top" Height="29"/>
<Rectangle x:Name="SlitValve_Bottom" Style="{StaticResource SlitValve_Animation}" Fill="Black" Width="8" VerticalAlignment="Bottom" Height="29"/>
</Grid>
</Grid>
</Grid>
</Border>
</Grid>
</UserControl>
+65
View File
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
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 OpenSEMI.ClientBase;
using Aitex.Sorter.Common;
using MECF.Framework.UI.Client.ClientBase;
namespace SicUI.Controls
{
/// <summary>
/// LoadLock.xaml 的交互逻辑
/// </summary>
public partial class LoadLock : UserControl
{
public LoadLock()
{
InitializeComponent();
}
#region UnitData (DependencyProperty)
public ModuleInfo UnitData
{
get { return (ModuleInfo)GetValue(UnitDataProperty); }
set { SetValue(UnitDataProperty, value); }
}
public static readonly DependencyProperty UnitDataProperty =
DependencyProperty.Register("UnitData", typeof(ModuleInfo), typeof(LoadLock), new UIPropertyMetadata(null));
public FoupDoorState ATMDoorStatus
{
get { return (FoupDoorState)GetValue(ATMDoorStatusProperty); }
set { SetValue(ATMDoorStatusProperty, value); }
}
public static readonly DependencyProperty ATMDoorStatusProperty =
DependencyProperty.Register("ATMDoorStatus", typeof(FoupDoorState), typeof(LoadLock), new UIPropertyMetadata(FoupDoorState.Close));
public FoupDoorState SlitValveStatus
{
get { return (FoupDoorState)GetValue(SlitValveStatusProperty); }
set { SetValue(SlitValveStatusProperty, value); }
}
public static readonly DependencyProperty SlitValveStatusProperty =
DependencyProperty.Register("SlitValveStatus", typeof(FoupDoorState), typeof(LoadLock), new UIPropertyMetadata(FoupDoorState.Close));
public int CurrentSlot
{
get { return (int)GetValue(CurrentSlotProperty); }
set { SetValue(CurrentSlotProperty, value); }
}
public static readonly DependencyProperty CurrentSlotProperty =
DependencyProperty.Register("CurrentSlot", typeof(int), typeof(LoadLock), new UIPropertyMetadata(0));
#endregion
}
}
+423
View File
@@ -0,0 +1,423 @@
<UserControl
x:Class="SicUI.Controls.M2C4Parts.M2C4EFEMView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:SicUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:efempart="clr-namespace:SicUI.Controls.M2C4Parts"
xmlns:local="clr-namespace:SicUI.Controls.M2C4Parts"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:unitControls="clr-namespace:MECF.Framework.UI.Client.Ctrlib.UnitControls;assembly=MECF.Framework.UI.Client"
Width="771"
Height="699"
mc:Ignorable="d">
<Grid
x:Name="root"
Height="800"
VerticalAlignment="Top">
<Canvas>
<Canvas Canvas.Top="300">
<Path
Canvas.Left="427.2"
Canvas.Top="151.041"
Width="167.8"
Height="160.959"
Data="M573,221 L571,215 595,244 553,312 531,297 522,282 C522,282 495,283 482,279 471.19749,275.67615 450.72801,257.85184 444.11644,247.90441 442.99887,246.22296 430,241 430,241 L427.1997,170.99239 433.04081,170.57377 455,169 466,162 485,154 C485,154 493,149 505,152 517,155 555,152.00043 570,198.0003"
Fill="Silver"
Stretch="Fill" />
<Path
Canvas.Left="134"
Canvas.Top="112"
Width="208"
Height="198"
Data="M134,155 L196,152 192,134 276,112 283,145 293,150 300,157 304,162 308,168 342,168 339,250 335,274 278,310 256,278 244,299 235,309 166,278 186,254 145,252"
Fill="Silver"
Stretch="Fill" />
</Canvas>
<Image
Canvas.Left="254"
Canvas.Top="233"
Source="Images/tm1.png" />
<Image
Canvas.Left="341.166"
Canvas.Top="327.333"
Source="Images/tm3.png" />
<Canvas Visibility="{Binding IsPM1Installed, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="198"
Canvas.Top="121"
Width="160"
Source="Images/pmbg51.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="0.43" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<unitControls:Door
Canvas.Left="272"
Canvas.Top="264"
Width="90"
Height="8"
IsDoorOpen="{Binding IsPM1DoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="-30.127" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<Canvas Visibility="{Binding IsPM2Installed, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="398"
Canvas.Top="123"
Width="160"
RenderTransformOrigin="0.5,0.5"
Source="Images/pmbg41.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="0.535" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<unitControls:Door
Canvas.Left="392"
Canvas.Top="267"
Width="90"
Height="8"
IsDoorOpen="{Binding IsPM2DoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="30.086" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<Canvas Visibility="{Binding IsUnLoadInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="174"
Canvas.Top="339"
RenderTransformOrigin="0.5,0.5"
Source="Images/wf.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="-13.5" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<unitControls:Door
Canvas.Left="232"
Canvas.Top="372"
Width="82"
Height="8"
IsDoorOpen="{Binding IsUnLoadDoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="76.127" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<Canvas Visibility="{Binding IsLLInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<unitControls:Door
Canvas.Left="330"
Canvas.Top="455"
Width="90"
Height="8"
IsDoorOpen="{Binding IsLLDoorOpen}"
RenderTransformOrigin="0.5,0.5" />
<Image
Canvas.Left="327"
Canvas.Top="458"
Source="Images/wf.png" />
</Canvas>
<local:AtmRobotMultiLP
Canvas.Left="349"
Canvas.Top="316"
Width="550"
Height="80"
HasTray="{Binding TMRobotHaveTray}"
HasWafer="{Binding IsArmWater}"
IsEnabled="{Binding TMEnableWaferClick}"
RobotMoveInfo="{Binding TmRobotMoveInfo}"
ShowDock="False"
ToolTipService.ShowOnDisabled="True"
Wafer1="{Binding TMRobotWafer1}" />
<Canvas Canvas.Top="300">
<Image
Canvas.Left="179"
Canvas.Top="129"
Height="150"
Source="Images/tm.png" />
<Image
Canvas.Left="430"
Canvas.Top="142"
Height="150"
Source="Images/tm.png" />
<Image
Canvas.Left="75"
Canvas.Top="129"
Width="90"
Source="Images/Alinger.png" />
<local:RobotEfemTray
Canvas.Left="482"
Canvas.Top="189"
Height="40"
HasTray="{Binding TrayRobotHaveTray}"
HasWafer="{Binding TrayRobotIsArmWater}"
IsEnabled="{Binding TrayRobotEnableWaferClick}"
RobotMoveInfo="{Binding TrayRobotMoveInfo}"
ShowDock="False"
ToolTipService.ShowOnDisabled="True"
Wafer1="{Binding TrayRobotWafer}" />
<Canvas Visibility="{Binding IsLLInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="330"
Canvas.Top="158"
Width="95"
Source="Images/pm52.png"
Visibility="{Binding LoadLockHaveTray}" />
</Canvas>
<local:RobotEfemWafer
Canvas.Left="232"
Canvas.Top="183"
Height="40"
HasWafer="{Binding WaferRobotIsArmWater}"
IsEnabled="{Binding WaferRobotEnableWaferClick}"
RobotMoveInfo="{Binding WaferRobotMoveInfo}"
ShowDock="False"
ToolTipService.ShowOnDisabled="True"
Wafer1="{Binding WaferRobotWafer}" />
<Image
Canvas.Left="275"
Canvas.Top="256"
RenderTransformOrigin="0.5,0.5"
Source="Images/Layout07.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="145.128" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image
Canvas.Left="138"
Canvas.Top="260"
RenderTransformOrigin="0.5,0.5"
Source="Images/Layout07.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="212.156" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image
Canvas.Left="542"
Canvas.Top="238"
RenderTransformOrigin="0.5,0.5"
Source="Images/Layout08.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="128.669" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<controls:WaferCtrl
Canvas.Left="91"
Canvas.Top="167"
Width="60"
Height="60"
IsEnabled="{Binding AlignerEnableWaferClick}"
ToolTipService.ShowOnDisabled="True"
WaferData="{Binding AlignerWafer}" />
<unitControls:Door
Canvas.Left="191"
Canvas.Top="129"
Width="92"
Height="8"
IsDoorOpen="{Binding IsEfemUnLoadDoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="-13.873" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
<unitControls:Door
Canvas.Left="288"
Canvas.Top="200"
Width="80"
Height="8"
IsDoorOpen="{Binding IsEfemLLLeftDoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="90" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
<unitControls:Door
Canvas.Left="388"
Canvas.Top="200"
Width="80"
Height="8"
IsDoorOpen="{Binding IsEfemLLRightDoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="90" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<Canvas Visibility="{Binding IsBufferInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="466"
Canvas.Top="342"
RenderTransformOrigin="0.5,0.5"
Source="Images/Layout09.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="106" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<unitControls:Door
Canvas.Left="435"
Canvas.Top="377"
Width="82"
Height="8"
IsDoorOpen="{Binding IsBufferDoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="106.127" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<!-- 石墨盘和Wafer -->
<Canvas Visibility="{Binding IsPM1Installed, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="239"
Canvas.Top="164"
Width="96"
Source="Images/pm52.png"
Visibility="{Binding PM1HaveTray}" />
<controls:WaferCtrl
Canvas.Left="258"
Canvas.Top="183"
Width="60"
Height="60"
IsEnabled="{Binding PM1EnableWaferClick}"
ToolTipService.ShowOnDisabled="True"
WaferData="{Binding PM1Wafer}" />
</Canvas>
<Canvas Visibility="{Binding IsPM2Installed, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="420"
Canvas.Top="165"
Width="96"
Source="Images/pm52.png"
Visibility="{Binding PM2HaveTray}" />
<controls:WaferCtrl
Canvas.Left="439"
Canvas.Top="184"
Width="60"
Height="60"
IsEnabled="{Binding PM2EnableWaferClick}"
ToolTipService.ShowOnDisabled="True"
WaferData="{Binding PM2Wafer}" />
</Canvas>
<Canvas Visibility="{Binding IsUnLoadInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="176"
Canvas.Top="340"
Width="95"
Source="Images/pm52.png"
Visibility="{Binding UnLoadHaveTray}" />
<controls:WaferCtrl
Canvas.Left="194"
Canvas.Top="358"
Width="60"
Height="60"
IsEnabled="{Binding UnLoadEnableWaferClick}"
ToolTipService.ShowOnDisabled="True"
WaferData="{Binding UnLoadWafer}" />
</Canvas>
<Canvas Visibility="{Binding IsLLInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<!--<Image Source="Images/pm52.png" Canvas.Left="330" Canvas.Top="458" Visibility="{Binding LoadLockHaveTray}" Width="95"/>-->
<controls:WaferCtrl
Canvas.Left="348"
Canvas.Top="476"
Width="60"
Height="60"
IsEnabled="{Binding LLEnableWaferClick}"
ToolTipService.ShowOnDisabled="True"
WaferData="{Binding LoadLockWafer}" />
</Canvas>
</Canvas>
</Grid>
</UserControl>
@@ -0,0 +1,15 @@
using System.Windows.Controls;
namespace SicUI.Controls.M2C4Parts
{
/// <summary>
/// M2C4EFEMView.xaml 的交互逻辑
/// </summary>
public partial class M2C4EFEMView : UserControl
{
public M2C4EFEMView()
{
InitializeComponent();
}
}
}
+253
View File
@@ -0,0 +1,253 @@
<UserControl
x:Class="SicUI.Controls.M2C4Parts.M2C4EFEMView2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:SicUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls.M2C4Parts"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:unitControls="clr-namespace:MECF.Framework.UI.Client.Ctrlib.UnitControls;assembly=MECF.Framework.UI.Client"
Width="771"
Height="699"
mc:Ignorable="d">
<Grid
x:Name="root"
Height="800"
VerticalAlignment="Top">
<Canvas Margin="0,45.333,0,26.667">
<Image
Canvas.Left="254"
Canvas.Top="233"
Source="Images/tm1.png" />
<Image
Canvas.Left="341.166"
Canvas.Top="327.333"
Source="Images/tm3.png" />
<Canvas Visibility="{Binding IsPM1Installed, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="198"
Canvas.Top="121"
Width="160"
Source="Images/pmbg51.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="0.43" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<unitControls:Door
Canvas.Left="273"
Canvas.Top="264"
Width="90"
Height="8"
IsDoorOpen="{Binding IsPM1DoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="-30.127" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<Canvas Visibility="{Binding IsPM2Installed, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="398"
Canvas.Top="123"
Width="160"
Source="Images/pmbg41.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="0.535" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<unitControls:Door
Canvas.Left="390"
Canvas.Top="267"
Width="90"
Height="8"
IsDoorOpen="{Binding IsPM2DoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="30.086" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<Canvas Visibility="{Binding IsUnLoadInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="174"
Canvas.Top="339"
Opacity="0.3"
RenderTransformOrigin="0.5,0.5"
Source="Images/wf.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="-13.5" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<unitControls:Door
Canvas.Left="232"
Canvas.Top="372"
Width="82"
Height="8"
IsDoorOpen="False"
Opacity="0.5"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="76.127" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<Canvas Visibility="{Binding IsLoadLockInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<unitControls:Door
Canvas.Left="336"
Canvas.Top="455"
Width="83"
Height="8"
IsDoorOpen="{Binding IsLLDoorOpen}"
RenderTransformOrigin="0.5,0.5" />
<Image
Canvas.Left="327"
Canvas.Top="458"
Source="Images/wf.png" />
</Canvas>
<local:AtmRobotMultiLP
Canvas.Left="349"
Canvas.Top="316"
Width="550"
Height="80"
HasTray="{Binding TMRobotHaveTray}"
HasWafer="{Binding IsArmWater}"
IsEnabled="{Binding TMEnableWaferClick}"
RobotMoveInfo="{Binding TmRobotMoveInfo}"
RotateAngle="123"
ShowDock="False"
TranslateX="120"
Wafer1="{Binding TMRobotWafer1}" />
<Canvas Visibility="{Binding IsBufferInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="466"
Canvas.Top="343"
RenderTransformOrigin="0.5,0.5"
Source="Images/Layout09.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="106" />
<TranslateTransform />
</TransformGroup>
</Image.RenderTransform>
</Image>
<unitControls:Door
Canvas.Left="435"
Canvas.Top="377"
Width="82"
Height="8"
IsDoorOpen="{Binding IsBufferDoorOpen}"
RenderTransformOrigin="0.5,0.5">
<unitControls:Door.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="106.127" />
<TranslateTransform />
</TransformGroup>
</unitControls:Door.RenderTransform>
</unitControls:Door>
</Canvas>
<Canvas Visibility="{Binding IsPM1Installed, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="239"
Canvas.Top="164"
Width="96"
Source="Images/pm52.png"
Visibility="{Binding PM1HaveTray}" />
<controls:WaferCtrl
Canvas.Left="258"
Canvas.Top="183"
Width="60"
Height="60"
IsEnabled="{Binding PM1EnableWaferClick}"
IsRotary="{Binding IsPm1WaferRotary}"
WaferData="{Binding PM1Wafer}" />
</Canvas>
<Canvas Visibility="{Binding IsPM2Installed, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="420"
Canvas.Top="165"
Width="96"
Source="Images/pm52.png"
Visibility="{Binding PM2HaveTray}" />
<controls:WaferCtrl
Canvas.Left="439"
Canvas.Top="184"
Width="60"
Height="60"
IsEnabled="{Binding PM2EnableWaferClick}"
IsRotary="{Binding IsPm2WaferRotary}"
WaferData="{Binding PM2Wafer}" />
</Canvas>
<Canvas Visibility="{Binding IsUnLoadInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="176"
Canvas.Top="340"
Width="95"
Opacity="0.5"
Source="Images/pm52.png"
Visibility="{Binding UnLoadHaveTray}" />
<controls:WaferCtrl
Canvas.Left="191"
Canvas.Top="358"
Width="66"
Height="60"
IsEnabled="{Binding EnableWaferClick}"
WaferData="{Binding UnLoadWafer}" />
</Canvas>
<Canvas Visibility="{Binding IsLoadLockInstalled, Converter={StaticResource BoolVisibilityConverter}}">
<Image
Canvas.Left="330"
Canvas.Top="459"
Width="95"
Source="Images/pm52.png"
Visibility="{Binding LoadLockHaveTray}" />
<controls:WaferCtrl
Canvas.Left="348"
Canvas.Top="477"
Width="60"
Height="60"
IsEnabled="{Binding LLEnableWaferClick}"
WaferData="{Binding LoadLockWafer}" />
</Canvas>
</Canvas>
</Grid>
</UserControl>
@@ -0,0 +1,44 @@
using System.Windows;
using System.Windows.Controls;
namespace SicUI.Controls.M2C4Parts
{
/// <summary>
/// M2C4EFEMView2.xaml 的交互逻辑
/// </summary>
public partial class M2C4EFEMView2 : UserControl
{
public M2C4EFEMView2()
{
InitializeComponent();
}
public bool IsPM1DoorOpen
{
get { return (bool)GetValue(IsPM1DoorOpenProperty); }
set { SetValue(IsPM1DoorOpenProperty, value); }
}
public static readonly DependencyProperty IsPM1DoorOpenProperty =
DependencyProperty.Register("IsPM1DoorOpen", typeof(bool), typeof(M2C4EFEMView2), new FrameworkPropertyMetadata(false));
public bool IsPM2DoorOpen
{
get { return (bool)GetValue(IsPM2DoorOpenProperty); }
set { SetValue(IsPM2DoorOpenProperty, value); }
}
public static readonly DependencyProperty IsPM2DoorOpenProperty =
DependencyProperty.Register("IsPM2DoorOpen", typeof(bool), typeof(M2C4EFEMView2), new FrameworkPropertyMetadata(false));
public bool IsLLDoorOpen
{
get { return (bool)GetValue(IsLLDoorOpenProperty); }
set { SetValue(IsLLDoorOpenProperty, value); }
}
public static readonly DependencyProperty IsLLDoorOpenProperty =
DependencyProperty.Register("IsLLDoorOpen", typeof(bool), typeof(M2C4EFEMView2), new FrameworkPropertyMetadata(false));
}
}
File diff suppressed because it is too large Load Diff
+39
View File
@@ -0,0 +1,39 @@
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
namespace SicUI.Controls.Parts
{
public class StatsDataListItem : NotifiableItem
{
public string Gas { get; set; }
public string GasName { get; set; }
public string Flow { get; set; }
public string ActualFlow { get; set; }
public string Error { get; set; }
public string InvertedVolume { get; set; }
public string DataTime { get; set; }
public string ElapseTime { get; set; }
}
/// <summary>
/// Interaction logic for IOView.xaml
/// </summary>
public partial class MFCView : UserControl
{
public ObservableCollection<StatsDataListItem> StatData
{
get { return (ObservableCollection<StatsDataListItem>)GetValue(StatDataProperty); }
set { SetValue(StatDataProperty, value); }
}
// Using a DependencyProperty as the backing store for StatData. This enables animation, styling, binding, etc...
public static readonly DependencyProperty StatDataProperty =
DependencyProperty.Register("StatData", typeof(ObservableCollection<StatsDataListItem>), typeof(MFCView), new PropertyMetadata(null));
public MFCView()
{
InitializeComponent();
}
}
}
+126
View File
@@ -0,0 +1,126 @@
using Aitex.Core.Common;
using Aitex.Core.UI.MVVM;
using Aitex.Sorter.Common;
using SicUI.Controls.Common;
using MECF.Framework.Common.Equipment;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using SicUI.Client;
namespace SicUI.Controls.Parts
{
public class MFModel : ViewModelControl
{
//public FoupDoorState PM1DoorState
//{
// get;
// set;
//}
//public FoupDoorState PM2DoorState
//{
// get;
// set;
//}
//public FoupDoorState PM3DoorState
//{
// get;
// set;
//}
//public FoupDoorState LL1ATMDoorState
//{
// get;
// set;
//}
//public FoupDoorState LL1VTMDoorState
//{
// get;
// set;
//}
//public WaferInfo PM1Wafer
//{
// get;
// set;
//}
//public WaferInfo PM2Wafer
//{
// get;
// set;
//}
//public WaferInfo PM3Wafer
//{
// get;
// set;
//}
//public WaferInfo LL1Wafer
//{
// get;
// set;
//}
//public WaferInfo[] RobotWafers
//{
// get;
// set;
//}
// PM1.A LL1.A PM2.B
public ModuleName TMRobotBladeTarget
{
get;
set;
}
public string ArmAExtended
{
get;
set;
}
public string ArmBExtended
{
get;
set;
}
public ICommand DeviceOperationCommand
{
get;
private set;
}
public MFModel()
{
DeviceOperationCommand = new DelegateCommand<object>(DeviceOperation);
// if (ModuleManager.ModuleInfos.ContainsKey("PM1"))
// PM1Wafer = ModuleManager.ModuleInfos["PM1"].WaferManager.AitexWafers[0];
//if (ModuleManager.ModuleInfos.ContainsKey("PM2"))
// PM2Wafer = ModuleManager.ModuleInfos["PM2"].WaferManager.AitexWafers[0];
//if (ModuleManager.ModuleInfos.ContainsKey("PM3"))
// PM3Wafer = ModuleManager.ModuleInfos["PM3"].WaferManager.AitexWafers[0];
//if (ModuleManager.ModuleInfos.ContainsKey("TMRobot"))
// RobotWafers = ModuleManager.ModuleInfos["TMRobot"].WaferManager.AitexWafers;
}
void DeviceOperation(object param)
{
//InvokeClient.Instance.Service.DoOperation(OperationName.DeviceOperation.ToString(), (object[])param);
}
}
}
@@ -0,0 +1,73 @@
<UserControl
x:Class="SicUI.Controls.M2C4Parts.RobotEfemTray"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Common="clr-namespace:SicUI.Controls.Common"
xmlns:controls="clr-namespace:SicUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls.M2C4Parts"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:extendedControls="clr-namespace:MECF.Framework.UI.Core.ExtendedControls;assembly=MECF.Framework.UI.Core"
d:DesignHeight="38"
d:DesignWidth="416"
mc:Ignorable="d">
<UserControl.Resources>
<extendedControls:BindingProxy x:Key="proxy" Data="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}"/>
</UserControl.Resources>
<Viewbox Stretch="Uniform">
<Canvas
x:Name="root"
Width="416"
Height="38">
<Image
Width="75"
Height="80"
Margin="-20,-24"
Source="Images/AtmRobotMultiLP/dock.png"
Visibility="{Binding ShowDock, Converter={StaticResource BoolVisibilityConverter}}" />
<Common:AxisCanvas
x:Name="canvas1"
Canvas.Left="10"
Canvas.Top="10"
Width="68"
Height="21">
<Image Source="Images/AtmRobotMultiLP/dq01.png" />
<Common:AxisCanvas
x:Name="canvas2"
Canvas.Left="36"
Width="46"
Height="21">
<Image Source="Images/AtmRobotMultiLP/dq01.png" />
<Common:AxisCanvas
x:Name="canvas3"
Canvas.Left="36"
Canvas.Top="-8"
Width="80"
Height="38">
<Image Source="Images/AtmRobotMultiLP/dq02.png" />
<Image
Canvas.Left="-6"
Canvas.Top="-29"
Width="95"
Source="Images/pm52.png"
Visibility="{Binding HasTray}" />
<controls:WaferCtrl
Canvas.Left="11"
Canvas.Top="-12"
Width="60"
Height="60"
WaferData="{Binding Wafer1}" />
</Common:AxisCanvas>
</Common:AxisCanvas>
</Common:AxisCanvas>
<Canvas.RenderTransform>
<TransformGroup>
<RotateTransform Angle="{Binding Source={StaticResource proxy},Path=Data.RotateAngle}" CenterY="30" />
<TranslateTransform x:Name="translate" X="{Binding Source={StaticResource proxy},Path=Data.TranslateX}" />
</TransformGroup>
</Canvas.RenderTransform>
</Canvas>
</Viewbox>
</UserControl>
@@ -0,0 +1,538 @@
using SicUI.Controls.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace SicUI.Controls.M2C4Parts
{
/// <summary>
/// RobotEfemTray.xaml 的交互逻辑
/// </summary>
public partial class RobotEfemTray : UserControl, INotifyPropertyChanged
{
private int moveTime = 300;
private const int AnimationTimeout = 3000; // ms
private string CurrentPosition
{
get; set;
}
private RobotAction CurrentAction
{
get; set;
}
public int MoveTime
{
get => moveTime;
set
{
moveTime = value;
}
}
public bool ShowDock
{
get { return (bool)GetValue(ShowDockProperty); }
set { SetValue(ShowDockProperty, value); }
}
// Using a DependencyProperty as the backing store for ShowDock. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ShowDockProperty =
DependencyProperty.Register("ShowDock", typeof(bool), typeof(RobotEfemTray), new PropertyMetadata(false));
public double RotateAngle
{
get { return (double)GetValue(RotateAngleProperty); }
set { SetValue(RotateAngleProperty, value); }
}
// Using a DependencyProperty as the backing store for RotateAngle. This enables animation, styling, binding, etc...
public static readonly DependencyProperty RotateAngleProperty =
DependencyProperty.Register("RotateAngle", typeof(int), typeof(RobotEfemTray), new PropertyMetadata(0.0));
public double TranslateX
{
get { return (double)GetValue(TranslateXProperty); }
set { SetValue(TranslateXProperty, value); }
}
// Using a DependencyProperty as the backing store for TranslateX. This enables animation, styling, binding, etc...
public static readonly DependencyProperty TranslateXProperty =
DependencyProperty.Register("TranslateX", typeof(double), typeof(RobotEfemTray), new PropertyMetadata(0.0));
public MECF.Framework.UI.Client.ClientBase.WaferInfo Wafer1
{
get { return (MECF.Framework.UI.Client.ClientBase.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(MECF.Framework.UI.Client.ClientBase.WaferInfo), typeof(RobotEfemTray), new PropertyMetadata(null));
//public Visibility IsArmWater => Wafer1 == null ? Visibility.Hidden : Wafer1.IsVisibility;
public MECF.Framework.UI.Client.ClientBase.WaferInfo Wafer2
{
get { return (MECF.Framework.UI.Client.ClientBase.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(MECF.Framework.UI.Client.ClientBase.WaferInfo), typeof(RobotEfemTray), new PropertyMetadata(null));
public string Station
{
get { return (string)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(string), typeof(RobotEfemTray), new PropertyMetadata("Robot"));
public RobotMoveInfo RobotMoveInfo
{
get { return (RobotMoveInfo)GetValue(RobotMoveInfoProperty); }
set { SetValue(RobotMoveInfoProperty, value); }
}
public static readonly DependencyProperty RobotMoveInfoProperty =
DependencyProperty.Register("RobotMoveInfo", typeof(RobotMoveInfo), typeof(RobotEfemTray), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
public bool WaferPresentA
{
get { return (bool)GetValue(WaferPresentAProperty); }
set { SetValue(WaferPresentAProperty, value); }
}
// Using a DependencyProperty as the backing store for WaferPresent. This enables animation, styling, binding, etc...
public static readonly DependencyProperty WaferPresentAProperty =
DependencyProperty.Register("WaferPresentA", typeof(bool), typeof(RobotEfemTray), new PropertyMetadata(false));
public bool WaferPresentB
{
get { return (bool)GetValue(WaferPresentBProperty); }
set { SetValue(WaferPresentBProperty, value); }
}
// Using a DependencyProperty as the backing store for WaferPresent. This enables animation, styling, binding, etc...
public static readonly DependencyProperty WaferPresentBProperty =
DependencyProperty.Register("WaferPresentB", typeof(bool), typeof(RobotEfemTray), new PropertyMetadata(false));
public ICommand CreateDeleteWaferCommand
{
get { return (ICommand)GetValue(CreateDeleteWaferCommandProperty); }
set { SetValue(CreateDeleteWaferCommandProperty, value); }
}
// Using a DependencyProperty as the backing store for CreateDeleteWaferCommand. This enables animation, styling, binding, etc...
public static readonly DependencyProperty CreateDeleteWaferCommandProperty =
DependencyProperty.Register("CreateDeleteWaferCommand", typeof(ICommand), typeof(RobotEfemTray), new PropertyMetadata(null));
public ICommand MoveWaferCommand
{
get { return (ICommand)GetValue(MoveWaferCommandProperty); }
set { SetValue(MoveWaferCommandProperty, value); }
}
// Using a DependencyProperty as the backing store for MoveWaferCommand. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MoveWaferCommandProperty =
DependencyProperty.Register("MoveWaferCommand", typeof(ICommand), typeof(RobotEfemTray), new PropertyMetadata(null));
public Dictionary<string, StationPosition> StationPosition
{
get { return (Dictionary<string, StationPosition>)GetValue(StationPositionProperty); }
set { SetValue(StationPositionProperty, value); }
}
// Using a DependencyProperty as the backing store for StationPosition. This enables animation, styling, binding, etc... new PropertyMetadata(null, StationPositionChangedCallback)
public static readonly DependencyProperty StationPositionProperty =
DependencyProperty.Register("StationPosition", typeof(Dictionary<string, StationPosition>), typeof(RobotEfemTray), new PropertyMetadata(null, StationPositionChangedCallback));
public Visibility HasWafer
{
get { return (Visibility)GetValue(HasWaferProperty); }
set { SetValue(HasWaferProperty, value); }
}
// Using a DependencyProperty as the backing store for Station. This enables animation, styling, binding, etc...
public static readonly DependencyProperty HasWaferProperty =
DependencyProperty.Register("HasWafer", typeof(Visibility), typeof(RobotEfemTray), new PropertyMetadata(Visibility.Hidden));
public Visibility HasTray
{
get { return (Visibility)GetValue(HasTrayProperty); }
set { SetValue(HasTrayProperty, value); }
}
// Using a DependencyProperty as the backing store for Station. This enables animation, styling, binding, etc...
public static readonly DependencyProperty HasTrayProperty =
DependencyProperty.Register("HasTray", typeof(Visibility), typeof(RobotEfemTray), new PropertyMetadata(Visibility.Hidden));
private List<MenuItem> menu;
public event PropertyChangedEventHandler PropertyChanged;
public List<MenuItem> Menu
{
get
{
return menu;
}
set
{
menu = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Menu"));
}
}
private ICommand MoveCommand
{
get; set;
}
private void MoveTo(object target)
{
MoveRobot((RobotMoveInfo)target);
}
public RobotEfemTray()
{
InitializeComponent();
root.DataContext = this;
MoveCommand = new RelayCommand(MoveTo);
CurrentPosition = "ArmA.System";
canvas1.Rotate(45);
canvas2.Rotate(120);
canvas3.Rotate(120);
StationPosition = new Dictionary<string, StationPosition>
{
{ "ArmA.System",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root=45,
Arm=120,
Hand=120
},
EndPosition= new RobotPosition()
{
Root=45,
Arm=120,
Hand=120
}
}
},
{ "ArmA.CassBL",new StationPosition() //ArmA.PerHeat
{
StartPosition= new RobotPosition()
{
Z=0,
Root = -195,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -315,
Arm = 360,
Hand = 0
}
}
},
{ "ArmA.LoadLock",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root = -60,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -180,
Arm = 360,
Hand = 0
}
}
},{ "System",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root=45,
Arm=120,
Hand=120
},
EndPosition= new RobotPosition()
{
Root=45,
Arm=120,
Hand=120
}
}
},
{ "CassBL",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root = -195,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -315,
Arm = 360,
Hand = 0
}
}
},
{ "LoadLock",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root = -60,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -180,
Arm = 360,
Hand = 0
}
}
},
};
}
static void StationPositionChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var self = (RobotEfemTray)d;
var positions = (Dictionary<string, StationPosition>)e.NewValue;
var menus = new List<MenuItem>();
foreach (var position in positions)
{
var m = new MenuItem() { Header = position.Key };
Enum.TryParse<RobotArm>(position.Key.Split('.')[0], out RobotArm arm);
m.Items.Add(new MenuItem() { Header = "Pick", Command = self.MoveCommand, CommandParameter = new RobotMoveInfo() { BladeTarget = position.Key, Action = RobotAction.Picking, ArmTarget = arm } });
m.Items.Add(new MenuItem() { Header = "Place", Command = self.MoveCommand, CommandParameter = new RobotMoveInfo() { BladeTarget = position.Key, Action = RobotAction.Placing, ArmTarget = arm } });
m.Items.Add(new MenuItem() { Header = "Move", Command = self.MoveCommand, CommandParameter = new RobotMoveInfo() { BladeTarget = position.Key, Action = RobotAction.Moving, ArmTarget = arm } });
menus.Add(m);
}
self.Menu = menus;
self.MoveTo(new RobotMoveInfo() { BladeTarget = positions.First().Key, Action = RobotAction.None });
}
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
if (DesignerProperties.GetIsInDesignMode(this))
{
return;
}
if (RobotMoveInfo != null)
{
var needMove = CurrentPosition != RobotMoveInfo.BladeTarget || CurrentAction != RobotMoveInfo.Action;
if (needMove)
{
LogMsg($" RobotMoveInfo, action:{RobotMoveInfo.Action} armTarget:{RobotMoveInfo.ArmTarget} bladeTarget:{RobotMoveInfo.BladeTarget}");
Invoke(() => MoveRobot(RobotMoveInfo));
CurrentAction = RobotMoveInfo.Action;
CurrentPosition = RobotMoveInfo.BladeTarget;
}
}
}
private void Invoke(Action action)
{
Dispatcher.Invoke(action);
}
private void LogMsg(string msg)
{
var source = "ATM Robot";
Console.WriteLine("{0} {1}", source, msg);
}
private void MoveRobot(RobotMoveInfo moveInfo)
{
canvas1.Stop();
canvas2.Stop();
canvas3.Stop();
//canvas21.Stop();
//canvas22.Stop();
//canvas23.Stop();
if (String.IsNullOrEmpty(CurrentPosition))
{
CurrentPosition = "ArmA.System";
}
var target = moveInfo.BladeTarget;
var arm = moveInfo.ArmTarget;
MoveToStart(arm, CurrentPosition
,
() => TranslateTo(target, () => MoveToStart(arm, target, () =>
{
if (moveInfo.Action != RobotAction.Moving)
{
MoveToEnd(arm, target, () => UpdateWafer(moveInfo));
}
})));
}
private void RotateTo(string station, Action onComplete = null)
{
var position = StationPosition[station];
LogMsg($"Rotate to {position.StartPosition.X}");
}
private void TranslateTo(string station, Action onComplete = null)
{
var position = StationPosition[station];
LogMsg($"Translate to {position.StartPosition.Z}");
Translate(StationPosition[CurrentPosition].StartPosition.Z, position.StartPosition.Z, onComplete);
}
private void MoveToStart(RobotArm arm, string station, Action onComplete = null)
{
LogMsg($"{arm} Move to start {station}");
var position = StationPosition[station];
var storyboard = new Storyboard();
storyboard.Completed += (s, e) => onComplete?.Invoke();
var needRotate = new List<bool>();
//if (arm == RobotArm.ArmA)
{
needRotate.Add(canvas1.Rotate(storyboard, position.StartPosition.Root, true, MoveTime));
needRotate.Add(canvas2.Rotate(storyboard, position.StartPosition.Arm, true, MoveTime));
needRotate.Add(canvas3.Rotate(storyboard, position.StartPosition.Hand, true, MoveTime));
}
//else if (arm == RobotArm.ArmB)
{
//needRotate.Add(canvas21.Rotate(storyboard, position.StartPosition.Root, true, MoveTime));
//needRotate.Add(canvas22.Rotate(storyboard, position.StartPosition.Arm, true, MoveTime));
//needRotate.Add(canvas23.Rotate(storyboard, position.StartPosition.Hand, true, MoveTime));
}
if (needRotate.Any(x => x))
{
storyboard.Begin();
}
else
{
onComplete?.Invoke();
}
CurrentPosition = station;
}
private void MoveToEnd(RobotArm arm, string station, Action onComplete = null)
{
LogMsg($"{arm} move to end {station}");
var position = StationPosition[station];
var storyboard = new Storyboard();
storyboard.Completed += (s, e) => onComplete?.Invoke();
var needRotate = new List<bool>();
if (arm == RobotArm.ArmA || arm == RobotArm.Both)
{
needRotate.Add(canvas1.Rotate(storyboard, position.EndPosition.Root, true, MoveTime));
needRotate.Add(canvas2.Rotate(storyboard, position.EndPosition.Arm, true, MoveTime));
needRotate.Add(canvas3.Rotate(storyboard, position.EndPosition.Hand, true, MoveTime));
}
if (arm == RobotArm.ArmB || arm == RobotArm.Both)
{
//needRotate.Add(canvas21.Rotate(storyboard, position.EndPosition.Root, true, MoveTime));
//needRotate.Add(canvas22.Rotate(storyboard, position.EndPosition.Arm, true, MoveTime));
//needRotate.Add(canvas23.Rotate(storyboard, position.EndPosition.Hand, true, MoveTime));
}
if (needRotate.Any(x => x))
{
storyboard.Begin();
}
else
{
onComplete?.Invoke();
}
CurrentPosition = station;
}
private void UpdateWafer(RobotMoveInfo moveInfo)
{
var waferPresent = false;
switch (moveInfo.Action)
{
case RobotAction.None:
case RobotAction.Moving:
return;
case RobotAction.Picking:
waferPresent = true;
break;
case RobotAction.Placing:
waferPresent = false;
break;
default:
break;
}
switch (moveInfo.ArmTarget)
{
case RobotArm.ArmA:
WaferPresentA = waferPresent;
break;
case RobotArm.ArmB:
WaferPresentB = waferPresent;
break;
case RobotArm.Both:
WaferPresentA = waferPresent;
WaferPresentB = waferPresent;
break;
default:
break;
}
}
private void Translate(int start, int target, Action onComplete = null)
{
AnimationHelper.TranslateX(root, start, target, MoveTime, onComplete);
}
}
}
@@ -0,0 +1,74 @@
<UserControl
x:Class="SicUI.Controls.M2C4Parts.RobotEfemWafer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Common="clr-namespace:SicUI.Controls.Common"
xmlns:controls="clr-namespace:SicUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Controls.M2C4Parts"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:extendedControls="clr-namespace:MECF.Framework.UI.Core.ExtendedControls;assembly=MECF.Framework.UI.Core"
d:DesignHeight="38"
d:DesignWidth="416"
mc:Ignorable="d">
<UserControl.Resources>
<extendedControls:BindingProxy x:Key="proxy" Data="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}"/>
</UserControl.Resources>
<Viewbox Stretch="Uniform">
<Canvas
x:Name="root"
Width="416"
Height="38">
<!--<Canvas.ContextMenu>
<ContextMenu ItemsSource="{Binding Menu}" />
</Canvas.ContextMenu>-->
<Image
Width="75"
Height="80"
Margin="-20,-24"
Source="Images/AtmRobotMultiLP/dock.png"
Visibility="{Binding ShowDock, Converter={StaticResource BoolVisibilityConverter}}" />
<!--<Image Width="38" Height="38" Source="Images/AtmRobotMultiLP/robotDock.png" />-->
<Common:AxisCanvas
x:Name="canvas1"
Canvas.Left="10"
Canvas.Top="10"
Width="68"
Height="21">
<Image Source="Images/AtmRobotMultiLP/dq01.png" />
<Common:AxisCanvas
x:Name="canvas2"
Canvas.Left="36"
Width="46"
Height="21">
<Image Source="Images/AtmRobotMultiLP/dq01.png" />
<Common:AxisCanvas
x:Name="canvas3"
Canvas.Left="36"
Canvas.Top="-8"
Width="80"
Height="38">
<Image Source="Images/AtmRobotMultiLP/dq02.png" />
<!--<Image Source="Images/pm2.png" Canvas.Left="3" Canvas.Top="-41" Visibility="{Binding IsArmWater}"/>-->
<!--<Image Source="Images/pm2.png" Visibility="{Binding HasWafer}" Canvas.Top="-40" Canvas.Left="27" />-->
<controls:WaferCtrl
Canvas.Left="30"
Canvas.Top="-12"
Width="60"
Height="60"
IsEnabled="{Binding EnableWaferClick}"
ToolTipService.ShowOnDisabled="True"
WaferData="{Binding Wafer1}" />
</Common:AxisCanvas>
</Common:AxisCanvas>
</Common:AxisCanvas>
<Canvas.RenderTransform>
<TransformGroup>
<RotateTransform Angle="{Binding Source={StaticResource proxy},Path=Data.RotateAngle}" CenterY="30" />
<TranslateTransform x:Name="translate" X="{Binding Source={StaticResource proxy},Path=Data.TranslateX}" />
</TransformGroup>
</Canvas.RenderTransform>
</Canvas>
</Viewbox>
</UserControl>
@@ -0,0 +1,630 @@
using SicUI.Controls.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace SicUI.Controls.M2C4Parts
{
/// <summary>
/// RobotEfemWafer.xaml 的交互逻辑
/// </summary>
public partial class RobotEfemWafer : UserControl, INotifyPropertyChanged
{
private int moveTime = 300;
private const int AnimationTimeout = 3000; // ms
private string CurrentPosition
{
get; set;
}
private RobotAction CurrentAction
{
get; set;
}
public int MoveTime
{
get => moveTime;
set
{
moveTime = value;
}
}
public bool ShowDock
{
get { return (bool)GetValue(ShowDockProperty); }
set { SetValue(ShowDockProperty, value); }
}
// Using a DependencyProperty as the backing store for ShowDock. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ShowDockProperty =
DependencyProperty.Register("ShowDock", typeof(bool), typeof(RobotEfemWafer), new PropertyMetadata(false));
public double RotateAngle
{
get { return (double)GetValue(RotateAngleProperty); }
set { SetValue(RotateAngleProperty, value); }
}
// Using a DependencyProperty as the backing store for RotateAngle. This enables animation, styling, binding, etc...
public static readonly DependencyProperty RotateAngleProperty =
DependencyProperty.Register("RotateAngle", typeof(double), typeof(RobotEfemWafer), new PropertyMetadata(0.0));
public double TranslateX
{
get { return (double)GetValue(TranslateXProperty); }
set { SetValue(TranslateXProperty, value); }
}
// Using a DependencyProperty as the backing store for TranslateX. This enables animation, styling, binding, etc...
public static readonly DependencyProperty TranslateXProperty =
DependencyProperty.Register("TranslateX", typeof(double), typeof(RobotEfemWafer), new PropertyMetadata(0.0));
public MECF.Framework.UI.Client.ClientBase.WaferInfo Wafer1
{
get { return (MECF.Framework.UI.Client.ClientBase.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(MECF.Framework.UI.Client.ClientBase.WaferInfo), typeof(RobotEfemWafer), new PropertyMetadata(null));
//public Visibility IsArmWater => Wafer1 == null ? Visibility.Hidden : Wafer1.IsVisibility;
public MECF.Framework.UI.Client.ClientBase.WaferInfo Wafer2
{
get { return (MECF.Framework.UI.Client.ClientBase.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(MECF.Framework.UI.Client.ClientBase.WaferInfo), typeof(RobotEfemWafer), new PropertyMetadata(null));
public string Station
{
get { return (string)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(string), typeof(RobotEfemWafer), new PropertyMetadata("Robot"));
public RobotMoveInfo RobotMoveInfo
{
get { return (RobotMoveInfo)GetValue(RobotMoveInfoProperty); }
set { SetValue(RobotMoveInfoProperty, value); }
}
public static readonly DependencyProperty RobotMoveInfoProperty =
DependencyProperty.Register("RobotMoveInfo", typeof(RobotMoveInfo), typeof(RobotEfemWafer), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
public bool WaferPresentA
{
get { return (bool)GetValue(WaferPresentAProperty); }
set { SetValue(WaferPresentAProperty, value); }
}
// Using a DependencyProperty as the backing store for WaferPresent. This enables animation, styling, binding, etc...
public static readonly DependencyProperty WaferPresentAProperty =
DependencyProperty.Register("WaferPresentA", typeof(bool), typeof(RobotEfemWafer), new PropertyMetadata(false));
public bool WaferPresentB
{
get { return (bool)GetValue(WaferPresentBProperty); }
set { SetValue(WaferPresentBProperty, value); }
}
// Using a DependencyProperty as the backing store for WaferPresent. This enables animation, styling, binding, etc...
public static readonly DependencyProperty WaferPresentBProperty =
DependencyProperty.Register("WaferPresentB", typeof(bool), typeof(RobotEfemWafer), new PropertyMetadata(false));
public ICommand CreateDeleteWaferCommand
{
get { return (ICommand)GetValue(CreateDeleteWaferCommandProperty); }
set { SetValue(CreateDeleteWaferCommandProperty, value); }
}
// Using a DependencyProperty as the backing store for CreateDeleteWaferCommand. This enables animation, styling, binding, etc...
public static readonly DependencyProperty CreateDeleteWaferCommandProperty =
DependencyProperty.Register("CreateDeleteWaferCommand", typeof(ICommand), typeof(RobotEfemWafer), new PropertyMetadata(null));
public ICommand MoveWaferCommand
{
get { return (ICommand)GetValue(MoveWaferCommandProperty); }
set { SetValue(MoveWaferCommandProperty, value); }
}
// Using a DependencyProperty as the backing store for MoveWaferCommand. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MoveWaferCommandProperty =
DependencyProperty.Register("MoveWaferCommand", typeof(ICommand), typeof(RobotEfemWafer), new PropertyMetadata(null));
public Dictionary<string, StationPosition> StationPosition
{
get { return (Dictionary<string, StationPosition>)GetValue(StationPositionProperty); }
set { SetValue(StationPositionProperty, value); }
}
// Using a DependencyProperty as the backing store for StationPosition. This enables animation, styling, binding, etc... new PropertyMetadata(null, StationPositionChangedCallback)
public static readonly DependencyProperty StationPositionProperty =
DependencyProperty.Register("StationPosition", typeof(Dictionary<string, StationPosition>), typeof(RobotEfemWafer), new PropertyMetadata(null, StationPositionChangedCallback));
public Visibility HasWafer
{
get { return (Visibility)GetValue(HasWaferProperty); }
set { SetValue(HasWaferProperty, value); }
}
// Using a DependencyProperty as the backing store for Station. This enables animation, styling, binding, etc...
public static readonly DependencyProperty HasWaferProperty =
DependencyProperty.Register("HasWafer", typeof(Visibility), typeof(RobotEfemWafer), new PropertyMetadata(Visibility.Hidden));
private List<MenuItem> menu;
public event PropertyChangedEventHandler PropertyChanged;
public List<MenuItem> Menu
{
get
{
return menu;
}
set
{
menu = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Menu"));
}
}
private ICommand MoveCommand
{
get; set;
}
private void MoveTo(object target)
{
MoveRobot((RobotMoveInfo)target);
}
public RobotEfemWafer()
{
InitializeComponent();
root.DataContext = this;
MoveCommand = new RelayCommand(MoveTo);
CurrentPosition = "System";
canvas1.Rotate(45);
canvas2.Rotate(120);
canvas3.Rotate(120);
StationPosition = new Dictionary<string, StationPosition>
{
{ "System",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root=45,
Arm=120,
Hand=120
},
EndPosition= new RobotPosition()
{
Root=45,
Arm=120,
Hand=120
}
}
},
{ "UnLoad",new StationPosition() //ArmA.ReactorA
{
StartPosition= new RobotPosition()
{
Z=0,
Root = 18,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -102,
Arm = 360,
Hand = 0
}
}
},
{ "LoadLock",new StationPosition() //ArmA.ReactorB
{
StartPosition= new RobotPosition()
{
Z=0,
Root = 123,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = 3,
Arm = 360,
Hand = 0
}
}
},
{ "Aligner",new StationPosition() //ArmA.PerHeat
{
StartPosition= new RobotPosition()
{
Z=0,
Root = -55,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -175,
Arm = 360,
Hand = 0
}
}
},
{ "CassAR",new StationPosition() //ArmA.Buffer
{
StartPosition= new RobotPosition()
{
Z=0,
Root = -183,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -303,
Arm = 360,
Hand = 0
}
}
},
{ "CassAL",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root = -118,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -238,
Arm = 360,
Hand = 0
}
}
},{ "ArmA.System",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root=45,
Arm=120,
Hand=120
},
EndPosition= new RobotPosition()
{
Root=45,
Arm=120,
Hand=120
}
}
},
{ "ArmA.UnLoad",new StationPosition() //ArmA.ReactorA
{
StartPosition= new RobotPosition()
{
Z=0,
Root = 18,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -102,
Arm = 360,
Hand = 0
}
}
},
{ "ArmA.LoadLock",new StationPosition() //ArmA.ReactorB
{
StartPosition= new RobotPosition()
{
Z=0,
Root = 123,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = 3,
Arm = 360,
Hand = 0
}
}
},
{ "ArmA.Aligner",new StationPosition() //ArmA.PerHeat
{
StartPosition= new RobotPosition()
{
Z=0,
Root = -55,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -175,
Arm = 360,
Hand = 0
}
}
},
{ "ArmA.CassAR",new StationPosition() //ArmA.Buffer
{
StartPosition= new RobotPosition()
{
Z=0,
Root = -183,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -303,
Arm = 360,
Hand = 0
}
}
},
{ "ArmA.CassAL",new StationPosition()
{
StartPosition= new RobotPosition()
{
Z=0,
Root = -118,
Arm = 120,
Hand = 120
},
EndPosition= new RobotPosition()
{
Root = -238,
Arm = 360,
Hand = 0
}
}
},
};
//canvas21.Rotate(90);
//canvas22.Rotate(180);
//canvas23.Rotate(180);
}
static void StationPositionChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var self = (RobotEfemWafer)d;
var positions = (Dictionary<string, StationPosition>)e.NewValue;
var menus = new List<MenuItem>();
foreach (var position in positions)
{
var m = new MenuItem() { Header = position.Key };
Enum.TryParse<RobotArm>(position.Key.Split('.')[0], out RobotArm arm);
m.Items.Add(new MenuItem() { Header = "Pick", Command = self.MoveCommand, CommandParameter = new RobotMoveInfo() { BladeTarget = position.Key, Action = RobotAction.Picking, ArmTarget = arm } });
m.Items.Add(new MenuItem() { Header = "Place", Command = self.MoveCommand, CommandParameter = new RobotMoveInfo() { BladeTarget = position.Key, Action = RobotAction.Placing, ArmTarget = arm } });
m.Items.Add(new MenuItem() { Header = "Move", Command = self.MoveCommand, CommandParameter = new RobotMoveInfo() { BladeTarget = position.Key, Action = RobotAction.Moving, ArmTarget = arm } });
menus.Add(m);
}
self.Menu = menus;
self.MoveTo(new RobotMoveInfo() { BladeTarget = positions.First().Key, Action = RobotAction.None });
}
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
if (DesignerProperties.GetIsInDesignMode(this))
{
return;
}
if (RobotMoveInfo != null)
{
var needMove = CurrentPosition != RobotMoveInfo.BladeTarget || CurrentAction != RobotMoveInfo.Action;
if (needMove)
{
LogMsg($" RobotMoveInfo, action:{RobotMoveInfo.Action} armTarget:{RobotMoveInfo.ArmTarget} bladeTarget:{RobotMoveInfo.BladeTarget}");
Invoke(() => MoveRobot(RobotMoveInfo));
CurrentAction = RobotMoveInfo.Action;
CurrentPosition = RobotMoveInfo.BladeTarget;
}
}
}
private void Invoke(Action action)
{
Dispatcher.Invoke(action);
}
private void LogMsg(string msg)
{
var source = "ATM Robot";
Console.WriteLine("{0} {1}", source, msg);
}
private void MoveRobot(RobotMoveInfo moveInfo)
{
canvas1.Stop();
canvas2.Stop();
canvas3.Stop();
var target = moveInfo.BladeTarget;
var arm = moveInfo.ArmTarget;
MoveToStart(arm, CurrentPosition
,
() => TranslateTo(target, () => MoveToStart(arm, target, () =>
{
if (moveInfo.Action != RobotAction.Moving)
{
MoveToEnd(arm, target, () => UpdateWafer(moveInfo));
}
})));
}
private void RotateTo(string station, Action onComplete = null)
{
var position = StationPosition[station];
LogMsg($"Rotate to {position.StartPosition.X}");
}
private void TranslateTo(string station, Action onComplete = null)
{
if (station == null || !StationPosition.ContainsKey(station))
{
station = "ArmA.System";
}
var position = StationPosition[station];
LogMsg($"Translate to {position.StartPosition.Z}");
Translate(StationPosition[CurrentPosition].StartPosition.Z, position.StartPosition.Z, onComplete);
}
private void MoveToStart(RobotArm arm, string station, Action onComplete = null)
{
LogMsg($"{arm} Move to start {station}");
var position = StationPosition[station];
var storyboard = new Storyboard();
storyboard.Completed += (s, e) => onComplete?.Invoke();
var needRotate = new List<bool>();
//if (arm == RobotArm.ArmA)
{
needRotate.Add(canvas1.Rotate(storyboard, position.StartPosition.Root, true, MoveTime));
needRotate.Add(canvas2.Rotate(storyboard, position.StartPosition.Arm, true, MoveTime));
needRotate.Add(canvas3.Rotate(storyboard, position.StartPosition.Hand, true, MoveTime));
}
//else if (arm == RobotArm.ArmB)
{
//needRotate.Add(canvas21.Rotate(storyboard, position.StartPosition.Root, true, MoveTime));
//needRotate.Add(canvas22.Rotate(storyboard, position.StartPosition.Arm, true, MoveTime));
//needRotate.Add(canvas23.Rotate(storyboard, position.StartPosition.Hand, true, MoveTime));
}
if (needRotate.Any(x => x))
{
storyboard.Begin();
}
else
{
onComplete?.Invoke();
}
CurrentPosition = station;
}
private void MoveToEnd(RobotArm arm, string station, Action onComplete = null)
{
LogMsg($"{arm} move to end {station}");
var position = StationPosition[station];
var storyboard = new Storyboard();
storyboard.Completed += (s, e) => onComplete?.Invoke();
var needRotate = new List<bool>();
if (arm == RobotArm.ArmA || arm == RobotArm.Both)
{
needRotate.Add(canvas1.Rotate(storyboard, position.EndPosition.Root, true, MoveTime));
needRotate.Add(canvas2.Rotate(storyboard, position.EndPosition.Arm, true, MoveTime));
needRotate.Add(canvas3.Rotate(storyboard, position.EndPosition.Hand, true, MoveTime));
}
if (arm == RobotArm.ArmB || arm == RobotArm.Both)
{
//needRotate.Add(canvas21.Rotate(storyboard, position.EndPosition.Root, true, MoveTime));
//needRotate.Add(canvas22.Rotate(storyboard, position.EndPosition.Arm, true, MoveTime));
//needRotate.Add(canvas23.Rotate(storyboard, position.EndPosition.Hand, true, MoveTime));
}
if (needRotate.Any(x => x))
{
storyboard.Begin();
}
else
{
onComplete?.Invoke();
}
CurrentPosition = station;
}
private void UpdateWafer(RobotMoveInfo moveInfo)
{
var waferPresent = false;
switch (moveInfo.Action)
{
case RobotAction.None:
case RobotAction.Moving:
return;
case RobotAction.Picking:
waferPresent = true;
break;
case RobotAction.Placing:
waferPresent = false;
break;
default:
break;
}
switch (moveInfo.ArmTarget)
{
case RobotArm.ArmA:
WaferPresentA = waferPresent;
break;
case RobotArm.ArmB:
WaferPresentB = waferPresent;
break;
case RobotArm.Both:
WaferPresentA = waferPresent;
WaferPresentB = waferPresent;
break;
default:
break;
}
}
private void Translate(int start, int target, Action onComplete = null)
{
AnimationHelper.TranslateX(root, start, target, MoveTime, onComplete);
}
}
}

Some files were not shown because too many files have changed in this diff Show More