Go to the documentation of this file.
65 const std::string& fmt )
70 try {rv =
ANSITime(t).
printf( rv );}
catch (gnsstk::InvalidRequest e){};
71 try {rv =
CivilTime(t).
printf( rv );}
catch (gnsstk::InvalidRequest e){};
75 try {rv =
MJD(t).
printf( rv );}
catch (gnsstk::InvalidRequest e){};
76 try {rv =
UnixTime(t).
printf( rv );}
catch (gnsstk::InvalidRequest e){};
77 try {rv =
PosixTime(t).
printf( rv );}
catch (gnsstk::InvalidRequest e){};
78 try {rv =
YDSTime(t).
printf( rv );}
catch (gnsstk::InvalidRequest e){};
85 catch( gnsstk::StringUtils::StringException&
se )
101 TimeTag::getInfo( str, fmt, info );
115 catch( gnsstk::InvalidRequest& ir )
119 catch( gnsstk::StringUtils::StringException&
se )
135 TimeTag::getInfo( str, fmt, info );
138 bool hmjd(
false ), hsow(
false ), hweek(
false ), hfullweek(
false ),
139 hdow(
false ), hyear(
false ), hmonth(
false ), hday(
false ),
140 hzcount(
false ), hdoy(
false ), hzcount29(
false ),
141 hzcount32(
false ), hhour(
false ), hmin(
false ), hsec(
false ),
142 hsod(
false ), hunixsec(
false ), hunixusec(
false ),
143 hepoch(
false ), hansi(
false ), hjulian(
false ),
144 hbdsw(
false ), hqzsw(
false ), hgalw(
false ), hirnw(
false ),
145 hbdsfw(
false ), hqzsfw(
false ), hgalfw(
false ), hirnfw(
false ),
146 hbdse(
false ), hqzse(
false ), hgale(
false), hirne(
false ),
147 hposixsec(
false ), hposixnsec(
false );
153 for( TimeTag::IdToValue::iterator itr = info.begin();
154 itr != info.end(); itr++ )
181 idow =
asInt( itr->second );
211 string thisDay =
firstWord( itr->second );
213 if (
isLike(thisDay,
"sun.*")) idow = 0;
214 else if (
isLike(thisDay,
"mon.*")) idow = 1;
215 else if (
isLike(thisDay,
"tue.*")) idow = 2;
216 else if (
isLike(thisDay,
"wed.*")) idow = 3;
217 else if (
isLike(thisDay,
"thu.*")) idow = 4;
218 else if (
isLike(thisDay,
"fri.*")) idow = 5;
219 else if (
isLike(thisDay,
"sat.*")) idow = 6;
250 info[
'S'] = info[
'f'];
289 case 'R': hepoch = hbdse =
true;
break;
290 case 'T': hepoch = hgale =
true;
break;
291 case 'V': hepoch = hqzse =
true;
break;
292 case 'X': hepoch = hirne =
true;
break;
294 case 'D': hfullweek = hbdsfw =
true;
break;
295 case 'e': hweek = hbdsw =
true;
break;
296 case 'L': hfullweek = hgalfw =
true;
break;
297 case 'l': hweek = hgalw =
true;
break;
298 case 'h': hfullweek = hqzsfw =
true;
break;
299 case 'i': hweek = hqzsw =
true;
break;
300 case 'O': hfullweek = hirnfw =
true;
break;
301 case 'o': hweek = hirnw =
true;
break;
331 if( hhour && hmin && hsec )
344 (hfullweek && (hzcount || hzcount29)) ||
345 (hepoch && (hzcount29 ||
346 (hweek && hzcount))) )
354 if ( (hepoch && hweek) || hfullweek )
370 else if( hhour && hmin && hsec )
407 if( hunixsec || hunixusec )
415 if( hposixsec || hposixnsec )
423 InvalidRequest ir(
"Incomplete time specification for readTime");
426 catch( gnsstk::StringUtils::StringException&
se )
442 TimeTag::getInfo( str, fmt, info );
445 bool hsow(
false ), hweek(
false ), hfullweek(
false ),
446 hdow(
false ), hyear(
false ), hmonth(
false ), hday(
false ),
447 hzcount(
false ), hdoy(
false ), hzcount29(
false ),
448 hhour(
false ), hmin(
false ), hsec(
false ),
449 hsod(
false ), hepoch(
false ),
451 hbdsw(
false ), hqzsw(
false ), hgalw(
false ), hirnw(
false ),
452 hbdsfw(
false ), hqzsfw(
false ), hgalfw(
false ), hirnfw(
false ),
453 hbdse(
false ), hqzse(
false ), hgale(
false ), hirne(
false );
460 double isow, isod, isec;
461 int iweek, ifullweek, idow, iyear, imonth, iday, izcount, idoy,
462 izcount29, ihour, imin, iepoch;
465 for( TimeTag::IdToValue::iterator itr = info.begin();
466 itr != info.end(); itr++ )
514 izcount =
asInt(itr->second);
528 idow =
asInt(itr->second);
534 iweek =
asInt(itr->second);
539 ifullweek =
asInt(itr->second);
544 idoy =
asInt(itr->second);
549 imonth = CivilTime::monthAbbrev(itr->second);
554 exc(
"Invalid month abbreviation: " + itr->second);
561 imonth = CivilTime::monthLong(itr->second);
566 exc(
"Invalid month name: " + itr->second);
573 iyear =
asInt(itr->second);
585 if( itr->second.length() > 2)
589 exc(
"Invalid format for %y: expected 2 digits");
592 iyear =
asInt( itr->second );
603 string thisDay =
firstWord( itr->second );
605 if (
isLike(thisDay,
"sun.*")) idow = 0;
606 else if (
isLike(thisDay,
"mon.*")) idow = 1;
607 else if (
isLike(thisDay,
"tue.*")) idow = 2;
608 else if (
isLike(thisDay,
"wed.*")) idow = 3;
609 else if (
isLike(thisDay,
"thu.*")) idow = 4;
610 else if (
isLike(thisDay,
"fri.*")) idow = 5;
611 else if (
isLike(thisDay,
"sat.*")) idow = 6;
617 imonth =
asInt(itr->second);
622 iday =
asInt(itr->second);
627 ihour =
asInt(itr->second);
632 imin =
asInt(itr->second);
647 izcount29 =
asInt(itr->second);
652 iepoch =
asInt(itr->second);
656 hepoch = hbdse =
true;
657 iepoch =
asInt(itr->second);
661 hepoch = hgale =
true;
662 iepoch =
asInt(itr->second);
666 hepoch = hqzse =
true;
667 iepoch =
asInt(itr->second);
671 hepoch = hirne =
true;
672 iepoch =
asInt(itr->second);
675 case 'D': hfullweek = hbdsfw =
true;
break;
676 case 'e': hweek = hbdsw =
true;
break;
677 case 'L': hfullweek = hgalfw =
true;
break;
678 case 'l': hweek = hgalw =
true;
break;
679 case 'I': hfullweek = hqzsfw =
true;
break;
680 case 'i': hweek = hqzsw =
true;
break;
681 case 'O': hfullweek = hirnfw =
true;
break;
682 case 'o': hweek = hirnw =
true;
break;
691 bool hbds(hbdse || hbdsfw || hbdsw);
692 bool hgal(hgale || hgalfw || hgalw);
693 bool hqzs(hqzse || hqzsfw || hqzsw);
694 bool hirn(hirne || hirnfw || hirnw);
744 ptt->
week = ifullweek;
749 ptt->
week = ifullweek;
852 catch( gnsstk::StringUtils::StringException&
se )
long asInt(const std::string &s)
double se
obliquity cos, T*cos, sin coefficients
virtual CommonTime convertToCommonTime() const
virtual CommonTime convertToCommonTime() const
virtual bool setFromInfo(const IdToValue &info)
void scanTime(CommonTime &t, const string &str, const string &fmt)
virtual std::string printf(const std::string &fmt) const
const Epoch BEGINNING_OF_TIME(CommonTime::BEGINNING_OF_TIME)
Earliest representable Epoch.
const long SEC_PER_DAY
Seconds per day.
virtual void convertFromCommonTime(const CommonTime &ct)
GPSWeekZcount & setZcount32(unsigned int z)
virtual bool setFromInfo(const IdToValue &info)
virtual std::string printf(const std::string &fmt) const
long double asLongDouble(const std::string &s)
virtual std::string printf(const std::string &fmt) const
virtual CommonTime convertToCommonTime() const
virtual bool setFromInfo(const IdToValue &info)
virtual CommonTime convertToCommonTime() const
CommonTime & setTimeSystem(TimeSystem timeSystem)
virtual void setEpoch(unsigned int e)
virtual std::string printf(const std::string &fmt) const
virtual CommonTime convertToCommonTime() const
virtual void setModWeek(unsigned int w)
void mixedScanTime(CommonTime &t, const string &str, const string &fmt)
virtual bool setFromInfo(const IdToValue &info)
virtual CommonTime convertToCommonTime() const
virtual bool setFromInfo(const IdToValue &info)
virtual std::string printf(const std::string &fmt) const
TimeSystem asTimeSystem(const std::string &s)
Convert a string representation of TimeSystem to an enum.
virtual std::string printf(const std::string &fmt) const
virtual std::string printf(const std::string &fmt) const
virtual std::string printf(const std::string &fmt) const
void convertSODtoTime(double sod, int &hh, int &mm, double &sec)
TimeSystem
Definition of various time systems.
virtual bool setFromInfo(const IdToValue &info)
int week
Full week number.
double asDouble(const std::string &s)
#define GNSSTK_RETHROW(exc)
virtual CommonTime convertToCommonTime() const
virtual CommonTime convertToCommonTime() const
virtual bool setFromInfo(const IdToValue &info)
bool isLike(const std::string &s, const std::string &aPattern, const char zeroOrMore=' *', const char oneOrMore='+', const char anyChar='.')
TimeSystem getTimeSystem() const
Obtain time system info (enum).
std::string printTime(const CommonTime &t, const std::string &fmt)
virtual std::string printf(const std::string &fmt) const
std::string firstWord(const std::string &s, const char delimiter=' ')
virtual std::string printf(const std::string &fmt) const
#define GNSSTK_THROW(exc)
virtual std::string printf(const std::string &fmt) const
GPSWeekZcount & setZcount29(unsigned int z)
double convertTimeToSOD(int hh, int mm, double sec)
virtual CommonTime convertToCommonTime() const
virtual bool setFromInfo(const IdToValue &info)
std::string & lowerCase(std::string &s)
virtual std::string printf(const std::string &fmt) const
virtual std::string printf(const std::string &fmt) const
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:42