MDPObsEpoch.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: MDPObsEpoch.hpp 1202 2008-04-17 12:35:36Z 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 MDPOBSEPOCH_HPP
00040 #define MDPOBSEPOCH_HPP
00041 
00042 #include <map>
00043 
00044 #include "MDPHeader.hpp"
00045 #include "miscenum.hpp"
00046 
00047 namespace gpstk
00048 {
00051    class MDPObsEpoch : public MDPHeader
00052    {
00053    public:
00054       // A helper class to hold a single code/carrier block of observations
00055       class Observation
00056       {
00057       public:
00058          Observation() throw(): carrier(ccUnknown), range(rcUnknown),bw(0),
00059             snr(0), lockCount(0), pseudorange(0), phase(0), doppler(0) {}
00060 
00061          void dump(std::ostream& out) const throw();
00062          std::string encode() const throw();
00063 
00064          // Note that this is a destructive decode, unlike the others in this
00065          //  set of classes.
00066          void decode(std::string& str) throw();
00067   
00068          CarrierCode carrier;     
00069          RangeCode range;         
00070          unsigned bw;             
00071          double snr;              
00072          unsigned long lockCount; 
00073 
00074          double pseudorange;      
00075          double phase;            
00076          double doppler;          
00077 
00078       };
00079 
00080       MDPObsEpoch() throw();
00081 
00085       virtual std::string encode() const
00086          throw();
00087          
00092       virtual void decode(std::string str)
00093          throw();
00094          
00095       virtual std::string getName() const {return "obs";};
00096 
00100       void dump(std::ostream& out) const throw();
00101 
00102       typedef std::pair<CarrierCode, RangeCode> ObsKey;
00103       typedef std::map<ObsKey, Observation> ObsMap;
00104    
00105       unsigned numSVs;      
00106       unsigned channel;     
00107       unsigned prn;         
00108       unsigned status;      
00109       double elevation;     
00110       double azimuth;       
00111 
00112       ObsMap obs;          
00113 
00114       bool haveObservation(const CarrierCode cc, const RangeCode rc) const;
00115       Observation getObservation(const CarrierCode cc, const RangeCode rc) 
00116          const;
00117 
00118       bool haveObservation(const ObsKey& ok) const
00119       {return haveObservation(ok.first, ok.second);}
00120 
00121       Observation getObservation(const ObsKey& ok) const
00122       {return getObservation(ok.first, ok.second);}
00123 
00124       static const unsigned myId = 300;
00125       // This is just the pre obs_block stuff
00126       static const unsigned myLength = 8;
00127       // This is the size of a single obs_block
00128       static const unsigned myObsLength=32;
00129    }; // class MDPObsEpoch
00130 
00131    // The key is intended to the PRN of the MDPObsEpoch
00132    typedef std::multimap<int, gpstk::MDPObsEpoch> MDPEpoch;
00133    // This is useful when finding all obs from a prn
00134    // BTW, MCIP stands for MDPEPoch const interator pair
00135    typedef std::pair<MDPEpoch::const_iterator, MDPEpoch::const_iterator> MCIP;
00136 
00137    void dump(std::ostream& out, const MDPEpoch& me);
00138 
00139    FFStream& operator>>(FFStream& s, MDPEpoch& oe);
00140    FFStream& operator<<(FFStream& s, const MDPEpoch& oe);
00141 
00142 } // namespace gpstk
00143 
00144 #endif //MDPOBSEPOCH_HPP

Generated on Tue May 22 03:30:59 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1