This commit is contained in:
@@ -294,7 +294,7 @@ public partial class D7896ViewModel : ObservableObject
|
||||
{
|
||||
attemptCount++;
|
||||
CurrentMeasurementIndex = attemptCount; // 显示当前尝试次数(不是有效次数)
|
||||
StatusMessage = $"正在执行第 {attemptCount} 次测量(有效:{validCount}/{requiredCount})...";
|
||||
//StatusMessage = $"正在执行第{validCount}次测量)...";
|
||||
|
||||
// --- 步骤1:基线采集(加热前)---
|
||||
await _th1963Ustd.PrepareBatchAsync(50);
|
||||
@@ -391,7 +391,7 @@ public partial class D7896ViewModel : ObservableObject
|
||||
double vhc = lambda / alpha; // kJ/(m³·K)
|
||||
double cp = vhc / SampleDensity; // J/(kg·K)
|
||||
|
||||
Logger.Log($"测量 {attemptCount} 结果: λ={lambda:F6} W/(m·K), α={alpha:E6} m²/s, Cp={cp:F2} J/(kg·K)");
|
||||
Logger.Log($"测量 {validCount} 结果: λ={lambda:F6} W/(m·K), α={alpha:E6} m²/s, Cp={cp:F2} J/(kg·K)");
|
||||
|
||||
// ---- 异常值检测 ----
|
||||
bool isOutlier = false;
|
||||
@@ -719,7 +719,7 @@ public partial class D7896ViewModel : ObservableObject
|
||||
{
|
||||
if (TemperatureCurveModel == null)
|
||||
{
|
||||
TemperatureCurveModel = new PlotModel { Title = "温升与冷却曲线", Background = OxyColors.White };
|
||||
TemperatureCurveModel = new PlotModel { };
|
||||
TemperatureCurveModel.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, Title = "时间 (s)" });
|
||||
TemperatureCurveModel.Axes.Add(new LinearAxis { Position = AxisPosition.Left, Title = "温升 (℃)" });
|
||||
}
|
||||
|
||||
@@ -109,15 +109,15 @@
|
||||
<Grid Background="#F2F2F2" Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 样品信息+复选框 -->
|
||||
<!-- 样品信息 -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 仪表盘 -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 体积/密度/加压 -->
|
||||
<RowDefinition Height="*"/>
|
||||
<!-- 曲线图(占满剩余高度) -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 数据表格 -->
|
||||
<!-- 曲线图(固定高度380) -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 数据表格(占满剩余高度) -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 平均值+按钮 -->
|
||||
</Grid.RowDefinitions>
|
||||
@@ -204,16 +204,20 @@
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding CurveTitle}" FontWeight="Bold" FontSize="13" Margin="0,0,0,3" Foreground="#1E4F7A"/>
|
||||
<!-- 将高度从350提升到380,并让控件随网格拉伸 -->
|
||||
<oxy:PlotView Model="{Binding TemperatureCurveModel}" Height="380"/>
|
||||
<oxy:PlotView Model="{Binding TemperatureCurveModel}" Height="220"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 5. 测量数据表格(固定高度,不再无限制拉伸,紧凑显示) -->
|
||||
<!-- 5. 测量数据表格(占据剩余高度,带滚动条,最小高度保证可见) -->
|
||||
<Border Grid.Row="4" Background="White" CornerRadius="4" Padding="6" Margin="0,4" Effect="{StaticResource CardShadow}">
|
||||
<DataGrid ItemsSource="{Binding Measurements}" AutoGenerateColumns="False"
|
||||
CanUserAddRows="False" IsReadOnly="True"
|
||||
HeadersVisibility="Column" GridLinesVisibility="Horizontal"
|
||||
RowHeight="24" MinHeight="120" MaxHeight="180">
|
||||
CanUserAddRows="False" IsReadOnly="True"
|
||||
HeadersVisibility="Column" GridLinesVisibility="Horizontal"
|
||||
RowHeight="24"
|
||||
Height="120"
|
||||
VerticalAlignment="Stretch"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="序号" Binding="{Binding Index}" Width="60">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
@@ -247,10 +251,12 @@
|
||||
</DataGrid>
|
||||
</Border>
|
||||
|
||||
<!-- 6. 平均值 + 按钮(紧凑排列) -->
|
||||
|
||||
<!-- 6. 平均值 + 按钮(水平排列并放大) -->
|
||||
<Border Grid.Row="5" Background="#E8F0FE" CornerRadius="4" Padding="8" Margin="0,4,0,0" Effect="{StaticResource CardShadow}">
|
||||
<StackPanel>
|
||||
<WrapPanel Margin="0,0,0,5">
|
||||
<!-- 平均值显示行(保持不变) -->
|
||||
<WrapPanel Margin="0,0,0,8">
|
||||
<TextBlock Text="平均热导率:" Width="90" FontWeight="SemiBold"/>
|
||||
<TextBox Text="{Binding AverageThermalConductivity, StringFormat=F5}" Width="90" IsReadOnly="True"/>
|
||||
<TextBlock Text="W/m·K" Margin="5,0,25,0"/>
|
||||
@@ -261,21 +267,31 @@
|
||||
<TextBox Text="{Binding AverageVolumetricHeatCapacity, StringFormat=F2}" Width="90" IsReadOnly="True"/>
|
||||
<TextBlock Text="kJ/m³·K" Margin="5,0,0,0"/>
|
||||
</WrapPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,4">
|
||||
<Button Content="压力校准" Command="{Binding PressureCalibrationCommand}" Width="80" Margin="3"/>
|
||||
<Button Content="电阻归零" Command="{Binding ResistanceZeroCommand}" Width="80" Margin="3"/>
|
||||
<Button Content="进气阀" Command="{Binding InletValveControlCommand}" Width="70" Margin="3"/>
|
||||
<Button Content="排气阀" Command="{Binding OutletValveControlCommand}" Width="70" Margin="3"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,4">
|
||||
<Button Content="▶ 开始测试" Command="{Binding StartTestCommand}" Width="120" Height="32" Margin="5"
|
||||
IsEnabled="{Binding IsTesting, Converter={StaticResource InverseBooleanConverter}}"
|
||||
Background="{StaticResource PrimaryButtonBrush}"/>
|
||||
<Button Content="■ 停止测试" Command="{Binding StopTestCommand}" Width="120" Height="32" Margin="5" Background="Orange"/>
|
||||
<Button Content="⟳ 重置" Command="{Binding ResetCommand}" Width="90" Height="32" Margin="5"/>
|
||||
<Button Content="📄 生成报告" Command="{Binding GenerateReportCommand}" Width="100" Height="32" Margin="5"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 按钮区域:一排,放大按钮 -->
|
||||
<WrapPanel HorizontalAlignment="Center" Margin="0,4">
|
||||
<Button Content="压力校准" Command="{Binding PressureCalibrationCommand}"
|
||||
Width="100" Height="36" Margin="5" FontSize="13"/>
|
||||
<Button Content="电阻归零" Command="{Binding ResistanceZeroCommand}"
|
||||
Width="100" Height="36" Margin="5" FontSize="13"/>
|
||||
<Button Content="进气阀" Command="{Binding InletValveControlCommand}"
|
||||
Width="90" Height="36" Margin="5" FontSize="13"/>
|
||||
<Button Content="排气阀" Command="{Binding OutletValveControlCommand}"
|
||||
Width="90" Height="36" Margin="5" FontSize="13"/>
|
||||
<Button Content="▶ 开始测试" Command="{Binding StartTestCommand}"
|
||||
Width="130" Height="40" Margin="5" FontSize="14" FontWeight="Bold"
|
||||
IsEnabled="{Binding IsTesting, Converter={StaticResource InverseBooleanConverter}}"
|
||||
Background="{StaticResource PrimaryButtonBrush}"/>
|
||||
<Button Content="■ 停止测试" Command="{Binding StopTestCommand}"
|
||||
Width="130" Height="40" Margin="5" FontSize="14" FontWeight="Bold"
|
||||
Background="Orange"/>
|
||||
<Button Content="⟳ 重置" Command="{Binding ResetCommand}"
|
||||
Width="100" Height="36" Margin="5" FontSize="13"/>
|
||||
<Button Content="📄 生成报告" Command="{Binding GenerateReportCommand}"
|
||||
Width="110" Height="36" Margin="5" FontSize="13"/>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
BIN
瞬态热线法说明书.docx
BIN
瞬态热线法说明书.docx
Binary file not shown.
Reference in New Issue
Block a user