周立功换同星

This commit is contained in:
“hsc”
2026-07-29 14:20:32 +08:00
parent d8a22a15b1
commit 3bf33bb561
29 changed files with 1913 additions and 3255 deletions

View File

@@ -1,10 +1,11 @@
<UserControl x:Class="CANModule.Views.ZLGCANFDView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<UserControl x:Class="CANModule.Views.CANView"
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:CANModule.Views"
xmlns:oxy="http://oxyplot.org/wpf"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:CANModule.Views"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
xmlns:prism="http://prismlibrary.com/"
@@ -17,16 +18,11 @@
<Style BasedOn="{StaticResource DialogUserManageStyle}"
TargetType="Window" />
</prism:Dialog.WindowStyle>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding LoadCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<UserControl.Resources>
<cons:HexConverter x:Key="HexConverter" />
</UserControl.Resources>
<GroupBox Padding="0,0,0,0"
>
MouseLeftButtonDown="MouseLeftButtonDown">
<GroupBox.Header>
<Grid Margin="0">
<Grid.ColumnDefinitions>
@@ -38,59 +34,46 @@
Foreground="White"
VerticalAlignment="Center"
Margin="5,0,10,0" />
<Button Content="关闭"
Grid.Column="2"
Margin="150 0 0 0"
Width="60"
Command="{Binding CloseCommand}"
Height="25" />
</Grid>
</GroupBox.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="829*" />
<ColumnDefinition Width="69*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<!-- CAN卡连接 -->
<StackPanel Orientation="Horizontal"
Margin="5"
Grid.Row="0">
<Button Content="打开设备"
Command="{Binding ConnectCanCommand}"
Margin="5" />
<Button Content="关闭设备"
Command="{Binding CloseCanCommand}"
Margin="5" />
<Button Content="清空循环发送报文"
Command="{Binding ClearCycleCommand}"
Margin="5" />
</StackPanel>
<StackPanel Orientation="Horizontal"
Margin="5"
Grid.Row="1">
<Label Content="选择通道初始化(选择前先打开设备)"
VerticalAlignment="Center" />
<ComboBox SelectedItem="{Binding SelectedChannel}"
ItemsSource="{Binding ChannelList}"
materialDesign:HintAssist.Hint=""
MinWidth="80"
Margin="5"
VerticalAlignment="Center" />
</StackPanel>
<TreeView Grid.Row="2">
<!-- TreeView 用于显示不同选项 -->
<TreeView Grid.Row="1"
Grid.ColumnSpan="2">
<!-- 调试选项 -->
<TreeViewItem Header="调试选项">
<Button Content="初始化TSMaster"
Command="{Binding InitTSMasterCommand}"
CommandParameter="初始化TSMaster" />
<Button Content="释放TSMaster"
Command="{Binding ReleaseTSMasterCommand}"
CommandParameter="释放TSMaster" />
</TreeViewItem>
<!-- 监视选项 -->
<TreeViewItem Header="监视">
<DataGrid x:Name="表格"
Width="550"
Height="350"
<DataGrid x:Name="表格" Width="800"
Height="450"
VirtualizingPanel.IsVirtualizing="True"
IsReadOnly="True"
AutoGenerateColumns="False"
ItemsSource="{Binding CanMessageList, Mode=OneWay}">
<DataGrid.Columns>
<DataGridTextColumn Header="通道" Binding="{Binding 通道}" Width="90" />
<DataGridTextColumn Header="报文ID" Binding="{Binding 报文ID, Converter={StaticResource HexConverter}}" Width="150" />
<DataGridTextColumn Header="长度" Binding="{Binding 长度}" Width="90" />
<DataGridTextColumn Header="时间戳" Binding="{Binding 时间戳}" Width="Auto" />
</DataGrid.Columns>
</DataGrid>
</TreeViewItem>
@@ -98,11 +81,13 @@
<TreeViewItem Header="DBC">
<Label Content="请注意,要在断开CAN卡的情况下才能操作DBC!"
Foreground="Red" />
<Button Content="卸载当前通道DBC"
Command="{Binding UpLoadDBCCommand}" />
<Button Content="卸载所有DBC"
Command="{Binding UpLoadDBCCommand}"
CommandParameter="卸载DBC" />
<StackPanel Orientation="Horizontal">
<Button Content="更换DBC"
Command="{Binding ChangeDBCCommand}" />
Command="{Binding ChangeDBCCommand}"
CommandParameter="更换DBC" />
<Label Content="DBC文件路径"
VerticalContentAlignment="Center" />
<TextBox Text="{Binding DBCPath,Mode=TwoWay}"
@@ -112,7 +97,8 @@
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button Content="加载DBC"
Command="{Binding LoadDBCCommand}" />
Command="{Binding LoadDBCCommand}"
CommandParameter="加载DBC" />
<Label Content="通道(从0开始)"
VerticalContentAlignment="Center" />
<TextBox Text="{Binding DBCChannel,Mode=TwoWay}"
@@ -145,28 +131,27 @@
</ContextMenu>
</DataGrid.ContextMenu>
</DataGrid>
<Button Content="查看DBC"
Command="{Binding CheckDBCCommand}"
CommandParameter="查看DBC" />
</TreeViewItem>
<!-- CAN卡连接选项 -->
<TreeViewItem Header="CAN卡连接">
<Button Content="连接"
Command="{Binding ConnectCanCommand}"
CommandParameter="连接" />
<Button Content="断开"
Command="{Binding CloseCanCommand}"
CommandParameter="断开" />
<Button Content="清空循环发送报文"
Command="{Binding ClearCycleCommand}"
CommandParameter="清空循环发送报文" />
</TreeViewItem>
<!-- DBC报文发送 -->
<TreeViewItem Header="DBC报文发送">
<StackPanel Orientation="Horizontal">
<Label Content="通道(从0开始)"
VerticalContentAlignment="Center" />
<ComboBox SelectedValue="{Binding MessageSendChannel}"
SelectedValuePath="Content"
materialDesign:HintAssist.Hint=""
MinWidth="60"
VerticalAlignment="Center"
Margin="0,5,5,5">
<ComboBoxItem Content="0"/>
<ComboBoxItem Content="1"/>
<ComboBoxItem Content="2"/>
<ComboBoxItem Content="3"/>
</ComboBox>
<Button Content="加载报文"
Command="{Binding LoadMessageCommand}"
Margin="5" />
</StackPanel>
<DockPanel>
<Label Content="报文" />
<ComboBox MinWidth="100"
@@ -194,21 +179,33 @@
MinWidth="100" />
</DockPanel>
<StackPanel Orientation="Horizontal">
<Label Content="通道(从0开始)"
VerticalContentAlignment="Center" />
<TextBox Text="{Binding MessageSendChannel}"
materialDesign:HintAssist.Hint=""
MinWidth="100"
VerticalAlignment="Center"
Margin="0,10,10,10" />
<Button Content="加载报文"
Command="{Binding LoadMessageCommand}"
CommandParameter="加载报文"
Margin="10" />
<Button Content="设置信号并发送"
Command="{Binding SetAndSendMessageCommand}" />
Command="{Binding SetAndSendMessageCommand}"
CommandParameter="设置" />
<CheckBox Content="直接发送"
IsChecked="{Binding IsDirectlySend}" />
</StackPanel>
</TreeViewItem>
<!-- 自定义报文发送 -->
<TreeViewItem Header="自定义报文发送">
<DockPanel>
<Label Content="通道" />
<ComboBox MinWidth="100"
materialDesign:HintAssist.Hint=""
SelectedItem="{Binding AIdxChn}"
ItemsSource="{Binding APP_CHANNEL}" />
ItemsSource="{Binding APP_CHANNEL}"
/>
</DockPanel>
<DockPanel>
<Label Content="ID" />
@@ -250,10 +247,11 @@
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button Content="发送"
Command="{Binding SendCustomMessageCommand}" />
<!--<CheckBox Margin="10"
Command="{Binding SendCustomMessageCommand}"
/>
<CheckBox Margin="10"
Content="更新到数据库"
IsChecked="{Binding UpdateToDB}" />-->
IsChecked="{Binding UpdateToDB}" />
</StackPanel>
</TreeViewItem>
@@ -268,16 +266,20 @@
VerticalContentAlignment="Center" />
<Button Content="选择路径"
Margin="10 0"
Command="{Binding SelectBLFPathCommand}" />
Command="{Binding SelectBLFPathCommand}"
CommandParameter="选择路径" />
<Button Content="保存路径"
Command="{Binding SaveBLFPathCommand}" />
Command="{Binding SaveBLFPathCommand}"
CommandParameter="保存路径" />
</DockPanel>
<StackPanel Orientation="Horizontal">
<Button Content="开始录制"
Command="{Binding StartTranscribeCommand}" />
Command="{Binding StartTranscirbeCommand}"
CommandParameter="开始录制" />
<Button Content="结束录制"
Margin="10 0"
Command="{Binding EndTranscribeCommand}" />
Command="{Binding EndTranscirbeCommand}"
CommandParameter="结束录制" />
</StackPanel>
</TreeViewItem>
</TreeView>

