This commit is contained in:
xyy
2026-06-21 10:27:30 +08:00
parent 09072ccda5
commit f37114a0cf
3 changed files with 21 additions and 11 deletions

View File

@@ -10,9 +10,9 @@ namespace HME_MoistureLossMeter.Services
public class ModbusTcpPlcService : IPlcService, IDisposable
{
// 寄存器地址常量 - 测试界面
public const ushort ADDR_WATER_TEMP = 1118; // 水浴温度
public const ushort ADDR_CHAMBER_TEMP = 1168; // 箱体温度
public const ushort ADDR_WEIGHT = 1268; // 重量
public const ushort ADDR_WATER_TEMP = 3118; // 水浴温度
public const ushort ADDR_CHAMBER_TEMP = 3168; // 箱体温度
public const ushort ADDR_WEIGHT = 3268; // 重量
public const ushort ADDR_AIR_VOLUME = 4110; // 空气体积
public const ushort ADDR_OUTLET_FLOW = 1218; // 出口流量
public const ushort ADDR_PRESET_HOUR = 1681; // 设定测试时
@@ -26,8 +26,8 @@ namespace HME_MoistureLossMeter.Services
public const ushort ADDR_BATCH_NO = 3202; // 生产批号
public const ushort ADDR_OPERATOR_ID = 3200; // 操作员编号
public const ushort ADDR_EXPERIMENT_ID = 3204; // 实验编号
public const ushort ADDR_TIDAL_VOLUME = 300; // 潮气量
public const ushort ADDR_FREQUENCY = 210; // 频率
public const ushort ADDR_TIDAL_VOLUME = 2300; // 潮气量
public const ushort ADDR_FREQUENCY = 2210; // 频率
public const ushort ADDR_BREATH_COUNT = 3000; // 呼吸次数
public const ushort ADDR_DRY_AIR_FLOW = 3700; // 通入干燥空气量

View File

@@ -240,11 +240,21 @@
Command="{Binding PrintCommand}"
Width="80" Height="40"/>
<Button Content="加热"
Command="{Binding ToggleHeatCommand}"
Width="80" Height="40"
Background="{Binding IsHeating, Converter={StaticResource BoolToVisibilityConverter},
ConverterParameter=DangerBrush, FallbackValue={StaticResource AccentBrush}}"/>
<Button Command="{Binding ToggleHeatCommand}"
Width="80" Height="40"
Content="加热">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Background" Value="{StaticResource AccentBrush}"/>
<Setter Property="Foreground" Value="White"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsHeating}" Value="True">
<Setter Property="Background" Value="{StaticResource DangerBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button Content="呼气"
Command="{Binding ManualExhaleCommand}"

View File

@@ -1,6 +1,6 @@
{
"PlcConfiguration": {
"IpAddress": "192.168.1.100",
"IpAddress": "192.168.1.150",
"Port": 502,
"SlaveId": 1,
"PressureRegister": 1000,