|
|
@@ -0,0 +1,367 @@
|
|
|
+<UserControl x:Class="TeamAAS_VP.Views.Home.TorqueCheck"
|
|
|
+ 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.Views.Home"
|
|
|
+ mc:Ignorable="d"
|
|
|
+ xmlns:prism="http://prismlibrary.com/"
|
|
|
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
|
+ xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
|
|
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
|
+ xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
|
|
|
+ xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
|
|
|
+ xmlns:convert="clr-namespace:TeamAAS_VP.ValueConverter"
|
|
|
+ xmlns:valRules="clr-namespace:TeamAAS_VP.Identity"
|
|
|
+ xmlns:validationRule="clr-namespace:TeamAAS_VP.ValidationRules"
|
|
|
+ xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
|
|
|
+ xmlns:lex="http://wpflocalizeextension.codeplex.com"
|
|
|
+ xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Home"
|
|
|
+ lex:LocalizeDictionary.DesignCulture="zh-CN"
|
|
|
+ lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
|
|
|
+ lex:ResxLocalizationProvider.DefaultDictionary="Lang"
|
|
|
+ d:Background="White"
|
|
|
+ d:DataContext="{d:DesignInstance Type=vm:TorqueCheckViewModel}"
|
|
|
+ prism:ViewModelLocator.AutoWireViewModel="True"
|
|
|
+ FontFamily="{DynamicResource DefaultFont}">
|
|
|
+ <b:Interaction.Triggers>
|
|
|
+ <b:EventTrigger EventName="Loaded">
|
|
|
+ <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
|
|
|
+ </b:EventTrigger>
|
|
|
+ </b:Interaction.Triggers>
|
|
|
+
|
|
|
+ <UserControl.Resources>
|
|
|
+ <convert:JogConverter x:Key="JogConverter" />
|
|
|
+ </UserControl.Resources>
|
|
|
+
|
|
|
+ <prism:Dialog.WindowStyle>
|
|
|
+ <Style TargetType="Window">
|
|
|
+ <Setter Property="prism:Dialog.WindowStartupLocation"
|
|
|
+ Value="CenterScreen" />
|
|
|
+ <!--<Setter Property="WindowChrome.WindowChrome">
|
|
|
+ <Setter.Value>
|
|
|
+ <WindowChrome CaptionHeight="0"
|
|
|
+ ResizeBorderThickness="1" />
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>-->
|
|
|
+ <Setter Property="WindowStyle"
|
|
|
+ Value="None" />
|
|
|
+ <Setter Property="AllowDrop"
|
|
|
+ Value="True" />
|
|
|
+ <Setter Property="BorderThickness"
|
|
|
+ Value="0" />
|
|
|
+ <Setter Property="ShowInTaskbar"
|
|
|
+ Value="False" />
|
|
|
+ <Setter Property="SizeToContent"
|
|
|
+ Value="WidthAndHeight" />
|
|
|
+ <Setter Property="WindowState"
|
|
|
+ Value="Normal" />
|
|
|
+ <Setter Property="Topmost"
|
|
|
+ Value="True" />
|
|
|
+ </Style>
|
|
|
+ </prism:Dialog.WindowStyle>
|
|
|
+
|
|
|
+ <Grid HorizontalAlignment="Center">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition />
|
|
|
+ <ColumnDefinition />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <materialDesign:DrawerHost Grid.Column="0"
|
|
|
+ OpenMode="Standard"
|
|
|
+ x:Name="DrawerHost"
|
|
|
+ IsLeftDrawerOpen="{Binding IsLeftDrawerOpen,Mode=TwoWay}"
|
|
|
+ d:IsLeftDrawerOpen="true"
|
|
|
+ IsEnabled="{Binding IsAllowEdit}">
|
|
|
+ <materialDesign:DrawerHost.LeftDrawerContent>
|
|
|
+ <Grid Width="auto">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="*" />
|
|
|
+ <RowDefinition Height="*" />
|
|
|
+ <RowDefinition Height="*" />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <StackPanel Orientation="Horizontal"
|
|
|
+ HorizontalAlignment="Center"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Margin="5">
|
|
|
+ <Button Content="{lex:Loc 上使能}"
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding DataContext.MotorCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
|
|
+ CommandParameter="True"
|
|
|
+ Margin="10,0" />
|
|
|
+ <Button Content="{lex:Loc 下使能}"
|
|
|
+ Margin="10,0"
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding DataContext.MotorCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
|
|
+ CommandParameter="False" />
|
|
|
+ </StackPanel>
|
|
|
+
|
|
|
+ <Grid Grid.Row="1">
|
|
|
+ <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" />
|
|
|
+ </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>
|
|
|
+ <Button Grid.Row="1"
|
|
|
+ Grid.Column="0"
|
|
|
+ Command="{Binding DataContext.JogCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
|
|
+ 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="1"
|
|
|
+ Grid.Column="2"
|
|
|
+ Command="{Binding DataContext.JogCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
|
|
+ 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="0"
|
|
|
+ Grid.Column="1"
|
|
|
+ Command="{Binding DataContext.JogCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
|
|
+ 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="2"
|
|
|
+ Grid.Column="1"
|
|
|
+ Command="{Binding DataContext.JogCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
|
|
+ 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="0"
|
|
|
+ Grid.Column="3"
|
|
|
+ Command="{Binding DataContext.JogCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
|
|
+ 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="2"
|
|
|
+ Grid.Column="3"
|
|
|
+ Command="{Binding DataContext.JogCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
|
|
+ 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>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ <Grid Grid.Row="2">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition />
|
|
|
+ <RowDefinition />
|
|
|
+ <RowDefinition />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition />
|
|
|
+ <ColumnDefinition />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <TextBlock VerticalAlignment="Center"
|
|
|
+ Margin="5"
|
|
|
+ Grid.ColumnSpan="2">
|
|
|
+ <TextBlock.Text>
|
|
|
+ <MultiBinding StringFormat="{}CurPos X: {0:F3} mm Y: {1:F3} mm Z: {2:F3} mm">
|
|
|
+ <Binding Path="Robot.CurrentPosition.X" />
|
|
|
+ <Binding Path="Robot.CurrentPosition.Y" />
|
|
|
+ <Binding Path="Robot.CurrentPosition.Z" />
|
|
|
+ </MultiBinding>
|
|
|
+ </TextBlock.Text>
|
|
|
+ </TextBlock>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="1"
|
|
|
+ Grid.Column="0"
|
|
|
+ Text="{lex:Loc 步进距离,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
|
|
|
+ Margin="10"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ HorizontalAlignment="Right" />
|
|
|
+ <uControl:myNumericUpDowm x:Name="txtDistance"
|
|
|
+ Grid.Row="1"
|
|
|
+ Grid.Column="1"
|
|
|
+ MinWidth="100"
|
|
|
+ Value="{Binding DataContext.Distance,RelativeSource={RelativeSource AncestorType={x:Type UserControl}},Mode=TwoWay}"
|
|
|
+ Interval="0.1"
|
|
|
+ Minimum="0"
|
|
|
+ Maximum="100"
|
|
|
+ StringFormat="{}{0:N3} mm"
|
|
|
+ Margin="10"
|
|
|
+ materialDesign:HintAssist.Hint="{lex:Loc 步进距离}" />
|
|
|
+
|
|
|
+
|
|
|
+ <Button Grid.Row="2"
|
|
|
+ Grid.ColumnSpan="2"
|
|
|
+ Content="{lex:Loc 示教}"
|
|
|
+ Margin="0,10"
|
|
|
+ HorizontalAlignment="Center"
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding DataContext.TechPointCommand}" />
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
+ </materialDesign:DrawerHost.LeftDrawerContent>
|
|
|
+
|
|
|
+ <Grid Grid.Column="1">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition />
|
|
|
+ <RowDefinition />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <ToggleButton HorizontalAlignment="Left"
|
|
|
+ VerticalAlignment="Top"
|
|
|
+ materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=ArrowLeft}"
|
|
|
+ Content="{materialDesign:PackIcon Kind=ArrowAll}"
|
|
|
+ Style="{StaticResource MaterialDesignActionToggleButton}"
|
|
|
+ ToolTip="轴操作"
|
|
|
+ Margin="5,0"
|
|
|
+ IsChecked="{Binding IsLeftDrawerOpen,ElementName=DrawerHost}" />
|
|
|
+
|
|
|
+ <StackPanel Orientation="Horizontal"
|
|
|
+ HorizontalAlignment="Left"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Grid.Row="1"
|
|
|
+ Margin="5,2">
|
|
|
+ <TextBlock Text="{lex:Loc 扭力阈值}"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Margin="5,2" />
|
|
|
+ <TextBox Text="{Binding torqueValue}"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ HorizontalAlignment="Center"
|
|
|
+ Width="80"
|
|
|
+ Margin="5,2" />
|
|
|
+ <Button Content="{lex:Loc 修改}"
|
|
|
+ Margin="15,2"
|
|
|
+ HorizontalAlignment="Center"
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding ModifyCommand}" />
|
|
|
+ </StackPanel>
|
|
|
+
|
|
|
+ <Grid Grid.Row="2">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="auto" />
|
|
|
+ <ColumnDefinition />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <StackPanel Orientation="Vertical"
|
|
|
+ HorizontalAlignment="Left"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Margin="5,2">
|
|
|
+ <TextBlock Text="{lex:Loc 扭力测量仪值}"
|
|
|
+ Margin="5,3,10,3" />
|
|
|
+ <TextBlock Text="{lex:Loc 电批测量值}"
|
|
|
+ Margin="5,3,10,3" />
|
|
|
+ <TextBlock Text="{lex:Loc 差值}"
|
|
|
+ Margin="5,3,10,3" />
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Vertical"
|
|
|
+ HorizontalAlignment="Left"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Margin="2"
|
|
|
+ Grid.Column="1">
|
|
|
+ <TextBlock Text="{Binding TValue}"
|
|
|
+ Margin="3" />
|
|
|
+ <TextBlock Text="{Binding PValue}"
|
|
|
+ Margin="3" />
|
|
|
+ <TextBlock Text="{Binding SubValue}"
|
|
|
+ Margin="3" />
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ <Button Content="{lex:Loc 执行}"
|
|
|
+ VerticalContentAlignment="Center"
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding WorkCommand}"
|
|
|
+ Margin="10,5"
|
|
|
+ Grid.Row="3"/>
|
|
|
+
|
|
|
+ <TextBlock Text="{Binding Result}"
|
|
|
+ HorizontalAlignment="Center"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Grid.Row="4"
|
|
|
+ FontSize="30"
|
|
|
+ Foreground="{Binding FontColor}" />
|
|
|
+
|
|
|
+ <StackPanel Orientation="Horizontal"
|
|
|
+ Margin="10,3"
|
|
|
+ HorizontalAlignment="Right"
|
|
|
+ Grid.Row="5">
|
|
|
+ <Button Content="{lex:Loc 确定}"
|
|
|
+ VerticalContentAlignment="Center"
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding ConfirmCommand}"
|
|
|
+ Margin="10,3" />
|
|
|
+ <Button Content="{lex:Loc 取消}"
|
|
|
+ VerticalContentAlignment="Center"
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
+ Style="{StaticResource MaterialDesignRaisedDarkButton}"
|
|
|
+ Command="{Binding CancelCommand}"
|
|
|
+ Margin="10,3" />
|
|
|
+ </StackPanel>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ </materialDesign:DrawerHost>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+</UserControl>
|