Compare commits

...

5 Commits

Author SHA1 Message Date
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
4 changed files with 9 additions and 8 deletions

Binary file not shown.

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 { }
@@ -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,