View File

@@ -16,14 +16,15 @@ using System.Windows.Shapes;
namespace CANModule.Views
{
/// <summary>
/// ZLGCANFDView.xaml 的交互逻辑
/// CANView.xaml 的交互逻辑
/// </summary>
public partial class ZLGCANFDView : UserControl
public partial class CANView : UserControl
{
public ZLGCANFDView()
public CANView()
{
InitializeComponent();
}
private void MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
@@ -31,5 +32,7 @@ namespace CANModule.Views
Window.GetWindow(this)?.DragMove();
}
}
}
}

View File

@@ -1,23 +1,27 @@
<UserControl x:Class="CANModule.Views.CollectCANSignalSettingView"
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:CANModule.Views"
xmlns:oxy="http://oxyplot.org/wpf"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
xmlns:prism="http://prismlibrary.com/"
xmlns:cons="clr-namespace:UIShare.Converters;assembly=UIShare"
Background="White"
prism:ViewModelLocator.AutoWireViewModel="True"
Height="400"
Width="1000">
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:oxy="http://oxyplot.org/wpf"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
xmlns:prism="http://prismlibrary.com/"
xmlns:cons="clr-namespace:UIShare.Converters;assembly=UIShare"
Background="White"
prism:ViewModelLocator.AutoWireViewModel="True"
Height="400"
Width="1000">
<prism:Dialog.WindowStyle>
<Style BasedOn="{StaticResource DialogUserManageStyle}"
TargetType="Window" />
</prism:Dialog.WindowStyle>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding LoadCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<UserControl.Resources>
<cons:HexConverter x:Key="HexConverter" />
</UserControl.Resources>
@@ -79,11 +83,12 @@
Margin="10">
<Label Content="通道(从0开始)"
VerticalAlignment="Center" />
<TextBox Name="SignalComboBox"
Text="{Binding MessageChannel}"
<ComboBox Name="SignalComboBox"
SelectedItem="{Binding MessageChannel,Mode=TwoWay}"
MaxWidth="200"
MinWidth="120"
Margin="10"
ItemsSource="{Binding ChannelList}"
VerticalAlignment="Center"
materialDesign:HintAssist.Hint="信号通道" />
<Label Content="报文"

