EngNav.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: EngNav.hpp 3190 2012-07-05 13:27:16Z jwbasden $"
00002 
00003 //============================================================================
00004 //
00005 //  This file is part of GPSTk, the GPS Toolkit.
00006 //
00007 //  The GPSTk is free software; you can redistribute it and/or modify
00008 //  it under the terms of the GNU Lesser General Public License as published
00009 //  by the Free Software Foundation; either version 2.1 of the License, or
00010 //  any later version.
00011 //
00012 //  The GPSTk is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU Lesser General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU Lesser General Public
00018 //  License along with GPSTk; if not, write to the Free Software Foundation,
00019 //  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
00020 //  
00021 //  Copyright 2004, The University of Texas at Austin
00022 //
00023 //============================================================================
00024 
00025 //============================================================================
00026 //
00027 //This software developed by Applied Research Laboratories at the University of
00028 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00029 //Department of Defense. The U.S. Government retains all rights to use,
00030 //duplicate, distribute, disclose, or release this software. 
00031 //
00032 //Pursuant to DoD Directive 523024 
00033 //
00034 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00035 //                           release, distribution is unlimited.
00036 //
00037 //=============================================================================
00038 
00044 #ifndef GPSTK_ENGNAV_HPP
00045 #define GPSTK_ENGNAV_HPP
00046 
00047 
00048 #include <sys/types.h>
00049 #include <ostream>
00050 
00051 #include "gpstkplatform.h"
00052 #include "BinUtils.hpp"
00053 
00054 namespace gpstk
00055 {
00058 
00059    struct DecodeQuant;
00060 
00067    class EngNav
00068    {
00069    public:
00071       enum BitConvertType
00072       {
00073          BITS8 = 0,
00074          BITS10 = 1
00075       };
00076 
00078       EngNav() throw();
00079 
00081       virtual ~EngNav() {}
00082 
00083 
00097       static uint32_t computeParity(uint32_t sfword,
00098                                     uint32_t psfword,
00099                                     bool knownUpright=true);
00100 
00113       static uint32_t fixParity(uint32_t sfword,
00114                                 uint32_t psfword,
00115                                 bool nib);
00116             
00121       static bool checkParity(const uint32_t input[10], bool knownUpright=true);
00122       static bool checkParity(const std::vector<uint32_t>& v, bool knownUpright=true);
00123 
00124 
00126       static bool subframeParity(const long input[10]);
00127 
00128       
00131       static inline uint32_t getd30(uint32_t sfword)
00132       {
00133          return (sfword & 0x01);
00134       }
00135 
00137       static inline uint32_t getd29(uint32_t sfword)
00138       {
00139          return ((sfword & 0x02) >> 1);
00140       }
00141 
00143       static inline unsigned long getHOWTime(uint32_t word2)
00144       {
00145          word2 >>= 13;
00146          word2 &= 0x0001FFFFL;
00147          return word2 * 6;
00148       }
00149 
00151       static inline short getSFID(uint32_t word2)
00152       {
00153          word2 >>= 8;
00154          word2 &= 0x00000007L;
00155          return word2 ;
00156       }
00157 
00158       
00171       static bool subframeConvert(const long input[10], 
00172                                   int gpsWeek,
00173                                   double output[60])
00174          throw();
00175 
00188       static bool subframeConvert(const uint32_t input[10], 
00189                                   short gpsWeek,
00190                                   double output[60])
00191          throw();
00192          
00200       static bool convert8bit(int gpsWeek, double *out)
00201          throw();
00202 
00210       static bool convert10bit(int gpsWeek, double *out)
00211          throw();
00212 
00222       static short convertXBit( short fullGPSWeek, 
00223                                 short incompleteGPSWeek,
00224                                 BitConvertType type);
00225          
00250       static short getSubframePattern(const long input[10])
00251          throw();
00252       static short getSubframePattern(const uint32_t input[10])
00253          throw();
00254       static void dump(std::ostream& s = std::cout);
00255       
00256 
00257    private:
00258 
00277       static void convertQuant(const uint32_t input[10], 
00278                                double output[60],
00279                                DecodeQuant *p)
00280          throw();
00281    }; // class EngNav
00282 
00284 
00285 } // namespace
00286 
00287 #endif

Generated on Thu May 23 03:31:06 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1