EngNav.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: EngNav.hpp 499 2007-04-27 12:02:44Z ocibu $"
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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 
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    }; // class EngNav
00279 
00281 
00282 } // namespace
00283 
00284 #endif

Generated on Thu Sep 9 03:30:52 2010 for GPS ToolKit Software Library by  doxygen 1.3.9.1