EngNav.cpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
44 #include <cstdlib>
45 #include <iostream>
46 #include <cmath>
47 #include "EngNav.hpp"
48 #include "GNSSconstants.hpp"
49 
50 #ifdef _MSC_VER
51 #define LDEXP(x,y) ldexp(x,y)
52 #else
53 #define LDEXP(x,y) std::ldexp(x,y)
54 #endif
55 
56 namespace gnsstk
57 {
59  struct DecodeBits
60  {
61  short startBit;
62  short numBits;
63  };
64 
68  struct DecodeQuant
69  {
70  short outIndex;
71  short pow2;
72  short powPI;
73  double scale;
74  short signq;
76  };
77 
83  static std::vector<std::vector<DecodeQuant> > subframeListFoo
84  {
85  {
86  // Dummy pattern for changing index base to 1
87  { 0, 0, 0, 1.0L, 0,{ { 0, 0},{ 0, 0} } }
88  },
89  {
90  // Pattern 1
91  //idx pow2 powPI scale signq fmt
92  { 0, 0, 0, 1.0L, 0,{ { 1, 8},{ 0, 0} } }, // Preamble
93  { 1, 0, 0, 1.0L, 0,{ { 9,14},{ 0, 0} } }, // Message
94  { 2, 0, 0, 6.0L, 0,{ { 31,17},{ 0, 0} } }, // HOW
95  { 3, 0, 0, 1.0L, 0,{ { 48, 2},{ 0, 0} } }, // "alert"
96  { 4, 0, 0, 1.0L, 0,{ { 50, 3},{ 0, 0} } }, // SF ID
97  { 5, 0, 0, 1.0L, 0,{ { 61,10},{ 0, 0} } }, // week #
98  { 6, 0, 0, 1.0L, 0,{ { 71, 2},{ 0, 0} } }, // L2 code
99  { 7, 0, 0, 1.0L, 0,{ { 73, 4},{ 0, 0} } }, // accuracy
100  { 8, 0, 0, 1.0L, 0,{ { 77, 6},{ 0, 0} } }, // health
101  { 9, 11, 0, 1.0L, 0,{ { 83, 2},{211, 8} } }, // AODC
102  { 10, 0, 0, 1.0L, 0,{ { 91, 1},{ 0, 0} } }, // L2 P
103  { 11, -31, 0, 1.0L, 1,{ {197, 8},{ 0, 0} } }, // Tgd
104  { 12, 4, 0, 1.0L, 0,{ {219,16},{ 0, 0} } }, // Toc
105  { 13, -55, 0, 1.0L, 1,{ {241, 8},{ 0, 0} } }, // Af2
106  { 14, -43, 0, 1.0L, 1,{ {249,16},{ 0, 0} } }, // Af1
107  { 15, -31, 0, 1.0L, 1,{ {271,22},{ 0, 0} } }, // Af0
108  },
109  {
110  // Pattern 2
111  //idx pow2 powPI scale signq fmt
112  { 0, 0, 0, 1.0L, 0,{ { 1, 8},{ 0, 0} } }, // Preamble
113  { 1, 0, 0, 1.0L, 0,{ { 9,14},{ 0, 0} } }, // Message
114  { 2, 0, 0, 6.0L, 0,{ { 31,17},{ 0, 0} } }, // HOW
115  { 3, 0, 0, 1.0L, 0,{ { 48, 2},{ 0, 0} } }, // "alert"
116  { 4, 0, 0, 1.0L, 0,{ { 50, 3},{ 0, 0} } }, // SF ID
117  { 5, 11, 0, 1.0L, 0,{ { 61, 8},{ 0, 0} } }, // AODE
118  { 6, -5, 0, 1.0L, 1,{ { 69,16},{ 0, 0} } }, // Crs
119  { 7, -43, 1, 1.0L, 1,{ { 91,16},{ 0, 0} } }, // delta n
120  { 8, -31, 1, 1.0L, 1,{ {107, 8},{121,24} } }, // M0
121  { 9, -29, 0, 1.0L, 1,{ {151,16},{ 0, 0} } }, // Cuc
122  { 10, -33, 0, 1.0L, 0,{ {167, 8},{181,24} } }, // ecc
123  { 11, -29, 0, 1.0L, 1,{ {211,16},{ 0, 0} } }, // Cus
124  { 12, -19, 0, 1.0L, 0,{ {227, 8},{241,24} } }, // sqrt(A)
125  { 13, 4, 0, 1.0L, 0,{ {271,16},{ 0, 0} } }, // Toe
126  { 14, 0, 0, 1.0L, 0,{ {287, 1},{ 0, 0} } }, // fit init
127  { 15, 0, 0, 900.0L, 0,{ {288, 5},{ 0, 0} } }, // AODO
128  },
129  {
130  // Pattern 3
131  //idx pow2 powPI scale signq fmt
132  { 0, 0, 0, 1.0L, 0,{ { 1, 8},{ 0, 0} } }, // Preamble
133  { 1, 0, 0, 1.0L, 0,{ { 9,14},{ 0, 0} } }, // Message
134  { 2, 0, 0, 6.0L, 0,{ { 31,17},{ 0, 0} } }, // HOW
135  { 3, 0, 0, 1.0L, 0,{ { 48, 2},{ 0, 0} } }, // "alert"
136  { 4, 0, 0, 1.0L, 0,{ { 50, 3},{ 0, 0} } }, // SF ID
137  { 5, -29, 0, 1.0L, 1,{ { 61,16},{ 0, 0} } }, // Cic
138  { 6, -31, 1, 1.0L, 1,{ { 77, 8},{ 91,24} } }, // OMEGA0
139  { 7, -29, 0, 1.0L, 1,{ {121,16},{ 0, 0} } }, // Cis
140  { 8, -31, 1, 1.0L, 1,{ {137, 8},{151,24} } }, // i0
141  { 9, -5, 0, 1.0L, 1,{ {181,16},{ 0, 0} } }, // Crc
142  { 10, -31, 1, 1.0L, 1,{ {197, 8},{211,24} } }, // w
143  { 11, -43, 1, 1.0L, 1,{ {241,24},{ 0, 0} } }, // OMEGAdot
144  { 12, 11, 0, 1.0L, 0,{ {271, 8},{ 0, 0} } }, // AODE
145  { 13, -43, 1, 1.0L, 1,{ {279,14},{ 0, 0} } }, // idot
146  },
147  {
148  // Pattern 4
149  //idx pow2 powPI scale signq fmt
150  { 0, 0, 0, 1.0L, 0,{ { 1, 8},{ 0, 0} } }, // Preamble
151  { 1, 0, 0, 1.0L, 0,{ { 9,14},{ 0, 0} } }, // Message
152  { 2, 0, 0, 6.0L, 0,{ { 31,17},{ 0, 0} } }, // HOW
153  { 3, 0, 0, 1.0L, 0,{ { 48, 2},{ 0, 0} } }, // "alert"
154  { 4, 0, 0, 1.0L, 0,{ { 50, 3},{ 0, 0} } }, // SF ID
155  { 5, 0, 0, 1.0L, 0,{ { 61, 2},{ 0, 0} } }, // Dataflag
156  { 6, 0, 0, 1.0L, 0,{ { 63, 6},{ 0, 0} } }, // Page ID
157  { 7, -21, 0, 1.0L, 0,{ { 69,16},{ 0, 0} } }, // e
158  { 8, 12, 0, 1.0L, 0,{ { 91, 8},{ 0, 0} } }, // time ep
159  { 9, -19, 1, 1.0L, 1,{ { 99,16},{ 0, 0} } }, // i offset
160  { 10, -38, 1, 1.0L, 1,{ {121,16},{ 0, 0} } }, // OMEGADOT
161  { 11, 0, 0, 1.0L, 0,{ {137, 8},{ 0, 0} } }, // Health
162  { 12, -11, 0, 1.0L, 0,{ {151,24},{ 0, 0} } }, // SQRT(a)
163  { 13, -23, 1, 1.0L, 1,{ {181,24},{ 0, 0} } }, // OMEGA
164  { 14, -23, 1, 1.0L, 1,{ {211,24},{ 0, 0} } }, // w
165  { 15, -23, 1, 1.0L, 1,{ {241,24},{ 0, 0} } }, // Mean Ano
166  { 16, -20, 0, 1.0L, 1,{ {271, 8},{290, 3} } }, // AF0
167  { 17, -38, 0, 1.0L, 1,{ {279,11},{ 0, 0} } }, // AF1
168  { 18, 0, 0, 1.0L, 0,{ { 0, 0},{ 0, 0} } }, // REF WEEK
169  { 19, 0, 0, 1.0L, 0,{ { 63, 6},{ 0, 0} } }, // PRN #
170  },
171  {
172  // Pattern 5
173  //idx pow2 powPI scale signq fmt
174  { 0, 0, 0, 1.0L, 0,{ { 1, 8},{ 0, 0} } }, // Preamble
175  { 1, 0, 0, 1.0L, 0,{ { 9,14},{ 0, 0} } }, // Message
176  { 2, 0, 0, 6.0L, 0,{ { 31,17},{ 0, 0} } }, // HOW
177  { 3, 0, 0, 1.0L, 0,{ { 48, 2},{ 0, 0} } }, // "alert"
178  { 4, 0, 0, 1.0L, 0,{ { 50, 3},{ 0, 0} } }, // SF ID
179  { 5, 0, 0, 1.0L, 0,{ { 61, 2},{ 0, 0} } }, // Dataflag
180  { 6, 0, 0, 1.0L, 0,{ { 63, 6},{ 0, 0} } }, // Page ID
181  { 7, 0, 0, 1.0L, 0,{ { 77, 8},{ 0, 0} } }, // Refweek
182  { 8, 0, 0, 1.0L, 0,{ { 91, 6},{ 0, 0} } }, // SV1 Hlth
183  { 9, 0, 0, 1.0L, 0,{ { 97, 6},{ 0, 0} } }, // SV2 Hlth
184  { 10, 0, 0, 1.0L, 0,{ {103, 6},{ 0, 0} } }, // SV3 Hlth
185  { 11, 0, 0, 1.0L, 0,{ {109, 6},{ 0, 0} } }, // SV4 Hlth
186  { 12, 0, 0, 1.0L, 0,{ {121, 6},{ 0, 0} } }, // SV5 Hlth
187  { 13, 0, 0, 1.0L, 0,{ {127, 6},{ 0, 0} } }, // SV6 Hlth
188  { 14, 0, 0, 1.0L, 0,{ {133, 6},{ 0, 0} } }, // SV7 Hlth
189  { 15, 0, 0, 1.0L, 0,{ {139, 6},{ 0, 0} } }, // SV8 Hlth
190  { 16, 0, 0, 1.0L, 0,{ {151, 6},{ 0, 0} } }, // SV9 Hlth
191  { 17, 0, 0, 1.0L, 0,{ {157, 6},{ 0, 0} } }, // SV10 Hlth
192  { 18, 0, 0, 1.0L, 0,{ {163, 6},{ 0, 0} } }, // SV11 Hlth
193  { 19, 0, 0, 1.0L, 0,{ {169, 6},{ 0, 0} } }, // SV12 Hlth
194  { 20, 0, 0, 1.0L, 0,{ {181, 6},{ 0, 0} } }, // SV13 Hlth
195  { 21, 0, 0, 1.0L, 0,{ {187, 6},{ 0, 0} } }, // SV14 Hlth
196  { 22, 0, 0, 1.0L, 0,{ {193, 6},{ 0, 0} } }, // SV15 Hlth
197  { 23, 0, 0, 1.0L, 0,{ {199, 6},{ 0, 0} } }, // SV16 Hlth
198  { 24, 0, 0, 1.0L, 0,{ {211, 6},{ 0, 0} } }, // SV17 Hlth
199  { 25, 0, 0, 1.0L, 0,{ {217, 6},{ 0, 0} } }, // SV18 Hlth
200  { 26, 0, 0, 1.0L, 0,{ {223, 6},{ 0, 0} } }, // SV19 Hlth
201  { 27, 0, 0, 1.0L, 0,{ {229, 6},{ 0, 0} } }, // SV20 Hlth
202  { 28, 0, 0, 1.0L, 0,{ {241, 6},{ 0, 0} } }, // SV21 Hlth
203  { 29, 0, 0, 1.0L, 0,{ {247, 6},{ 0, 0} } }, // SV22 Hlth
204  { 30, 0, 0, 1.0L, 0,{ {253, 6},{ 0, 0} } }, // SV23 Hlth
205  { 31, 0, 0, 1.0L, 0,{ {259, 6},{ 0, 0} } }, // SV24 Hlth
206  },
207  {
208  // Pattern 6
209  //idx pow2 powPI scale signq fmt
210  { 0, 0, 0, 1.0L, 0,{ { 1, 8},{ 0, 0} } }, // Preamble
211  { 1, 0, 0, 1.0L, 0,{ { 9,14},{ 0, 0} } }, // Message
212  { 2, 0, 0, 6.0L, 0,{ { 31,17},{ 0, 0} } }, // HOW
213  { 3, 0, 0, 1.0L, 0,{ { 48, 2},{ 0, 0} } }, // "alert"
214  { 4, 0, 0, 1.0L, 0,{ { 50, 3},{ 0, 0} } }, // SF ID
215  { 5, 0, 0, 1.0L, 0,{ { 61, 2},{ 0, 0} } }, // Dataflag
216  { 6, 0, 0, 1.0L, 0,{ { 63, 6},{ 0, 0} } }, // Page ID
217  { 7, 0, 0, 1.0L, 0,{ { 69,16},{ 0, 0} } }, // Reserved
218  { 8, 0, 0, 1.0L, 0,{ { 91,24},{ 0, 0} } }, // Reserved
219  { 9, 0, 0, 1.0L, 0,{ {121,24},{ 0, 0} } }, // Reserved
220  { 10, 0, 0, 1.0L, 0,{ {151,24},{ 0, 0} } }, // Reserved
221  { 11, 0, 0, 1.0L, 0,{ {181,24},{ 0, 0} } }, // Reserved
222  { 12, 0, 0, 1.0L, 0,{ {211,24},{ 0, 0} } }, // Reserved
223  { 13, 0, 0, 1.0L, 0,{ {241, 8},{ 0, 0} } }, // Reserved
224  { 14, 0, 0, 1.0L, 0,{ {249,16},{ 0, 0} } }, // Reserved
225  },
226  {
227  // Pattern 7
228  //idx pow2 powPI scale signq fmt
229  { 0, 0, 0, 1.0L, 0,{ { 1, 8},{ 0, 0} } }, // Preamble
230  { 1, 0, 0, 1.0L, 0,{ { 9,14},{ 0, 0} } }, // Message
231  { 2, 0, 0, 6.0L, 0,{ { 31,17},{ 0, 0} } }, // HOW
232  { 3, 0, 0, 1.0L, 0,{ { 48, 2},{ 0, 0} } }, // "alert"
233  { 4, 0, 0, 1.0L, 0,{ { 50, 3},{ 0, 0} } }, // SF ID
234  { 5, 0, 0, 1.0L, 0,{ { 61, 2},{ 0, 0} } }, // Dataflag
235  { 6, 0, 0, 1.0L, 0,{ { 63, 6},{ 0, 0} } }, // Page ID
236  { 7, 0, 0, 1.0L, 0,{ { 69,16},{ 0, 0} } }, // Reserved
237  { 8, 0, 0, 1.0L, 0,{ { 91,24},{ 0, 0} } }, // Reserved
238  { 9, 0, 0, 1.0L, 0,{ {121,24},{ 0, 0} } }, // Reserved
239  { 10, 0, 0, 1.0L, 0,{ {151,24},{ 0, 0} } }, // Reserved
240  { 11, 0, 0, 1.0L, 0,{ {181,24},{ 0, 0} } }, // Reserved
241  { 12, 0, 0, 1.0L, 0,{ {211,24},{ 0, 0} } }, // Reserved
242  { 13, 0, 0, 1.0L, 0,{ {241, 8},{ 0, 0} } }, // Reserved
243  { 14, 0, 0, 1.0L, 0,{ {249,16},{ 0, 0} } }, // Reserved
244  },
245  {
246  // Pattern 8
247  //idx pow2 powPI scale signq fmt
248  { 0, 0, 0, 1.0L, 0,{ { 1, 8},{ 0, 0} } }, // Preamble
249  { 1, 0, 0, 1.0L, 0,{ { 9,14},{ 0, 0} } }, // Message
250  { 2, 0, 0, 6.0L, 0,{ { 31,17},{ 0, 0} } }, // HOW
251  { 3, 0, 0, 1.0L, 0,{ { 48, 2},{ 0, 0} } }, // "alert"
252  { 4, 0, 0, 1.0L, 0,{ { 50, 3},{ 0, 0} } }, // SF ID
253  { 5, 0, 0, 1.0L, 0,{ { 61, 2},{ 0, 0} } }, // Dataflag
254  { 6, 0, 0, 1.0L, 0,{ { 63, 6},{ 0, 0} } }, // Page ID
255  { 7, -30, 0, 1.0L, 1,{ { 69, 8},{ 0, 0} } }, // ALPHA0
256  { 8, -27, -1, 1.0L, 1,{ { 77, 8},{ 0, 0} } }, // ALPHA1
257  { 9, -24, -2, 1.0L, 1,{ { 91, 8},{ 0, 0} } }, // ALPHA2
258  { 10, -24, -3, 1.0L, 1,{ { 99, 8},{ 0, 0} } }, // ALPHA3
259  { 11, 11, 0, 1.0L, 1,{ {107, 8},{ 0, 0} } }, // BETA0
260  { 12, 14, -1, 1.0L, 1,{ {121, 8},{ 0, 0} } }, // BETA1
261  { 13, 16, -2, 1.0L, 1,{ {129, 8},{ 0, 0} } }, // BETA2
262  { 14, 16, -3, 1.0L, 1,{ {137, 8},{ 0, 0} } }, // BETA3
263  { 15, -30, 0, 1.0L, 1,{ {181,24},{211, 8} } }, // A0
264  { 16, -50, 0, 1.0L, 1,{ {151,24},{ 0, 0} } }, // A1
265  { 17, 12, 0, 1.0L, 0,{ {219, 8},{ 0, 0} } }, // Tot
266  { 18, 0, 0, 1.0L, 0,{ {227, 8},{ 0, 0} } }, // wnt
267  { 19, 0, 0, 1.0L, 1,{ {241, 8},{ 0, 0} } }, // DELTATLS
268  { 20, 0, 0, 1.0L, 0,{ {249, 8},{ 0, 0} } }, // WN LSF
269  { 21, 0, 0, 1.0L, 0,{ {257, 8},{ 0, 0} } }, // DN
270  { 22, 0, 0, 1.0L, 1,{ {271, 8},{ 0, 0} } }, // DELTALSF
271  },
272  {
273  // Pattern 9
274  //idx pow2 powPI scale signq fmt
275  { 0, 0, 0, 1.0L, 0,{ { 1, 8},{ 0, 0} } }, // Preamble
276  { 1, 0, 0, 1.0L, 0,{ { 9,14},{ 0, 0} } }, // Message
277  { 2, 0, 0, 6.0L, 0,{ { 31,17},{ 0, 0} } }, // HOW
278  { 3, 0, 0, 1.0L, 0,{ { 48, 2},{ 0, 0} } }, // "alert"
279  { 4, 0, 0, 1.0L, 0,{ { 50, 3},{ 0, 0} } }, // SF ID
280  { 5, 0, 0, 1.0L, 0,{ { 61, 2},{ 0, 0} } }, // Dataflag
281  { 6, 0, 0, 1.0L, 0,{ { 63, 6},{ 0, 0} } }, // Page ID
282  { 7, 0, 0, 1.0L, 0,{ { 69, 4},{ 0, 0} } }, // SV1 cnfig
283  { 8, 0, 0, 1.0L, 0,{ { 73, 4},{ 0, 0} } }, // SV2 cnfig
284  { 9, 0, 0, 1.0L, 0,{ { 77, 4},{ 0, 0} } }, // SV3 cnfig
285  { 10, 0, 0, 1.0L, 0,{ { 81, 4},{ 0, 0} } }, // SV4 cnfig
286  { 11, 0, 0, 1.0L, 0,{ { 91, 4},{ 0, 0} } }, // SV5 cnfig
287  { 12, 0, 0, 1.0L, 0,{ { 95, 4},{ 0, 0} } }, // SV6 cnfig
288  { 13, 0, 0, 1.0L, 0,{ { 99, 4},{ 0, 0} } }, // SV7 cnfig
289  { 14, 0, 0, 1.0L, 0,{ {103, 4},{ 0, 0} } }, // SV8 cnfig
290  { 15, 0, 0, 1.0L, 0,{ {107, 4},{ 0, 0} } }, // SV9 cnfig
291  { 16, 0, 0, 1.0L, 0,{ {111, 4},{ 0, 0} } }, // SV10 cnfig
292  { 17, 0, 0, 1.0L, 0,{ {121, 4},{ 0, 0} } }, // SV11 cnfig
293  { 18, 0, 0, 1.0L, 0,{ {125, 4},{ 0, 0} } }, // SV12 cnfig
294  { 19, 0, 0, 1.0L, 0,{ {129, 4},{ 0, 0} } }, // SV13 cnfig
295  { 20, 0, 0, 1.0L, 0,{ {133, 4},{ 0, 0} } }, // SV14 cnfig
296  { 21, 0, 0, 1.0L, 0,{ {137, 4},{ 0, 0} } }, // SV15 cnfig
297  { 22, 0, 0, 1.0L, 0,{ {141, 4},{ 0, 0} } }, // SV16 cnfig
298  { 23, 0, 0, 1.0L, 0,{ {151, 4},{ 0, 0} } }, // SV17 cnfig
299  { 24, 0, 0, 1.0L, 0,{ {155, 4},{ 0, 0} } }, // SV18 cnfig
300  { 25, 0, 0, 1.0L, 0,{ {159, 4},{ 0, 0} } }, // SV19 cnfig
301  { 26, 0, 0, 1.0L, 0,{ {163, 4},{ 0, 0} } }, // SV20 cnfig
302  { 27, 0, 0, 1.0L, 0,{ {167, 4},{ 0, 0} } }, // SV21 cnfig
303  { 28, 0, 0, 1.0L, 0,{ {171, 4},{ 0, 0} } }, // SV22 cnfig
304  { 29, 0, 0, 1.0L, 0,{ {181, 4},{ 0, 0} } }, // SV23 cnfig
305  { 30, 0, 0, 1.0L, 0,{ {185, 4},{ 0, 0} } }, // SV24 cnfig
306  { 31, 0, 0, 1.0L, 0,{ {189, 4},{ 0, 0} } }, // SV25 cnfig
307  { 32, 0, 0, 1.0L, 0,{ {193, 4},{ 0, 0} } }, // SV26 cnfig
308  { 33, 0, 0, 1.0L, 0,{ {197, 4},{ 0, 0} } }, // SV27 cnfig
309  { 34, 0, 0, 1.0L, 0,{ {201, 4},{ 0, 0} } }, // SV28 cnfig
310  { 35, 0, 0, 1.0L, 0,{ {211, 4},{ 0, 0} } }, // SV29 cnfig
311  { 36, 0, 0, 1.0L, 0,{ {215, 4},{ 0, 0} } }, // SV30 cnfig
312  { 37, 0, 0, 1.0L, 0,{ {219, 4},{ 0, 0} } }, // SV31 cnfig
313  { 38, 0, 0, 1.0L, 0,{ {223, 4},{ 0, 0} } }, // SV32 cnfig
314  { 39, 0, 0, 1.0L, 0,{ {229, 6},{ 0, 0} } }, // SV25 Hlth
315  { 40, 0, 0, 1.0L, 0,{ {241, 6},{ 0, 0} } }, // SV26 Hlth
316  { 41, 0, 0, 1.0L, 0,{ {247, 6},{ 0, 0} } }, // SV27 Hlth
317  { 42, 0, 0, 1.0L, 0,{ {253, 6},{ 0, 0} } }, // SV28 Hlth
318  { 43, 0, 0, 1.0L, 0,{ {259, 6},{ 0, 0} } }, // SV29 Hlth
319  { 44, 0, 0, 1.0L, 0,{ {271, 6},{ 0, 0} } }, // SV30 Hlth
320  { 45, 0, 0, 1.0L, 0,{ {277, 6},{ 0, 0} } }, // SV31 Hlth
321  { 46, 0, 0, 1.0L, 0,{ {283, 6},{ 0, 0} } }, // SV32 Hlth
322  },
323  {
324  // Pattern 10
325  //idx pow2 powPI scale signq fmt
326  { 0, 0, 0, 1.0L, 0,{ { 1, 8},{ 0, 0} } }, // Preamble
327  { 1, 0, 0, 1.0L, 0,{ { 9,14},{ 0, 0} } }, // Message
328  { 2, 0, 0, 6.0L, 0,{ { 31,17},{ 0, 0} } }, // HOW
329  { 3, 0, 0, 1.0L, 0,{ { 48, 2},{ 0, 0} } }, // "alert"
330  { 4, 0, 0, 1.0L, 0,{ { 50, 3},{ 0, 0} } }, // SF ID
331  { 5, 0, 0, 1.0L, 0,{ { 61, 2},{ 0, 0} } }, // Dataflag
332  { 6, 0, 0, 1.0L, 0,{ { 63, 6},{ 0, 0} } }, // Page ID
333  { 7, 0, 0, 1.0L, 0,{ { 69, 8},{ 0, 0} } }, // ASCII
334  { 8, 0, 0, 1.0L, 0,{ { 77, 8},{ 0, 0} } }, // ASCII
335  { 9, 0, 0, 1.0L, 0,{ { 91, 8},{ 0, 0} } }, // ASCII
336  { 10, 0, 0, 1.0L, 0,{ { 99, 8},{ 0, 0} } }, // ASCII
337  { 11, 0, 0, 1.0L, 0,{ {107, 8},{ 0, 0} } }, // ASCII
338  { 12, 0, 0, 1.0L, 0,{ {121, 8},{ 0, 0} } }, // ASCII
339  { 13, 0, 0, 1.0L, 0,{ {129, 8},{ 0, 0} } }, // ASCII
340  { 14, 0, 0, 1.0L, 0,{ {137, 8},{ 0, 0} } }, // ASCII
341  { 15, 0, 0, 1.0L, 0,{ {151, 8},{ 0, 0} } }, // ASCII
342  { 16, 0, 0, 1.0L, 0,{ {159, 8},{ 0, 0} } }, // ASCII
343  { 17, 0, 0, 1.0L, 0,{ {167, 8},{ 0, 0} } }, // ASCII
344  { 18, 0, 0, 1.0L, 0,{ {181, 8},{ 0, 0} } }, // ASCII
345  { 19, 0, 0, 1.0L, 0,{ {189, 8},{ 0, 0} } }, // ASCII
346  { 20, 0, 0, 1.0L, 0,{ {197, 8},{ 0, 0} } }, // ASCII
347  { 21, 0, 0, 1.0L, 0,{ {211, 8},{ 0, 0} } }, // ASCII
348  { 22, 0, 0, 1.0L, 0,{ {219, 8},{ 0, 0} } }, // ASCII
349  { 23, 0, 0, 1.0L, 0,{ {227, 8},{ 0, 0} } }, // ASCII
350  { 24, 0, 0, 1.0L, 0,{ {241, 8},{ 0, 0} } }, // ASCII
351  { 25, 0, 0, 1.0L, 0,{ {249, 8},{ 0, 0} } }, // ASCII
352  { 26, 0, 0, 1.0L, 0,{ {257, 8},{ 0, 0} } }, // ASCII
353  { 27, 0, 0, 1.0L, 0,{ {271, 8},{ 0, 0} } }, // ASCII
354  { 28, 0, 0, 1.0L, 0,{ {279, 8},{ 0, 0} } } // ASCII
355  }
356  };
357 
359  static double PItab[7] =
360  { 1/(PI*PI*PI),
361  1/(PI*PI),
362  1/PI,
363  1,
364  PI,
365  PI*PI,
366  PI*PI*PI };
367 
368 
370  noexcept
371  {
372  }
373 
374  // Retained for backward compatibility
375  bool EngNav :: subframeConvert(const long input[10],
376  int gpsWeek,
377  double output[60])
378  noexcept
379  {
380  uint32_t tinput[10];
381  for (int n=0;n<10;++n)
382  tinput[n] = static_cast<uint32_t>( input[n] );
383  short tgpsWeek = gpsWeek;
384  return( subframeConvert( tinput, tgpsWeek, output ));
385  }
386 
387  bool EngNav :: subframeConvert(const uint32_t input[10],
388  short gpsWeek,
389  double output[60])
390  noexcept
391  {
392  short patId = -2, i = 2;
393  struct DecodeQuant *p=NULL;
394 
395  for (i=0; i< 20; i++)
396  output[i] = 0.0L;
397 
398  // Get subframe and page id and derive pattern number.
399  if ((patId = getSubframePattern(input)) == 0)
400  return false;
401 
402  // convert each quantity in the list
403  for (i = 0; i < subframeListFoo[patId].size(); i++)
404  {
405  convertQuant(input, output, subframeListFoo[patId][i]);
406  }
407 
408  // Almanac does not contain a reference week
409  // However we need to put one in the Almanac
410  if (patId==4)
411  {
412  output[18]= static_cast<double>( gpsWeek );
413  }
414 
415  // Modify the 8-bit week numbers to be the full week numbers
416  if (patId == 8)
417  {
418  if (!convert8bit(gpsWeek, &output[18]))
419  return false;
420 
421  if (!convert8bit(gpsWeek, &output[20]))
422  return false;
423  }
424 
425  // Change the 10 bit week number in subframe 1 to full weeks
426  if (patId == 1)
427  {
428  short week10Bit = static_cast<uint32_t>( output[5] );
429  output[5] =
430  static_cast<double>( convertXBit(gpsWeek, week10Bit, BITS10) );
431  }
432  return true;
433  }
434 
435  // Retained for backward compatibility
436  bool EngNav :: convert8bit(int gpsWeek, double *output)
437  noexcept
438  {
439  short tgpsWeek = static_cast<short>( gpsWeek );
440  short toutput = static_cast<short> ( *output );
441  short retArg = convertXBit( tgpsWeek, toutput, BITS8 );
442  *output = static_cast<double>(retArg);
443 
444  return true;
445  }
446 
447  // Retained for backward compatibility
448  bool EngNav :: convert10bit(int gpsWeek, double *output)
449  noexcept
450  {
451  short tgpsWeek = static_cast<short>( gpsWeek );
452  short toutput = static_cast<short> ( *output );
453  short retArg = convertXBit( tgpsWeek, toutput, BITS10 );
454  *output = static_cast<double>(retArg);
455  return true;
456  }
457 
458  static short LIMIT[] = { 127, 511 };
459  static short RANGE[] = { 256, 1024 };
460 
461  short EngNav :: convertXBit(short fullGPSWeek,
462  short incompleteGPSWeek,
463  BitConvertType type)
464  {
465  short extension = fullGPSWeek - (fullGPSWeek % RANGE[type]);
466  short target = extension + incompleteGPSWeek;
467 
468  short diff = target - fullGPSWeek;
469  if (diff>LIMIT[type])
470  target -= RANGE[type];
471  else if (diff< -LIMIT[type])
472  target += RANGE[type];
473 
474  return( target );
475  }
476 
477  // Retained for backward compatibility
478  short EngNav :: getSubframePattern(const long input[10])
479  noexcept
480  {
481  uint32_t tinput[10];
482  for (int n=0;n<10;++n)
483  tinput[n] = static_cast<uint32_t>( input[n] );
484  return( getSubframePattern( tinput ));
485  }
486 
487  short EngNav :: getSubframePattern(const uint32_t input[10])
488  noexcept
489  {
490  short iret, svid;
491  long itemp;
492 
493  short patId[]
494  = { 5, 6, 6, 6, 10, 8, 6, 7, 7, 7, 7, 7, 9 };
495  /*SVid 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 */
496 
497  // Get subframe id. If 1-3 return as patId.
498 
499  itemp = input[1]; /* move HOW to temp storage */
500  itemp >>= 8; /* shift so subframe id is in 3 lsb */
501  itemp &= 0x00000007L; /* and mask off msbs */
502  iret = static_cast<short>( itemp );
503  /* Not a valid sf id */
504  if ( iret < 1 || iret > 5 )
505  return(0);
506  if ( iret < 4 )
507  return(iret);
508 
509 
510  /* If subframe 1-5, get page id and look up patId */
511  itemp = input[2]; /* move word 3 into temp storage */
512  itemp >>= 22; /* shift so SV ID is in 6 lsbs */
513  itemp &= 0x0000003FL; /* and mask off msbs */
514  svid = static_cast<short>( itemp );
515  if ( svid <= 32 )
516  iret = 4; /* PRN orbit data */
517  else
518  iret = patId[svid-51]; /* look up pat id for almanac overhead
519  information */
520  return iret;
521  }
522 
523 
524  bool EngNav :: sv2page(short svpgid, short& subframe, short& page)
525  noexcept
526  {
527  if (svpgid < 1)
528  return false;
529 
530  if ((svpgid >= 1) && (svpgid <= 24))
531  {
532  subframe = 5;
533  page = svpgid;
534  return true;
535  }
536 
537  switch (svpgid)
538  {
539  case 51:
540  subframe = 5;
541  page = 25;
542  return true;
543  case 29:
544  case 30:
545  case 31:
546  case 32:
547  subframe = 4;
548  page = svpgid - 22;
549  return true;
550  case 25:
551  case 26:
552  case 27:
553  case 28:
554  subframe = 4;
555  page = svpgid - 23;
556  return true;
557  case 57:
558  subframe = 4;
559  page = 1;
560  return true;
561  case 55:
562  case 56:
563  case 60:
564  case 61:
565  case 62:
566  case 63:
567  subframe = 4;
568  page = svpgid - 38;
569  return true;
570  case 52:
571  case 53:
572  case 54:
573  case 58:
574  case 59:
575  subframe = 4;
576  page = svpgid - 39;
577  return true;
578  }
579  return false;
580  }
581 
582 
583  bool EngNav :: sfpage2svid(short subframe, short page, short& svpgid)
584  noexcept
585  {
586  static const short sf4pg[25] = { 57, 25, 26, 27, 28, 57, 29, 30, 31, 32,
587  57, 62, 52, 53, 54, 57, 55, 56, 58, 59,
588  57, 60, 61, 62, 63 };
589 
590  svpgid = 0;
591 
592  if ((page < 1) || (page > 25) || (subframe < 4) || (subframe > 5))
593  return false;
594 
595  if (subframe == 4)
596  {
597  svpgid = sf4pg[page-1];
598  }
599  else if (page == 25)
600  svpgid = 51;
601  else
602  svpgid = page;
603 
604  return true;
605  }
606 
607 
608  bool EngNav :: zcount2page(unsigned long zcount,
609  short& subframe, short& page)
610  noexcept
611  {
612  subframe = ((zcount % 20) / 4);
613  if (subframe == 0)
614  subframe = 5;
615  unsigned long mod500 = zcount % 500;
616 
617  switch (subframe)
618  {
619  case 1:
620  case 2:
621  case 3:
622  page = 0;
623  break;
624  case 4:
625  page = ((mod500 - 12) / 20) + 1;
626  break;
627  case 5:
628  page = (mod500 > 0) ? ((mod500 - 16) / 20) + 1 : 25;
629  break;
630  default:
631  return false;
632  }
633  return true;
634  }
635 
636 
637  uint32_t EngNav :: computeParity(uint32_t sfword,
638  uint32_t psfword,
639  bool knownUpright)
640  {
641  /*
642  This function is somewhat table-driven. There is one
643  element in bmask for each of the six parity bits. Each
644  element is a bit mask with bits set corresponding to the
645  bits which are to be exclusive-OR'd together to form the
646  parity check bit. The following bit maps define the bmask
647  array. They were drawn from table 20-XIV of ICD-GPS-200C
648  (10 OCT 1993).
649 
650  Bit in navigation message
651  bit1 bit 30
652  bit 12 3456 789. 1234 5678 9.12 3456 789.
653  --- -------------------------------------
654  D25 11 1011 0001 1111 0011 0100 1000 0000
655  D26 01 1101 1000 1111 1001 1010 0100 0000
656  D27 10 1110 1100 0111 1100 1101 0000 0000
657  D28 01 0111 0110 0011 1110 0110 1000 0000
658  D29 10 1011 1011 0001 1111 0011 0100 0000
659  D30 00 1011 0111 1010 1000 1001 1100 0000
660  */
661  uint32_t bmask[6] = { 0x3B1F3480L, 0x1D8F9A40L, 0x2EC7CD00L,
662  0x1763E680L, 0x2BB1F340L, 0x0B7A89C0L };
663 
664  uint32_t D = 0;
665  uint32_t d = sfword;
666  uint32_t D29 = getd29(psfword);
667  uint32_t D30 = getd30(psfword);
668 
669  // If D30 of the previous subframe was set, complement the word
670  // to get the source data bits. This will also complement the
671  // parity, but we don't need the original parity to compute the
672  // new.
673  if (D30 && !knownUpright)
674  d = ~d;
675  D |= ((D29 + BinUtils::countBits(bmask[0] & d)) % 2) << 5;
676  D |= ((D30 + BinUtils::countBits(bmask[1] & d)) % 2) << 4;
677  D |= ((D29 + BinUtils::countBits(bmask[2] & d)) % 2) << 3;
678  D |= ((D30 + BinUtils::countBits(bmask[3] & d)) % 2) << 2;
679  D |= ((D30 + BinUtils::countBits(bmask[4] & d)) % 2) << 1;
680  D |= ((D29 + BinUtils::countBits(bmask[5] & d)) % 2);
681 
682  return D;
683  }
684 
685  uint32_t EngNav :: fixParity(uint32_t sfword,
686  uint32_t psfword,
687  bool nib,
688  bool knownUpright)
689  {
690  uint32_t bmask[6] = { 0x3B1F3480L, 0x1D8F9A40L, 0x2EC7CD00L,
691  0x1763E680L, 0x2BB1F340L, 0x0B7A89C0L };
692 
693  uint32_t D = 0;
694  uint32_t d = sfword;
695  uint32_t D29 = getd29(psfword);
696  uint32_t D30 = getd30(psfword);
697 
698  if (nib)
699  {
700  // make sure the non-information bits are zero to start with.
701  d &= 0xffffff00;
702  if ((D30 + BinUtils::countBits(bmask[4] & d)) % 2)
703  d |= 0x00000040;
704  if ((D29 + BinUtils::countBits(bmask[5] & d)) % 2)
705  d |= 0x00000080;
706  }
707 
708  D = computeParity(d, psfword, knownUpright);
709 
710  return D | d;
711  }
712 
714  bool EngNav :: subframeParity(const long input[10])
715  {
716  uint32_t temp[10];
717  for (int n=0;n<10;++n) temp[n] = input[n];
718  return(checkParity( temp ));
719  }
720 
721 
722  bool EngNav :: checkParity(const std::vector<uint32_t>& sf, bool knownUpright)
723  {
724  return checkParity(&sf[0], knownUpright);
725  }
726 
727  bool EngNav :: checkParity(const uint32_t sf[10], bool knownUpright)
728  {
729  return
730  ((sf[0] & 0x0000003f) == computeParity(sf[0], 0, knownUpright)) &&
731  ((sf[1] & 0x0000003f) == computeParity(sf[1], sf[0], knownUpright)) &&
732  ((sf[2] & 0x0000003f) == computeParity(sf[2], sf[1], knownUpright)) &&
733  ((sf[3] & 0x0000003f) == computeParity(sf[3], sf[2], knownUpright)) &&
734  ((sf[4] & 0x0000003f) == computeParity(sf[4], sf[3], knownUpright)) &&
735  ((sf[5] & 0x0000003f) == computeParity(sf[5], sf[4], knownUpright)) &&
736  ((sf[6] & 0x0000003f) == computeParity(sf[6], sf[5], knownUpright)) &&
737  ((sf[7] & 0x0000003f) == computeParity(sf[7], sf[6], knownUpright)) &&
738  ((sf[8] & 0x0000003f) == computeParity(sf[8], sf[7], knownUpright)) &&
739  ((sf[9] & 0x0000003f) == computeParity(sf[9], sf[8], knownUpright));
740  }
741 
742  void EngNav :: convertQuant(const uint32_t input[10],
743  double output[60],
744  const DecodeQuant& dq)
745  noexcept
746  {
747  double dval;
748  short i, n, bit1, nword, nbit;
749  union equ
750  {
751  uint32_t u;
752  int32_t s;
753  } temp;
754  uint32_t *b;
755  uint32_t mask;
756 
757  // Convert starting bit number to word/bit pair
758  temp.u = 0x0L;
759  for (n=0; n<=1; n++)
760  {
761  if (dq.fmt[n].startBit == 0)
762  break;
763  bit1 = dq.fmt[n].startBit;
764  nword = (bit1-1) / 30;
765  nbit = (bit1 % 30) + 1;
766 
767  b = const_cast<uint32_t *>( input ) + nword;
768  for (i=0;i<dq.fmt[n].numBits;i++)
769  {
770  temp.u <<= 1;
771  mask = 0x80000000L >> nbit++;
772  if (*b & mask)
773  temp.u++;
774  if (nbit>=32)
775  {
776  b++;
777  nbit = 0;
778  }
779  }
780  }
781 
782  // Convert to double and scale
783  if (dq.signq)
784  {
785  nbit = 32 - (dq.fmt[0].numBits + dq.fmt[1].numBits);
786  temp.u <<= nbit; // Move sign bit to msb
787  temp.s >>= nbit; // Move lsb back to right spot with sign extend
788  dval = temp.s;
789  }
790  else
791  {
792  dval = temp.u; // msb = 0
793  }
794  dval = dval * dq.scale; // Scale by scalar
795  dval = dval * PItab[ dq.powPI+3 ]; // Scale by power of PI
796  dval = LDEXP(dval,dq.pow2); // Scale by power of 2
797  output[dq.outIndex] = dval; // Store result in output array
798  }
799 
800  void EngNav :: dump(std::ostream& s)
801  {
802  for(short pattern = 1; pattern <= 10; pattern++)
803  {
804  s.setf(std::ios::fixed, std::ios::floatfield);
805  s.setf(std::ios::right, std::ios::adjustfield);
806  s.precision(0);
807  s.fill(' ');
808  s << "****************************************"
809  << "*****************************************"
810  << std::endl
811  << "Pattern : " << pattern
812  << std::endl << std::endl
813  << " First Second"
814  << std::endl
815  << " n OutIndex pow2 powPI Scale Signq Start #bits Start #bits"
816  << std::endl;
817  for (unsigned n = 0; n < subframeListFoo[pattern].size(); n++)
818  {
819  /* s.setf(std::ios::fixed, std::ios::floatfield);
820  s.setf(std::ios::right, std::ios::adjustfield);
821  s.precision(0);
822  s.fill(' '); */
823  struct DecodeQuant *p = &subframeListFoo[pattern][n];
824 
825  s << std::dec << std::setw(2) << n << " " << std::setw(3) << p->outIndex
826  << " " << std::setw(3) << p->pow2
827  << " " << std::setw(3) << p->powPI
828  << " " << std::setw(3) << p->scale
829  << " " << std::setw(3) << p->signq
830  << " " << std::setw(3) << p->fmt[0].startBit
831  << " " << std::setw(3) << p->fmt[0].numBits
832  << " " << std::setw(3) << p->fmt[1].startBit
833  << " " << std::setw(3) << p->fmt[1].numBits
834  << std::endl;
835  }
836  s << std::endl;
837  }
838  s << std::endl;
839  s << "Index Power Value\n";
840  int x = -3;
841  for(int i = 0; i < 7; i++)
842  {
843  s << " " << i << " " << std::setw(2) << x << " " << std::setw(8) << std::setprecision(5) << PItab[i] << std::endl;
844  x++;
845  }
846 
847 
848  }
849 
850 
851  bool EngNav :: getNMCTValidity(const uint32_t sf2[10],
852  unsigned howWeek,
853  uint32_t &aodo,
854  CommonTime &tnmct,
855  CommonTime &toe,
856  CommonTime &tot)
857  {
858  uint32_t toeSOW, offset;
859  short sfid = getSFID(sf2[1]);
860  if (sfid != 2)
861  {
862  InvalidParameter exc("getNMCTValidity called using non-subframe 2"
863  " data");
864  GNSSTK_THROW(exc);
865  }
866  // no math functions in anything but common time, so extra
867  // conversions, yay.
868  GPSWeekSecond totWS(howWeek, getHOWTime(sf2[1])), toeWS;
869  tot = totWS;
870  tot -= 6; // move from TOW to actual transmit time
871  totWS = tot; // convert back to seconds of week
872  aodo = ((sf2[9] >> 8) & 0x001f) * 900;
873  toeSOW = ((sf2[9] >> 14) & 0xffff) << 4;
874  // correct the toe week at week roll-over if necessary
875  if ((totWS.sow - toeSOW) > HALFWEEK)
876  toeWS = GPSWeekSecond(totWS.week+1, toeSOW);
877  else if ((totWS.sow - toeSOW) < -HALFWEEK)
878  toeWS = GPSWeekSecond(totWS.week-1, toeSOW);
879  else
880  toeWS = GPSWeekSecond(totWS.week, toeSOW);
881  toe = toeWS;
882  offset = toeSOW % 7200;
883  if (offset == 0)
884  tnmct = toe - aodo;
885  else
886  tnmct = toe - offset + 7200 - aodo;
887  return aodo != 27900;
888  }
889 
890 
891 } // namespace
example3.svid
svid
Definition: example3.py:19
gnsstk::EngNav::convert10bit
static bool convert10bit(int gpsWeek, double *out) noexcept
Definition: EngNav.cpp:448
gnsstk::HALFWEEK
const long HALFWEEK
Seconds per half week.
Definition: TimeConstants.hpp:58
gnsstk::subframeListFoo
static std::vector< std::vector< DecodeQuant > > subframeListFoo
Definition: EngNav.cpp:84
gnsstk::RANGE
static short RANGE[]
Definition: EngNav.cpp:459
gnsstk::DecodeQuant::fmt
DecodeBits fmt[2]
start bit, number of bits for up to 2 sections
Definition: EngNav.cpp:75
gnsstk::EngNav::getd29
static uint32_t getd29(uint32_t sfword)
Get bit 29 from the given subframe word.
Definition: EngNav.hpp:140
gnsstk::LIMIT
static short LIMIT[]
Definition: EngNav.cpp:458
gnsstk::EngNav::subframeParity
static bool subframeParity(const long input[10])
This is the old routine only left around for compatibility.
Definition: EngNav.cpp:714
gnsstk::DecodeQuant::outIndex
short outIndex
Output array index (0-19)
Definition: EngNav.cpp:70
NULL
#define NULL
Definition: getopt1.c:64
gnsstk::PI
const double PI
GPS value of PI; also specified by GAL.
Definition: GNSSconstants.hpp:62
gnsstk::DecodeQuant::scale
double scale
Scalar scale factor.
Definition: EngNav.cpp:73
GNSSconstants.hpp
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::EngNav::EngNav
EngNav() noexcept
default constructor
Definition: EngNav.cpp:369
gnsstk::EngNav::sv2page
static bool sv2page(short svpgid, short &subframe, short &page) noexcept
Definition: EngNav.cpp:524
gnsstk::GPSWeekSecond
Definition: GPSWeekSecond.hpp:56
example4.temp
temp
Definition: example4.py:35
gnsstk::EngNav::convert8bit
static bool convert8bit(int gpsWeek, double *out) noexcept
Definition: EngNav.cpp:436
gnsstk::EngNav::convertXBit
static short convertXBit(short fullGPSWeek, short incompleteGPSWeek, BitConvertType type)
Definition: EngNav.cpp:461
gnsstk::EngNav::zcount2page
static bool zcount2page(unsigned long zcount, short &subframe, short &page) noexcept
Definition: EngNav.cpp:608
gnsstk::EngNav::getSubframePattern
static short getSubframePattern(const long input[10]) noexcept
Definition: EngNav.cpp:478
gnsstk::bds::sf2
@ sf2
Definition: BDSD1Bits.hpp:192
gnsstk::EngNav::dump
static void dump(std::ostream &s=std::cout)
Definition: EngNav.cpp:800
gnsstk::EngNav::getHOWTime
static unsigned long getHOWTime(uint32_t word2)
Get the HOW time from the provided HOW.
Definition: EngNav.hpp:146
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::EngNav::fixParity
static uint32_t fixParity(uint32_t sfword, uint32_t psfword, bool nib, bool knownUpright=true)
Definition: EngNav.cpp:685
gnsstk::EngNav::sfpage2svid
static bool sfpage2svid(short subframe, short page, short &svpgid) noexcept
Definition: EngNav.cpp:583
gnsstk::EngNav::subframeConvert
static bool subframeConvert(const long input[10], int gpsWeek, double output[60]) noexcept
Definition: EngNav.cpp:375
gnsstk::EngNav::getSFID
static short getSFID(uint32_t word2)
Get the subframe ID from the provided HOW.
Definition: EngNav.hpp:163
gnsstk::DecodeQuant
Definition: EngNav.cpp:68
gnsstk::EngNav::computeParity
static uint32_t computeParity(uint32_t sfword, uint32_t psfword, bool knownUpright=true)
Definition: EngNav.cpp:637
gnsstk::EngNav::checkParity
static bool checkParity(const uint32_t input[10], bool knownUpright=true)
Definition: EngNav.cpp:727
gnsstk::EngNav::BitConvertType
BitConvertType
This enumeration is used by the convertXBit() method.
Definition: EngNav.hpp:73
gnsstk::DecodeQuant::powPI
short powPI
Power of PI scale factor.
Definition: EngNav.cpp:72
gnsstk::EngNav::getNMCTValidity
static bool getNMCTValidity(const uint32_t sf2[10], unsigned howWeek, uint32_t &aodo, CommonTime &tnmct, CommonTime &toe, CommonTime &tot)
Definition: EngNav.cpp:851
gnsstk::BinUtils::countBits
unsigned short countBits(uint32_t v)
Definition: BinUtils.hpp:342
LDEXP
#define LDEXP(x, y)
Definition: EngNav.cpp:53
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
gnsstk::PItab
static double PItab[7]
Table of powers of PI, initialized in EngNav().
Definition: EngNav.cpp:359
gnsstk::DecodeQuant::pow2
short pow2
Power of 2 to scale factor.
Definition: EngNav.cpp:71
gnsstk::DecodeBits::startBit
short startBit
Definition: EngNav.cpp:61
gnsstk::DecodeQuant::signq
short signq
0 = unsigned, 1 = signed
Definition: EngNav.cpp:74
gnsstk::EngNav::convertQuant
static void convertQuant(const uint32_t input[10], double output[60], const DecodeQuant &dq) noexcept
Definition: EngNav.cpp:742
gnsstk::EngNav::getd30
static uint32_t getd30(uint32_t sfword)
Definition: EngNav.hpp:134
EngNav.hpp
gnsstk::DecodeBits
DecodeBits .
Definition: EngNav.cpp:59
gnsstk::DecodeBits::numBits
short numBits
Definition: EngNav.cpp:62


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39