ORDEpoch.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: ORDEpoch.hpp 330 2006-12-01 15:58:14Z 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 
00045 #ifndef ORDEPOCH_HPP
00046 #define ORDEPOCH_HPP
00047 
00048 #include <map>
00049 #include "Exception.hpp"
00050 #include "ObsRngDev.hpp"
00051 #include "ClockModel.hpp"
00052 #include "SatID.hpp"
00053 
00054 namespace gpstk
00055 {
00056    class ORDEpoch
00057    {
00058    public:
00059       ORDEpoch() : wonky(false) {};
00060 
00062       typedef std::map<SatID, ObsRngDev> ORDMap;
00063 
00064       ORDEpoch& removeORD(const SatID& svid) throw()
00065       {
00066          ORDMap::iterator i = ords.find(svid);
00067          if(i != ords.end())
00068             ords.erase(i);
00069          return *this;
00070       }
00071    
00072       ORDEpoch& applyClockModel(const ClockModel& cm) throw()
00073       {
00074          if (cm.isOffsetValid(time))
00075          {
00076             clockOffset = cm.getOffset(time);
00077             removeOffset(clockOffset);
00078          }
00079          return *this;
00080       }
00081 
00082       ORDEpoch& removeOffset(const double offset) throw()
00083       {
00084          ORDMap::iterator i;
00085          for (i = ords.begin(); i != ords.end(); i++)
00086             i->second.applyClockOffset(offset);
00087          return *this;
00088       }
00089 
00090       vdouble clockOffset;    
00091       vdouble clockResidual;  
00092       ORDMap ords;            
00093       gpstk::DayTime time;
00094       bool wonky;             
00095 
00096       friend std::ostream& operator<<(std::ostream& s, 
00097                                       const ORDEpoch& oe)
00098          throw()
00099       {
00100          s << "t=" << oe.time
00101            << " clk=" << oe.clockOffset << std::endl;
00102          ORDMap::const_iterator i;
00103          for (i=oe.ords.begin(); i!=oe.ords.end(); i++)
00104             s << i->second << std::endl;
00105          return s;
00106       }
00107    
00108    };
00109 
00110    // this is a store of ORDs over time
00111    typedef std::map<gpstk::DayTime, gpstk::ORDEpoch> ORDEpochMap;
00112 }
00113 #endif

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