Compare commits

7 Commits
master ... xyy

Author SHA1 Message Date
xyy
8419aaaccd 2026-06-05 19:20:01 +08:00
xyy
4764ca789b 2026-06-05 19:18:29 +08:00
xyy
9eb7c54ac8 2026-06-05 19:13:46 +08:00
xyy
abc3e186e2 2026-06-05 17:33:59 +08:00
xyy
8573f5c4e5 2026-06-05 15:37:05 +08:00
xyy
d3fdb6a288 2026-06-05 11:58:47 +08:00
xyy
2c20eaf323 2026-06-05 11:27:05 +08:00
5 changed files with 14 additions and 13 deletions

Binary file not shown.

View File

@@ -46,7 +46,7 @@ public class TestParameters
public int MeasurementCount { get; set; } = 10;
[Range(5, 300)]
public int IntervalSeconds { get; set; } = 30;
public double PlatinumWireLength { get; set; } = 0.056; // 默认 5.6 cm
public double PlatinumWireLength { get; set; } = 0.04; // 默认 5.6 cm
public double PlatinumWireDiameter { get; set; } = 0.00006;
public string ReportOutputPath { get; set; } = "Reports\\";
@@ -91,6 +91,6 @@ public class CalibrationCoefficients
public ushort PressureProtection { get; set; }
public ushort TemperatureCoefficient { get; set; }
public ushort ResistanceCoefficient { get; set; }
public double ThermalConductivityCorrection { get; set; } = 39;//蒸馏水 比热率修正
public double ThermalDiffusivityCorrection { get; set; } = 0.5;//导热率修正
public double ThermalConductivityCorrection { get; set; } = 37;//蒸馏水 比热率修正
public double ThermalDiffusivityCorrection { get; set; } = 0.45;//导热率修正
}

View File

@@ -52,7 +52,7 @@ public partial class D7896ViewModel : ObservableObject
[ObservableProperty] private PlotModel _temperatureCurveModel;
// UI 绑定属性 (与之前一致)
public ObservableCollection<string> ReferenceLiquids { get; } = new() { "蒸馏水", "甲苯", "乙二醇" };
public ObservableCollection<string> ReferenceLiquids { get; } = new() { "蒸馏水" };
[ObservableProperty] private string _sampleId = "未命名样品";
[ObservableProperty] private double _testTemperature = 25.0;
[ObservableProperty] private string _testDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
@@ -143,6 +143,7 @@ public partial class D7896ViewModel : ObservableObject
Application.Current?.Dispatcher.Invoke(() => ChamberPressure = rawPressure);
float rawTemp = await _plcService.ReadFloatAsync(_config.PlcRegisterAddresses.Temperature);
rawTemp *= 1.0435f;
Application.Current?.Dispatcher.Invoke(() => CurrentTestTemperature = rawTemp);
}
catch { }
@@ -303,7 +304,7 @@ public partial class D7896ViewModel : ObservableObject
double[] ustdBase = await _th1963Ustd.FetchBatchAsync();
double[] uptBase = await _th1953Ustd.FetchBatchAsync();
double dynamicR0 = 2.45; // 默认值
double dynamicR0 = 1.476979; // 默认值
if (ustdBase != null && ustdBase.Length > 0 && uptBase != null && uptBase.Length > 0)
{
double sumR0 = 0; int cnt = 0;
@@ -348,7 +349,7 @@ public partial class D7896ViewModel : ObservableObject
double[] ustd = await _th1963Ustd.FetchBatchAsync();
double[] upt = await _th1953Ustd.FetchBatchAsync();
if (dynamicR0 == 2.45) // 基线无效
if (dynamicR0 == 1.476979) // 基线无效
{
double sumR0 = 0; int cnt = 0;
for (int j = 2; j < Math.Min(6, ustd.Length); j++)
@@ -439,7 +440,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 * 100, _testCts.Token); } catch (OperationCanceledException) { break; }
}
}
@@ -942,7 +943,7 @@ public partial class D7896ViewModel : ObservableObject
var textRect = new XRect(cellX, currentRowY, colWidths[i], 20);
gfx.DrawString(headers[i], normalFont, XBrushes.Black, textRect, XStringFormats.Center);
}
currentRowY += 20;
currentRowY += 20;
// 填充数据行 (假设 Measurements 是列表)
for (int i = 0; i < Measurements.Count; i++)
@@ -1048,7 +1049,7 @@ public partial class D7896ViewModel : ObservableObject
try
{
float rawPressure = await _plcService.ReadFloatAsync(_config.PlcRegisterAddresses.Pressure);
ChamberPressure = rawPressure / 10.0;
ChamberPressure = rawPressure;
}
catch { }
}

View File

@@ -136,7 +136,7 @@
<CheckBox IsChecked="{Binding PlatinumCompatible}" Content="铂兼容性 (1.4)" Margin="0,0,15,0"/>
<CheckBox IsChecked="{Binding AmbientCalibrated}" Content="环境温度校准 (8.1)" Margin="0,0,15,0"/>
<TextBlock Text="状态:" VerticalAlignment="Center" Margin="20,0,5,0"/>
<TextBox Text="{Binding StatusMessage}" Width="200" IsReadOnly="True" Background="#FFF7E6"/>
<TextBox Text="{Binding StatusMessage}" Width="260" IsReadOnly="True" Background="#FFF7E6"/>
</WrapPanel>
</StackPanel>
</Border>
@@ -218,7 +218,7 @@
CanUserAddRows="False" IsReadOnly="True"
HeadersVisibility="Column" GridLinesVisibility="Horizontal"
RowHeight="28" MinHeight="150">
<DataGrid.Columns>
<DataGridTextColumn Header="序号" Binding="{Binding Index}" Width="60">
<DataGridTextColumn.ElementStyle>
@@ -324,7 +324,7 @@
<TextBlock Text="系统校准 (附录A3)" FontWeight="Bold" Margin="0,0,0,5"/>
<WrapPanel>
<TextBlock Text="参考液:" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding ReferenceLiquids}" SelectedItem="{Binding SelectedReferenceLiquid}" Width="100" Margin="5,0"/>
<ComboBox ItemsSource="{Binding ReferenceLiquids}" IsReadOnly="True" SelectedItem="{Binding SelectedReferenceLiquid}" Width="100" Margin="5,0"/>
<TextBlock Text="参考热导率 (W/m·K):" VerticalAlignment="Center" Margin="10,0,5,0"/>
<TextBox Text="{Binding ReferenceConductivity}" Width="70" Margin="0,0,10,0"/>
<!--<Button Content="开始校准" Command="{Binding PerformSystemCalibrationCommand}" Width="100"/>-->

View File

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