AshtechMBEN.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: AshtechMBEN.hpp 816 2007-10-09 14:02:42Z 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 
00039 #ifndef ASHTECHMBEN_HPP
00040 #define ASHTECHMBEN_HPP
00041 
00047 #include <map>
00048 #include <iostream>
00049 
00050 #include "AshtechData.hpp"
00051 
00052 namespace gpstk
00053 {
00054    class AshtechMBEN : public AshtechData
00055    {
00056    public:
00057 
00058       AshtechMBEN() {};
00059 
00060       std::string header; // 11 characters exactly
00061       unsigned seq;     // sow in units of 50 ms, modulo 36,000
00062                         // (36,000 * 50 ms = 30 minutes)
00063       unsigned left;
00064       unsigned svprn; // the PRN of the tracked satellite
00065       unsigned el;    // degrees
00066       unsigned az;    // degrees
00067       unsigned chid;  // 1..12
00068 
00069       struct code_block
00070       {
00071          // Warning flag, a bit packed field
00072          // bits 1&2: 0 same as goodbad=22, 1 same as goodbad=23,
00073          //           3 same as goodbad=24
00074          // bit 3: carrier phase questionable
00075          // bit 4: code phase questionable
00076          // bit 5: code phase integration not stable
00077          // bit 6: Z tracking mode
00078          // bit 7: possible lock of lock
00079          // bit 8: loss of lock counter reset
00080          unsigned  warning;
00081          // Measurement quality
00082          // 0: measurement not available
00083          // 22: code and or carrier phase measured
00084          //     P mode tracking on Z(Y)-12 units
00085          // 23: 22 + nav msg obtained + obs NOT used in PVT computation
00086          // 24: 22 + nav msg obtained + obs used in PVT computation
00087          //     Y mode tracking on Z(Y)-12 units
00088          // 25: Z mode tracking on Z(Y)-12 units
00089          unsigned  goodbad;
00090          unsigned  polarity_known;  // 'spare' in the ashtech docs
00091          unsigned  ireg;       // SNR in custom units
00092          unsigned  qa_phase;   // phase quality 0..5 and 95..100 are good
00093          double    full_phase; // cycles
00094          double    raw_range;  // seconds
00095          double    doppler;    // Hz
00096          double    smoothing;  // meters
00097          unsigned  smooth_cnt; //
00098 
00099          virtual void decodeASCII(std::stringstream& str)
00100             throw(std::exception, FFStreamError);
00101          virtual void decodeBIN(std::string& str)
00102             throw(std::exception, FFStreamError);
00103          float snr(float chipRate) const throw();
00104          void dump(std::ostream& out) const;
00105       };
00106          
00107       // The remaining block is repeated repeated three times for an MPC but
00108       // only appears once for an MCA
00109       code_block ca;
00110       code_block p1;
00111       code_block p2;
00112          
00113       static const char *mpcId, *mcaId;
00114 
00115       virtual std::string getName() const {return "mben";}
00116       
00117       virtual bool checkId(std::string hdrId) const
00118       {return hdrId==mpcId || hdrId==mcaId;}
00119 
00120       void dump(std::ostream& out) const throw();
00121       virtual void decode(const std::string& data) 
00122          throw(std::exception, FFStreamError);
00123 
00124    protected:
00125       virtual void reallyGetRecord(FFStream& ffs)
00126          throw(std::exception, FFStreamError, EndOfFile);
00127    };
00128 } // namespace gpstk
00129 
00130 #endif

Generated on Thu Feb 9 03:30:54 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1