00001 #pragma ident "$Id: GPSWeekSecond.hpp 3140 2012-06-18 15:03:02Z susancummins $"
00002
00003
00004
00005 #ifndef GPSTK_GPSWEEKSECOND_HPP
00006 #define GPSTK_GPSWEEKSECOND_HPP
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #include "GPSWeek.hpp"
00045 #include "TimeConstants.hpp"
00046 #include "TimeSystem.hpp"
00047
00048 namespace gpstk
00049 {
00054 class GPSWeekSecond : public GPSWeek
00055 {
00056 public:
00066 GPSWeekSecond( unsigned int w = 0,
00067 double s = 0.,
00068 TimeSystem ts = TimeSystem::Unknown )
00069 throw()
00070 : GPSWeek(w), sow(s)
00071 { timeSystem = ts; }
00072
00077 GPSWeekSecond( const GPSWeekSecond& right )
00078 throw()
00079 : GPSWeek( right ), sow( right.sow )
00080 { timeSystem = right.timeSystem; }
00081
00089 GPSWeekSecond( const TimeTag& right )
00090 throw( gpstk::InvalidRequest )
00091 {
00092 convertFromCommonTime( right.convertToCommonTime() );
00093 }
00094
00102 GPSWeekSecond( const CommonTime& right )
00103 throw( gpstk::InvalidRequest )
00104 {
00105 convertFromCommonTime( right );
00106 }
00107
00113 GPSWeekSecond& operator=( const GPSWeekSecond& right )
00114 throw();
00115
00117 virtual ~GPSWeekSecond()
00118 throw()
00119 {}
00121
00122
00123 virtual CommonTime convertToCommonTime() const
00124 throw( gpstk::InvalidRequest );
00125
00126 virtual void convertFromCommonTime( const CommonTime& ct )
00127 throw( gpstk::InvalidRequest );
00128
00131 virtual std::string printf( const std::string& fmt ) const
00132 throw( gpstk::StringUtils::StringException );
00133
00136 virtual std::string printError( const std::string& fmt ) const
00137 throw( gpstk::StringUtils::StringException );
00138
00145 virtual bool setFromInfo( const IdToValue& info )
00146 throw();
00147
00150 virtual std::string getPrintChars() const
00151 throw()
00152 {
00153 return GPSWeek::getPrintChars() + "wg";
00154 }
00155
00157 virtual std::string getDefaultFormat() const
00158 throw()
00159 {
00160 return GPSWeek::getDefaultFormat() + " %010.3g %P";
00161 }
00162
00163 virtual bool isValid() const
00164 throw();
00165
00166 virtual void reset()
00167 throw();
00168
00169 inline virtual unsigned int getDayOfWeek() const
00170 throw()
00171 {
00172 return static_cast<unsigned int>(sow) / SEC_PER_DAY;
00173 }
00174
00183 bool operator==( const GPSWeekSecond& right ) const
00184 throw();
00185 bool operator!=( const GPSWeekSecond& right ) const
00186 throw();
00187 bool operator<( const GPSWeekSecond& right ) const
00188 throw();
00189 bool operator>( const GPSWeekSecond& right ) const
00190 throw();
00191 bool operator<=( const GPSWeekSecond& right ) const
00192 throw();
00193 bool operator>=( const GPSWeekSecond& right ) const
00194 throw();
00196
00197 double sow;
00198 };
00199
00200 }
00201
00202 #endif // GPSTK_GPSWEEKSECOND_HPP