|
|
@@ -0,0 +1,309 @@
|
|
|
+<UserControl x:Class="TeamAAS_VP.Controls.PlcRobotManual"
|
|
|
+ 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:TeamAAS_VP.Controls"
|
|
|
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
|
+ xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
|
|
+ xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
|
|
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
|
+ xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
|
|
|
+ xmlns:convert="clr-namespace:TeamAAS_VP.ValueConverter"
|
|
|
+ xmlns:lex="http://wpflocalizeextension.codeplex.com"
|
|
|
+ lex:LocalizeDictionary.DesignCulture="zh-CN"
|
|
|
+ lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
|
|
|
+ lex:ResxLocalizationProvider.DefaultDictionary="Lang"
|
|
|
+ mc:Ignorable="d"
|
|
|
+ d:Background="White"
|
|
|
+ FontFamily="{DynamicResource DefaultFont}">
|
|
|
+ <UserControl.Resources>
|
|
|
+ <convert:JogConverter x:Key="JogConverter" />
|
|
|
+ </UserControl.Resources>
|
|
|
+ <ScrollViewer HorizontalAlignment="Stretch"
|
|
|
+ VerticalAlignment="Stretch">
|
|
|
+ <Grid HorizontalAlignment="Stretch"
|
|
|
+ VerticalAlignment="Top">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+
|
|
|
+ <Grid Grid.Row="0"
|
|
|
+ Margin="10" HorizontalAlignment="Center">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="auto" />
|
|
|
+ <ColumnDefinition Width="auto" />
|
|
|
+ <ColumnDefinition Width="auto" />
|
|
|
+ <ColumnDefinition Width="auto" />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <Grid.Resources>
|
|
|
+ <Style TargetType="Button"
|
|
|
+ BasedOn="{StaticResource MaterialDesignRaisedDarkButton}">
|
|
|
+ <Setter Property="Width"
|
|
|
+ Value="60" />
|
|
|
+ <Setter Property="Height"
|
|
|
+ Value="60" />
|
|
|
+ <Setter Property="FontSize"
|
|
|
+ Value="13" />
|
|
|
+ <Setter Property="Padding"
|
|
|
+ Value="0" />
|
|
|
+ <Setter Property="HorizontalAlignment"
|
|
|
+ Value="Center" />
|
|
|
+ <Setter Property="VerticalAlignment"
|
|
|
+ Value="Center" />
|
|
|
+ <Setter Property="Margin"
|
|
|
+ Value="2" />
|
|
|
+ <Setter Property="materialDesign:ButtonAssist.CornerRadius"
|
|
|
+ Value="10" />
|
|
|
+ </Style>
|
|
|
+ </Grid.Resources>
|
|
|
+ <StackPanel Grid.ColumnSpan="4"
|
|
|
+ Grid.Row="0"
|
|
|
+ Grid.Column="0"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Orientation="Horizontal">
|
|
|
+ <Button Content="{lex:Loc 上使能}"
|
|
|
+ Grid.Row="2"
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding MotorCommand}"
|
|
|
+ CommandParameter="True" />
|
|
|
+ <Button Content="{lex:Loc 下使能}"
|
|
|
+ Grid.Row="3"
|
|
|
+ Margin="10"
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding MotorCommand}"
|
|
|
+ CommandParameter="False" />
|
|
|
+ <Button Content="{lex:Loc 复位错误}"
|
|
|
+ Grid.Row="4"
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding ResetCommand}" />
|
|
|
+ </StackPanel>
|
|
|
+ <Button Grid.Row="2"
|
|
|
+ Grid.Column="0"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X-}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="ArrowLeftBold"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="-X"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Grid.Row="2"
|
|
|
+ Grid.Column="2"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X+}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="ArrowRightBold"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="+X"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Grid.Row="1"
|
|
|
+ Grid.Column="1"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y+}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="ArrowTopBold"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="+Y"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Grid.Row="3"
|
|
|
+ Grid.Column="1"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y-}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="ArrowBottomBold"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="-Y"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Grid.Row="1"
|
|
|
+ Grid.Column="3"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z+}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="ArrowTopBold"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="+Z"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Grid.Row="3"
|
|
|
+ Grid.Column="3"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z-}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="ArrowBottomBold"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="-Z"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Grid.Row="4"
|
|
|
+ Grid.Column="3"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U+}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="AxisZRotateCounterclockwise"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="+U"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Grid.Row="4"
|
|
|
+ Grid.Column="0"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U-}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="AxisZRotateClockwise"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="-U"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <!--<Button Grid.Row="4"
|
|
|
+ Grid.Column="1"
|
|
|
+ Grid.ColumnSpan="2"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V+}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="AxisYRotateCounterclockwise"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="+V"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Grid.Row="5"
|
|
|
+ Grid.Column="1"
|
|
|
+ Grid.ColumnSpan="2"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V-}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="AxisYRotateClockwise"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="-V"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Grid.Row="4"
|
|
|
+ Grid.Column="3"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W+}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="AxisXRotateCounterclockwise"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="+W"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Grid.Row="5"
|
|
|
+ Grid.Column="3"
|
|
|
+ Command="{Binding JogCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W-}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <materialDesign:PackIcon Kind="AxisXRotateClockwise"
|
|
|
+ Width="26"
|
|
|
+ Height="26" />
|
|
|
+ <TextBlock Text="-W"
|
|
|
+ HorizontalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ </Button>-->
|
|
|
+ <StackPanel Grid.Row="6"
|
|
|
+ Grid.ColumnSpan="7"
|
|
|
+ Margin="10,10,0,10"
|
|
|
+ Grid.Column="0"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Orientation="Horizontal">
|
|
|
+ <TextBlock Text="{lex:Loc 步进距离}"
|
|
|
+ VerticalAlignment="Center" />
|
|
|
+ <uControl:myNumericUpDowm x:Name="txtDistance"
|
|
|
+ MinWidth="100"
|
|
|
+ Interval="0.1"
|
|
|
+ Minimum="0"
|
|
|
+ Maximum="100"
|
|
|
+ StringFormat="{}{0:N3} mm"
|
|
|
+ Value="{Binding Distance,Mode=TwoWay}"
|
|
|
+ Margin="10,0" />
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ <!-- 附加轴列表:绑定到视图模型中的 ExtraAxes 集合(每项假定有 Name、Position) -->
|
|
|
+ <ItemsControl Grid.Row="1" ItemsSource="{Binding ExtraAxes}">
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <Border Padding="6"
|
|
|
+ Margin="0,2"
|
|
|
+ Background="{DynamicResource MaterialDesignPaper}">
|
|
|
+ <DockPanel LastChildFill="False"
|
|
|
+ VerticalAlignment="Center">
|
|
|
+ <StackPanel Orientation="Horizontal"
|
|
|
+ DockPanel.Dock="Left"
|
|
|
+ VerticalAlignment="Center">
|
|
|
+ <TextBlock Text="{Binding Name}"
|
|
|
+ Width="140"
|
|
|
+ VerticalAlignment="Center" />
|
|
|
+ <TextBlock Text="{Binding Position, StringFormat='{}{0:N3} mm'}"
|
|
|
+ Width="140"
|
|
|
+ VerticalAlignment="Center" />
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal"
|
|
|
+ HorizontalAlignment="Right"
|
|
|
+ DockPanel.Dock="Right">
|
|
|
+ <Button Content="-"
|
|
|
+ Width="60"
|
|
|
+ Height="36"
|
|
|
+ Margin="6,0"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding DataContext.JogCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
|
|
+ CommandParameter="{Binding Name, StringFormat={}{0}-}" />
|
|
|
+ <Button Content="+"
|
|
|
+ Width="60"
|
|
|
+ Height="36"
|
|
|
+ Margin="6,0"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding DataContext.JogCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
|
|
+ CommandParameter="{Binding Name, StringFormat={}{0}+}" />
|
|
|
+ </StackPanel>
|
|
|
+ </DockPanel>
|
|
|
+ </Border>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+
|
|
|
+ <materialDesign:Snackbar Grid.RowSpan="2"
|
|
|
+ x:Name="snackbar"
|
|
|
+ Opacity="0.9"
|
|
|
+ HorizontalContentAlignment="Center"
|
|
|
+ VerticalAlignment="Top" />
|
|
|
+ </Grid>
|
|
|
+ </ScrollViewer>
|
|
|
+</UserControl>
|