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; [ObservableProperty] private PlotModel _temperatureCurveModel;
// UI 绑定属性 (与之前一致) // UI 绑定属性 (与之前一致)
public ObservableCollection<string> ReferenceLiquids { get; } = new() { "蒸馏水", "甲苯", "乙二醇" }; public ObservableCollection<string> ReferenceLiquids { get; } = new() { "蒸馏水" };
[ObservableProperty] private string _sampleId = "未命名样品"; [ObservableProperty] private string _sampleId = "未命名样品";
[ObservableProperty] private double _testTemperature = 25.0; [ObservableProperty] private double _testTemperature = 25.0;
[ObservableProperty] private string _testDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); [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); Application.Current?.Dispatcher.Invoke(() => ChamberPressure = rawPressure);
float rawTemp = await _plcService.ReadFloatAsync(_config.PlcRegisterAddresses.Temperature); float rawTemp = await _plcService.ReadFloatAsync(_config.PlcRegisterAddresses.Temperature);
rawTemp *= 1.0435f;
Application.Current?.Dispatcher.Invoke(() => CurrentTestTemperature = rawTemp); Application.Current?.Dispatcher.Invoke(() => CurrentTestTemperature = rawTemp);
} }
catch { } catch { }
@@ -439,7 +440,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 * 100, _testCts.Token); } catch (OperationCanceledException) { break; }
} }
} }
@@ -1048,7 +1049,7 @@ public partial class D7896ViewModel : ObservableObject
try try
{ {
float rawPressure = await _plcService.ReadFloatAsync(_config.PlcRegisterAddresses.Pressure); float rawPressure = await _plcService.ReadFloatAsync(_config.PlcRegisterAddresses.Pressure);
ChamberPressure = rawPressure / 10.0; ChamberPressure = rawPressure;
} }
catch { } catch { }
} }

View File

@@ -136,7 +136,7 @@
<CheckBox IsChecked="{Binding PlatinumCompatible}" Content="铂兼容性 (1.4)" Margin="0,0,15,0"/> <CheckBox IsChecked="{Binding PlatinumCompatible}" Content="铂兼容性 (1.4)" Margin="0,0,15,0"/>
<CheckBox IsChecked="{Binding AmbientCalibrated}" Content="环境温度校准 (8.1)" 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"/> <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> </WrapPanel>
</StackPanel> </StackPanel>
</Border> </Border>
@@ -324,7 +324,7 @@
<TextBlock Text="系统校准 (附录A3)" FontWeight="Bold" Margin="0,0,0,5"/> <TextBlock Text="系统校准 (附录A3)" FontWeight="Bold" Margin="0,0,0,5"/>
<WrapPanel> <WrapPanel>
<TextBlock Text="参考液:" VerticalAlignment="Center"/> <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"/> <TextBlock Text="参考热导率 (W/m·K):" VerticalAlignment="Center" Margin="10,0,5,0"/>
<TextBox Text="{Binding ReferenceConductivity}" Width="70" Margin="0,0,10,0"/> <TextBox Text="{Binding ReferenceConductivity}" Width="70" Margin="0,0,10,0"/>
<!--<Button Content="开始校准" Command="{Binding PerformSystemCalibrationCommand}" Width="100"/>--> <!--<Button Content="开始校准" Command="{Binding PerformSystemCalibrationCommand}" Width="100"/>-->

View File

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