This commit is contained in:
xyy
2026-06-17 14:31:52 +08:00
parent 9c7698e9cc
commit afd044ce09
2 changed files with 4 additions and 4 deletions

View File

@@ -283,7 +283,7 @@ public partial class D7896ViewModel : ObservableObject
int requiredCount = _config.TestParameters.MeasurementCount; // 需要多少有效数据 int requiredCount = _config.TestParameters.MeasurementCount; // 需要多少有效数据
int validCount = 0; int validCount = 0;
int attemptCount = 0; int attemptCount = 0;
int maxAttempts = requiredCount * 3; // 最多尝试次数,防止死循环 int maxAttempts = requiredCount * 4; // 最多尝试次数,防止死循环
// 存储每次成功测量的结果(用于后续异常判断) // 存储每次成功测量的结果(用于后续异常判断)
List<double> validLambdaList = new List<double>(); List<double> validLambdaList = new List<double>();
@@ -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 * 200, _testCts.Token); } catch (OperationCanceledException) { break; } try { await Task.Delay(_config.TestParameters.IntervalSeconds * 150, _testCts.Token); } catch (OperationCanceledException) { break; }
} }
} }
@@ -764,7 +764,7 @@ public partial class D7896ViewModel : ObservableObject
} }
TemperatureCurveModel.InvalidatePlot(true); TemperatureCurveModel.InvalidatePlot(true);
CurveTitle = $"已完成 {CurrentMeasurementIndex} 次测量"; //CurveTitle = $"已完成 {CurrentMeasurementIndex} 次测量";
} }

View File

@@ -38,7 +38,7 @@
<RadioButton x:Name="rb50Hz" Content="50 Hz" GroupName="Freq" IsChecked="True" Margin="5,0,15,0"/> <RadioButton x:Name="rb50Hz" Content="50 Hz" GroupName="Freq" IsChecked="True" Margin="5,0,15,0"/>
<RadioButton x:Name="rb60Hz" Content="60 Hz" GroupName="Freq"/> <RadioButton x:Name="rb60Hz" Content="60 Hz" GroupName="Freq"/>
<Label Content="设定电流 (A):" Margin="20,0,0,0"/> <Label Content="设定电流 (A):" Margin="20,0,0,0"/>
<TextBox x:Name="txtSetCurrent" Text="0.9" Width="80" TextAlignment="Center"/> <TextBox x:Name="txtSetCurrent" Text="1" Width="80" TextAlignment="Center"/>
<Label Content="A"/> <Label Content="A"/>
<Button x:Name="btnSet" Content="直接设定" Click="BtnSet_Click" Width="80" Margin="10,0,0,0"/> <Button x:Name="btnSet" Content="直接设定" Click="BtnSet_Click" Width="80" Margin="10,0,0,0"/>
<Button x:Name="btnStop" Content="禁止输出" Click="BtnStop_Click" Width="80" Margin="5,0,0,0"/> <Button x:Name="btnStop" Content="禁止输出" Click="BtnStop_Click" Width="80" Margin="5,0,0,0"/>