예제 #1
0
        /*public override void write(ByteStream queue)
         * {
         *  if (nullValue != null)
         *      nullValue.write(queue);
         *  else if (realValue != null)
         *      realValue.write(queue);
         *  else if (binaryValue != null)
         *      binaryValue.write(queue);
         *  else if (integerValue != null)
         *      integerValue.write(queue);
         *  else
         *      constructedValue.write(queue, 0);
         * }*/

        public PriorityValue(ByteStream queue)
        {
            // Sweet Jesus...
            int tag = (queue.PeekFromHere(0) & 0xff);

            if ((tag & 8) == 8)
            {
                // A class tag, so this is a constructed value.
                ConstructedValue = new AmbiguousValue(queue, 0);
            }
            else
            {
                // A primitive value
                tag = tag >> 4;
                if (tag == Null.TYPE_ID)
                {
                    NullValue = new Null(queue);
                }
                else if (tag == Real.TYPE_ID)
                {
                    RealValue = new Real(queue);
                }
                else if (tag == Primitive.Enumerated.TYPE_ID)
                {
                    BinaryValue = new BinaryPV(queue);
                }
                else if (tag == UnsignedInteger.TYPE_ID)
                {
                    IntegerValue = new UnsignedInteger(queue);
                }
                else
                {
                    throw new BACnetErrorException(ErrorClass.Property, ErrorCode.InvalidDataType,
                                                   "Unsupported primitive id: " + tag);
                }
            }
        }
예제 #2
0
 public BinaryValueWrapper(BinaryPV item)
 {
     this.Item = item;
 }
예제 #3
0
 public static PropertyStates NewBinaryValue(BinaryPV binaryValue)
 {
     return new BinaryValueWrapper(binaryValue);
 }
예제 #4
0
 public static PriorityValue NewBinary(BinaryPV binary)
 {
     return new BinaryWrapper(binary);
 }
예제 #5
0
 public BinaryValueWrapper(BinaryPV item)
 {
     this.Item = item;
 }
예제 #6
0
 public static PropertyStates NewBinaryValue(BinaryPV binaryValue)
 {
     return(new BinaryValueWrapper(binaryValue));
 }
예제 #7
0
 public PriorityValue(BinaryPV binaryValue)
 {
     this.BinaryValue = binaryValue;
 }
예제 #8
0
 public static PriorityValue NewBinary(BinaryPV binary)
 {
     return(new BinaryWrapper(binary));
 }