Public Member Functions | Public Attributes | List of all members
gnsstk::NavTimeSystemConverter Class Reference

Detailed Description

Define a class for doing time system conversions using navigation messages provided by a NavLibrary object.

Example use:

// Some time to convert
// Construct the time system converter
make_shared<gnsstk::NavTimeSystemConverter>();
// Get a pointer to the NavTimeSystemConverter
NavTimeSystemConverter *ntsc = dynamic_cast<NavTimeSystemConverter*>(
// Construct a NavLibrary object.
ntsc->navLib = make_shared<gnsstk::NavLibrary>();
// Construct a NavDataFactory object
std::make_shared<gnsstk::MultiFormatNavDataFactory>());
// Add the NavDataFactory to the NavLibrary
ntsc->navLib->addFactory(ndfp);
// Add input data (files) to the NavDataFactory
if (!ndfp->addDataSource(inputFileName))
{
cerr << "Unable to load \"" << inputFileName << "\"" << endl;
return false;
}
// Convert the time to UTC
if (!ct.changeTimeSystem(gnsstk::TimeSystem::UTC))
{
cerr << "Unable to change time system to UTC" << endl;
return false;
}
cout << "Time is "
<< gnsstk::printTime("%Y/%02m/%02d %02H:%02M:%02S %P") << endl;

Definition at line 87 of file NavTimeSystemConverter.hpp.

#include <NavTimeSystemConverter.hpp>

Inheritance diagram for gnsstk::NavTimeSystemConverter:
Inheritance graph
[legend]

Public Member Functions

bool getOffset (TimeSystem fromSys, TimeSystem toSys, const CommonTime &t, double &offs) override
 

Public Attributes

std::shared_ptr< NavLibrarynavLib
 Pointer to the nav library from which we will get time offset data. More...
 

Member Function Documentation

◆ getOffset()

bool gnsstk::NavTimeSystemConverter::getOffset ( TimeSystem  fromSys,
TimeSystem  toSys,
const CommonTime t,
double &  offs 
)
overridevirtual

Get the offset in seconds between fromSys and toSys.

Precondition
navLib must be set.
Parameters
[in]fromSysThe time system to convert from.
[in]toSysThe time system to convert to.
[in]tThe time at which the offset is being requested (i.e. the time being converted).
[out]offsThe resulting offset, if available.
Returns
true if successful, false if unavailable.
Note
We use Any health because if someone loads the NavLibrary with only TimeOffset data, there won't be any health to match, resulting in a failure.

Implements gnsstk::TimeSystemConverter.

Definition at line 46 of file NavTimeSystemConverter.cpp.

Member Data Documentation

◆ navLib

std::shared_ptr<NavLibrary> gnsstk::NavTimeSystemConverter::navLib

Pointer to the nav library from which we will get time offset data.

Definition at line 102 of file NavTimeSystemConverter.hpp.


The documentation for this class was generated from the following files:
gnsstk::CommonTime::tsConv
static GNSSTK_EXPORT std::shared_ptr< TimeSystemConverter > tsConv
Definition: CommonTime.hpp:406
gnsstk::GPSWeekSecond
Definition: GPSWeekSecond.hpp:56
gnsstk::NavDataFactoryPtr
std::shared_ptr< NavDataFactory > NavDataFactoryPtr
Managed pointer to NavDataFactory.
Definition: NavDataFactory.hpp:398
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::TimeSystem::UTC
@ UTC
Coordinated Universal Time (e.g., from NTP)
gnsstk::printTime
std::string printTime(const CommonTime &t, const std::string &fmt)
Definition: TimeString.cpp:64


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:45