0.2.0
Loading...
Searching...
No Matches
NAV::InsTime Class Reference

The class is responsible for all time-related tasks. More...

Public Member Functions

constexpr int differenceToUTC (TimeSystem timesys) const
 Returns the time difference in [s] of a time system and UTC.
 
constexpr bool empty () const
 Checks if the Time object has a value.
 
constexpr InsTime ()=default
 Default Constructor.
 
constexpr InsTime (const InsTime &)=default
 Copy constructor.
 
constexpr InsTime (const InsTime_GPSweekTow &gpsWeekTow, TimeSystem timesys=GPST)
 Constructor.
 
constexpr InsTime (const InsTime_JD &jd, TimeSystem timesys=UTC)
 Constructor.
 
constexpr InsTime (const InsTime_MJD &mjd, TimeSystem timesys=UTC)
 Constructor.
 
constexpr InsTime (const InsTime_YDoySod &yearDoySod, TimeSystem timesys=UTC)
 Constructor.
 
constexpr InsTime (const InsTime_YMDHMS &yearMonthDayHMS, TimeSystem timesys=UTC)
 Constructor.
 
constexpr InsTime (InsTime &&)=default
 Move constructor.
 
constexpr InsTime (int32_t gpsCycle, int32_t gpsWeek, long double tow, TimeSystem timesys=GPST)
 Constructor.
 
constexpr InsTime (int32_t year, int32_t month, int32_t day, int32_t hour, int32_t min, long double sec, TimeSystem timesys=UTC)
 Constructor.
 
constexpr bool isLeapYear () const
 Checks if the current time is a leap year.
 
constexpr uint16_t leapGps2UTC () const
 Returns the current number of leap seconds (offset GPST to UTC)
 
void MakeTimeFromGloOrbit (double UTC_sec)
 Adds the difference [seconds] between toe (OBRIT-0 last element) and toc (ORBIT-0 first element) to the current time (Changes time, so that it corresponds to the time of GLONASS ORBIT last element)
 
 operator std::string () const
 Converts the object into a readable string.
 
constexpr bool operator!= (const InsTime &rhs) const
 Inequal comparison operator (takes double precision into account)
 
constexpr InsTimeoperator+= (const std::chrono::duration< long double > &duration)
 Adds a duration to this time point.
 
constexpr InsTimeoperator-= (const std::chrono::duration< long double > &duration)
 Substracts a duration to this time point.
 
constexpr bool operator< (const InsTime &rhs) const
 Smaller comparison operator (takes double precision into account)
 
constexpr bool operator<= (const InsTime &rhs) const
 Smaller or equal comparison operator (takes double precision into account)
 
constexpr InsTimeoperator= (const InsTime &)=default
 Copy assignment operator.
 
constexpr InsTimeoperator= (InsTime &&)=default
 Move assignment operator.
 
constexpr bool operator== (const InsTime &rhs) const
 Equal comparison operator (takes double precision into account)
 
constexpr bool operator> (const InsTime &rhs) const
 Greater comparison operator (takes double precision into account)
 
constexpr bool operator>= (const InsTime &rhs) const
 Greater or equal comparison operator (takes double precision into account)
 
void reset ()
 Resets the InsTime object.
 
constexpr InsTime toFullDay () const
 Returns the current time rounded/cutted to a full day (changes time to 0:0:0h UTC of current day)
 
constexpr InsTime_GPSweekTow toGPSweekTow (TimeSystem timesys=GPST) const
 Converts this time object into a different format.
 
constexpr InsTime_JD toJD (TimeSystem timesys=UTC) const
 Converts this time object into a different format.
 
constexpr InsTime_MJD toMJD (TimeSystem timesys=UTC) const
 Converts this time object into a different format.
 
constexpr long double toUnixTime () const
 Converts this time object into a UNIX timestamp in [s].
 
constexpr InsTime_YDoySod toYDoySod (TimeSystem timesys=UTC) const
 Converts this time object into a different format.
 
constexpr InsTime_YMDHMS toYMDHMS (TimeSystem timesys=UTC, int digits=-1) const
 Converts this time object into a different format.
 
 ~InsTime ()=default
 Destructor.
 

Static Public Member Functions

static constexpr uint16_t leapGps2UTC (const InsTime &insTime)
 Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime object.
 
static constexpr uint16_t leapGps2UTC (const InsTime_GPSweekTow &gpsWeekTow)
 Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime_GPSweekTow object.
 
static constexpr uint16_t leapGps2UTC (const InsTime_JD &jd)
 Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime_JD object.
 
static constexpr uint16_t leapGps2UTC (const InsTime_MJD &mjd_in)
 Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime_MJD object.
 
static constexpr uint16_t leapGps2UTC (const InsTime_YDoySod &yearDoySod)
 Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime_YDoySod object.
 
