147 lines
4.7 KiB
C#
147 lines
4.7 KiB
C#
namespace Common.Hardware.WaterMeter.eRegister.Telegrams
|
|
{
|
|
using Common.Hardware.Ports;
|
|
using Common.Hardware.SIRT.Parameters;
|
|
using Common.Hardware.WaterMeter.eRegister.Features;
|
|
|
|
using System;
|
|
using System.Text;
|
|
|
|
public class SEMI : BUP
|
|
{
|
|
public SEMI(byte[] payload, int mhz, P11 p11) : base(payload, p11)
|
|
{
|
|
this.PAMStatus = new PAMStatus(payload[11]);
|
|
this.RSSI = new RSSI(payload[12], mhz);
|
|
this.MeterType = payload[13];
|
|
this.TransmissionInterval = payload.ToUInt16BE(14);
|
|
this.LATInterval = payload[16];
|
|
this.CurrentFlow = payload.ToUInt16BE(17);
|
|
this.BackwardVolume = payload.ToUInt32BE(19);
|
|
this.NumberOfDials = payload[23];
|
|
this.Units = (DisplayUnits)payload[24];
|
|
this.MeterID = payload.ToUInt32BE(25);
|
|
this.MBusStatus = payload[29];
|
|
this.MBusTransmissionInterval = payload.ToUInt16BE(30);
|
|
this.AlarmActiveInformation = payload[32];
|
|
this.LeakageDetectionParameters = payload[33];
|
|
this.BrokenPipeDetectionParameters = payload[34];
|
|
this.BatteryRemainingYears = payload.ToUInt16BE(35) / (4D * 365);
|
|
this.BatteryEndDetected = payload.ToUInt16BE(37);
|
|
this.MaximumFlow = payload.ToUInt16BE(39);
|
|
this.TimeOfMaximumFlow = payload.ToUInt16BE(41);
|
|
this.LowBatteryDetected = payload.ToUInt16BE(43);
|
|
this.LeakStart = payload.ToUInt16BE(45);
|
|
this.LeakEnd = payload.ToUInt16BE(47);
|
|
this.MagneticTamperStart = payload.ToUInt16BE(49);
|
|
this.MagneticTamperEnd = payload.ToUInt16BE(51);
|
|
this.ModuleRemoveStart = payload.ToUInt16BE(53);
|
|
this.ModuleRemoveEnd = payload.ToUInt16BE(55);
|
|
this.BackflowStart = payload.ToUInt16BE(57);
|
|
this.BackflowEnd = payload.ToUInt16BE(59);
|
|
this.BrokenPipeStart = payload.ToUInt16BE(61);
|
|
this.BrokenPipeEnd = payload.ToUInt16BE(63);
|
|
this.LogContent = payload.ToUInt16BE(65);
|
|
this.LoggingInterval = payload.ToUInt16BE(67);
|
|
this.FixedDateReadingContent = payload.ToUInt16BE(69);
|
|
this.DayOfMonth = payload[71];
|
|
this.ActualDateTime = new Epoch20000101(payload.ToUInt32BE(72), DateTimeKind.Local);
|
|
this.HistoricalErrorLimit = payload[76];
|
|
this.CustomerSpecificText = Encoding.ASCII.GetString(payload, 77, 9);
|
|
this.TimeOfFDRReset = payload.ToUInt16BE(86);
|
|
this.TimeOfLogReset = payload.ToUInt16BE(88);
|
|
this.MeterSize = payload[90];
|
|
this.Crc = 0;
|
|
|
|
if (payload.Length >= 93)
|
|
{
|
|
this.Crc = payload.ToUInt16BE(91);
|
|
}
|
|
}
|
|
|
|
public uint ModuleAddress { get; }
|
|
|
|
public AlarmsMask Alarms { get; }
|
|
|
|
public PAMStatus PAMStatus { get; }
|
|
|
|
public RSSI RSSI { get; }
|
|
|
|
public byte MeterType { get; }
|
|
|
|
public ushort TransmissionInterval { get; }
|
|
|
|
public byte LATInterval { get; }
|
|
|
|
public ushort CurrentFlow { get; }
|
|
|
|
public uint BackwardVolume { get; }
|
|
|
|
public byte NumberOfDials { get; }
|
|
|
|
public DisplayUnits Units { get; }
|
|
|
|
public uint MeterID { get; }
|
|
|
|
public byte MBusStatus { get; }
|
|
|
|
public ushort MBusTransmissionInterval { get; }
|
|
|
|
public byte AlarmActiveInformation { get; }
|
|
|
|
public byte LeakageDetectionParameters { get; }
|
|
|
|
public byte BrokenPipeDetectionParameters { get; }
|
|
|
|
public double BatteryRemainingYears { get; }
|
|
|
|
public ushort BatteryEndDetected { get; }
|
|
|
|
public ushort MaximumFlow { get; }
|
|
|
|
public ushort TimeOfMaximumFlow { get; }
|
|
|
|
public ushort LowBatteryDetected { get; }
|
|
|
|
public ushort LeakStart { get; }
|
|
|
|
public ushort LeakEnd { get; }
|
|
|
|
public ushort MagneticTamperStart { get; }
|
|
|
|
public ushort MagneticTamperEnd { get; }
|
|
|
|
public ushort ModuleRemoveStart { get; }
|
|
|
|
public ushort ModuleRemoveEnd { get; }
|
|
|
|
public ushort BackflowStart { get; }
|
|
|
|
public ushort BackflowEnd { get; }
|
|
|
|
public ushort BrokenPipeStart { get; }
|
|
|
|
public ushort BrokenPipeEnd { get; }
|
|
|
|
public ushort LogContent { get; }
|
|
|
|
public ushort LoggingInterval { get; }
|
|
|
|
public ushort FixedDateReadingContent { get; }
|
|
|
|
public byte DayOfMonth { get; }
|
|
|
|
public DateTime ActualDateTime { get; }
|
|
|
|
public byte HistoricalErrorLimit { get; }
|
|
|
|
public string CustomerSpecificText { get; }
|
|
|
|
public ushort TimeOfFDRReset { get; }
|
|
|
|
public ushort TimeOfLogReset { get; }
|
|
|
|
public byte MeterSize { get; }
|
|
}
|
|
}
|