| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708 |
- <UserControl x:Class="TeamAAS_VP.Views.Product.PalletManage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- 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:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Product"
- xmlns:convert="clr-namespace:TeamAAS_VP.ValueConverter"
- xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
- xmlns:lex="http://wpflocalizeextension.codeplex.com"
- lex:LocalizeDictionary.DesignCulture="zh-CN"
- lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
- lex:ResxLocalizationProvider.DefaultDictionary="Lang"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d"
- d:DataContext="{d:DesignInstance Type=vm:PalletManageViewModel}"
- d:Height="600"
- d:Width="1024"
- d:Background="White"
- FontFamily="{DynamicResource DefaultFont}">
- <prism:Dialog.WindowStyle>
- <Style TargetType="Window">
- <Setter Property="prism:Dialog.WindowStartupLocation"
- Value="CenterScreen" />
- <Setter Property="ShowInTaskbar"
- Value="True" />
- <Setter Property="WindowState"
- Value="Maximized" />
- <Setter Property="Topmost"
- Value="False" />
- </Style>
- </prism:Dialog.WindowStyle>
- <UserControl.Resources>
- <ObjectDataProvider x:Key="eRobotHand"
- MethodName="GetNames"
- ObjectType="{x:Type sys:Enum}">
- <ObjectDataProvider.MethodParameters>
- <x:Type TypeName="enums:RobotHand" />
- </ObjectDataProvider.MethodParameters>
- </ObjectDataProvider>
- <convert:JogConverter x:Key="JogConverter" />
- <convert:MultiParameterConverter x:Key="MultiParameterConverter" />
- </UserControl.Resources>
- <materialDesign:DialogHost DialogTheme="Inherit"
- Identifier="PalletCalculateDialog">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="auto" />
- </Grid.RowDefinitions>
- <DockPanel LastChildFill="True">
- <!--列表-->
- <Border DockPanel.Dock="Left"
- Width="220"
- Margin="2"
- BorderBrush="#9e9e9e"
- BorderThickness="1"
- CornerRadius="0,10,10,0">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <!--头部-->
- <Grid Grid.Row="0">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <StackPanel Grid.Column="0"
- Margin="10,10,0,0"
- Orientation="Horizontal">
- <materialDesign:PackIcon Kind="FormatListBulleted"
- VerticalAlignment="Top" />
- <TextBlock Text="{lex:Loc 托盘列表}"
- Margin="10,0,0,0"
- FontSize="12"
- VerticalAlignment="Top"
- TextAlignment="Center" />
- </StackPanel>
- <Button Height="35"
- Width="35"
- Grid.Column="1"
- Style="{StaticResource MaterialDesignIconButton}"
- Command="{Binding CreateCommand}">
- <StackPanel Orientation="Vertical">
- <materialDesign:PackIcon Kind="PlusCircle" />
- <TextBlock Text="{lex:Loc 增加}"
- FontSize="8"
- Foreground="Black"
- HorizontalAlignment="Center" />
- </StackPanel>
- </Button>
- <Button Height="35"
- Width="35"
- Grid.Column="2"
- Style="{StaticResource MaterialDesignIconButton}"
- Command="{Binding RemoveCommand}"
- CommandParameter="{Binding ElementName=ModelsListBox,Path=SelectedItem}">
- <StackPanel Orientation="Vertical">
- <materialDesign:PackIcon Kind="DeleteForever" />
- <TextBlock Text="{lex:Loc 移除}"
- FontSize="8"
- Foreground="Black"
- HorizontalAlignment="Center" />
- </StackPanel>
- </Button>
- </Grid>
- </Grid>
- <!--托盘列表-->
- <ListBox x:Name="ModelsListBox"
- Grid.Row="1"
- Background="Transparent"
- ItemsSource="{Binding Pallets}"
- SelectedItem="{Binding SelectPallet}"
- BorderBrush="White"
- BorderThickness="1"
- Margin="2,2,2,10">
- <b:Interaction.Triggers>
- <b:EventTrigger EventName="SelectionChanged">
- <b:InvokeCommandAction Command="{Binding ProductSelectionChangedCommand}"
- CommandParameter="{Binding ElementName=ModelsListBox,Path=SelectedItem}" />
- </b:EventTrigger>
- </b:Interaction.Triggers>
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="Background"
- Value="Transparent" />
- </Style>
- </ListBox.ItemContainerStyle>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border x:Name="itemBorder"
- BorderThickness="1"
- CornerRadius="8"
- Opacity="1"
- BorderBrush="#CCCCCC">
- <StackPanel Orientation="Vertical"
- Width="200"
- Margin="5">
- <!--标题-->
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="TableLarge" />
- <TextBlock Text="{Binding Name}"
- FontSize="12"
- FontWeight="Bold"
- Margin="5,1"
- TextWrapping="Wrap"
- VerticalAlignment="Center" />
- </StackPanel>
- <!--详情-->
- <StackPanel Orientation="Horizontal"
- Margin="0,5">
- <materialDesign:PackIcon Kind="TableMultiple" />
- <TextBlock Text="{Binding Description}"
- FontSize="10"
- Margin="5,1"
- TextWrapping="Wrap" />
- <TextBlock FontSize="10"
- TextWrapping="Wrap">
- <TextBlock.Text>
- <MultiBinding StringFormat="{}{0}{1} X {2}">
- <lex:BLoc Key="行X列" />
- <Binding Path="Row" />
- <Binding Path="Column" />
- </MultiBinding>
- </TextBlock.Text>
- </TextBlock>
- </StackPanel>
- <StackPanel.ContextMenu>
- <ContextMenu>
- <MenuItem Header="{lex:Loc 新建}"
- Command="{Binding CreateCommand}"
- Icon="{materialDesign:PackIcon Kind=CreateNewFolderOutline}" />
- <MenuItem Header="{lex:Loc 移除}"
- Command="{Binding RemoveCommand}"
- CommandParameter="{Binding ElementName=ModelsListBox,Path=SelectedItem}"
- Icon="{materialDesign:PackIcon Kind=Remove}" />
- <Separator />
- <MenuItem Header="{lex:Loc 复制}"
- Command="{Binding CopyCommand}"
- CommandParameter="{Binding ElementName=ModelsListBox,Path=SelectedItem}"
- Icon="{materialDesign:PackIcon Kind=ContentCopy}" />
- <Separator />
- <MenuItem Header="{lex:Loc 修改名称}"
- Command="{Binding EditNameCommand}"
- CommandParameter="{Binding ElementName=ModelsListBox,Path=SelectedItem}"
- Icon="{materialDesign:PackIcon Kind=ContentCopy}" />
- </ContextMenu>
- </StackPanel.ContextMenu>
- </StackPanel>
- </Border>
- <DataTemplate.Triggers>
- <Trigger SourceName="itemBorder"
- Property="IsMouseOver"
- Value="True">
- <Setter TargetName="itemBorder"
- Property="Background"
- Value="#3DB8B8" />
- </Trigger>
- </DataTemplate.Triggers>
- </DataTemplate>
- </ListBox.ItemTemplate>
- <ListBox.ContextMenu>
- <ContextMenu>
- <MenuItem Header="{lex:Loc 新建}"
- Command="{Binding CreateCommand}"
- Icon="{materialDesign:PackIcon Kind=CreateNewFolderOutline}" />
- </ContextMenu>
- </ListBox.ContextMenu>
- </ListBox>
- </Grid>
- </Border>
- <!--内容-->
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="auto" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <!--托盘表格-->
- <Border Grid.Row="0"
- Grid.Column="0"
- Margin="60"
- BorderThickness="1"
- BorderBrush="Black">
- <Grid x:Name="gridPalllet"
- ShowGridLines="True">
- </Grid>
- </Border>
- <TextBlock Text="{Binding SelectPallet.Name}"
- VerticalAlignment="Top"
- HorizontalAlignment="Center"
- Margin="0,20,0,0" />
- <TextBox Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Center"
- VerticalAlignment="Bottom"
- MinWidth="80"
- materialDesign:HintAssist.Hint="{lex:Loc 列数}"
- Text="{Binding Column}"
- TextAlignment="Center"
- materialDesign:HintAssist.HelperText="{lex:Loc 列数}"
- Style="{StaticResource MaterialDesignOutlinedTextBox}">
- </TextBox>
- <TextBox Grid.Row="0"
- Grid.Column="0"
- Margin="50"
- VerticalAlignment="Center"
- HorizontalAlignment="Left"
- MinWidth="80"
- materialDesign:HintAssist.Hint="{lex:Loc 行数}"
- Text="{Binding Row}"
- TextAlignment="Center"
- materialDesign:HintAssist.HelperText="{lex:Loc 行数}"
- Style="{StaticResource MaterialDesignOutlinedTextBox}">
- <TextBox.RenderTransform>
- <RotateTransform Angle="90" />
- </TextBox.RenderTransform>
- </TextBox>
- <StackPanel Grid.Row="0"
- Grid.Column="0"
- Margin="0,0,5,5"
- Orientation="Horizontal"
- HorizontalAlignment="Right"
- VerticalAlignment="Bottom">
- <TextBlock Text="{lex:Loc 排列方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- VerticalAlignment="Center" />
- <ComboBox Margin="5,0"
- Width="30"
- materialDesign:HintAssist.Hint="{lex:Loc 选择排列模式}"
- SelectedItem="{Binding Arrangement,Mode=TwoWay}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:PalletArrangement}" />
- <Button Content="{lex:Loc 保存布局图}"
- Command="{Binding SavePalletImage}"
- Margin="0,0,5,0" />
- </StackPanel>
- <Button Grid.Row="0"
- Grid.Column="1"
- Content="{materialDesign:PackIcon Kind=CalculatorVariant}"
- Style="{StaticResource MaterialDesignFloatingActionLightButton}"
- ToolTip="{lex:Loc 托盘计算器}"
- Margin="10"
- HorizontalAlignment="Right"
- VerticalAlignment="Bottom"
- Command="{Binding CalculatePalletCommand}" />
- <StackPanel Orientation="Vertical"
- Grid.Row="1"
- Grid.Column="0"
- Grid.ColumnSpan="2">
- <StackPanel Orientation="Horizontal"
- Margin="5"
- Visibility="{Binding SelectPallet.Extend,Converter={StaticResource ObjectToVisibilityConverter}}">
- <materialDesign:PopupBox ToolTip="{lex:Loc 帮助}"
- ToggleContent="{materialDesign:PackIcon Kind=HelpCircle}">
- <Image Source="pack://application:,,,/TeamAAS-VP;component/Resources/Images/Palletlayout.png"
- Width="400"
- Height="400"
- Stretch="Fill" />
- </materialDesign:PopupBox>
- <TextBlock Text="{lex:Loc 组合托盘,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- VerticalAlignment="Center" />
- <TextBlock Text="{lex:Loc 行数,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(R): '}"
- VerticalAlignment="Center" />
- <TextBox Text="{Binding SelectPallet.Extend.Pallet_Row}"
- MinWidth="30" />
- <TextBlock Text="{lex:Loc 列数,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(C): '}"
- VerticalAlignment="Center" />
- <TextBox Text="{Binding SelectPallet.Extend.Pallet_Column}"
- MinWidth="30" />
- <TextBlock Text="{lex:Loc 行间距,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(IR)(mm): '}"
- VerticalAlignment="Center" />
- <TextBox Text="{Binding SelectPallet.Extend.Pallet_X_Interval}"
- MinWidth="30" />
- <TextBlock Text="{lex:Loc 列间距,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(IC)(mm): '}"
- VerticalAlignment="Center" />
- <TextBox Text="{Binding SelectPallet.Extend.Pallet_Y_Interval}"
- MinWidth="30" />
- <TextBlock Text="{lex:Loc 坐标系,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(C): '}"
- VerticalAlignment="Center" />
- <ComboBox Margin="5,0"
- SelectedItem="{Binding SelectPallet.Extend.CoordinateModel,Mode=TwoWay}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:CoordinateModel}" />
- </StackPanel>
- <!--点位表-->
- <DataGrid AutoGenerateColumns="False"
- CanUserAddRows="False"
- ColumnWidth="*"
- ItemsSource="{Binding Points}"
- HeadersVisibility="All">
- <DataGrid.Resources>
- <Style TargetType="DataGridCell">
- <Style.Resources>
- <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}"
- Color="#0078D7" />
- </Style.Resources>
- <Setter Property="MinHeight"
- Value="25" />
- <Setter Property="VerticalContentAlignment"
- Value="Center" />
- <Setter Property="HorizontalContentAlignment"
- Value="Center" />
- <Setter Property="VerticalAlignment"
- Value="Center" />
- <Style.Triggers>
- <Trigger Property="IsSelected"
- Value="True">
- <Setter Property="Foreground"
- Value="White" />
- </Trigger>
- </Style.Triggers>
- </Style>
- </DataGrid.Resources>
- <DataGrid.Columns>
- <DataGridTextColumn Header="{lex:Loc 编号}"
- IsReadOnly="True"
- Binding="{Binding Number, Mode=TwoWay}">
- </DataGridTextColumn>
- <DataGridTextColumn Header="{lex:Loc 标签}"
- Binding="{Binding Description, Mode=TwoWay}" />
- <DataGridTextColumn Header="X"
- Binding="{Binding X, Mode=TwoWay, StringFormat={}{0:F3}}" />
- <DataGridTextColumn Header="Y"
- Binding="{Binding Y, Mode=TwoWay, StringFormat={}{0:F3}}" />
- <DataGridTextColumn Header="Z"
- Binding="{Binding Z, Mode=TwoWay, StringFormat={}{0:F3}}" />
- <DataGridTextColumn Header="U"
- Binding="{Binding U, Mode=TwoWay, StringFormat={}{0:F3}}" />
- <DataGridTextColumn Header="V"
- Binding="{Binding V, Mode=TwoWay, StringFormat={}{0:F3}}" />
- <DataGridTextColumn Header="W"
- Binding="{Binding W, Mode=TwoWay, StringFormat={}{0:F3}}" />
- <materialDesign:DataGridComboBoxColumn Width="100"
- Header="Hand"
- IsEditable="True"
- ItemsSourceBinding="{Binding Source={StaticResource eRobotHand}}"
- SelectedValueBinding="{Binding Hand}">
- </materialDesign:DataGridComboBoxColumn>
- <DataGridTextColumn Header="Local"
- Binding="{Binding Local, Mode=TwoWay}" />
- <DataGridTextColumn Header="Tool"
- Binding="{Binding Tool, Mode=TwoWay}" />
- </DataGrid.Columns>
- </DataGrid>
- </StackPanel>
- <Grid Margin="20"
- Grid.Column="1"
- Grid.Row="0"
- VerticalAlignment="Center">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- <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" />
- </Grid.RowDefinitions>
- <ComboBox Grid.Row="0"
- MinWidth="100"
- materialDesign:HintAssist.Hint="{lex:Loc 选择机器人}"
- materialDesign:HintAssist.HelperText="{lex:Loc 选择机器人}"
- HorizontalAlignment="Left"
- ItemsSource="{Binding Robots}"
- SelectedItem="{Binding SelectRobotInfo}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="RobotIndustrialOutline" />
- <TextBlock Text="{Binding RobotName}" />
- </StackPanel>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <ComboBox Grid.Row="0"
- Grid.Column="2"
- materialDesign:HintAssist.Hint="{lex:Loc 选择Tool}"
- materialDesign:HintAssist.HelperText="{lex:Loc 选择Tool}"
- SelectedItem="{Binding SelectTool,Mode=TwoWay}"
- ItemsSource="{Binding Tools}" />
- <Button Content="X-"
- Grid.Row="1"
- Grid.Column="0"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X-}" />
- <Button Content="X+"
- Grid.Row="1"
- Grid.Column="2"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X+}" />
- <Button Content="Y+"
- Grid.Row="0"
- Grid.Column="1"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y+}" />
- <Button Content="Y-"
- Grid.Row="2"
- Grid.Column="1"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y-}" />
- <Button Content="Z+"
- Grid.Row="0"
- Grid.Column="3"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z+}" />
- <Button Content="Z-"
- Grid.Row="2"
- Grid.Column="3"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z-}" />
- <Button Content="U+"
- Grid.Row="3"
- Grid.Column="0"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U+}" />
- <Button Content="U-"
- Grid.Row="4"
- Grid.Column="0"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U-}" />
- <Button Content="V+"
- Grid.Row="3"
- Grid.Column="1"
- Grid.ColumnSpan="2"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V+}" />
- <Button Content="V-"
- Grid.Row="4"
- Grid.Column="1"
- Grid.ColumnSpan="2"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V-}" />
- <Button Content="W+"
- Grid.Row="3"
- Grid.Column="3"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W+}" />
- <Button Content="W-"
- Grid.Row="4"
- Grid.Column="3"
- Margin="10,10,10,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding JogCommand}"
- CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W-}" />
- <Grid Grid.Row="5"
- Grid.ColumnSpan="7"
- Margin="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <TextBlock Grid.Row="0"
- Grid.Column="0"
- Text="{lex:Loc 步进距离,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Margin="10"
- VerticalAlignment="Center"
- HorizontalAlignment="Right" />
- <uControl:myNumericUpDowm x:Name="txtDistance"
- Grid.Row="0"
- Grid.Column="1"
- MinWidth="100"
- Margin="10"
- Interval="0.1"
- Minimum="0"
- Maximum="100"
- Value="{Binding Distance,Mode=TwoWay}"
- StringFormat="{}{0:N3} mm"
- materialDesign:HintAssist.Hint="{lex:Loc 步进距离}" />
- <TextBlock Grid.Row="1"
- Grid.Column="0"
- Text="{lex:Loc 点编号,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Margin="10"
- VerticalAlignment="Center" />
- <ComboBox x:Name="cmbSelectPoint"
- Grid.Row="2"
- Grid.Column="0"
- MinWidth="80"
- materialDesign:HintAssist.Hint="{lex:Loc 选择点}"
- Margin="10,5"
- ItemsSource="{Binding Points}"
- SelectedItem="{Binding SelectPoint}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <StackPanel HorizontalAlignment="Left"
- Orientation="Horizontal">
- <TextBlock Text="{Binding Number,StringFormat={}{0}:}" />
- <TextBlock Text="{Binding Description}" />
- </StackPanel>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <TextBlock Grid.Row="1"
- Grid.Column="1"
- Text="{lex:Loc 动作指令,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Margin="10"
- VerticalAlignment="Center" />
- <ComboBox x:Name="cmbSelectMotioncmd"
- Grid.Row="2"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,5"
- materialDesign:HintAssist.Hint="{lex:Loc 动作指令}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:MotionCommand}"
- SelectedItem="{Binding SelectMotionCommand}" />
- <Button Grid.Row="2"
- Grid.Column="2"
- Content="{lex:Loc 执行动作}"
- Margin="10,5"
- Command="{Binding ExecuteMotion}">
- <Button.CommandParameter>
- <MultiBinding Converter="{StaticResource MultiParameterConverter}">
- <Binding ElementName="cmbSelectPoint"
- Path="SelectedItem" />
- <Binding ElementName="cmbSelectMotioncmd"
- Path="SelectedItem" />
- </MultiBinding>
- </Button.CommandParameter>
- </Button>
- <Button Grid.Row="3"
- Grid.Column="0"
- Content="{lex:Loc 示教}"
- Margin="10"
- HorizontalAlignment="Right"
- Command="{Binding TechPointCommand}"
- CommandParameter="{Binding ElementName=cmbSelectPoint,Path=SelectedItem}" />
- </Grid>
- <Grid Grid.Row="0"
- Grid.Column="4"
- Grid.RowSpan="5"
- VerticalAlignment="Center">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- </Grid.RowDefinitions>
- <Button Content="{lex:Loc 上使能}"
- Grid.Row="0"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding MotorCommand}"
- CommandParameter="True" />
- <Button Content="{lex:Loc 下使能}"
- Grid.Row="1"
- Margin="0,10,0,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding MotorCommand}"
- CommandParameter="False" />
- <Button Content="{lex:Loc 复位错误}"
- Grid.Row="2"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding ResetCommand}" />
- <Button Content="{lex:Loc 释放刹车}"
- Grid.Row="3"
- Margin="0,10,0,10"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding sFreeCommand}" />
- <Button Content="{lex:Loc 锁定刹车}"
- Grid.Row="4"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedDarkButton}"
- Command="{Binding SLockCommand}" />
- </Grid>
- </Grid>
- </Grid>
- </DockPanel>
- <StackPanel Grid.Row="1"
- Orientation="Horizontal"
- HorizontalAlignment="Right">
- <Button Height="30"
- materialDesign:ButtonAssist.CornerRadius="10"
- ToolTip="{lex:Loc 确定}"
- Style="{StaticResource MaterialDesignRaisedButton}"
- Command="{Binding ConfirmCommand}">
- <TextBlock Text="{lex:Loc 确定}" />
- </Button>
- <Button Height="30"
- Margin="20,0"
- materialDesign:ButtonAssist.CornerRadius="10"
- Style="{StaticResource MaterialDesignRaisedButton}"
- ToolTip="{lex:Loc 取消}"
- Command="{Binding CancelCommand}">
- <TextBlock Text="{lex:Loc 取消}" />
- </Button>
- </StackPanel>
- </Grid>
- </materialDesign:DialogHost>
- </UserControl>
|