Decimate.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: Decimate.hpp 1315 2008-07-25 18:35:21Z architest $"
00002 
00008 #ifndef DECIMATE_HPP
00009 #define DECIMATE_HPP
00010 
00011 //============================================================================
00012 //
00013 //  This file is part of GPSTk, the GPS Toolkit.
00014 //
00015 //  The GPSTk is free software; you can redistribute it and/or modify
00016 //  it under the terms of the GNU Lesser General Public License as published
00017 //  by the Free Software Foundation; either version 2.1 of the License, or
00018 //  any later version.
00019 //
00020 //  The GPSTk is distributed in the hope that it will be useful,
00021 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 //  GNU Lesser General Public License for more details.
00024 //
00025 //  You should have received a copy of the GNU Lesser General Public
00026 //  License along with GPSTk; if not, write to the Free Software Foundation,
00027 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //
00029 //  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2008
00030 //
00031 //============================================================================
00032 
00033 
00034 #include "Exception.hpp"
00035 #include "ProcessingClass.hpp"
00036 
00037 
00038 
00039 namespace gpstk
00040 {
00041 
00044     NEW_EXCEPTION_CLASS(DecimateEpoch, gpstk::Exception);
00045 
00046 
00049 
00050 
00148    class Decimate : public ProcessingClass
00149    {
00150    public:
00151 
00153       Decimate()
00154          : sampling(30.0),tolerance(0.5),lastEpoch(DayTime::BEGINNING_OF_TIME)
00155       { setIndex(); };
00156 
00157 
00164       Decimate( const double sampleInterval,
00165                 const double tol,
00166                 const DayTime& initialEpoch )
00167          : sampling(sampleInterval), tolerance(tol), lastEpoch(initialEpoch)
00168       { setIndex(); };
00169 
00170 
00177       virtual satTypeValueMap& Process( const DayTime& time,
00178                                         satTypeValueMap& gData )
00179          throw(DecimateEpoch);
00180 
00181 
00187       virtual gnssSatTypeValue& Process(gnssSatTypeValue& gData)
00188          throw(DecimateEpoch)
00189       { Process(gData.header.epoch, gData.body); return gData; };
00190 
00191 
00197       virtual gnssRinex& Process(gnssRinex& gData)
00198          throw(DecimateEpoch)
00199       { Process(gData.header.epoch, gData.body); return gData; };
00200 
00201 
00203       virtual double getSampleInterval(void) const
00204       { return sampling; };
00205 
00206 
00211       virtual Decimate& setSampleInterval(const double sampleInterval);
00212 
00213 
00215       virtual double getTolerance(void) const
00216       { return tolerance; };
00217 
00218 
00223       virtual Decimate& setTolerance(const double tol);
00224 
00225 
00230       virtual Decimate& setInitialEpoch(const DayTime& initialEpoch)
00231       { lastEpoch = initialEpoch; return (*this); };
00232 
00233 
00235       virtual int getIndex(void) const;
00236 
00237 
00239       virtual std::string getClassName(void) const;
00240 
00241 
00243       virtual ~Decimate() {};
00244 
00245 
00246    private:
00247 
00248 
00250       double sampling;
00251 
00253       double tolerance;
00254 
00256       DayTime lastEpoch;
00257 
00259       static int classIndex;
00260 
00262       int index;
00263 
00265       void setIndex(void)
00266       { index = classIndex++; };
00267 
00268 
00269    }; // End of class 'Decimate'
00270 
00272 
00273 }  // End of namespace gpstk
00274 #endif   // DECIMATE_HPP

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