From b544d5cccd76735e034c8055918a50927b437474 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期二, 10 十一月 2026 08:29:04 +0800
Subject: [PATCH] fix: 维护模式重复进入失败与按钮灰死 + Broker 并发验证用例
---
Plugin.IntegrationTest/MainWindow.xaml | 84 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 84 insertions(+), 0 deletions(-)
diff --git a/Plugin.IntegrationTest/MainWindow.xaml b/Plugin.IntegrationTest/MainWindow.xaml
index 3e3aece..c0bf843 100644
--- a/Plugin.IntegrationTest/MainWindow.xaml
+++ b/Plugin.IntegrationTest/MainWindow.xaml
@@ -116,6 +116,90 @@
<Border x:Name="canSimulatorHost" Grid.Row="1" Background="White" Margin="4"/>
</Grid>
</TabItem>
+
+ <!-- Tab 5: 鍏ㄨ嚜鍔ㄦ祴璇� -->
+ <TabItem Header=" 鍏ㄨ嚜鍔ㄦ祴璇� " FontSize="13">
+ <Grid Margin="8">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+
+ <!-- 姝ラ淇℃伅鍖� -->
+ <Border Grid.Row="0" Background="#FFF3E0" CornerRadius="4" Padding="14,10" Margin="0,0,0,8">
+ <StackPanel>
+ <TextBlock Text="CAN 鑰佸寲鑷姩鍖栨楠ょず渚嬶紙鏂规 B + C锛�" FontSize="16" FontWeight="Bold" Foreground="#E65100" Margin="0,0,0,8"/>
+ <WrapPanel>
+ <TextBlock Text="鍙戦�佽澶�:" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,6,6"/>
+ <ComboBox x:Name="autoTxDeviceCombo" Width="150" Height="28" Margin="0,0,16,6"/>
+
+ <TextBlock Text="鐩爣璁惧:" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,6,6"/>
+ <ComboBox x:Name="autoRxDeviceCombo" Width="150" Height="28" Margin="0,0,16,6"/>
+
+ <TextBlock Text="寰幆娆℃暟:" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,6,6"/>
+ <TextBox x:Name="autoLoopCount" Width="60" Height="28" Text="5" VerticalContentAlignment="Center" Padding="4,0" Margin="0,0,16,6"/>
+
+ <TextBlock Text="甯ч棿闅�(ms):" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,6,6"/>
+ <TextBox x:Name="autoInterval" Width="70" Height="28" Text="300" VerticalContentAlignment="Center" Padding="4,0" Margin="0,0,16,6"/>
+ </WrapPanel>
+
+ <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+ <Button x:Name="autoRunBtn" Content="鈻� 杩愯鑷姩鍖栨楠�" Width="180" Height="36" Margin="0,0,10,0"
+ Click="AutoRunBtn_Click" Background="#FF9800" Foreground="White"
+ BorderThickness="0" Cursor="Hand" FontWeight="SemiBold" FontSize="13"/>
+ <Button x:Name="perDeviceBtn" Content="鈻� 閫愯澶囦竴娆℃敹鍙�(CAN-001~004)" Width="250" Height="36" Margin="0,0,10,0"
+ Click="PerDeviceCanTest_Click" Background="#3F51B5" Foreground="White"
+ BorderThickness="0" Cursor="Hand" FontWeight="SemiBold" FontSize="13"/>
+ <Button x:Name="autoStopBtn" Content="鈻� 涓" Width="90" Height="36" Margin="0,0,10,0"
+ Click="AutoStopBtn_Click" Background="#F44336" Foreground="White"
+ BorderThickness="0" Cursor="Hand" FontWeight="SemiBold" IsEnabled="False"/>
+ <ProgressBar x:Name="autoProgress" Width="300" Height="18" Margin="0,0,10,0"/>
+ <TextBlock x:Name="autoProgressText" Text="灏辩华" VerticalAlignment="Center" Foreground="#666"/>
+ </StackPanel>
+ </StackPanel>
+ </Border>
+
+ <!-- 浠g爜棰勮 -->
+ <Expander Grid.Row="1" Header="鏌ョ湅绛変环浠g爜锛堟柟妗� B + C 浣跨敤绀轰緥锛�" IsExpanded="False" Margin="0,0,0,8">
+ <Border Background="#263238" Padding="12" CornerRadius="4" MaxHeight="280">
+ <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
+ <TextBlock FontFamily="Consolas" FontSize="12" Foreground="#ECEFF1">
+<Run Foreground="#80CBC4">// 涓氬姟浠g爜鍙湅鍒扮被鍨嬪寲鏈嶅姟锛堟柟妗� C锛夊拰浣滃煙锛堟柟妗� B锛�</Run>
+<Run> </Run><Run Foreground="#FFCC80">using </Run><Run Foreground="#C5E1A5">var </Run><Run>lease = </Run><Run Foreground="#FFCC80">await </Run><Run>auto.AcquireAsync(</Run><Run Foreground="#C5E1A5">"CAN-001"</Run><Run>, </Run><Run Foreground="#C5E1A5">"CAN_Aging"</Run><Run>, ct);</Run>
+<Run> </Run><Run Foreground="#C5E1A5">await </Run><Run>canBus.SetAutoResponseAsync(lease, enabled:</Run><Run Foreground="#F48FB1">true</Run><Run>);</Run>
+<Run> </Run><Run Foreground="#89DDFF">for </Run><Run>(</Run><Run Foreground="#C5E1A5">int </Run><Run>i = 0; i < cycles; i++)</Run>
+<Run> </Run><Run>{</Run>
+<Run> </Run><Run> </Run><Run Foreground="#C5E1A5">await </Run><Run>canBus.SendFrameAsync(lease, 0x100 + i, data);</Run>
+<Run> </Run><Run> </Run><Run Foreground="#C5E1A5">var </Run><Run>echo = </Run><Run Foreground="#C5E1A5">await </Run><Run>canBus.ReceiveFrameAsync(lease, ct);</Run>
+<Run> </Run><Run> Verify(echo != </Run><Run Foreground="#FF5370">null</Run><Run>); </Run><Run Foreground="#546E7A">// 鏂█</Run>
+<Run> </Run><Run>}</Run>
+ </TextBlock>
+ </ScrollViewer>
+ </Border>
+ </Expander>
+
+ <!-- 鏃ュ織鍖� -->
+ <Border Grid.Row="2" BorderBrush="#DDD" BorderThickness="1" CornerRadius="4">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+ <DockPanel Grid.Row="0" Margin="10,6">
+ <TextBlock Text="鑷姩鍖栨墽琛屾棩蹇�" FontWeight="Bold" FontSize="14"/>
+ <Button Content="娓呯┖" Padding="10,3" DockPanel.Dock="Right" Click="AutoClearLog_Click"
+ Background="#9E9E9E" Foreground="White" BorderThickness="0" Cursor="Hand"/>
+ </DockPanel>
+ <TextBox Grid.Row="1" x:Name="autoLog"
+ IsReadOnly="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
+ FontFamily="Consolas" FontSize="12"
+ Background="#1E1E1E" Foreground="#D4D4D4"
+ BorderThickness="0" Padding="10" TextWrapping="NoWrap" AcceptsReturn="True"/>
+ </Grid>
+ </Border>
+ </Grid>
+ </TabItem>
</TabControl>
<!-- 搴曢儴缁撴灉鏍� -->
--
Gitblit v1.9.1