Compare commits

..

2 Commits

Author SHA1 Message Date
xyy
9c7698e9cc 2026-06-15 17:23:29 +08:00
xyy
75d9405770 2026-06-12 16:30:29 +08:00
6 changed files with 9 additions and 8 deletions

View File

@@ -89,6 +89,6 @@ public class CalibrationCoefficients
public ushort PressureProtection { get; set; }
public ushort TemperatureCoefficient { get; set; }
public ushort ResistanceCoefficient { get; set; }
public double ThermalConductivityCorrection { get; set; } = 47.305349f;//蒸馏水 比热率修正
public double ThermalDiffusivityCorrection { get; set; } = 0.3469589023611997;//导热率修正
public double ThermalConductivityCorrection { get; set; } = 17.305349f;//蒸馏水 比热率修正
public double ThermalDiffusivityCorrection { get; set; } = 0.158682538;//导热率修正
}

View File

@@ -283,7 +283,7 @@ public partial class D7896ViewModel : ObservableObject
int requiredCount = _config.TestParameters.MeasurementCount; // 需要多少有效数据
int validCount = 0;
int attemptCount = 0;
int maxAttempts = requiredCount * 2; // 最多尝试次数,防止死循环
int maxAttempts = requiredCount * 3; // 最多尝试次数,防止死循环
// 存储每次成功测量的结果(用于后续异常判断)
List<double> validLambdaList = new List<double>();
@@ -444,7 +444,7 @@ public partial class D7896ViewModel : ObservableObject
// 测量间隔(即使舍弃也等待,让样品恢复)
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">
<StackPanel Orientation="Horizontal" Margin="5">
<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"/>
<ComboBox x:Name="cmbBaudrate" Width="80" SelectedIndex="1">
<ComboBoxItem>9600</ComboBoxItem>
@@ -38,7 +38,7 @@
<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"/>
<Label Content="设定电流 (A):" Margin="20,0,0,0"/>
<TextBox x:Name="txtSetCurrent" Text="0.720" Width="80" TextAlignment="Center"/>
<TextBox x:Name="txtSetCurrent" Text="0.9" Width="80" TextAlignment="Center"/>
<Label Content="A"/>
<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"/>

View File

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

View File

@@ -29,8 +29,8 @@
//"PlatinumWireDiameter": 0.000032,
//"PlatinumWireLength": 0.056, //铂丝长度(单位:米)
//"PlatinumWireDiameter": 0.00006,
"PlatinumWireLength": 0.04, //铂丝长度(单位:米)
"PlatinumWireDiameter": 0.00006,
"PlatinumWireLength": 0.035, //铂丝长度(单位:米)
"PlatinumWireDiameter": 0.00010,
"ReportOutputPath": "Reports\\",
"DefaultSampleVolume": 40.0,
"DefaultPressure": 0.0,