View File

@@ -1,11 +1,22 @@
using System.Windows;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace CANModule.Views
{
/// <summary>
/// CollectCANSignalSettingView.xaml 的交互逻辑
/// CollectCANSignalSetting.xaml 的交互逻辑
/// </summary>
public partial class CollectCANSignalSettingView : UserControl
{

View File

@@ -1,9 +1,8 @@
<UserControl x:Class="CANModule.Views.SelectCanMessageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:CANModule.Views"
xmlns:oxy="http://oxyplot.org/wpf"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
@@ -44,26 +43,26 @@
Height="25" />
</Grid>
</GroupBox.Header>
<Grid>
<StackPanel Grid.Row="1" Margin="10">
<Label Content="通道" VerticalAlignment="Center"/>
<Grid>
<StackPanel Grid.Row="1" Margin="10">
<Label Content="通道" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding ChannelList}"
SelectedItem="{Binding MessageChannel,Mode=TwoWay}"
MinWidth="100"
VerticalAlignment="Center"
materialDesign:HintAssist.Hint="" />
<Label Content="报文" VerticalAlignment="Center"/>
<Label Content="报文" VerticalAlignment="Center"/>
<ComboBox materialDesign:HintAssist.Hint=""
MinWidth="100"
SelectedItem="{Binding SelectedMessage,Mode=TwoWay}"
ItemsSource="{Binding MessageList}" />
<Label Content="信号" VerticalAlignment="Center"/>
<Label Content="信号" VerticalAlignment="Center"/>
<ComboBox materialDesign:HintAssist.Hint=""
SelectedItem="{Binding SelectedSignal,Mode=TwoWay}"
ItemsSource="{Binding SignalList}" MinWidth="100" />
<Button Content="选择报文名" Margin="10" Command="{Binding GetSelectedMessageCommand}"/>
<Button Content="选择报文名" Margin="10" Command="{Binding GetSelectedMessageCommand}"/>
<Button Content="选择信号名" Margin="10" Command="{Binding GetSelectedSignalCommand}"/>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</GroupBox>
</UserControl>
</UserControl>