4 * This software is distributed under a zlib-style license.
\r
5 * See license.txt for more information.
\r
9 using System.Collections.Generic;
\r
12 namespace Yubeshi.Ubx
\r
14 public class NavPosLlh : Packet
\r
16 #region constructors
\r
18 public NavPosLlh(byte[] sentence, int length)
\r
19 : base(sentence, length)
\r
27 public decimal TimeOfWeek
\r
31 return BitConverter.ToUInt32(Raw, 6 + 0) * 1e-3m;
\r
35 public GeodeticCoordinate Position
\r
39 Degree lon = BitConverter.ToInt32(Raw, 6 + 4) * 1e-7;
\r
40 Degree lat = BitConverter.ToInt32(Raw, 6 + 8) * 1e-7;
\r
41 Height h = new Height(
\r
42 BitConverter.ToUInt32(Raw, 6 + 12) * 1e-3,
\r
43 Height.Base.Ellipsoid);
\r
44 return new GeodeticCoordinate(lat, lon, h);
\r
48 public Height MslHeight
\r
52 Height h = new Height(
\r
53 BitConverter.ToUInt32(Raw, 6 + 16) * 1e-3,
\r
54 Height.Base.MeanSeaLevel);
\r
59 public double HorizonalAccuracy
\r
63 return BitConverter.ToUInt32(Raw, 6 + 20) * 1e-3;
\r
67 public double VerticalAccuracy
\r
71 return BitConverter.ToUInt32(Raw, 6 + 24) * 1e-3;
\r
76 #region public methods
\r
78 public static bool TryParse(byte[] sentence, out UnknownPacket packet)
\r
80 return TryParse(sentence, out packet,
\r
81 MessageID.NavPosLlh, 28, Build);
\r
86 #region private methods
\r
88 private static Packet Build(byte[] sentence, int length)
\r
90 return new NavPosLlh(sentence, length);
\r