This commit is contained in:
@@ -39,11 +39,28 @@ namespace MembranePoreTester.Communication
|
||||
public async Task<float> ReadPressureAsync() =>
|
||||
await ReadFloatAsync(_config.PressureRegister);
|
||||
|
||||
public async Task<float> ReadWetFlowAsync() =>
|
||||
await ReadFloatAsync(_config.WetFlowRegister);
|
||||
public async Task<float> ReadWetFlowAsync(int stationId)
|
||||
{
|
||||
ushort startAddress = stationId switch
|
||||
{
|
||||
1 => _config.WetFlowRegister,
|
||||
2 => _config.WetFlowRegister2,
|
||||
3 => _config.WetFlowRegister3,
|
||||
};
|
||||
return await ReadFloatAsync(startAddress);
|
||||
}
|
||||
|
||||
public async Task<float> ReadDryFlowAsync() =>
|
||||
await ReadFloatAsync(_config.DryFlowRegister);
|
||||
public async Task<float> ReadDryFlowAsync(int stationId)
|
||||
{
|
||||
ushort startAddress = stationId switch
|
||||
{
|
||||
1 => _config.DryFlowRegister,
|
||||
2 => _config.DryFlowRegister2,
|
||||
3 => _config.DryFlowRegister3,
|
||||
_ => throw new ArgumentException("Invalid station")
|
||||
};
|
||||
return await ReadFloatAsync(startAddress);
|
||||
}
|
||||
|
||||
|
||||
public async Task WriteCoilAsync(ushort coilAddress, bool value)
|
||||
|
||||
Reference in New Issue
Block a user