00001 #pragma ident "$Id: SVExclusionList.hpp 81 2006-08-10 16:45:12Z ehagen $"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00057 #ifndef GPSTK_SVEXCLUSIONLIST_HPP
00058 #define GPSTK_SVEXCLUSIONLIST_HPP
00059
00060
00061 #include <stdio.h>
00062 #include <fstream>
00063 #include <iostream>
00064
00065
00066 #include <map>
00067
00068
00069 #include "DayTime.hpp"
00070 #include "Exception.hpp"
00071 #include "gps_constants.hpp"
00072
00073 namespace gpstk
00074 {
00075 class SVExclusion
00076 {
00077 public:
00078 SVExclusion( const gpstk::DayTime begin,
00079 const gpstk::DayTime end,
00080 const int PRNID,
00081 const std::string commentArg );
00082 bool isApplicable( const int PRNID, const gpstk::DayTime dt ) const;
00083 std::string getComment() const;
00084 int getPRNID() const;
00085 gpstk::DayTime getBeginTime() const;
00086 gpstk::DayTime getEndTime() const;
00087
00088 protected:
00089 int PRN_IDENTIFIER;
00090 gpstk::DayTime begExclude;
00091 gpstk::DayTime endExclude;
00092 std::string comment;
00093 };
00094
00095
00096
00097
00098 typedef std::multimap< int, SVExclusion >::const_iterator SVXListCI;
00099 typedef std::pair<SVXListCI,SVXListCI> SVXListPair;
00100
00101 class SVExclusionList
00102 {
00103 public:
00104 NEW_EXCEPTION_CLASS( NoSVExclusionFound , gpstk::Exception);
00105 NEW_EXCEPTION_CLASS( SVExclusionFileNotFound , gpstk::Exception);
00106
00107 SVExclusionList( );
00108 SVExclusionList( std::string filename )
00109 throw(SVExclusionFileNotFound);
00110 void addFile( const std::string filename )
00111 throw(SVExclusionFileNotFound);
00112 bool isExcluded( const int PRN, const gpstk::DayTime dt ) const;
00113 void addExclusion( const SVExclusion );
00114 gpstk::DayTime getEarliestTime() const;
00115 gpstk::DayTime getLatestTime() const;
00116 int getNumberOfExclusions() const;
00117 const SVExclusion& getApplicableExclusion(
00118 const int PRN, const gpstk::DayTime dt)
00119 const throw(NoSVExclusionFound);
00120 int numberOfReadFailures() const;
00121 void listOfReadFailures() const;
00122 void listOfReadFailures( FILE* fpout ) const;
00123 void listOfReadFailures( std::ofstream fsout ) const;
00124 void dumpList( FILE* fp ) const;
00125
00126 protected:
00127 gpstk::DayTime earliestTime;
00128 gpstk::DayTime latestTime;
00129 std::multimap< int, SVExclusion > exclusionMap;
00130
00131 std::string timeSpecString;
00132 int readFailCount;
00133 std::list<std::string> readFailList;
00134
00135 std::string buildFailString(const std::string s,
00136 const int lineCount, const std::string filename );
00137 };
00138
00139 inline gpstk::DayTime SVExclusionList::getEarliestTime() const
00140 { return(earliestTime); }
00141 inline gpstk::DayTime SVExclusionList::getLatestTime() const
00142 { return(latestTime); }
00143 inline int SVExclusionList::getNumberOfExclusions() const
00144 { return(exclusionMap.size()); }
00145 inline int SVExclusionList::numberOfReadFailures() const
00146 { return(readFailCount); }
00147
00148 inline std::string SVExclusion::getComment() const {return(comment); }
00149 inline int SVExclusion::getPRNID() const { return(PRN_IDENTIFIER); }
00150 inline gpstk::DayTime SVExclusion::getBeginTime() const { return(begExclude); }
00151 inline gpstk::DayTime SVExclusion::getEndTime() const { return(endExclude); }
00152
00153 }
00154 #endif