This commit is contained in:
xyy
2026-04-10 19:12:30 +08:00
parent db683ead3b
commit 7c0e057cf4
2 changed files with 14 additions and 2 deletions

View File

@@ -124,6 +124,11 @@ namespace MembranePoreTester.ViewModels
flow = Math.Round(ConvertFlowByMode(rawFlow), 3);
}
float Pressure = await _plcService.ReadPressureAsync(StationId);
CurrentPressure = Math.Round(rawPressure, 2);
if (pressure <= 0 || flow <= 0)
return;
CurrentFlow = flow;
@@ -1163,6 +1168,12 @@ namespace MembranePoreTester.ViewModels
set => SetProperty(ref _currentFlow, value);
}
private double _currentPressure;
public double CurrentPressure
{
get => _currentPressure;
set => SetProperty(ref _currentPressure, value);
}
// 修改命令初始化(构造函数中)

View File

@@ -126,6 +126,7 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<!-- 新增第5行 -->
</Grid.RowDefinitions>
@@ -186,8 +187,8 @@
<Label Grid.Row="4" Grid.Column="2" Content="实时流量(L/min):"/>
<TextBox Grid.Row="4" Grid.Column="3" IsEnabled="False" Text="{Binding CurrentFlow, StringFormat=F3}"/>
<!--<Label Grid.Row="4" Grid.Column="0" Content="实时流量(L/min):"/>
<TextBox Grid.Row="4" Grid.Column="1" IsEnabled="False" Text="{Binding CurrentFlow, StringFormat=F2}"/>-->
<Label Grid.Row="5" Grid.Column="0" Content="当前压力(kPa):"/>
<TextBox Grid.Row="5" Grid.Column="1" IsEnabled="False" Grid.ColumnSpan="3" Text="{Binding CurrentPressure, StringFormat=F2}"/>
</Grid>
</GroupBox>