This commit is contained in:
xyy
2026-06-12 16:30:29 +08:00
parent db8d255fdd
commit 75d9405770
3 changed files with 3 additions and 2 deletions

View File

@@ -444,7 +444,7 @@ public partial class D7896ViewModel : ObservableObject
// 测量间隔(即使舍弃也等待,让样品恢复) // 测量间隔(即使舍弃也等待,让样品恢复)
if (validCount < requiredCount && !_stopRequested && attemptCount < maxAttempts) if (validCount < requiredCount && !_stopRequested && attemptCount < maxAttempts)
{ {
try { await Task.Delay(_config.TestParameters.IntervalSeconds * 1000, _testCts.Token); } catch (OperationCanceledException) { break; } try { await Task.Delay(_config.TestParameters.IntervalSeconds * 200, _testCts.Token); } catch (OperationCanceledException) { break; }
} }
} }

View File

@@ -16,7 +16,7 @@
<GroupBox Header="串口设置" Grid.Row="0" Margin="5"> <GroupBox Header="串口设置" Grid.Row="0" Margin="5">
<StackPanel Orientation="Horizontal" Margin="5"> <StackPanel Orientation="Horizontal" Margin="5">
<Label Content="端口:"/> <Label Content="端口:"/>
<ComboBox x:Name="cmbPort" Width="80" IsEditable="True"/> <ComboBox x:Name="cmbPort" Width="80" IsEditable="True" Text="COM2"/>
<Label Content="波特率:" Margin="10,0,0,0"/> <Label Content="波特率:" Margin="10,0,0,0"/>
<ComboBox x:Name="cmbBaudrate" Width="80" SelectedIndex="1"> <ComboBox x:Name="cmbBaudrate" Width="80" SelectedIndex="1">
<ComboBoxItem>9600</ComboBoxItem> <ComboBoxItem>9600</ComboBoxItem>

View File

@@ -31,6 +31,7 @@ namespace ConstantCurrentControl
_readTimer = new DispatcherTimer(); _readTimer = new DispatcherTimer();
_readTimer.Interval = TimeSpan.FromMilliseconds(50); _readTimer.Interval = TimeSpan.FromMilliseconds(50);
_readTimer.Tick += ReadTimer_Tick; _readTimer.Tick += ReadTimer_Tick;
cmbPort.Text = "COM2";
} }
#region #region