feat:스테이지모터_Z축 추가 (사용 확인 완료)
This commit is contained in:
parent
dbdc759c98
commit
08aed62c94
@ -171,6 +171,7 @@ namespace ILSOS_PrismaticScanner.Recipes
|
||||
|
||||
private void ApplyParamToReport(ScannerParam param, int parameterNo)
|
||||
{
|
||||
// 26.04.14 확인용
|
||||
// 모델 -> Report (Value = )
|
||||
getReportData($"RecipeNo").Value = _aurora.RecipeManager.ActivatedRecipe().Id;
|
||||
getReportData($"{nameof(param.MarkSpeed)}_{parameterNo}").Value = param.MarkSpeed;
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- ── Stage X Motion (JOG / ABS) ── -->
|
||||
<GroupBox Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Margin="5">
|
||||
<GroupBox Visibility="Collapsed" Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Margin="5">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Text="Stage X Motion" FontSize="20" FontWeight="Bold" Foreground="RoyalBlue"/>
|
||||
</GroupBox.Header>
|
||||
@ -105,6 +105,14 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!-- Stage X Y -->
|
||||
<GroupBox Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Margin="5">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Text="Stage X Y Motion" FontSize="20" FontWeight="Bold" Foreground="RoyalBlue"/>
|
||||
</GroupBox.Header>
|
||||
<local:UCStageMotorMoving/>
|
||||
</GroupBox>
|
||||
|
||||
<!-- ── Motor Status ── -->
|
||||
<GroupBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Margin="5">
|
||||
<GroupBox.Header>
|
||||
|
||||
@ -0,0 +1,315 @@
|
||||
<UserControl x:Class="WeldingCommon.Views.ACS.UCStageMotorMoving"
|
||||
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"
|
||||
xmlns:local="clr-namespace:WeldingCommon.Views.ACS"
|
||||
xmlns:usercontrols="clr-namespace:AuroraUIComponent.UserControls;assembly=AuroraUIComponent"
|
||||
xmlns:conv="clr-namespace:AuroraUIComponent.UIConverter;assembly=AuroraUIComponent"
|
||||
xmlns:acs="clr-namespace:AuroraACS;assembly=AuroraACS"
|
||||
xmlns:YAxisType="clr-namespace:WeldingCommon"
|
||||
xmlns:dev="clr-namespace:Aurora.Api.Devices;assembly=Aurora"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
d:DataContext="{d:DesignInstance Type=local:UCStageMotorMovingViewModel}"
|
||||
x:Name="ucs"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style x:Key="StTBMonitorName" TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Top"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="FontSize" Value="10"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="Margin" Value="5 0"/>
|
||||
</Style>
|
||||
<Style x:Key="StTBPosition" TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
<Setter Property="FontSize" Value="24"/>
|
||||
<Setter Property="Padding" Value="5 5 5 7"/>
|
||||
<Setter Property="Foreground" Value="#A50034"/>
|
||||
</Style>
|
||||
|
||||
<conv:EnumConverter x:Key="EnumConverter"/>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<i:Interaction.Triggers>
|
||||
<i:PropertyChangedTrigger Binding="{Binding IsVisible, ElementName=ucs}">
|
||||
<i:InvokeCommandAction Command="{Binding CMD_VisibleChanged}" CommandParameter="{Binding IsVisible, ElementName=ucs}"/>
|
||||
</i:PropertyChangedTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.RowSpan="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Background="{StaticResource ACBlueDark}" Grid.ColumnSpan="2">
|
||||
<Grid Margin="10 5 10 5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="21*"/>
|
||||
<RowDefinition Height="85*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Left" FontSize="14" Foreground="{StaticResource ACOrangeNormal}" FontWeight="Bold" Margin="5 0 5 2">
|
||||
Motor Position</TextBlock>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Grid.Column="0" BorderBrush="Black" BorderThickness="1" Margin="1">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseLeftButtonDown">
|
||||
<i:InvokeCommandAction Command="{Binding CMD_CopyToClipboard}"
|
||||
CommandParameter="{Binding PosX, StringFormat={}{0:0.####}}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<Grid>
|
||||
<TextBlock Style="{StaticResource StTBMonitorName}">X</TextBlock>
|
||||
<TextBlock Style="{StaticResource StTBPosition}" Text="{Binding PosX, StringFormat={}{0:0.####}}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="1" BorderBrush="Black" BorderThickness="1" Margin="1">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseLeftButtonDown">
|
||||
<i:InvokeCommandAction Command="{Binding CMD_CopyToClipboard}"
|
||||
CommandParameter="{Binding PosY1, StringFormat={}{0:0.####}}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<Grid>
|
||||
<TextBlock Style="{StaticResource StTBMonitorName}">Y1</TextBlock>
|
||||
<TextBlock Style="{StaticResource StTBPosition}" Text="{Binding PosY1, StringFormat={}{0:0.####}}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="0" Grid.Column="2" BorderBrush="Black" BorderThickness="1" Margin="1">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseLeftButtonDown">
|
||||
<i:InvokeCommandAction Command="{Binding CMD_CopyToClipboard}"
|
||||
CommandParameter="{Binding PosY2, StringFormat={}{0:0.####}}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<Grid>
|
||||
<TextBlock Style="{StaticResource StTBMonitorName}">Y2</TextBlock>
|
||||
<TextBlock Style="{StaticResource StTBPosition}" Text="{Binding PosY2, StringFormat={}{0:0.####}}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="0" Grid.Column="3" BorderBrush="Black" BorderThickness="1" Margin="1">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseLeftButtonDown">
|
||||
<i:InvokeCommandAction Command="{Binding CMD_CopyToClipboard}"
|
||||
CommandParameter="{Binding PosZ, StringFormat={}{0:0.####}}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<Grid>
|
||||
<TextBlock Style="{StaticResource StTBMonitorName}">Z</TextBlock>
|
||||
<TextBlock Style="{StaticResource StTBPosition}" Text="{Binding PosZ, StringFormat={}{0:0.####}}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="2" Grid.Column="0" Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Margin="2" FontWeight="Bold" FontSize="12" Foreground="{StaticResource ACOrangeNormal}">Move Type</TextBlock>
|
||||
<Grid Grid.Row="1" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<RadioButton Grid.Column="0" Style="{StaticResource StRbJogUnit}"
|
||||
IsChecked="{Binding MoveType, Converter={StaticResource EnumConverter}, ConverterParameter={x:Static dev:TargetPosType.ABS}, Mode=TwoWay}"
|
||||
Content="ABS" />
|
||||
<RadioButton Grid.Column="1" Style="{StaticResource StRbJogUnit}"
|
||||
IsChecked="{Binding MoveType, Converter={StaticResource EnumConverter}, ConverterParameter={x:Static dev:TargetPosType.REL}, Mode=TwoWay}"
|
||||
Content="INC" />
|
||||
</Grid>
|
||||
|
||||
|
||||
</Grid>
|
||||
<Grid Grid.Row="2" Grid.Column="1" Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Margin="2" FontWeight="Bold" FontSize="12" Foreground="{StaticResource ACOrangeNormal}">Speed</TextBlock>
|
||||
<Grid Grid.Row="1" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<RadioButton Grid.Column="0" Style="{StaticResource StRbJogUnit}"
|
||||
IsChecked="{Binding Speed, Converter={StaticResource EnumConverter}, ConverterParameter={x:Static acs:Speed.L}, Mode=TwoWay}"
|
||||
Content="L"/>
|
||||
<RadioButton Grid.Column="1" Style="{StaticResource StRbJogUnit}"
|
||||
IsChecked="{Binding Speed, Converter={StaticResource EnumConverter}, ConverterParameter={x:Static acs:Speed.M}, Mode=TwoWay}"
|
||||
Content="M"/>
|
||||
<RadioButton Grid.Column="2" Style="{StaticResource StRbJogUnit}"
|
||||
IsChecked="{Binding Speed, Converter={StaticResource EnumConverter}, ConverterParameter={x:Static acs:Speed.H}, Mode=TwoWay}"
|
||||
Content="H" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
<Border Grid.Row="4" BorderBrush="LightGray" BorderThickness="1" Margin="2">
|
||||
<Grid Margin="0 0 0 5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock HorizontalAlignment="Center" FontSize="14" Foreground="{StaticResource ACOrangeDeep}" FontWeight="Bold" Margin="5 0">
|
||||
XY</TextBlock>
|
||||
<Grid Grid.Row="1" Margin="0 0 0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<usercontrols:UCKeyValue Grid.Row="0" Grid.ColumnSpan="2" KeyText="Pos X" Value="{Binding TargetPosX}"
|
||||
DecimalPlaces="3" Height="32" Unit="mm" KeyTextFgColor="White"
|
||||
KeyTextWidth="1*" ValueTextWidth="2*"/>
|
||||
<Button Grid.Row="0" Grid.Column="2" Margin="1" Content="Move" Command="{Binding CMD_MoveX}"/>
|
||||
<usercontrols:UCKeyValue Grid.Row="1" Grid.ColumnSpan="2" KeyText="Pos Y" Value="{Binding TargetPosY}"
|
||||
DecimalPlaces="3" Height="32" Unit="mm" KeyTextFgColor="White"
|
||||
KeyTextWidth="1*" ValueTextWidth="2*"/>
|
||||
<Button Grid.Row="1" Grid.Column="2" Margin="1" Content="Move" Command="{Binding CMD_MoveY}" IsEnabled="False"/>
|
||||
|
||||
</Grid>
|
||||
<Grid Grid.Row="2" HorizontalAlignment="Center" Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button Name="ButtonMoveP_Y" Grid.Row="2" Grid.Column="1" Width="50" Height="40" Margin="1" Content="Y (+)"
|
||||
PreviewMouseUp="BtnYJog_P_PreviewMouseUp" PreviewMouseLeftButtonDown="BtnYJog_P_PreviewMouseLeftButtonDown"
|
||||
MouseLeave ="ButtonMoveP_Y_MouseLeave" IsEnabled="False"/>
|
||||
<Button Name="ButtonMoveN_X" Grid.Row="1" Grid.Column="2" Width="50" Height="40" Margin="1" Content="X (-)"
|
||||
PreviewMouseUp="BtnXJog_M_PreviewMouseUp" PreviewMouseLeftButtonDown="BtnXJog_M_PreviewMouseLeftButtonDown"
|
||||
MouseLeave ="ButtonMoveM_X_MouseLeave"/>
|
||||
<Button Name="ButtonMoveP_X" Grid.Row="1" Grid.Column="0" Width="50" Height="40" Margin="1" Content="X (+)"
|
||||
PreviewMouseUp="BtnXJog_P_PreviewMouseUp" PreviewMouseLeftButtonDown="BtnXJog_P_PreviewMouseLeftButtonDown"
|
||||
MouseLeave ="ButtonMoveP_X_MouseLeave"/>
|
||||
<Button Name="ButtonMoveN_Y" Grid.Row="0" Grid.Column="1" Width="50" Height="40" Margin="1" Content="Y (-)"
|
||||
PreviewMouseUp="BtnYJog_M_PreviewMouseUp" PreviewMouseLeftButtonDown="BtnYJog_M_PreviewMouseLeftButtonDown"
|
||||
MouseLeave ="ButtonMoveM_Y_MouseLeave" IsEnabled="False"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3" HorizontalAlignment="Center" Margin="0,20,0,0" Width="150">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<RadioButton Grid.Column="0" Style="{StaticResource StRbJogUnit}"
|
||||
IsChecked="{Binding YAxisType, Converter={StaticResource EnumConverter}, ConverterParameter={x:Static YAxisType:eYAxisType.Y1}, Mode=TwoWay}"
|
||||
Content="Y1 Use" />
|
||||
<RadioButton Grid.Column="1" Style="{StaticResource StRbJogUnit}"
|
||||
IsChecked="{Binding YAxisType, Converter={StaticResource EnumConverter}, ConverterParameter={x:Static YAxisType:eYAxisType.Y2}, Mode=TwoWay}"
|
||||
Content="Y2 Use" IsEnabled="False" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="4" Grid.Column="1" BorderBrush="LightGray" BorderThickness="1" Margin="2">
|
||||
<Grid Margin="0 0 0 5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock HorizontalAlignment="Center" Text="Z" FontSize="14" Foreground="{StaticResource ACOrangeDeep}" FontWeight="Bold" Margin="5 0"/>
|
||||
<Grid Grid.Row="1" Margin="0 0 0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<usercontrols:UCKeyValue Grid.Column="0" Grid.ColumnSpan="2" KeyText="Pos Z" Value="{Binding TargetPosZ}"
|
||||
DecimalPlaces="3" Height="32" Unit="mm" KeyTextFgColor="White"
|
||||
KeyTextWidth="1*" ValueTextWidth="2*"/>
|
||||
<Button Grid.Column="2" Margin="1" Content="Move" Command="{Binding CMD_MoveZ}" IsEnabled="{Binding IsDoorLock}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2" Margin="0 20 0 0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid HorizontalAlignment="Center" Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Button Name="ButtonMoveP_Z" Grid.Row="1" Grid.Column="1" Width="50" Height="40" Margin="1" Content="Z (+)"
|
||||
PreviewMouseUp="BtnJog_P_PreviewMouseUp" PreviewMouseLeftButtonDown="BtnJog_P_PreviewMouseLeftButtonDown"
|
||||
MouseLeave ="ButtonMoveP_Z_MouseLeave"/>
|
||||
<Button Name="ButtonMoveN_Z" Grid.Row="0" Grid.Column="1" Width="50" Height="40" Margin="1 1 1 20" Content="Z (-)"
|
||||
PreviewMouseUp="BtnJog_M_PreviewMouseUp" PreviewMouseLeftButtonDown="BtnJog_M_PreviewMouseLeftButtonDown"
|
||||
MouseLeave ="ButtonMoveM_Z_MouseLeave"/>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1" VerticalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Button Grid.Row="0" Margin="2" Height="40"
|
||||
Content="Focus Position" Command="{Binding CMD_MoveFocusPos}"/>
|
||||
<Button Grid.Row="1" Margin="2" Height="40"
|
||||
Content="Safety Position" Command="{Binding CMD_MoveSafetyPos}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3" Margin="0 50 0 0">
|
||||
<Button Command="{Binding CMD_MotorStop}" Grid.Row="3" CommandParameter="All" Content="All MoveStop" Margin="10 5" Background="DarkRed"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@ -0,0 +1,112 @@
|
||||
using Aurora.Api.Manager;
|
||||
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.Shapes;
|
||||
|
||||
namespace WeldingCommon.Views.ACS
|
||||
{
|
||||
/// <summary>
|
||||
/// UCStageMotorMoving.xaml에 대한 상호 작용 논리
|
||||
/// </summary>
|
||||
public partial class UCStageMotorMoving : UserControl
|
||||
{
|
||||
UCStageMotorMovingViewModel ViewModel = null;
|
||||
|
||||
public UCStageMotorMoving()
|
||||
{
|
||||
InitializeComponent();
|
||||
ViewModel = new UCStageMotorMovingViewModel();
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
|
||||
private void BtnXJog_P_PreviewMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.XJogStop(null);
|
||||
}
|
||||
private void BtnXJog_P_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.XJogPlus(null);
|
||||
}
|
||||
private void ButtonMoveP_X_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
ViewModel.XJogStop(null);
|
||||
}
|
||||
|
||||
private void BtnXJog_M_PreviewMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.XJogStop(null);
|
||||
}
|
||||
private void BtnXJog_M_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.XJogMinus(null);
|
||||
}
|
||||
private void ButtonMoveM_X_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
ViewModel.XJogStop(null);
|
||||
}
|
||||
|
||||
|
||||
private void BtnYJog_P_PreviewMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.YJogStop(null);
|
||||
}
|
||||
private void BtnYJog_P_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.YJogPlus(null);
|
||||
}
|
||||
private void ButtonMoveP_Y_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
ViewModel.YJogStop(null);
|
||||
}
|
||||
|
||||
private void BtnYJog_M_PreviewMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.YJogStop(null);
|
||||
}
|
||||
private void BtnYJog_M_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.YJogMinus(null);
|
||||
}
|
||||
private void ButtonMoveM_Y_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
ViewModel.YJogStop(null);
|
||||
}
|
||||
|
||||
|
||||
private void BtnJog_P_PreviewMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.ZJogStop(null);
|
||||
}
|
||||
private void BtnJog_P_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.ZJogPlus(null);
|
||||
}
|
||||
private void ButtonMoveP_Z_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
ViewModel.ZJogStop(null);
|
||||
}
|
||||
|
||||
private void BtnJog_M_PreviewMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.ZJogStop(null);
|
||||
}
|
||||
private void BtnJog_M_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel.ZJogMinus(null);
|
||||
}
|
||||
private void ButtonMoveM_Z_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
ViewModel.ZJogStop(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,315 @@
|
||||
using Aurora;
|
||||
using Aurora.Api;
|
||||
using Aurora.Api.Control;
|
||||
using Aurora.Api.Devices;
|
||||
using Aurora.Api.Manager;
|
||||
using Aurora.Util.HislogPlus;
|
||||
using Aurora.View;
|
||||
using AuroraACS;
|
||||
using AuroraMotionBoard.Ajin;
|
||||
using AuroraMotor;
|
||||
using WeldingCommon.Device;
|
||||
using WeldingCommon.Device.ACS;
|
||||
using WeldingCommon.Process;
|
||||
using WeldingCommon.Recipes;
|
||||
using WeldingCommon.Settings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
using WeldingCommon;
|
||||
using JogDirection = AuroraACS.JogDirection;
|
||||
using Speed = AuroraACS.Speed;
|
||||
using WeldingCommon.Devices.ACS;
|
||||
|
||||
namespace WeldingCommon.Views.ACS
|
||||
{
|
||||
public class UCStageMotorMovingViewModel : NotifyPropertyChangedBase
|
||||
{
|
||||
readonly Logger LOG = new Logger("ACSMotor");
|
||||
|
||||
public ICommand CMD_MoveFocusPos { get; }
|
||||
public ICommand CMD_MoveSafetyPos { get; }
|
||||
public ICommand CMD_MoveX { get; }
|
||||
public ICommand CMD_MoveY { get; }
|
||||
public ICommand CMD_MoveZ { get; }
|
||||
public ICommand CMD_VisibleChanged { get; }
|
||||
public ICommand CMD_MotorStop { get; }
|
||||
public ICommand CMD_CopyToClipboard { get; }
|
||||
|
||||
public double TargetPosX { get; set; }
|
||||
public double TargetPosY { get; set; }
|
||||
private double _TargetPosZ;
|
||||
public double TargetPosZ { get => _TargetPosZ; set => SetProperty(ref _TargetPosZ, value); }
|
||||
|
||||
public double PosX { get => _PosX; set => SetProperty(ref _PosX, value); }
|
||||
private double _PosX;
|
||||
public double PosY1 { get => _PosY1; set => SetProperty(ref _PosY1, value); }
|
||||
private double _PosY1;
|
||||
public double PosY2 { get => _PosY2; set => SetProperty(ref _PosY2, value); }
|
||||
private double _PosY2;
|
||||
public double PosZ { get => _PosZ; set => SetProperty(ref _PosZ, value); }
|
||||
private double _PosZ;
|
||||
|
||||
private eYAxisType _YAxisType = eYAxisType.Y1;
|
||||
public eYAxisType YAxisType {
|
||||
get => _YAxisType;
|
||||
set {
|
||||
if(SetProperty(ref _YAxisType, value)) {
|
||||
if(value == eYAxisType.Y1)
|
||||
YAxis = MotorY1;
|
||||
else
|
||||
YAxis = MotorY2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TargetPosType MoveType { get => _MoveType; set => SetProperty(ref _MoveType, value); }
|
||||
private TargetPosType _MoveType = TargetPosType.ABS;
|
||||
|
||||
public Speed Speed {
|
||||
get => _Speed;
|
||||
set {
|
||||
SetProperty(ref _Speed, value);
|
||||
}
|
||||
}
|
||||
private Speed _Speed = Speed.L;
|
||||
|
||||
public ScannerACS ACS { get; set; }
|
||||
public ACSMotor MotorX { get; set; }
|
||||
public ACSMotor MotorY1 { get; set; }
|
||||
public ACSMotor MotorY2 { get; set; }
|
||||
public ACSMotor MotorZ { get; set; }
|
||||
public ACSMotor XAxis { get; set; }
|
||||
public ACSMotor YAxis { get; set; }
|
||||
public ACSMotor ZAxis { get; set; }
|
||||
readonly DispatcherTimer CurrentPosUpdateTimer;
|
||||
static readonly TimeSpan TIMESPAN_NORMAL = TimeSpan.FromMilliseconds(300);
|
||||
static readonly TimeSpan TIMESPAN_FREQUENT = TimeSpan.FromMilliseconds(100);
|
||||
|
||||
private readonly IAuroraEnvironment _env;
|
||||
|
||||
public UCStageMotorMovingViewModel()
|
||||
{
|
||||
CMD_VisibleChanged = new DelegateCommand(VisibleChanged);
|
||||
CMD_MoveFocusPos = new DelegateCommand(MoveZFocusPos);
|
||||
CMD_MoveSafetyPos = new DelegateCommand(MoveZSafetyPos);
|
||||
CMD_MoveX = new DelegateCommand(MoveX);
|
||||
CMD_MoveY = new DelegateCommand(MoveY);
|
||||
CMD_MoveZ = new DelegateCommand(MoveZ);
|
||||
CMD_MotorStop = new DelegateCommand(OnMotorStop);
|
||||
CMD_CopyToClipboard = new DelegateCommand(OnCopyToClipboard);
|
||||
|
||||
_env = Application.Current.AuroraEnv();
|
||||
|
||||
ACS = _env.DeviceManager[CommonDeviceIds.ACS] as ScannerACS;
|
||||
|
||||
MotorX = _env.DeviceManager[CommonMotorIds.AxisX2] as ACSMotor;
|
||||
MotorY1 = _env.DeviceManager[CommonMotorIds.AxisY1] as ACSMotor;
|
||||
MotorY2 = _env.DeviceManager[CommonMotorIds.AxisY2] as ACSMotor;
|
||||
MotorZ = _env.DeviceManager[CommonMotorIds.AxisZ] as ACSMotor;
|
||||
|
||||
XAxis = MotorX;
|
||||
YAxis = MotorY1;
|
||||
ZAxis = MotorZ;
|
||||
|
||||
CurrentPosUpdateTimer = CreateTimer(
|
||||
TIMESPAN_FREQUENT,
|
||||
OnCurrentPosUpdateTime
|
||||
);
|
||||
|
||||
CurrentPosUpdateTimer.Interval = TIMESPAN_NORMAL;
|
||||
|
||||
_env.EventObservable.AsObservable(CommonEventIds.EVENT_CHANGE_DOOR_LOCK)
|
||||
.Where(param => param.Param is bool && param.Param != null)
|
||||
.Select(param => (bool)param.Param);
|
||||
}
|
||||
|
||||
private void OnMotorStop(object obj)
|
||||
{
|
||||
MotorX.DoStopAll();
|
||||
}
|
||||
private void OnCopyToClipboard(object obj)
|
||||
{
|
||||
var s = obj?.ToString();
|
||||
if (!string.IsNullOrWhiteSpace(s))
|
||||
Clipboard.SetText(s);
|
||||
}
|
||||
private void VisibleChanged(object obj)
|
||||
{
|
||||
bool visible = (bool)obj;
|
||||
if (visible) {
|
||||
CurrentPosUpdateTimer.Start();
|
||||
}
|
||||
else {
|
||||
CurrentPosUpdateTimer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void MoveZFocusPos(object obj)
|
||||
{
|
||||
var TeachingPos = _env.SettingEntry[CommonSettingIds.TeachingPos] as TeachingPositionSetting;
|
||||
var target = TeachingPos.Get(eTeachingPosition.StageWeldingStartPos).AxisZ;
|
||||
|
||||
ZAxis.SetTargetPos(target, TargetPosType.ABS);
|
||||
ZAxis.SetMoveVelocityImm(Speed.L);
|
||||
ZAxis.Move();
|
||||
|
||||
LOG.D($"Motion MoveZ : {target}");
|
||||
}
|
||||
private void MoveZSafetyPos(object obj)
|
||||
{
|
||||
var TeachingPos = _env.SettingEntry[CommonSettingIds.TeachingPos] as TeachingPositionSetting;
|
||||
var target = TeachingPos.Get(eTeachingPosition.SafetyPosition).AxisZ;
|
||||
|
||||
ZAxis.SetTargetPos(target, TargetPosType.ABS);
|
||||
ZAxis.SetMoveVelocityImm(Speed.L);
|
||||
ZAxis.Move();
|
||||
|
||||
LOG.D($"Motion MoveZ : {target}");
|
||||
}
|
||||
|
||||
private void MoveX(object obj)
|
||||
{
|
||||
var TargetPos = TargetPosX;
|
||||
if (MoveType == TargetPosType.REL)
|
||||
TargetPos += PosX;
|
||||
|
||||
if (MessageBox.Show($"Stage X축을 {TargetPos}로 이동하시겠습니까?", "Move", MessageBoxButton.YesNo) == MessageBoxResult.No)
|
||||
return;
|
||||
|
||||
XAxis.SetTargetPos(TargetPosX, MoveType);
|
||||
XAxis.SetMoveVelocityImm(Speed.L);
|
||||
XAxis.Move();
|
||||
|
||||
LOG.D($"Motion MoveX : {TargetPosX}");
|
||||
}
|
||||
private void MoveY(object obj)
|
||||
{
|
||||
var TargetPos = TargetPosY;
|
||||
if (MoveType == TargetPosType.REL)
|
||||
TargetPos += YAxisType == eYAxisType.Y1 ? PosY1 : PosY2;
|
||||
|
||||
if (MessageBox.Show($"Stage {YAxisType}축을 {TargetPos}로 이동하시겠습니까?", "Move", MessageBoxButton.YesNo) == MessageBoxResult.No)
|
||||
return;
|
||||
|
||||
YAxis.SetTargetPos(TargetPosY, MoveType);
|
||||
YAxis.SetMoveVelocityImm(Speed.L);
|
||||
YAxis.Move();
|
||||
|
||||
LOG.D($"Motion MoveY : {TargetPosY}");
|
||||
}
|
||||
private void MoveZ(object obj)
|
||||
{
|
||||
var TargetPos = TargetPosZ;
|
||||
if (MoveType == TargetPosType.REL)
|
||||
TargetPos += PosZ;
|
||||
|
||||
//if(TargetPos > 35){
|
||||
// MessageBox.Show($"{TargetPosZ}로 이동할 수 없습니다.(Limit : 35)", "InterLock", MessageBoxButton.OK);
|
||||
// return;
|
||||
//}
|
||||
|
||||
if (MessageBox.Show($"Stage Z축을 {TargetPos}로 이동하시겠습니까?", "Move", MessageBoxButton.YesNo) == MessageBoxResult.No)
|
||||
return;
|
||||
|
||||
ZAxis.SetTargetPos(TargetPosZ, MoveType);
|
||||
ZAxis.SetMoveVelocityImm(Speed.L);
|
||||
ZAxis.Move();
|
||||
|
||||
LOG.D($"Motion MoveZ : {TargetPosZ}");
|
||||
}
|
||||
|
||||
DispatcherTimer CreateTimer(TimeSpan interval, Action onTime)
|
||||
{
|
||||
var timer = new DispatcherTimer();
|
||||
timer.Tick += (s, e) => onTime();
|
||||
timer.Interval = interval;
|
||||
return timer;
|
||||
}
|
||||
|
||||
void OnCurrentPosUpdateTime()
|
||||
{
|
||||
if (!ACS.IsActivated)
|
||||
return;
|
||||
|
||||
PosX = ACS._motorVariable.X2AxisPosition;
|
||||
PosY1 = ACS._motorVariable.Y1AxisPosition;
|
||||
PosY2 = ACS._motorVariable.Y2AxisPosition;
|
||||
PosZ = ACS._motorVariable.ZAxisPosition;
|
||||
}
|
||||
internal void XJogStop(object obj)
|
||||
{
|
||||
XAxis.Stop();
|
||||
}
|
||||
internal void XJogPlus(object obj)
|
||||
{
|
||||
XAxis.MoveToSWLimit(JogDirection.plus, Speed);
|
||||
//XAxis.Jog(JogDirection.plus, Speed);
|
||||
}
|
||||
internal void XJogMinus(object obj)
|
||||
{
|
||||
XAxis.MoveToSWLimit(JogDirection.minus, Speed);
|
||||
}
|
||||
|
||||
internal void YJogStop(object obj)
|
||||
{
|
||||
YAxis.Stop();
|
||||
}
|
||||
internal void YJogPlus(object obj)
|
||||
{
|
||||
YAxis.MoveToSWLimit(JogDirection.plus, Speed);
|
||||
}
|
||||
internal void YJogMinus(object obj)
|
||||
{
|
||||
YAxis.MoveToSWLimit(JogDirection.minus, Speed);
|
||||
}
|
||||
|
||||
internal void ZJogStop(object obj)
|
||||
{
|
||||
ZAxis.Stop();
|
||||
}
|
||||
internal void ZJogPlus(object obj)
|
||||
{
|
||||
ZAxis.MoveToSWLimit(JogDirection.plus, Speed);
|
||||
}
|
||||
internal void ZJogMinus(object obj)
|
||||
{
|
||||
ZAxis.MoveToSWLimit(JogDirection.minus, Speed);
|
||||
}
|
||||
|
||||
internal void JogUp()
|
||||
{
|
||||
//var res = ZAxis.Jog((AuroraMotionBoard.Ajin.JogDirection)JogDirection.plus, (AuroraMotionBoard.Ajin.Speed)Speed);
|
||||
|
||||
//if (res != 0)
|
||||
// LOG.W($"Please, Check Motor(Axis Z) Status({res}).");
|
||||
}
|
||||
internal void JogDown()
|
||||
{
|
||||
//int res = ZAxis.Jog((AuroraMotionBoard.Ajin.JogDirection)JogDirection.minus, (AuroraMotionBoard.Ajin.Speed)Speed);
|
||||
|
||||
//if (res != 0)
|
||||
// LOG.W($"Please, Check Motor(Axis Z) Status({res}).");
|
||||
}
|
||||
}
|
||||
public class ComparisonConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value?.Equals(parameter);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value?.Equals(true) == true ? parameter : Binding.DoNothing;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -353,6 +353,10 @@
|
||||
<DependentUpon>UCStageManual.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Manual\ACS\Stage\UCStageManualViewModel.cs" />
|
||||
<Compile Include="Views\Manual\ACS\Stage\UCStageMotorMoving.xaml.cs">
|
||||
<DependentUpon>UCStageMotorMoving.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Manual\ACS\Stage\UCStageMotorMovingViewModel.cs" />
|
||||
<Compile Include="Views\Manual\Scanner\UCManualScannerOperation.xaml.cs">
|
||||
<DependentUpon>UCManualScannerOperation.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -694,6 +698,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Manual\ACS\Stage\UCStageMotorMoving.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\Manual\Scanner\UCManualScannerOperation.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user