00001 #pragma ident "$Id: EngNav.hpp 499 2007-04-27 12:02:44Z ocibu $"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00044 #ifndef GPSTK_ENGNAV_HPP
00045 #define GPSTK_ENGNAV_HPP
00046
00047
00048 #include <sys/types.h>
00049
00050 #include "gpstkplatform.h"
00051 #include "BinUtils.hpp"
00052
00053 namespace gpstk
00054 {
00057
00058 struct DecodeQuant;
00059
00066 class EngNav
00067 {
00068 public:
00070 enum BitConvertType
00071 {
00072 BITS8 = 0,
00073 BITS10 = 1
00074 };
00075
00077 EngNav() throw();
00078
00080 virtual ~EngNav() {}
00081
00082
00096 static uint32_t computeParity(uint32_t sfword,
00097 uint32_t psfword,
00098 bool knownUpright=true);
00099
00112 static uint32_t fixParity(uint32_t sfword,
00113 uint32_t psfword,
00114 bool nib);
00115
00120 static bool checkParity(const uint32_t input[10], bool knownUpright=true);
00121 static bool checkParity(const std::vector<uint32_t>& v, bool knownUpright=true);
00122
00123
00125 static bool subframeParity(const long input[10]);
00126
00127
00130 static inline uint32_t getd30(uint32_t sfword)
00131 {
00132 return (sfword & 0x01);
00133 }
00134
00136 static inline uint32_t getd29(uint32_t sfword)
00137 {
00138 return ((sfword & 0x02) >> 1);
00139 }
00140
00142 static inline unsigned long getHOWTime(uint32_t word2)
00143 {
00144 word2 >>= 13;
00145 word2 &= 0x0001FFFFL;
00146 return word2 * 6;
00147 }
00148
00150 static inline short getSFID(uint32_t word2)
00151 {
00152 word2 >>= 8;
00153 word2 &= 0x00000007L;
00154 return word2 ;
00155 }
00156
00157
00170 static bool subframeConvert(const long input[10],
00171 int gpsWeek,
00172 double output[60])
00173 throw();
00174
00187 static bool subframeConvert(const uint32_t input[10],
00188 short gpsWeek,
00189 double output[60])
00190 throw();
00191
00199 static bool convert8bit(int gpsWeek, double *out)
00200 throw();
00201
00209 static bool convert10bit(int gpsWeek, double *out)
00210 throw();
00211
00221 static short convertXBit( short fullGPSWeek,
00222 short incompleteGPSWeek,
00223 BitConvertType type);
00224
00249 static short getSubframePattern(const long input[10])
00250 throw();
00251 static short getSubframePattern(const uint32_t input[10])
00252 throw();
00253
00254 private:
00255
00274 static void convertQuant(const uint32_t input[10],
00275 double output[60],
00276 DecodeQuant *p)
00277 throw();
00278 };
00279
00281
00282 }
00283
00284 #endif