internal StepPositionInformation(ApplicationLayerParameters parameters, byte[] msg, int startIndex, bool isSequence) : base(parameters, msg, startIndex, isSequence) { if (!isSequence) { startIndex += parameters.SizeOfIOA; /* skip IOA */ } if ((msg.Length - startIndex) < GetEncodedSize()) { throw new ASDUParsingException("Message too small"); } /* parse VTI (value with transient state indication) */ byte vti = msg[startIndex++]; isTransient = ((vti & 0x80) == 0x80); value = (vti & 0x7f); if (value > 63) { value = value - 128; } quality = new QualityDescriptor(msg[startIndex++]); }
public static QualityDescriptor INVALID() { var qd = new QualityDescriptor(); qd.Invalid = true; return(qd); }
public StepPositionInformation(int ioa, int value, bool isTransient, QualityDescriptor quality) : base(ioa) { if ((value < -64) || (value > 63)) { throw new ArgumentOutOfRangeException("value has to be in range -64 .. 63"); } Value = value; Transient = isTransient; this.quality = quality; }
internal MeasuredValueNormalized(ApplicationLayerParameters parameters, byte[] msg, int startIndex, bool isSequence) : base(parameters, msg, startIndex, isSequence) { if (!isSequence) { startIndex += parameters.SizeOfIOA; /* skip IOA */ } if ((msg.Length - startIndex) < GetEncodedSize()) { throw new ASDUParsingException("Message too small"); } startIndex += 2; /* normalized value */ /* parse QDS (quality) */ quality = new QualityDescriptor(msg[startIndex++]); }
internal PackedSinglePointWithSCD(ApplicationLayerParameters parameters, byte[] msg, int startIndex, bool isSquence) : base(parameters, msg, startIndex, isSquence) { if (!isSquence) { startIndex += parameters.SizeOfIOA; /* skip IOA */ } if ((msg.Length - startIndex) < GetEncodedSize()) { throw new ASDUParsingException("Message too small"); } scd = new StatusAndStatusChangeDetection(msg, startIndex); startIndex += 4; qds = new QualityDescriptor(msg[startIndex++]); }
internal Bitstring32(ApplicationLayerParameters parameters, byte[] msg, int startIndex, bool isSequence) : base(parameters, msg, startIndex, isSequence) { if (!isSequence) { startIndex += parameters.SizeOfIOA; /* skip IOA */ } if ((msg.Length - startIndex) < GetEncodedSize()) { throw new ASDUParsingException("Message too small"); } value = msg [startIndex++]; value += ((uint)msg [startIndex++] * 0x100); value += ((uint)msg [startIndex++] * 0x10000); value += ((uint)msg [startIndex++] * 0x1000000); quality = new QualityDescriptor(msg[startIndex++]); }
internal MeasuredValueShort(ApplicationLayerParameters parameters, byte[] msg, int startIndex, bool isSequence) : base(parameters, msg, startIndex, isSequence) { if (!isSequence) { startIndex += parameters.SizeOfIOA; /* skip IOA */ } if ((msg.Length - startIndex) < GetEncodedSize()) { throw new ASDUParsingException("Message too small"); } /* parse float value */ value = System.BitConverter.ToSingle(msg, startIndex); startIndex += 4; /* parse QDS (quality) */ quality = new QualityDescriptor(msg [startIndex++]); }
internal SinglePointInformation(ApplicationLayerParameters parameters, byte[] msg, int startIndex, bool isSequence) : base(parameters, msg, startIndex, isSequence) { if (!isSequence) { startIndex += parameters.SizeOfIOA; /* skip IOA */ } if ((msg.Length - startIndex) < GetEncodedSize()) { throw new ASDUParsingException("Message too small"); } /* parse SIQ (single point information with qualitiy) */ byte siq = msg[startIndex++]; value = ((siq & 0x01) == 0x01); quality = new QualityDescriptor((byte)(siq & 0xf0)); }
public SinglePointWithCP56Time2a(int objectAddress, bool value, QualityDescriptor quality, CP56Time2a timestamp) : base(objectAddress, value, quality) { this.timestamp = timestamp; }
public DoublePointInformation(int ioa, DoublePointValue value, QualityDescriptor quality) : base(ioa) { this.value = value; this.quality = quality; }
public DoublePointWithCP56Time2a(int ioa, DoublePointValue value, QualityDescriptor quality, CP56Time2a timestamp) : base(ioa, value, quality) { this.timestamp = timestamp; }
public MeasuredValueNormalizedWithCP56Time2a(int objectAddress, short value, QualityDescriptor quality, CP56Time2a timestamp) : base(objectAddress, value, quality) { this.timestamp = timestamp; }
public StepPositionWithCP56Time2a(int ioa, int value, bool isTransient, QualityDescriptor quality, CP56Time2a timestamp) : base(ioa, value, isTransient, quality) { Timestamp = timestamp; }
public MeasuredValueNormalized(int objectAddress, short value, QualityDescriptor quality) : base(objectAddress, value) { this.quality = quality; }
public Bitstring32WithCP56Time2a(int ioa, UInt32 value, QualityDescriptor quality, CP56Time2a timestamp) : base(ioa, value, quality) { this.timestamp = timestamp; }
public Bitstring32(int ioa, UInt32 value, QualityDescriptor quality) : base(ioa) { this.value = value; this.quality = quality; }
public IntegratedTotalsShortWithCP56Time2a(int objectAddress, float value, QualityDescriptor quality, CP56Time2a timestamp) : base(objectAddress, value, quality) { this.timestamp = timestamp; }
public MeasuredValueShort(int objectAddress, float value, QualityDescriptor quality) : base(objectAddress) { this.value = value; this.quality = quality; }
public IntegratedTotalsShort(int objectAddress, float value, QualityDescriptor quality) : base(objectAddress) { this.value = value; this.quality = quality; }
public PackedSinglePointWithSCD(int objectAddress, StatusAndStatusChangeDetection scd, QualityDescriptor quality) : base(objectAddress) { this.scd = scd; this.qds = quality; }
public MeasuredValueScaledWithCP24Time2a(int objectAddress, int value, QualityDescriptor quality, CP24Time2a timestamp) : base(objectAddress, value, quality) { this.timestamp = timestamp; }
public SinglePointInformation(int objectAddress, bool value, QualityDescriptor quality) : base(objectAddress) { this.value = value; this.quality = quality; }
/// <summary> /// Initializes a new instance of the <see cref="lib60870.MeasuredValueScaled"/> class. /// </summary> /// <param name="objectAddress">Information object address</param> /// <param name="value">scaled value (range -32768 - 32767) </param> /// <param name="quality">quality descriptor (according to IEC 60870-5-101:2003 7.2.6.3)</param> public MeasuredValueScaled(int objectAddress, int value, QualityDescriptor quality) : base(objectAddress) { this.scaledValue = new ScaledValue(value); this.quality = quality; }