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 NavPosEccf : Packet
\r
16 #region constructors
\r
18 public NavPosEccf(byte[] sentence, int length)
\r
19 : base(sentence, length)
\r
21 ID = MessageID.NavPosEcef;
\r
23 Raw = new byte[length + 8];
\r
24 Array.Copy(sentence, Raw, Raw.Length);
\r
26 uint tow = BitConverter.ToUInt32(sentence, 6 + 0);
\r
27 TimeOfWeek = tow * 1e-3m;
\r
28 int x = BitConverter.ToInt32(sentence, 6 + 4);
\r
29 int y = BitConverter.ToInt32(sentence, 6 + 8);
\r
30 int z = BitConverter.ToInt32(sentence, 6 + 12);
\r
31 uint acc = BitConverter.ToUInt32(sentence, 6 + 16);
\r
32 Position = new EcefCoordinate(x, y, z, acc);
\r
33 CheckSum = BitConverter.ToUInt16(sentence, sentence.Length - 2);
\r
40 public decimal TimeOfWeek
\r
46 public EcefCoordinate Position
\r
54 #region public methods
\r
56 public static bool TryParse(byte[] sentence, out Packet packet)
\r
58 return TryParse(sentence, out packet,
\r
59 MessageID.NavPosEcef, 20, Build);
\r
64 #region private methods
\r
66 private static Packet Build(byte[] sentence, int length)
\r
68 return new NavPosEccf(sentence, length);
\r