MagFlux equalize data format of streaming and response for:

- UniqueId as Hex-String with leading "0x",
- SensorId as Decimal-String
This commit is contained in:
Thomas Wiedebusch
2023-05-12 10:26:04 +02:00
parent eae5e63960
commit e4a5922a8b
3 changed files with 9 additions and 7 deletions
@@ -48,7 +48,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.DataPackages.MeasurementRecor
.Append($"FlowRate [m³/h]: {FlowRateCmPh}").Append(StringDelimiter)
.Append($"Status: 0x{StatusBits:X8}").Append(StringDelimiter)
.Append($"UniqueId: {UniqueId}").Append(StringDelimiter)
.Append($"SensorSN: {SensorId}").Append(StringDelimiter)
.Append($"SensorId: {SensorId}").Append(StringDelimiter)
.Append($"CRC: 0x{Crc:X4}").Append(StringDelimiter)
.Append($"OverflowVolume [m³]: {OverflowVolumeCm}").Append(StringDelimiter)
.Append($"OverflowTime [s]: {OverflowTimeS}").Append(StringDelimiter)
@@ -46,7 +46,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol
}
/// <summary>
/// Wrapper to connect mag flux
/// Wrapper to connect MagFlux
/// </summary>
/// <param name="portName"></param>
/// <returns></returns>
@@ -74,7 +74,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol
return retVal;
}
/// <summary>
/// Wrapper to connect mag flux
/// Wrapper to close the connection to the MagFlux
/// </summary>
/// <returns></returns>
/// <remarks date="2023-Mai-04" author="T.Wiedebusch">
@@ -87,7 +87,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol
return retVal;
}
/// <summary>
/// Wrapper to connect mag flux
/// Wrapper to connect MagFlux
/// </summary>
/// <returns></returns>
/// <remarks date="2023-Mai-04" author="T.Wiedebusch">
@@ -100,7 +100,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol
return retVal;
}
/// <summary>
/// Wrapper to get FW version
/// Wrapper to get FW version of MagFlux
/// </summary>
/// <param name="fwVersion"></param>
/// <returns></returns>
@@ -116,7 +116,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol
}
/// <summary>
/// Wrapper to get FW GIT hash
/// Wrapper to get FW GIT hash of MagFlux
/// </summary>
/// <param name="fwGitHash"></param>
/// <returns></returns>
@@ -175,7 +175,9 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.StreamingProtocol
// adding the hex identifier, as this is not part of the string
dataMagFluxRec.UniqueId = $"0x{fields[(Int32)ProtLsubString.UniqueId]}";
dataMagFluxRec.SensorId = $"0x{fields[(Int32)ProtLsubString.SensorId]}";
var decimalSensorId = UInt32.Parse(fields[(Int32)ProtLsubString.SensorId], NumberStyles.AllowHexSpecifier);
dataMagFluxRec.SensorId = decimalSensorId.ToString();
}
/// field position in protocol 'l'