plcsharp/PLCSharpWpf/VVMs/Robots/Epson/RobotPointsConfig.xaml

197 lines
11 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<UserControl x:Class="PLCSharp.VVMs.Robots.Epson.RobotPointsConfig"
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:PLCSharp.VVMs.Robots"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:Background="AliceBlue"
d:DataContext="{d:DesignInstance Type=local:RobotsViewModel}"
d:DesignHeight="200" d:DesignWidth="1000">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<Grid Grid.Row="1" Tag="操作">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="6*" />
</Grid.ColumnDefinitions>
<GroupBox Header="点动">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Row="1" Grid.Column="2"
Margin="5,0"
Command="{Binding RobotPointCommand}"
CommandParameter="X+" Content="X+" />
<Button Grid.Row="1" Grid.Column="0"
Margin="5,0"
Command="{Binding RobotPointCommand}"
CommandParameter="X-" Content="X-" />
<Button Grid.Row="0" Grid.Column="1"
Margin="10,0"
Command="{Binding RobotPointCommand}"
CommandParameter="Y+" Content="Y+" />
<Button Grid.Row="2" Grid.Column="1"
Margin="10,0"
Command="{Binding RobotPointCommand}"
CommandParameter="Y-" Content="Y-" />
<Button Grid.Row="0" Grid.Column="2"
Margin="10,5"
Command="{Binding RobotPointCommand}"
CommandParameter="Z+" Content="Z+" />
<Button Grid.Row="2" Grid.Column="2"
Margin="10,5"
Command="{Binding RobotPointCommand}"
CommandParameter="Z-" Content="Z-" />
<Button Grid.Row="2" Grid.Column="0"
Margin="10,5"
Command="{Binding RobotPointCommand}"
CommandParameter="U+" Content="U+" />
<Button Grid.Row="0" Grid.Column="0"
Margin="10,5"
Command="{Binding RobotPointCommand}"
CommandParameter="U-" Content="U-" />
<Button Grid.Row="1" Grid.Column="1"
Margin="3" Padding="15,3"
FontSize="14" FontWeight="Bold"
Background="Red"
Command="{Binding SelectedRobot.StopCmd}"
CommandParameter="Stop" Content="STOP" />
</Grid>
</GroupBox>
<GroupBox Grid.Column="1" Header="当前位置">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="X轴:" />
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding SelectedRobot.CurrPoint.X}" />
<TextBlock Grid.Row="1" Grid.Column="0" Text="Y轴:" />
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding SelectedRobot.CurrPoint.Y}" />
<TextBlock Grid.Row="2" Grid.Column="0" Text="Z轴:" />
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding SelectedRobot.CurrPoint.Z}" />
<TextBlock Grid.Row="3" Grid.Column="0" Text="U轴:" />
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding SelectedRobot.CurrPoint.U}" />
<Button Grid.Row="4" Grid.Column="0"
Grid.ColumnSpan="2"
Command="{Binding SaveRobotPointCommand}"
CommandParameter="Save" Content="保存到选中点" />
</Grid>
</GroupBox>
<GroupBox Grid.Column="2" Header="当前工具坐标位置">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="X轴:" />
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding SelectedRobot.CurrToolPoint.X}" />
<TextBlock Grid.Row="1" Grid.Column="0" Text="Y轴:" />
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding SelectedRobot.CurrToolPoint.Y}" />
<TextBlock Grid.Row="2" Grid.Column="0" Text="Z轴:" />
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding SelectedRobot.CurrToolPoint.Z}" />
<TextBlock Grid.Row="3" Grid.Column="0" Text="U轴:" />
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding SelectedRobot.CurrToolPoint.U}" />
<TextBlock Grid.Row="4" Grid.Column="0" Text="工具坐标:" />
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding SelectedRobot.CurrToolPoint.ToolNum}" />
</Grid>
</GroupBox>
<GroupBox Grid.Column="3" Header="点动距离">
<UniformGrid Grid.Column="2" Columns="2">
<TextBlock Margin="3"
Text="寸动距离" FontSize="14" FontWeight="Bold"
VerticalAlignment="Center" />
<TextBox Height="30" Margin="3"
Text="{Binding RelativeDistance}"
FontSize="14" FontWeight="Bold" />
<Button Width="50" Margin="3"
FontSize="14" FontWeight="Bold"
Command="{Binding DistanceSet}"
CommandParameter="0.01" Content="0.01" />
<Button Width="50" Margin="3"
FontSize="14" FontWeight="Bold"
Command="{Binding DistanceSet}"
CommandParameter="0.1" Content="0.1" />
<Button Width="50" Margin="3"
FontSize="14" FontWeight="Bold"
Command="{Binding DistanceSet}"
CommandParameter="1" Content="1" />
<Button Width="50" Margin="3"
FontSize="14" FontWeight="Bold"
Command="{Binding DistanceSet}"
CommandParameter="5" Content="5" />
<Button Width="50" Margin="3"
FontSize="14" FontWeight="Bold"
Command="{Binding DistanceSet}"
CommandParameter="10" Content="10" />
<Button Width="50" Margin="3"
FontSize="14" FontWeight="Bold"
Command="{Binding DistanceSet}"
CommandParameter="20" Content="20" />
</UniformGrid>
</GroupBox>
<GroupBox Grid.Column="4" Header="工具坐标">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Button Margin="10,3" Content="设置P1" Command="{Binding SetToolP1}" />
<TextBlock Margin="10,3" Text="{Binding SelectedRobot.Params.ToolP1.X, StringFormat=X: {0:F3}}" />
<TextBlock Margin="10,3" Text="{Binding SelectedRobot.Params.ToolP1.Y, StringFormat=Y: {0:F3}}" />
<TextBlock Margin="10,3" Text="{Binding SelectedRobot.Params.ToolP1.U, StringFormat=U: {0:F3}}" />
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<Button Margin="10,3" Content="设置P2" Command="{Binding SetToolP2}" />
<TextBlock Margin="10,3" Text="{Binding SelectedRobot.Params.ToolP2.X, StringFormat=X: {0:F3}}" />
<TextBlock Margin="10,3" Text="{Binding SelectedRobot.Params.ToolP2.Y, StringFormat=Y: {0:F3}}" />
<TextBlock Margin="10,3" Text="{Binding SelectedRobot.Params.ToolP2.U, StringFormat=U: {0:F3}}" />
</StackPanel>
<StackPanel Grid.Row="2" VerticalAlignment="Center" Orientation="Horizontal">
<TextBlock Margin="10,3" Text="目标工具:" />
<TextBox Width="40" Text="{Binding SelectedRobot.ToolTarget}" TextAlignment="Center" />
<Button Margin="10,3" Content="计算" Command="{Binding GetToolFrame4Axis}" />
</StackPanel>
</Grid>
</GroupBox>
</Grid>
</Grid>
</UserControl>