コード例 #1
0
        public SetpointCommandNormalized(int objectAddress, float value, SetpointCommandQualifier qos)
            : base(objectAddress)
        {
            // TODO check if value is in range

            this.scaledValue = (int)(value * 32767f);
            this.qos         = qos;
        }
コード例 #2
0
        internal SetpointCommandScaled(ConnectionParameters parameters, byte[] msg, int startIndex) :
            base(parameters, msg, startIndex, false)
        {
            startIndex += parameters.SizeOfIOA; /* skip IOA */

            scaledValue = new ScaledValue(msg, startIndex);
            startIndex += 2;

            this.qos = new SetpointCommandQualifier(msg[startIndex++]);
        }
コード例 #3
0
        internal SetpointCommandShort(ConnectionParameters parameters, byte[] msg, int startIndex) :
            base(parameters, msg, startIndex, false)
        {
            startIndex += parameters.SizeOfIOA; /* skip IOA */

            /* parse float value */
            value       = System.BitConverter.ToSingle(msg, startIndex);
            startIndex += 4;

            this.qos = new SetpointCommandQualifier(msg[startIndex++]);
        }
コード例 #4
0
        internal SetpointCommandNormalized(ConnectionParameters parameters, byte[] msg, int startIndex) :
            base(parameters, msg, startIndex, false)
        {
            startIndex += parameters.SizeOfIOA; /* skip IOA */

            scaledValue  = msg[startIndex++];
            scaledValue += (msg[startIndex++] * 0x100);

            if (scaledValue > 32767)
            {
                scaledValue = scaledValue - 65536;
            }

            this.qos = new SetpointCommandQualifier(msg[startIndex++]);
        }
コード例 #5
0
 public SetpointCommandShortWithCP56Time2a(int objectAddress, float value, SetpointCommandQualifier qos, CP56Time2a timestamp)
     : base(objectAddress, value, qos)
 {
     this.timestamp = timestamp;
 }
コード例 #6
0
 public SetpointCommandShort(int objectAddress, float value, SetpointCommandQualifier qos)
     : base(objectAddress)
 {
     this.value = value;
     this.qos   = qos;
 }
コード例 #7
0
 public SetpointCommandScaledWithCP56Time2a(int objectAddress, ScaledValue value, SetpointCommandQualifier qos, CP56Time2a timestamp)
     : base(objectAddress, value, qos)
 {
     this.timestamp = timestamp;
 }
コード例 #8
0
 public SetpointCommandScaled(int objectAddress, ScaledValue value, SetpointCommandQualifier qos)
     : base(objectAddress)
 {
     this.scaledValue = value;
     this.qos         = qos;
 }
コード例 #9
0
 public SetpointCommandNormalized(int ObjectAddress, short value, SetpointCommandQualifier qos)
     : base(ObjectAddress)
 {
     this.scaledValue = new ScaledValue(value);
     this.qos         = qos;
 }
コード例 #10
0
 public SetpointCommandNormalized(int objectAddress, float value, SetpointCommandQualifier qos)
     : base(objectAddress)
 {
     this.scaledValue = new ScaledValue((int)((value * 32767.5) - 0.5));
     this.qos         = qos;
 }