00001 #pragma ident "$Id: Synchronize.hpp 2584 2011-05-04 01:58:57Z yanweignss $"
00002
00008 #ifndef SYNCHRONIZE_HPP
00009 #define SYNCHRONIZE_HPP
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include <list>
00034 #include "Exception.hpp"
00035 #include "ProcessingClass.hpp"
00036
00037
00038
00039 namespace gpstk
00040 {
00041
00044 NEW_EXCEPTION_CLASS(SynchronizeException, gpstk::Exception);
00045
00046
00049
00050
00147 class Synchronize : public ProcessingClass
00148 {
00149 public:
00150
00152 Synchronize()
00153 : pRinexRef(NULL), pgRov1(NULL), tolerance(1.0),
00154 firstTime(true)
00155 { setIndex(); };
00156
00157
00164 Synchronize( RinexObsStream& rinexObs,
00165 gnssRinex& roverData,
00166 const double tol = 1.0 )
00167 : tolerance(tol), firstTime(true)
00168 { setReferenceSource(rinexObs); setRoverData(roverData); setIndex(); };
00169
00170
00177 Synchronize( RinexObsStream& rinexObs,
00178 gnssSatTypeValue& roverData,
00179 const double tol = 1.0 )
00180 : tolerance(tol), firstTime(true)
00181 { setReferenceSource(rinexObs); setRoverData(roverData); setIndex(); };
00182
00183
00189 virtual gnssSatTypeValue& Process(gnssSatTypeValue& gData)
00190 throw(SynchronizeException);
00191
00192
00198 virtual gnssRinex& Process(gnssRinex& gData)
00199 throw(SynchronizeException);
00200
00201
00203 virtual double getTolerance(void) const
00204 { return tolerance; };
00205
00206
00211 virtual Synchronize& setTolerance(const double tol);
00212
00213
00215 virtual RinexObsStream* getPtrReferenceSource(void) const
00216 { return pRinexRef; };
00217
00218
00223 virtual Synchronize& setReferenceSource(RinexObsStream& rinexObs)
00224 { pRinexRef = &rinexObs; firstTime=true; return (*this); }
00225
00226
00231 virtual Synchronize& setRoverData(gnssRinex& roverData)
00232 { pgRov1 = (gnssSatTypeValue*)(&roverData); return (*this); }
00233
00234
00239 virtual Synchronize& setRoverData(gnssSatTypeValue& roverData)
00240 { pgRov1 = &roverData; return (*this); }
00241
00242
00244 virtual int getIndex(void) const;
00245
00246
00248 virtual std::string getClassName(void) const;
00249
00250
00252 virtual ~Synchronize() {};
00253
00254
00255 protected:
00256
00257 virtual gnssRinex& Process(DayTime time, gnssRinex& gData)
00258 throw(SynchronizeException);
00259
00260
00262 std::list<gnssRinex> gnssRinexBuffer;
00263
00264
00266 RinexObsStream* pRinexRef;
00267
00268
00270 gnssSatTypeValue* pgRov1;
00271
00272
00274 double tolerance;
00275
00277 bool firstTime;
00278
00280 static int classIndex;
00281
00283 int index;
00284
00286 void setIndex(void)
00287 { index = classIndex++; };
00288
00289
00290 };
00291
00293
00294 }
00295 #endif // SYNCHRONIZE_HPP