static constexpr uint16_t leapGps2UTC (const InsTime_YMDHMS &yearMonthDayHMS)
 Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime_YMDHMS object.
 

Detailed Description

The class is responsible for all time-related tasks.

Constructor & Destructor Documentation

◆ InsTime() [1/7]

constexpr NAV::InsTime::InsTime ( const InsTime_MJD & mjd,
TimeSystem timesys = UTC )
inlineexplicitconstexpr

Constructor.

Parameters
[in]mjdTime in Modified Julien Date
[in]timesysTime System in which the previous values are given in

◆ InsTime() [2/7]

constexpr NAV::InsTime::InsTime ( const InsTime_JD & jd,
TimeSystem timesys = UTC )
inlineexplicitconstexpr

Constructor.

Parameters
[in]jdTime in Julien Date
[in]timesysTime System in which the previous values are given in

◆ InsTime() [3/7]

constexpr NAV::InsTime::InsTime ( const InsTime_GPSweekTow & gpsWeekTow,
TimeSystem timesys = GPST )
inlineexplicitconstexpr

Constructor.

Parameters
[in]gpsWeekTowTime as week and time of week
[in]timesysTime System in which the previous values are given in

◆ InsTime() [4/7]

constexpr NAV::InsTime::InsTime ( const InsTime_YMDHMS & yearMonthDayHMS,
TimeSystem timesys = UTC )
inlineexplicitconstexpr

Constructor.

Parameters
[in]yearMonthDayHMSTime in Universal Time Coordinated
[in]timesysTime System in which the previous values are given in

◆ InsTime() [5/7]

constexpr NAV::InsTime::InsTime ( const InsTime_YDoySod & yearDoySod,
TimeSystem timesys = UTC )
inlineexplicitconstexpr

Constructor.

Parameters
[in]yearDoySodTime as Year, day of year and seconds of day
[in]timesysTime System in which the previous values are given in

◆ InsTime() [6/7]

constexpr NAV::InsTime::InsTime ( int32_t gpsCycle,
int32_t gpsWeek,
long double tow,
TimeSystem timesys = GPST )
inlineconstexpr

Constructor.

Parameters
[in]gpsCycleGPS cycle in GPS standard time
[in]gpsWeekGPS week in GPS standard time
[in]towGPS time of week in GPS standard time
[in]timesysTime System in which the previous values are given in

◆ InsTime() [7/7]

constexpr NAV::InsTime::InsTime ( int32_t year,
int32_t month,
int32_t day,
int32_t hour,
int32_t min,
long double sec,
TimeSystem timesys = UTC )
inlineconstexpr

Constructor.

Parameters
[in]yearYear
[in]monthMonth (1 = January)
[in]dayDay (1 = first day)
[in]hourHour
[in]minMinute
[in]secSecond
[in]timesysTime System in which the previous values are given in

Member Function Documentation

◆ differenceToUTC()

constexpr int NAV::InsTime::differenceToUTC ( TimeSystem timesys) const
inlineconstexpr

Returns the time difference in [s] of a time system and UTC.

Parameters
[in]timesysTime system to get the difference from UTC

◆ isLeapYear()

constexpr bool NAV::InsTime::isLeapYear ( ) const
inlineconstexpr

Checks if the current time is a leap year.

Returns
True if the current time is a leap year, false otherwise

◆ leapGps2UTC() [1/7]

constexpr uint16_t NAV::InsTime::leapGps2UTC ( ) const
inlineconstexpr

Returns the current number of leap seconds (offset GPST to UTC)

Returns
Number of leap seconds

◆ leapGps2UTC() [2/7]

static constexpr uint16_t NAV::InsTime::leapGps2UTC ( const InsTime & insTime)
inlinestaticconstexpr

Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime object.

Parameters
[in]insTimeTime point
Returns
Number of leap seconds

◆ leapGps2UTC() [3/7]

static constexpr uint16_t NAV::InsTime::leapGps2UTC ( const InsTime_GPSweekTow & gpsWeekTow)
inlinestaticconstexpr

Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime_GPSweekTow object.

Parameters
[in]gpsWeekTowTime point
Returns
Number of leap seconds

◆ leapGps2UTC() [4/7]

static constexpr uint16_t NAV::InsTime::leapGps2UTC ( const InsTime_JD & jd)
inlinestaticconstexpr

Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime_JD object.

Parameters
[in]jdTime point
Returns
Number of leap seconds

◆ leapGps2UTC() [5/7]

static constexpr uint16_t NAV::InsTime::leapGps2UTC ( const InsTime_MJD & mjd_in)
inlinestaticconstexpr

Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime_MJD object.

Parameters
[in]mjd_inTime point
Returns
Number of leap seconds

◆ leapGps2UTC() [6/7]

static constexpr uint16_t NAV::InsTime::leapGps2UTC ( const InsTime_YDoySod & yearDoySod)
inlinestaticconstexpr

Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime_YDoySod object.

