Class TimeKeeper#

Inheritance Relationships#

Base Type#

Class Documentation#

class TimeKeeper : public Karana::Core::Base#

Keeps track of time.

Public Functions

TimeKeeper(const kc::ks_ptr<kf::FrameContainer> &fc)#

Constructor.

Parameters:

fc – FrameContainer. Used to update ephemeris in derived classes. The _initial_ephemeris will also be set to the FrameContainer’s current ephemeris.

TimeKeeper(const TimeKeeper &other)#

Copy constructor.

Parameters:

other – The TimeKeeper instance to copy from.

const km::Ktime &getTime() const#

Get the time from TimeKeeper.

Returns:

The current time.

virtual void setTime(const km::Ktime &time)#

Set the TimeKeeper’s time.

Parameters:

time – The current time.

virtual bool isReady() const override#

Determine if the TimeKeeper is initialized.

Returns:

true if initialized, false otherwise.

void setInitialEphemeris(double initial_ephemeris)#

Set the initial ephemeris.

Parameters:

initial_ephemeris – The initial ephemeris.

void setInitialEphemeris(const std::string &utc_time)#

Set the initial ephemeris.

Parameters:

utc_time – The UTC time as a string in the form “YYYY-MM-DDThh:mm:ss.ss” where Y is the year, M is the month, D is the day, h is the hour, m is the minute, and s is the second. The seconds can have decimals.

Public Static Functions

static double utcTimeToEphemeris(const std::string &utc_time)#

Convert a time in UTC to an ephemeris.

Parameters:

utc_time – The utc_time given as a string in the form “YYYY-MM-DDThh:mm:ss.ss” where Y is the year, M is the month, D is the day, h is the hour, m is the minute, and s is the second. The seconds can have decimals.

Returns:

The utc_time as an ephemeris.

Protected Attributes

km::Ktime _time#

The current time.

kc::ks_ptr<kf::FrameContainer> _fc#

The FrameContainer to keep in sync.

double _initial_ephemeris = km::notReadyNaN#

Initial ephemeris.