791 lines
40 KiB
XML
791 lines
40 KiB
XML
<UserControl
|
|
x:Class="CapMachine.Wpf.Views.CANConfigView"
|
|
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:local="clr-namespace:CapMachine.Wpf.Views"
|
|
xmlns:localEx="clr-namespace:CapMachine.Wpf"
|
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:prism="http://prismlibrary.com/"
|
|
d:DesignHeight="980"
|
|
d:DesignWidth="1920"
|
|
prism:ViewModelLocator.AutoWireViewModel="True"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<localEx:BindingProxy x:Key="Proxy" Data="{Binding}" />
|
|
</UserControl.Resources>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="60" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<materialDesign:Card
|
|
Margin="3"
|
|
Background="{DynamicResource MaterialDesignLightBackground}"
|
|
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
|
UniformCornerRadius="5">
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<TextBlock
|
|
Margin="10,0,10,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="30"
|
|
Text="" />
|
|
<TextBlock
|
|
Margin="5,0"
|
|
VerticalAlignment="Center"
|
|
FontSize="30"
|
|
FontWeight="Bold"
|
|
Text="CAN DBC 文件路径:" />
|
|
<Border
|
|
Width="800"
|
|
Margin="5,8"
|
|
Padding="15,5"
|
|
Background="LightGray"
|
|
CornerRadius="5">
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="22"
|
|
Text="{Binding SelectedCANConfigExdDto.DbcPath}" />
|
|
</Border>
|
|
|
|
<Button Command="{Binding LoadDbcCmd}" Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="选择Dbc文件" />
|
|
</StackPanel>
|
|
</Button>
|
|
</StackPanel>
|
|
</materialDesign:Card>
|
|
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="360" />
|
|
<ColumnDefinition />
|
|
<ColumnDefinition Width="800" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid Margin="3">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="60" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
|
|
<materialDesign:Card
|
|
Margin="0,1,0,3"
|
|
Background="{DynamicResource MaterialDesignLightBackground}"
|
|
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
|
UniformCornerRadius="5">
|
|
<StackPanel Margin="5" Orientation="Horizontal">
|
|
<Button
|
|
Margin="2,0"
|
|
Command="{Binding CanLinConfigPromdCmd}"
|
|
CommandParameter="Add"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="新建" />
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
<Button
|
|
Margin="2,0"
|
|
Command="{Binding CanLinConfigPromdCmd}"
|
|
CommandParameter="Edit"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="修改" />
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
<Button
|
|
Margin="2,0"
|
|
Command="{Binding CanLinConfigPromdCmd}"
|
|
CommandParameter="Delete"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="删除" />
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
<Button
|
|
Margin="2,0"
|
|
Command="{Binding CanLinConfigPromdCmd}"
|
|
CommandParameter="Active"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="启用" />
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
</StackPanel>
|
|
</materialDesign:Card>
|
|
<DataGrid
|
|
x:Name="CANConfigDatagrid"
|
|
Grid.Row="1"
|
|
AutoGenerateColumns="False"
|
|
BorderBrush="Black"
|
|
BorderThickness="1"
|
|
FontWeight="Bold"
|
|
IsHitTestVisible="{Binding IsCanConfigProActive}"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding ListCanLinConfigPro}"
|
|
SelectionMode="Extended"
|
|
SelectionUnit="FullRow">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Width="350" Binding="{Binding ConfigName}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="CAN配置名称" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
|
|
|
|
</DataGrid.Columns>
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<prism:InvokeCommandAction Command="{Binding CanConfigProGridSelectionChangedCmd}" CommandParameter="{Binding ElementName=CANConfigDatagrid, Path=SelectedItem}" />
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
|
|
</DataGrid>
|
|
</Grid>
|
|
|
|
<Grid Grid.Column="1" Margin="3">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="200" />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<materialDesign:Card
|
|
Margin="0,1,0,3"
|
|
Background="{DynamicResource MaterialDesignLightBackground}"
|
|
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
|
UniformCornerRadius="5">
|
|
<Grid>
|
|
<Grid.Resources>
|
|
<Style
|
|
x:Key="TextBoxStyle"
|
|
BasedOn="{StaticResource MaterialDesignTextBoxBase}"
|
|
TargetType="TextBox">
|
|
<Setter Property="FontSize" Value="18" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="Margin" Value="10,0" />
|
|
<Setter Property="Width" Value="80" />
|
|
</Style>
|
|
<Style x:Key="TextBlockStyle" TargetType="TextBlock">
|
|
<Setter Property="Width" Value="75" />
|
|
<Setter Property="FontSize" Value="18" />
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="Margin" Value="5,0" />
|
|
</Style>
|
|
</Grid.Resources>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition Width="2*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Margin="5" Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="5,0,10,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="24"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="24"
|
|
FontWeight="Bold"
|
|
Text="CAN通信配置" />
|
|
</StackPanel>
|
|
|
|
<StackPanel
|
|
Grid.Column="1"
|
|
Margin="0,0,15,0"
|
|
HorizontalAlignment="Right"
|
|
Orientation="Horizontal">
|
|
<Button
|
|
Margin="5,0"
|
|
Command="{Binding CanOpCmd}"
|
|
CommandParameter="Open"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="连接CAN" />
|
|
</StackPanel>
|
|
</Button>
|
|
<Button
|
|
Margin="5,0"
|
|
Command="{Binding CanOpCmd}"
|
|
CommandParameter="Close"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="关闭CAN" />
|
|
</StackPanel>
|
|
</Button>
|
|
<Button
|
|
Margin="5,0"
|
|
Command="{Binding CanOpCmd}"
|
|
CommandParameter="Parse"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="解析DBC" />
|
|
</StackPanel>
|
|
</Button>
|
|
<Button
|
|
Margin="5,0"
|
|
Command="{Binding CanOpCmd}"
|
|
CommandParameter="Save"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="保存配置" />
|
|
</StackPanel>
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
<Grid Grid.Row="1">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="10,0,10,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock Style="{StaticResource TextBlockStyle}" Text="波特率" />
|
|
<TextBox Style="{StaticResource TextBoxStyle}" Text="{Binding SelectedCANConfigExdDto.BaudRate}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="1" Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="10,0,10,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock Style="{StaticResource TextBlockStyle}" Text="循环周期" />
|
|
<TextBox Style="{StaticResource TextBoxStyle}" Text="{Binding SelectedCANConfigExdDto.Cycle}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel
|
|
Grid.Row="2"
|
|
Grid.ColumnSpan="2"
|
|
Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="10,0,10,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock Style="{StaticResource TextBlockStyle}" Text="连接状态" />
|
|
<Border
|
|
Width="90"
|
|
Margin="5,10"
|
|
Padding="5"
|
|
CornerRadius="3">
|
|
<Border.Style>
|
|
<Style TargetType="Border">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding CanDriveService.ToomossCanDrive.OpenState}" Value="True">
|
|
<Setter Property="Background" Value="LimeGreen" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding CanDriveService.ToomossCanDrive.OpenState}" Value="False">
|
|
<Setter Property="Background" Value="Gray" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
Foreground="White"
|
|
Text="" />
|
|
</Border>
|
|
|
|
<Button
|
|
Command="{Binding CanOpCmd}"
|
|
CommandParameter="SendTest1"
|
|
Content="发送测试数据" />
|
|
<Button
|
|
Command="{Binding CanOpCmd}"
|
|
CommandParameter="SendTest2"
|
|
Content="发送测试数据" />
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</materialDesign:Card>
|
|
|
|
<materialDesign:Card
|
|
Grid.Row="1"
|
|
Margin="0,2,0,3"
|
|
Background="{DynamicResource MaterialDesignLightBackground}"
|
|
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
|
UniformCornerRadius="5">
|
|
<Grid>
|
|
<Grid.Resources>
|
|
<Style
|
|
x:Key="TextBoxStyle"
|
|
BasedOn="{StaticResource MaterialDesignTextBoxBase}"
|
|
TargetType="TextBox">
|
|
<Setter Property="FontSize" Value="18" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="Margin" Value="10,0" />
|
|
<Setter Property="Width" Value="150" />
|
|
</Style>
|
|
<Style x:Key="TextBlockStyle" TargetType="TextBlock">
|
|
<Setter Property="Width" Value="75" />
|
|
<Setter Property="FontSize" Value="18" />
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="Margin" Value="5,0" />
|
|
</Style>
|
|
</Grid.Resources>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Margin="5" Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="5,0,10,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="24"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="24"
|
|
FontWeight="Bold"
|
|
Text="写入操作" />
|
|
</StackPanel>
|
|
<StackPanel
|
|
Grid.Column="1"
|
|
Margin="0,0,15,0"
|
|
HorizontalAlignment="Right"
|
|
Orientation="Horizontal">
|
|
<Button
|
|
Margin="5,0"
|
|
Command="{Binding WriteCmd}"
|
|
CommandParameter="Edit"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="修改" />
|
|
</StackPanel>
|
|
</Button>
|
|
<Button
|
|
Margin="5,0"
|
|
Command="{Binding WriteCmd}"
|
|
CommandParameter="Delete"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="删除" />
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
<DataGrid
|
|
x:Name="CANWriteDatagrid"
|
|
Grid.Row="1"
|
|
AutoGenerateColumns="False"
|
|
BorderBrush="Black"
|
|
CanUserAddRows="False"
|
|
ItemsSource="{Binding ListWriteCanLinRWConfigDto}"
|
|
SelectionMode="Extended"
|
|
SelectionUnit="FullRow">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Width="200" Binding="{Binding Name}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="名称" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
<DataGridTextColumn Binding="{Binding Content}" IsReadOnly="True">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="配置内容" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
<DataGridTextColumn Binding="{Binding DefautValue}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="默认值" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
</DataGrid.Columns>
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<prism:InvokeCommandAction Command="{Binding WriteGridSelectionChangedCmd}" CommandParameter="{Binding ElementName=CANWriteDatagrid, Path=SelectedItem}" />
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
|
|
</DataGrid>
|
|
|
|
</Grid>
|
|
</materialDesign:Card>
|
|
|
|
<materialDesign:Card
|
|
Grid.Row="2"
|
|
Margin="0,2,0,3"
|
|
Background="{DynamicResource MaterialDesignLightBackground}"
|
|
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
|
UniformCornerRadius="5">
|
|
<Grid>
|
|
<Grid.Resources>
|
|
<Style
|
|
x:Key="TextBoxStyle"
|
|
BasedOn="{StaticResource MaterialDesignTextBoxBase}"
|
|
TargetType="TextBox">
|
|
<Setter Property="FontSize" Value="18" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="Margin" Value="10,0" />
|
|
<Setter Property="Width" Value="150" />
|
|
</Style>
|
|
<Style x:Key="TextBlockStyle" TargetType="TextBlock">
|
|
<Setter Property="Width" Value="75" />
|
|
<Setter Property="FontSize" Value="18" />
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="Margin" Value="5,0" />
|
|
</Style>
|
|
</Grid.Resources>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Margin="5" Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="5,0,10,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="24"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="24"
|
|
FontWeight="Bold"
|
|
Text="读取操作" />
|
|
</StackPanel>
|
|
<StackPanel
|
|
Grid.Column="1"
|
|
Margin="0,0,15,0"
|
|
HorizontalAlignment="Right"
|
|
Orientation="Horizontal">
|
|
<Button
|
|
Margin="5,0"
|
|
Command="{Binding ReadCmd}"
|
|
CommandParameter="Edit"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="修改" />
|
|
</StackPanel>
|
|
</Button>
|
|
<Button
|
|
Margin="5,0"
|
|
Command="{Binding ReadCmd}"
|
|
CommandParameter="Delete"
|
|
Foreground="White">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="2,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="18"
|
|
Text="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="删除" />
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<DataGrid
|
|
x:Name="CANReadDatagrid"
|
|
Grid.Row="1"
|
|
AutoGenerateColumns="False"
|
|
BorderBrush="Black"
|
|
CanUserAddRows="False"
|
|
ItemsSource="{Binding ListReadCanLinRWConfigDto}"
|
|
SelectionMode="Extended"
|
|
SelectionUnit="FullRow">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Width="200" Binding="{Binding Name}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="名称" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
<DataGridTextColumn Binding="{Binding Content}" IsReadOnly="True">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="配置内容" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
<DataGridTextColumn Binding="{Binding DefautValue}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="默认值" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
</DataGrid.Columns>
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<prism:InvokeCommandAction Command="{Binding ReadGridSelectionChangedCmd}" CommandParameter="{Binding ElementName=CANReadDatagrid, Path=SelectedItem}" />
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
|
|
</DataGrid>
|
|
|
|
</Grid>
|
|
</materialDesign:Card>
|
|
|
|
</Grid>
|
|
|
|
<Grid Grid.Column="2" Margin="3">
|
|
<!--<Grid.RowDefinitions>
|
|
<RowDefinition Height="60" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>-->
|
|
|
|
<!--<materialDesign:Card
|
|
Margin="0,1,0,3"
|
|
Background="{DynamicResource MaterialDesignLightBackground}"
|
|
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
|
UniformCornerRadius="5">
|
|
<StackPanel Margin="5" Orientation="Horizontal">
|
|
<Button
|
|
Margin="5,0"
|
|
Content="连接CAN"
|
|
Foreground="White" />
|
|
<Button
|
|
Margin="5,0"
|
|
Content="关闭CAN"
|
|
Foreground="White" />
|
|
<Button
|
|
Margin="5,0"
|
|
Content="保存配置"
|
|
Foreground="White" />
|
|
</StackPanel>
|
|
</materialDesign:Card>-->
|
|
|
|
<DataGrid
|
|
x:Name="DbcDatagrid"
|
|
AutoGenerateColumns="False"
|
|
BorderBrush="Black"
|
|
BorderThickness="1"
|
|
CanUserAddRows="False"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding ListCanDbcModel}"
|
|
SelectionMode="Extended"
|
|
SelectionUnit="FullRow">
|
|
<DataGrid.RowStyle>
|
|
<Style TargetType="DataGridRow">
|
|
<Setter Property="ContextMenu">
|
|
<Setter.Value>
|
|
<ContextMenu>
|
|
<MenuItem
|
|
Command="{Binding Source={StaticResource Proxy}, Path=Data.DataGridMenuCmd}"
|
|
CommandParameter="Write"
|
|
Header="添加到写入操作" />
|
|
<MenuItem
|
|
Command="{Binding Source={StaticResource Proxy}, Path=Data.DataGridMenuCmd}"
|
|
CommandParameter="Read"
|
|
Header="添加到读取操作" />
|
|
</ContextMenu>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</DataGrid.RowStyle>
|
|
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Binding="{Binding MsgId}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="消息ID" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
|
|
<DataGridTextColumn Binding="{Binding MsgName}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="消息名称" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
|
|
<DataGridTextColumn Binding="{Binding SignalName}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="信号名称" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
|
|
<DataGridTextColumn Binding="{Binding SignalDesc}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="信号描述" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
|
|
<DataGridTextColumn Binding="{Binding SignalUnit}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="信号单位" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
|
|
<DataGridTextColumn Binding="{Binding SignalRtValue}">
|
|
<DataGridTextColumn.Header>
|
|
<TextBlock FontWeight="Bold" Text="实时值" />
|
|
</DataGridTextColumn.Header>
|
|
</DataGridTextColumn>
|
|
|
|
</DataGrid.Columns>
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<prism:InvokeCommandAction Command="{Binding DbcGridSelectionChangedCmd}" CommandParameter="{Binding ElementName=DbcDatagrid, Path=SelectedItem}" />
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
|
|
</DataGrid>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
</UserControl>
|