![]() |
ModelSpace
Documentation for ModelSpace models and classes.
|
Class to manage time for the simulation object. More...
#include <SimTimeManager.h>

Public Member Functions | |
| SimTimeManager () | |
| Base constructor – time manager should initialize to zeros and then be set. More... | |
| virtual | ~SimTimeManager () |
| void | stepTime (const clockwerk::Time &step) |
| Function to increment all times. More... | |
| void | updateStep (const clockwerk::Time &step) |
| Function to increment step start and end time. More... | |
| clockwerk::Time | wallClockTimer () |
| Function to return the wall clock time since run start. More... | |
| double | str2tdb (const std::string &time_input) |
| std::string | tdbTime () |
| Function to return the TDB time as a string. More... | |
| std::string | utcTime () |
| Function to return the TDB time as a string. More... | |
| std::string | jdTime () |
| Function to return the Julian date as a string. More... | |
| std::string | gpsTime () |
| Function to return the GPS time as a string. More... | |
| double | decimalYear () |
| Function to return the decimal year as a double. More... | |
| void | setTime (const std::string &time_input=DEFAULT_SIMULATION_TIME) |
| Function to set time by string input. More... | |
| bool | wallClockIsStarted () |
| Function to return whether the wall clock timer is started. More... | |
Public Member Functions inherited from clockwerk::GraphTreeObject | |
| GraphTreeObject (const char *gt_nme="", GraphTreeObject **storage_array=nullptr, uint32 storage_size=0) | |
| Name-based constructor for GraphTreeObject which will have no children by default. More... | |
| virtual | ~GraphTreeObject () |
| Destructor. More... | |
| GraphTreeObject * | parent () |
| Functions to get object's parent/children. More... | |
| GraphTreeObject ** | children () |
| GraphTreeObject * | childAtIndex (uint8 i) const |
| int16 | parent (GraphTreeObject *new_parent) |
| Function to assign the node's parent via pointer. More... | |
| int16 | parent (GraphTreeObject &new_parent) |
| Function to assign the node's parent via reference. More... | |
| uint8 | nChildren () const |
| Getters for number of children and descendants. More... | |
| uint16 | nDescendants () const |
| uint8 | capacity () const |
| const char * | name () const |
| Getter and setter for object name. More... | |
| int16 | name (const char *new_name) |
| uint8 | rank () |
| Getter for the object rank. More... | |
| int8 | type () |
| Function to indicate type – -1 by default unless implemented downstream. More... | |
| bool | loggable () |
| Getter for object logability flag – note no setter because should only be set by this or a derived class in its definition. More... | |
| GraphTreeObject * | getRootDataPointer () |
| Get the pointer to the highest object in the graph tree. More... | |
| virtual int16 | str (char *output, size_t size) const |
| Get object represented as string. More... | |
| virtual int16 | fromStr (const char *val) |
| Set value of graphtreeobject from string. More... | |
Public Attributes | |
| clockwerk::DataIO< clockwerk::Time > | step_start_time = clockwerk::DataIO<clockwerk::Time>(this, "step_start_time") |
| clockwerk::DataIO< clockwerk::Time > | step_end_time = clockwerk::DataIO<clockwerk::Time>(this, "step_end_time") |
| This is the time at the end of a given scheduler step. More... | |
| clockwerk::DataIO< clockwerk::Time > | base_time = clockwerk::DataIO<clockwerk::Time>(this, "base_time") |
| This is the exact current time as the scheduler steps forward. More... | |
| clockwerk::DataIO< clockwerk::Time > | tdb_time = clockwerk::DataIO<clockwerk::Time>(this, "tdb_time") |
Protected Attributes | |
| clockwerk::Time * | _tdb_ptr |
| Pointers to our time objects. More... | |
| clockwerk::Time | _diff |
| struct timespec | _tmp |
| clockwerk::Time * | _start_step_ptr |
| Pointers to our time objects. More... | |
| clockwerk::Time * | _end_step_ptr |
| clockwerk::Time * | _base_time_ptr |
| bool | _started = false |
| clockwerk::Time | _start |
| clockwerk::Time | _now |
| GraphTreeObject * | _children [MAXIMUM_APP_CHILDREN] |
Protected Attributes inherited from clockwerk::GraphTreeObject | |
| GraphTreeObject * | _parent = nullptr |
| GraphTreeObject ** | _children_ptr = nullptr |
| uint32 | _max_num_children = 0 |
| uint16 | _num_descendants = 0 |
| char | _name [MAXIMUM_NAME_CHARS] = "" |
| String name for object. More... | |
| uint8 | _num_children = 0 |
| Number of direct children of the tree (not including the tree itself) More... | |
| uint8 | _rank = 0 |
| int8 | _graph_tree_type = BASE_GRAPH_TREE |
| Variable to store graph tree object type. More... | |
| bool | _loggable = false |
| Variable to indicate whether the selected object is loggable. Set to false by default. More... | |
| uint32 | _index = 0 |
| Index pointing to the next write location for the graph tree children. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from clockwerk::GraphTreeObject | |
| int16 | _setStorage (GraphTreeObject **storage_array, uint8 storage_size) |
| Getter for object's string address. More... | |
| void | _recalculateDescendants () |
| Function to recursively re-calculate the number of descendants of a given node on the tree. More... | |
| void | _recalculateRank () |
| Function to recursively re-calculate the rank of a given node on the tree. More... | |
| int16 | _addChild (GraphTreeObject *child) |
| Function to decompose a string into a series of substrings via indexing. More... | |
| int16 | _removeChild (GraphTreeObject *child) |
| Function to remove a child from the graph node's children. More... | |
Class to manage time for the simulation object.
This class uses the SPICE module to manage time within the simulation. Internally it steps the sim time and the spice ephemeris time (TDB time), which is used to cast UTC and JD time scales. All are published on the time manager.
Time representations are based on the clockwerk Time class.
| modelspace::SimTimeManager::SimTimeManager | ( | ) |
Base constructor – time manager should initialize to zeros and then be set.
|
inlinevirtual |
| double modelspace::SimTimeManager::decimalYear | ( | ) |
Function to return the decimal year as a double.
| std::string modelspace::SimTimeManager::gpsTime | ( | ) |
Function to return the GPS time as a string.
| std::string modelspace::SimTimeManager::jdTime | ( | ) |
Function to return the Julian date as a string.
| void modelspace::SimTimeManager::setTime | ( | const std::string & | time_input = DEFAULT_SIMULATION_TIME | ) |
Function to set time by string input.
Methods to set time The following functions allow users to set time based on string
| time_input | The string input by which time will be set. valid inputs are any input which is accepted by the SPICE function STR2ET. More info here: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/spicelib/str2et.html This value defaults to 2023 September 26, 12:00:00 MDT |
| void modelspace::SimTimeManager::stepTime | ( | const clockwerk::Time & | step | ) |
Function to increment all times.
| step | Time object to step by |
| double modelspace::SimTimeManager::str2tdb | ( | const std::string & | time_input | ) |
|
inline |
| void modelspace::SimTimeManager::updateStep | ( | const clockwerk::Time & | step | ) |
Function to increment step start and end time.
| step | Time object to step by |
| std::string modelspace::SimTimeManager::utcTime | ( | ) |
Function to return the TDB time as a string.
|
inline |
Function to return whether the wall clock timer is started.
| clockwerk::Time modelspace::SimTimeManager::wallClockTimer | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Pointers to our time objects.
|
protected |
|
protected |
Pointers to our time objects.
|
protected |
| clockwerk::DataIO<clockwerk::Time> modelspace::SimTimeManager::base_time = clockwerk::DataIO<clockwerk::Time>(this, "base_time") |
This is the exact current time as the scheduler steps forward.
| clockwerk::DataIO<clockwerk::Time> modelspace::SimTimeManager::step_end_time = clockwerk::DataIO<clockwerk::Time>(this, "step_end_time") |
This is the time at the end of a given scheduler step.
| clockwerk::DataIO<clockwerk::Time> modelspace::SimTimeManager::step_start_time = clockwerk::DataIO<clockwerk::Time>(this, "step_start_time") |
| clockwerk::DataIO<clockwerk::Time> modelspace::SimTimeManager::tdb_time = clockwerk::DataIO<clockwerk::Time>(this, "tdb_time") |
TDB time is represented as seconds relative to the J2000 epoch, which is January 1, 2000, at 12:00 TT (Terrestrial Time). This is also known as "ephemeris time"