Beispiel #1
0
        public GpsElement Decode(IBitReader reader)
        {
            int x = reader != null?reader.ReadInt32() : throw new ArgumentNullException(nameof(reader));

            int   y          = reader.ReadInt32();
            short altitude   = reader.ReadInt16();
            short angle      = reader.ReadInt16();
            byte  satellites = reader.ReadByte();
            short speed      = reader.ReadInt16();

            return(new GpsElement(x, y, altitude, speed, angle, satellites));
        }
Beispiel #2
0
        public GpsElementExt Decode(IBitReader reader)
        {
            int x = reader != null?reader.ReadInt32() : throw new ArgumentNullException(nameof(reader));

            int        y          = reader.ReadInt32();
            short      altitude   = (short)Math.Round(reader.ReadInt16() / 10.0);
            short      angle      = (short)Math.Round(reader.ReadUInt16() / 100.0);
            byte       satellites = reader.ReadByte();
            short      speed      = reader.ReadInt16();
            IoProperty ioProperty = IoProperty.Create(500001, reader.ReadByte());

            return(new GpsElementExt(new GpsElement(x, y, altitude, speed, angle, satellites), new IoElement(0, new List <IoProperty>(1)
            {
                ioProperty
            })));
        }