1030 lines
54 KiB
XML
1030 lines
54 KiB
XML
<UserControl
|
||
x:Class="CapMachine.Wpf.Views.LINConfigView"
|
||
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="LIN LDF 文件路径:" />
|
||
<Border
|
||
Width="800"
|
||
Margin="5,8"
|
||
Padding="15,5"
|
||
Background="LightGray"
|
||
CornerRadius="5">
|
||
<TextBlock
|
||
VerticalAlignment="Center"
|
||
FontSize="22"
|
||
Text="{Binding SelectedLINConfigExdDto.LdfPath}" />
|
||
</Border>
|
||
|
||
<Button Command="{Binding LoadLdfCmd}" Foreground="White">
|
||
<StackPanel Orientation="Horizontal">
|
||
<TextBlock
|
||
Margin="2,0"
|
||
VerticalAlignment="Center"
|
||
FontFamily="/Assets/Fonts/#iconfont"
|
||
FontSize="18"
|
||
Text=" " />
|
||
<TextBlock
|
||
VerticalAlignment="Center"
|
||
FontSize="14"
|
||
Text="选择Ldf文件" />
|
||
</StackPanel>
|
||
</Button>
|
||
</StackPanel>
|
||
</materialDesign:Card>
|
||
|
||
<Grid Grid.Row="1">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="400" />
|
||
<ColumnDefinition />
|
||
<ColumnDefinition Width="550" />
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<Grid Margin="3">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="60" />
|
||
<RowDefinition Height="46" />
|
||
<RowDefinition />
|
||
</Grid.RowDefinitions>
|
||
|
||
<materialDesign:Card
|
||
Margin="0,1,0,3"
|
||
Background="{DynamicResource MaterialDesignLightBackground}"
|
||
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
||
UniformCornerRadius="5">
|
||
<StackPanel
|
||
Margin="5"
|
||
HorizontalAlignment="Center"
|
||
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"
|
||
ToolTip="【激活】代表启用选择的LIN配置为当前的工况所使用,激活后程序运行中不可改变LIN配置">
|
||
<StackPanel Orientation="Horizontal">
|
||
<TextBlock
|
||
Margin="2,0"
|
||
VerticalAlignment="Center"
|
||
FontFamily="/Assets/Fonts/#iconfont"
|
||
FontSize="18"
|
||
Text="" />
|
||
<TextBlock VerticalAlignment="Center" FontSize="14">
|
||
<TextBlock.Style>
|
||
<Style TargetType="TextBlock">
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding IsLinConfigProActive}" Value="True">
|
||
<Setter Property="Text" Value="取消" />
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding IsLinConfigProActive}" Value="False">
|
||
<Setter Property="Text" Value="激活" />
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</TextBlock.Style>
|
||
</TextBlock>
|
||
</StackPanel>
|
||
</Button>
|
||
|
||
</StackPanel>
|
||
</materialDesign:Card>
|
||
<materialDesign:Card
|
||
Grid.Row="1"
|
||
Margin="0,1,0,3"
|
||
Background="{DynamicResource MaterialDesignLightBackground}"
|
||
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
||
UniformCornerRadius="5">
|
||
<Border CornerRadius="5">
|
||
<Border.Style>
|
||
<Style TargetType="Border">
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding IsLinConfigProActive}" Value="True">
|
||
<Setter Property="Background" Value="LimeGreen" />
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding IsLinConfigProActive}" Value="False">
|
||
<Setter Property="Background" Value="Transparent" />
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</Border.Style>
|
||
<TextBlock
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
FontSize="24"
|
||
Foreground="Blue"
|
||
Text="{Binding SelectCanLinConfigProConfigName}" />
|
||
</Border>
|
||
<!--<StackPanel
|
||
Margin="5"
|
||
HorizontalAlignment="Center"
|
||
Orientation="Horizontal">
|
||
|
||
|
||
</StackPanel>-->
|
||
</materialDesign:Card>
|
||
|
||
<DataGrid
|
||
x:Name="LINConfigDatagrid"
|
||
Grid.Row="2"
|
||
AutoGenerateColumns="False"
|
||
BorderBrush="Black"
|
||
BorderThickness="1"
|
||
FontWeight="Bold"
|
||
IsHitTestVisible="{Binding IsLINConfigDatagridActive}"
|
||
IsReadOnly="True"
|
||
ItemsSource="{Binding ListCanLinConfigPro}"
|
||
SelectionMode="Extended"
|
||
SelectionUnit="FullRow">
|
||
<DataGrid.Columns>
|
||
<DataGridTextColumn Width="350" Binding="{Binding ConfigName}">
|
||
<DataGridTextColumn.Header>
|
||
<TextBlock FontWeight="Bold" Text="LIN配置名称" />
|
||
</DataGridTextColumn.Header>
|
||
</DataGridTextColumn>
|
||
|
||
|
||
</DataGrid.Columns>
|
||
<i:Interaction.Triggers>
|
||
<i:EventTrigger EventName="SelectionChanged">
|
||
<prism:InvokeCommandAction Command="{Binding LinConfigProGridSelectionChangedCmd}" CommandParameter="{Binding ElementName=LINConfigDatagrid, Path=SelectedItem}" />
|
||
</i:EventTrigger>
|
||
<i:EventTrigger EventName="PreviewMouseLeftButtonDown">
|
||
<prism:InvokeCommandAction Command="{Binding LinConfigProGridPreviewMouseLeftButtonDownCmd}" />
|
||
</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="110" />
|
||
<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="LIN通信配置" />
|
||
</StackPanel>
|
||
|
||
<StackPanel
|
||
Grid.Column="1"
|
||
Margin="0,0,15,0"
|
||
HorizontalAlignment="Right"
|
||
Orientation="Horizontal">
|
||
<Button
|
||
Margin="5,0"
|
||
Command="{Binding LinOpCmd}"
|
||
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="连接LIN" />
|
||
</StackPanel>
|
||
</Button>
|
||
<Button
|
||
Margin="5,0"
|
||
Command="{Binding LinOpCmd}"
|
||
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="关闭LIN" />
|
||
</StackPanel>
|
||
</Button>
|
||
<Button
|
||
Margin="5,0"
|
||
Command="{Binding LinOpCmd}"
|
||
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="解析Ldf" />
|
||
</StackPanel>
|
||
</Button>
|
||
<Button
|
||
Margin="5,0"
|
||
Command="{Binding LinOpCmd}"
|
||
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="波特率" />
|
||
<ComboBox
|
||
Width="100"
|
||
DisplayMemberPath="Text"
|
||
FontSize="16"
|
||
ItemsSource="{Binding DataBaudRateCbxItems}"
|
||
SelectedValue="{Binding SelectedLINConfigExdDto.BaudRate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||
SelectedValuePath="Key" />
|
||
<!--<TextBox Style="{StaticResource TextBoxStyle}" Text="{Binding SelectedLINConfigExdDto.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="循环周期(ms)" />
|
||
<TextBox Style="{StaticResource TextBoxStyle}" Text="{Binding SelectedLINConfigExdDto.Cycle}" />
|
||
</StackPanel>
|
||
|
||
<StackPanel
|
||
Grid.Row="2"
|
||
Grid.Column="2"
|
||
Orientation="Horizontal">
|
||
<TextBlock
|
||
Margin="0,0,5,0"
|
||
VerticalAlignment="Center"
|
||
FontFamily="/Assets/Fonts/#iconfont"
|
||
FontSize="18"
|
||
Text="" />
|
||
<TextBlock
|
||
Width="86"
|
||
Style="{StaticResource TextBlockStyle}"
|
||
Text="转速(rpm)" />
|
||
<TextBox
|
||
Margin="5,0"
|
||
Style="{StaticResource TextBoxStyle}"
|
||
Text="{Binding HandSpeed}" />
|
||
|
||
<Button
|
||
Margin="5,0"
|
||
Command="{Binding LinOpCmd}"
|
||
CommandParameter="HandSend"
|
||
Content="手动发送"
|
||
Foreground="White" />
|
||
</StackPanel>
|
||
|
||
<StackPanel
|
||
Grid.Row="2"
|
||
Grid.ColumnSpan="3"
|
||
Orientation="Horizontal">
|
||
<TextBlock
|
||
Margin="10,0,10,0"
|
||
VerticalAlignment="Center"
|
||
FontFamily="/Assets/Fonts/#iconfont"
|
||
FontSize="18"
|
||
Text="" />
|
||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="LIN连接状态" />
|
||
<Border
|
||
Width="50"
|
||
Margin="5,10"
|
||
Padding="5"
|
||
CornerRadius="3">
|
||
<Border.Style>
|
||
<Style TargetType="Border">
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding LinDriveService.ToomossLinDrive.OpenState}" Value="True">
|
||
<Setter Property="Background" Value="LimeGreen" />
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LinDriveService.ToomossLinDrive.OpenState}" Value="False">
|
||
<Setter Property="Background" Value="Gray" />
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</Border.Style>
|
||
<TextBlock
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
Foreground="White"
|
||
Text="连接" />
|
||
</Border>
|
||
<Border
|
||
Width="60"
|
||
Margin="5,10"
|
||
Padding="5"
|
||
CornerRadius="3">
|
||
<Border.Style>
|
||
<Style TargetType="Border">
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding LinDriveService.ToomossLinDrive.LdfParserState}" Value="True">
|
||
<Setter Property="Background" Value="LimeGreen" />
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LinDriveService.ToomossLinDrive.LdfParserState}" Value="False">
|
||
<Setter Property="Background" Value="Gray" />
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</Border.Style>
|
||
<TextBlock
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
Foreground="White"
|
||
Text="Ldf解析" />
|
||
</Border>
|
||
|
||
<Button
|
||
Margin="15,0,5,0"
|
||
Command="{Binding LinOpCmd}"
|
||
CommandParameter="CycleSend">
|
||
<Button.Style>
|
||
<Style BasedOn="{StaticResource MaterialDesignFlatDarkBgButton}" TargetType="Button">
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding LinDriveService.ToomossLinDrive.IsCycleSend}" Value="true">
|
||
<Setter Property="Background" Value="LimeGreen" />
|
||
<Setter Property="Foreground" Value="White" />
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LinDriveService.ToomossLinDrive.IsCycleSend}" Value="false">
|
||
<Setter Property="Background" Value="Gray" />
|
||
<Setter Property="Foreground" Value="White" />
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</Button.Style>
|
||
<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 LinOpCmd}"
|
||
CommandParameter="CycleRecive">
|
||
<Button.Style>
|
||
<Style BasedOn="{StaticResource MaterialDesignFlatDarkBgButton}" TargetType="Button">
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding LinDriveService.ToomossLinDrive.IsCycleRevice}" Value="true">
|
||
<Setter Property="Background" Value="LimeGreen" />
|
||
<Setter Property="Foreground" Value="White" />
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LinDriveService.ToomossLinDrive.IsCycleRevice}" Value="false">
|
||
<Setter Property="Background" Value="Gray" />
|
||
<Setter Property="Foreground" Value="White" />
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</Button.Style>
|
||
<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>
|
||
|
||
<StackPanel
|
||
Grid.Row="1"
|
||
Grid.Column="2"
|
||
Orientation="Horizontal">
|
||
<TextBlock
|
||
Margin="5,0,5,0"
|
||
VerticalAlignment="Center"
|
||
FontFamily="/Assets/Fonts/#iconfont"
|
||
FontSize="18"
|
||
Foreground="LimeGreen"
|
||
Text="" />
|
||
<TextBlock
|
||
Width="auto"
|
||
Foreground="LimeGreen"
|
||
Style="{StaticResource TextBlockStyle}"
|
||
Text="自动转速(rpm)" />
|
||
<TextBlock
|
||
Margin="5,0"
|
||
Foreground="LimeGreen"
|
||
Style="{StaticResource TextBlockStyle}"
|
||
Text="{Binding LinDriveService.AutoSpeedSv}" />
|
||
</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="LINWriteDatagrid"
|
||
Grid.Row="1"
|
||
AutoGenerateColumns="False"
|
||
BorderBrush="Black"
|
||
CanUserAddRows="False"
|
||
ItemsSource="{Binding ListWriteCanLinRWConfigDto}"
|
||
SelectionMode="Extended"
|
||
SelectionUnit="FullRow">
|
||
<DataGrid.Columns>
|
||
<DataGridTemplateColumn Width="200" Header="名称">
|
||
<DataGridTemplateColumn.CellTemplate>
|
||
<DataTemplate>
|
||
<ComboBox
|
||
DisplayMemberPath="Text"
|
||
ItemsSource="{Binding Source={StaticResource Proxy}, Path=Data.WriteNameCbxItems}"
|
||
SelectedValue="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||
SelectedValuePath="Text" />
|
||
</DataTemplate>
|
||
</DataGridTemplateColumn.CellTemplate>
|
||
</DataGridTemplateColumn>
|
||
|
||
<!--<DataGridTextColumn Width="200" Binding="{Binding Name}">
|
||
<DataGridTextColumn.Header>
|
||
<TextBlock FontWeight="Bold" Text="名称" />
|
||
</DataGridTextColumn.Header>
|
||
</DataGridTextColumn>-->
|
||
<DataGridTextColumn Binding="{Binding SignalName}" IsReadOnly="True">
|
||
<DataGridTextColumn.Header>
|
||
<TextBlock FontWeight="Bold" Text="信号内容" />
|
||
</DataGridTextColumn.Header>
|
||
</DataGridTextColumn>
|
||
<DataGridTextColumn Binding="{Binding MsgFrameName}" 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=LINWriteDatagrid, 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="LINReadDatagrid"
|
||
Grid.Row="1"
|
||
AutoGenerateColumns="False"
|
||
BorderBrush="Black"
|
||
CanUserAddRows="False"
|
||
ItemsSource="{Binding ListReadCanLinRWConfigDto}"
|
||
SelectionMode="Extended"
|
||
SelectionUnit="FullRow">
|
||
<DataGrid.Columns>
|
||
<DataGridTemplateColumn Width="200" Header="名称">
|
||
<DataGridTemplateColumn.CellTemplate>
|
||
<DataTemplate>
|
||
<ComboBox
|
||
DisplayMemberPath="Text"
|
||
ItemsSource="{Binding Source={StaticResource Proxy}, Path=Data.ReadNameCbxItems}"
|
||
SelectedValue="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||
SelectedValuePath="Text" />
|
||
</DataTemplate>
|
||
</DataGridTemplateColumn.CellTemplate>
|
||
</DataGridTemplateColumn>
|
||
|
||
<!--<DataGridTextColumn Width="200" Binding="{Binding Name}">
|
||
<DataGridTextColumn.Header>
|
||
<TextBlock FontWeight="Bold" Text="名称" />
|
||
</DataGridTextColumn.Header>
|
||
</DataGridTextColumn>-->
|
||
<DataGridTextColumn Binding="{Binding SignalName}" IsReadOnly="True">
|
||
<DataGridTextColumn.Header>
|
||
<TextBlock FontWeight="Bold" Text="信号名称" />
|
||
</DataGridTextColumn.Header>
|
||
</DataGridTextColumn>
|
||
<DataGridTextColumn Binding="{Binding MsgFrameName}" 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=LINReadDatagrid, 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="连接LIN"
|
||
Foreground="White" />
|
||
<Button
|
||
Margin="5,0"
|
||
Content="关闭LIN"
|
||
Foreground="White" />
|
||
<Button
|
||
Margin="5,0"
|
||
Content="保存配置"
|
||
Foreground="White" />
|
||
</StackPanel>
|
||
</materialDesign:Card>-->
|
||
|
||
<DataGrid
|
||
x:Name="LdfDatagrid"
|
||
AutoGenerateColumns="False"
|
||
BorderBrush="Black"
|
||
BorderThickness="1"
|
||
CanUserAddRows="False"
|
||
IsReadOnly="True"
|
||
ItemsSource="{Binding ListLinLdfModel}"
|
||
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.Triggers>
|
||
<DataTrigger Binding="{Binding IsSeletedInfo}" Value="1">
|
||
<Setter Property="Background" Value="GreenYellow" />
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding IsSeletedInfo}" Value="2">
|
||
<Setter Property="Background" Value="SkyBlue" />
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</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 Publisher}">
|
||
<DataGridTextColumn.Header>
|
||
<TextBlock FontWeight="Bold" Text="发布者" />
|
||
</DataGridTextColumn.Header>
|
||
</DataGridTextColumn>
|
||
|
||
<!--<DataGridTextColumn Binding="{Binding IsMasterFrame}">
|
||
<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 SignalRtValue}">
|
||
<DataGridTextColumn.Header>
|
||
<TextBlock FontWeight="Bold" Text="实时值" />
|
||
</DataGridTextColumn.Header>
|
||
</DataGridTextColumn>
|
||
|
||
</DataGrid.Columns>
|
||
<i:Interaction.Triggers>
|
||
<i:EventTrigger EventName="SelectionChanged">
|
||
<prism:InvokeCommandAction Command="{Binding LdfGridSelectionChangedCmd}" CommandParameter="{Binding ElementName=LdfDatagrid, Path=SelectedItem}" />
|
||
</i:EventTrigger>
|
||
</i:Interaction.Triggers>
|
||
|
||
</DataGrid>
|
||
|
||
</Grid>
|
||
|
||
|
||
|
||
|
||
</Grid>
|
||
|
||
</Grid>
|
||
</UserControl>
|