Go to the documentation of this file.
68 unsigned lastDay = (
epoch == 27 ? 365 : 366);
74 else if (
day <= (lastDay + 365))
79 else if (
day <= (lastDay + 730))
82 doy =
day - (lastDay + 365);
87 doy =
day - (lastDay + 730);
89 unsigned year = 1996 + 4*(
epoch-1) + (J - 1);
101 catch (InvalidParameter& ip)
103 InvalidRequest ir(ip);
112 long jday = 0, secDay = 0;
113 double fsecDay = 0.0;
115 sod =
static_cast<double>(secDay) + fsecDay;
117 int cvtYear = 0, cvtMonth = 0, cvtDay = 0;
121 InvalidRequest ir(
"Unable to represent years < 1996 in GLONASS time");
124 epoch = 1 + ((cvtYear - 1996) >> 2);
127 unsigned J = ((cvtYear-1996) % 4);
131 unsigned leapYear = cvtYear - (cvtYear % 4);
132 unsigned leapDay = (((leapYear % 400) == 0) ||
133 ((leapYear % 100) != 0));
136 day = leapDay + (J * 365);
165 if (
day < right.
day)
return true;
166 if (right.
day <
day)
return false;
167 if (
sod < right.
sod)
return true;
178 if (right.
day <
day)
return true;
179 if (
day < right.
day)
return false;
180 if (right.
sod <
sod)
return true;
191 if (
day < right.
day)
return true;
192 if (right.
day <
day)
return false;
193 if (
sod < right.
sod)
return true;
194 if (right.
sod <
sod)
return false;
205 if (right.
day <
day)
return true;
206 if (
day < right.
day)
return false;
207 if (right.
sod <
sod)
return true;
208 if (
sod < right.
sod)
return false;
217 return ((
day <= 1461) && (
sod >= 0.0) && (
sod < 86400.0));
static const GNSSTK_EXPORT double eps
Default tolerance for time equality in days.
bool operator>(const GLONASSTime &right) const
unsigned epoch
Number of leap years since 1996 (aka N4).
bool operator==(const GLONASSTime &right) const
CommonTime convertToCommonTime() const override
As it says, convert to a CommonTime object.
void convertFromCommonTime(const CommonTime &ct) override
As it says, convert from a CommonTime object.
void convertJDtoCalendar(long jd, int &iyear, int &imonth, int &iday)
bool isValid() const override
Returns true if this object's members are valid, false otherwise.
bool operator>=(const GLONASSTime &right) const
void reset() override
Reset this object to the default state.
TimeSystem
Definition of various time systems.
void get(long &day, long &sod, double &fsod, TimeSystem &timeSystem) const
@ GLO
GLONASS system time (aka UTC(SU))
bool operator<(const GLONASSTime &right) const
double sod
Time of day (seconds of day, aka tb).
#define GNSSTK_THROW(exc)
long convertCalendarToJD(int yy, int mm, int dd)
bool operator<=(const GLONASSTime &right) const
GLONASSTime(unsigned leapCount=0, unsigned days=0, double instant=0., TimeSystem ts=TimeSystem::GLO)
bool operator!=(const GLONASSTime &right) const
const double GLO_EPOCH_JD
'Julian day' of GLONASS epoch (Jan. 1, 1996).
CommonTime & set(long day, long sod, double fsod=0.0, TimeSystem timeSystem=TimeSystem::Unknown)
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39