Parameters
[in]yearDoySodTime point
Returns
Number of leap seconds

◆ leapGps2UTC() [7/7]

static constexpr uint16_t NAV::InsTime::leapGps2UTC ( const InsTime_YMDHMS & yearMonthDayHMS)
inlinestaticconstexpr

Returns the number of leap seconds (offset GPST to UTC) for the provided InsTime_YMDHMS object.

Parameters
[in]yearMonthDayHMSTime point
Returns
Number of leap seconds

◆ MakeTimeFromGloOrbit()

void NAV::InsTime::MakeTimeFromGloOrbit ( double UTC_sec)
inline

Adds the difference [seconds] between toe (OBRIT-0 last element) and toc (ORBIT-0 first element) to the current time (Changes time, so that it corresponds to the time of GLONASS ORBIT last element)

Parameters
[in]UTC_secSeconds in UTC time

◆ operator!=()

constexpr bool NAV::InsTime::operator!= ( const InsTime & rhs) const
inlineconstexpr

Inequal comparison operator (takes double precision into account)

Parameters
[in]rhsRight-hand side to compare with
Returns
Comparison result

◆ operator+=()

constexpr InsTime & NAV::InsTime::operator+= ( const std::chrono::duration< long double > & duration)
inlineconstexpr

Adds a duration to this time point.

Parameters
[in]durationThe duration to add
Returns
Reference to this object

◆ operator-=()

constexpr InsTime & NAV::InsTime::operator-= ( const std::chrono::duration< long double > & duration)
inlineconstexpr

Substracts a duration to this time point.

Parameters
[in]durationThe duration to substract
Returns
Reference to this object

◆ operator<()

constexpr bool NAV::InsTime::operator< ( const InsTime & rhs) const
inlineconstexpr

Smaller comparison operator (takes double precision into account)

Parameters
[in]rhsRight-hand side to compare with
Returns
Comparison result

◆ operator<=()

constexpr bool NAV::InsTime::operator<= ( const InsTime & rhs) const
inlineconstexpr

Smaller or equal comparison operator (takes double precision into account)

Parameters
[in]rhsRight-hand side to compare with
Returns
Comparison result

◆ operator==()

constexpr bool NAV::InsTime::operator== ( const InsTime & rhs) const
inlineconstexpr

Equal comparison operator (takes double precision into account)

Parameters
[in]rhsRight-hand side to compare with
Returns
Comparison result

◆ operator>()

constexpr bool NAV::InsTime::operator> ( const InsTime & rhs) const
inlineconstexpr

Greater comparison operator (takes double precision into account)

Parameters
[in]rhsRight-hand side to compare with
Returns
Comparison result

◆ operator>=()

constexpr bool NAV::InsTime::operator>= ( const InsTime & rhs) const
inlineconstexpr

Greater or equal comparison operator (takes double precision into account)

Parameters
[in]rhsRight-hand side to compare with
Returns
Comparison result

◆ toFullDay()

constexpr InsTime NAV::InsTime::toFullDay ( ) const
inlineconstexpr

Returns the current time rounded/cutted to a full day (changes time to 0:0:0h UTC of current day)

Returns
The rounded/cutted time object

◆ toGPSweekTow()

constexpr InsTime_GPSweekTow NAV::InsTime::toGPSweekTow ( TimeSystem timesys = GPST) const
inlineconstexpr

Converts this time object into a different format.

Parameters
timesysTime System in which the time should be given
Returns
InsTime_GPSweekTow structure of the this object

◆ toJD()

constexpr InsTime_JD NAV::InsTime::toJD ( TimeSystem timesys = UTC) const
inlineconstexpr

Converts this time object into a different format.

Parameters
timesysTime System in which the time should be given
Returns
InsTime_JD structure of the this object

◆ toMJD()

constexpr InsTime_MJD NAV::InsTime::toMJD ( TimeSystem timesys = UTC) const
inlineconstexpr

Converts this time object into a different format.

Parameters
timesysTime System in which the time should be given
Returns
InsTime_MJD structure of the this object

◆ toYDoySod()

constexpr InsTime_YDoySod NAV::InsTime::toYDoySod ( TimeSystem timesys = UTC) const
inlineconstexpr

Converts this time object into a different format.

Parameters
timesysTime System in which the time should be given
Returns
InsTime_YDoySod structure of the this object

◆ toYMDHMS()

constexpr InsTime_YMDHMS NAV::InsTime::toYMDHMS ( TimeSystem timesys = UTC,
int digits = -1 ) const
inlineconstexpr

Converts this time object into a different format.

Parameters
timesysTime System in which the time should be given
digitsAmount of digits for the seconds to round to
Returns
InsTime_YMDHMS structure of the this object

The documentation for this class was generated from the following file: