周立功开发过程1
This commit is contained in:
375
CapMachine.Wpf/Views/ZlgCanDriveConfigView.xaml
Normal file
375
CapMachine.Wpf/Views/ZlgCanDriveConfigView.xaml
Normal file
@@ -0,0 +1,375 @@
|
||||
<UserControl
|
||||
x:Class="CapMachine.Wpf.Views.ZlgCanDriveConfigView"
|
||||
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="{Binding DbcPathTitle}" />
|
||||
|
||||
<Border
|
||||
Width="700"
|
||||
Margin="5,8"
|
||||
Padding="15,5"
|
||||
Background="LightGray"
|
||||
CornerRadius="5">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="22"
|
||||
Text="{Binding CurrentDbcPath}" />
|
||||
</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>
|
||||
|
||||
<Button
|
||||
Margin="5,0"
|
||||
Command="{Binding CanOpCmd}"
|
||||
CommandParameter="CycleRecive">
|
||||
<Button.Style>
|
||||
<Style BasedOn="{StaticResource MaterialDesignFlatDarkBgButton}" TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ZlgCanDriveService.IsCycleRevice}" Value="true">
|
||||
<Setter Property="Background" Value="LimeGreen" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ZlgCanDriveService.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>
|
||||
|
||||
<TextBlock Margin="10,0,5,0" VerticalAlignment="Center" FontSize="14" Text="报文状态:" />
|
||||
|
||||
<Border Margin="0,10,5,10" Padding="5" CornerRadius="3">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="Gray" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ZlgCanDriveService.IsSendOk}" Value="true">
|
||||
<Setter Property="Background" Value="LimeGreen" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Text="发送" />
|
||||
</Border>
|
||||
|
||||
<Border Margin="0,10,5,10" Padding="5" CornerRadius="3">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="Gray" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ZlgCanDriveService.IsReviceOk}" Value="true">
|
||||
<Setter Property="Background" Value="LimeGreen" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Text="接收" />
|
||||
</Border>
|
||||
|
||||
<TextBlock Margin="25,0,5,0" VerticalAlignment="Center" FontSize="18" Text="模式:" />
|
||||
<ComboBox
|
||||
Width="120"
|
||||
Margin="0,0,15,0"
|
||||
VerticalAlignment="Center"
|
||||
SelectedValue="{Binding SelectedModeKey}"
|
||||
SelectedValuePath="Tag">
|
||||
<ComboBoxItem Content="CAN" Tag="Can" />
|
||||
<ComboBoxItem Content="CANFD" Tag="CanFd" />
|
||||
</ComboBox>
|
||||
|
||||
<Button
|
||||
Margin="2,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="{Binding ConnectButtonText}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button
|
||||
Margin="2,0"
|
||||
Command="{Binding CanOpCmd}"
|
||||
CommandParameter="Close"
|
||||
Foreground="White">
|
||||
<TextBlock FontSize="14" Text="关闭" />
|
||||
</Button>
|
||||
<Button
|
||||
Margin="2,0"
|
||||
Command="{Binding CanOpCmd}"
|
||||
CommandParameter="Parse"
|
||||
Foreground="White">
|
||||
<TextBlock FontSize="14" Text="解析" />
|
||||
</Button>
|
||||
<Button
|
||||
Margin="2,0"
|
||||
Command="{Binding CanOpCmd}"
|
||||
CommandParameter="Save"
|
||||
Foreground="White">
|
||||
<TextBlock FontSize="14" Text="保存" />
|
||||
</Button>
|
||||
|
||||
<TextBlock
|
||||
Margin="15,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="18"
|
||||
Text="" />
|
||||
|
||||
<TextBlock Margin="0,0,5,0" VerticalAlignment="Center" FontSize="14" Text="连接" />
|
||||
<Border
|
||||
Width="50"
|
||||
Margin="0,10,5,10"
|
||||
Padding="5"
|
||||
CornerRadius="3">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ZlgCanDriveService.OpenState}" Value="True">
|
||||
<Setter Property="Background" Value="LimeGreen" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ZlgCanDriveService.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="0,10,5,10"
|
||||
Padding="5"
|
||||
CornerRadius="3">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ZlgCanDriveService.DbcParserState}" Value="True">
|
||||
<Setter Property="Background" Value="LimeGreen" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ZlgCanDriveService.DbcParserState}" Value="False">
|
||||
<Setter Property="Background" Value="Gray" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Text="Dbc解析" />
|
||||
</Border>
|
||||
|
||||
<Button
|
||||
Margin="10,0,5,0"
|
||||
Command="{Binding CanOpCmd}"
|
||||
CommandParameter="CycleSend">
|
||||
<Button.Style>
|
||||
<Style BasedOn="{StaticResource MaterialDesignFlatDarkBgButton}" TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ZlgCanDriveService.IsCycleSend}" Value="true">
|
||||
<Setter Property="Background" Value="LimeGreen" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ZlgCanDriveService.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>
|
||||
|
||||
<TextBlock
|
||||
Margin="10,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="12"
|
||||
Text="{Binding OpTip}" />
|
||||
<TextBlock
|
||||
Margin="10,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="12"
|
||||
Foreground="Red"
|
||||
Text="{Binding LastError}" />
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="400" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<materialDesign:Card
|
||||
Grid.Column="0"
|
||||
Margin="3"
|
||||
Background="{DynamicResource MaterialDesignLightBackground}"
|
||||
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
||||
UniformCornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="18"
|
||||
FontWeight="Bold"
|
||||
Text="配置程序" />
|
||||
|
||||
<DataGrid
|
||||
x:Name="CanConfigDatagrid"
|
||||
Grid.Row="1"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
HeadersVisibility="Column"
|
||||
ItemsSource="{Binding ListCanLinConfigPro}"
|
||||
SelectedItem="{Binding SelectCanLinConfigPro, Mode=TwoWay}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<prism:InvokeCommandAction
|
||||
Command="{Binding CanConfigProGridSelectionChangedCmd}"
|
||||
CommandParameter="{Binding ElementName=CanConfigDatagrid, Path=SelectedItem}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding ConfigName}" Header="名称" Width="*" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</materialDesign:Card>
|
||||
|
||||
<materialDesign:Card
|
||||
Grid.Column="1"
|
||||
Margin="3"
|
||||
Background="{DynamicResource MaterialDesignLightBackground}"
|
||||
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
||||
UniformCornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="80" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="18"
|
||||
FontWeight="Bold"
|
||||
Text="参数/信号" />
|
||||
|
||||
<StackPanel Grid.Row="1" Margin="10" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="16" Text="周期:" />
|
||||
<TextBox
|
||||
Width="100"
|
||||
Margin="5,0,20,0"
|
||||
VerticalContentAlignment="Center"
|
||||
Text="{Binding CurrentCycle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<CheckBox
|
||||
VerticalAlignment="Center"
|
||||
Content="调度使能"
|
||||
IsChecked="{Binding CurrentSchEnable, Mode=TwoWay}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<prism:InvokeCommandAction
|
||||
Command="{Binding SchEnableCmd}"
|
||||
CommandParameter="{Binding IsChecked, RelativeSource={RelativeSource AncestorType=CheckBox}}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
|
||||
<DataGrid
|
||||
Grid.Row="2"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
HeadersVisibility="Column"
|
||||
ItemsSource="{Binding ListCanDbcModel}"
|
||||
SelectedItem="{Binding SelectedCanDbcModel, Mode=TwoWay}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding MsgName}" Header="Msg" Width="200" />
|
||||
<DataGridTextColumn Binding="{Binding SignalName}" Header="Signal" Width="*" />
|
||||
<DataGridTextColumn Binding="{Binding SignalRtValue}" Header="Value" Width="150" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</materialDesign:Card>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
Reference in New Issue
Block a user