예제 #1
0
        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++]);
        }
예제 #2
0
        public static QualityDescriptor INVALID()
        {
            var qd = new QualityDescriptor();

            qd.Invalid = true;
            return(qd);
        }
예제 #3
0
        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++]);
        }
예제 #5
0
        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++]);
        }
예제 #6
0
파일: Bitstring32.cs 프로젝트: lego92/EA104
        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++]);
        }
예제 #7
0
        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++]);
        }
예제 #8
0
        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));
        }
예제 #9
0
 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;
 }
예제 #13
0
 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;
 }
예제 #15
0
파일: Bitstring32.cs 프로젝트: lego92/EA104
 public Bitstring32WithCP56Time2a(int ioa, UInt32 value, QualityDescriptor quality, CP56Time2a timestamp) :
     base(ioa, value, quality)
 {
     this.timestamp = timestamp;
 }
예제 #16
0
파일: Bitstring32.cs 프로젝트: lego92/EA104
 public Bitstring32(int ioa, UInt32 value, QualityDescriptor quality) : base(ioa)
 {
     this.value   = value;
     this.quality = quality;
 }
예제 #17
0
 public IntegratedTotalsShortWithCP56Time2a(int objectAddress, float value, QualityDescriptor quality, CP56Time2a timestamp)
     : base(objectAddress, value, quality)
 {
     this.timestamp = timestamp;
 }
예제 #18
0
 public MeasuredValueShort(int objectAddress, float value, QualityDescriptor quality)
     : base(objectAddress)
 {
     this.value   = value;
     this.quality = quality;
 }
예제 #19
0
 public IntegratedTotalsShort(int objectAddress, float value, QualityDescriptor quality)
     : base(objectAddress)
 {
     this.value   = value;
     this.quality = quality;
 }
예제 #20
0
 public PackedSinglePointWithSCD(int objectAddress, StatusAndStatusChangeDetection scd, QualityDescriptor quality)
     : base(objectAddress)
 {
     this.scd = scd;
     this.qds = quality;
 }
예제 #21
0
 public MeasuredValueScaledWithCP24Time2a(int objectAddress, int value, QualityDescriptor quality, CP24Time2a timestamp)
     : base(objectAddress, value, quality)
 {
     this.timestamp = timestamp;
 }
예제 #22
0
 public SinglePointInformation(int objectAddress, bool value, QualityDescriptor quality)
     : base(objectAddress)
 {
     this.value   = value;
     this.quality = quality;
 }
예제 #23
0
 /// <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;
 }