WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
warpos::FlightExecutive Class Reference

Executive derivation specifically to run flight systems. More...

#include <FlightExecutive.h>

Inheritance diagram for warpos::FlightExecutive:

Public Member Functions

 FlightExecutive (warpos::Setup &setup, warpos::Scheduler &schedule, bool delay_parent_assignment=false)
 Only valid FlightExecutive constructor.
 FlightExecutive (const FlightExecutive &original)
const FlightExecutiveoperator= (const FlightExecutive &original)
virtual ~FlightExecutive ()
warpos::Setupsetup ()
 Handle to the current system setup.
warpos::Schedulerschedule ()
 Handle to the current system schedule.
warpos::OSos ()
 Handle to the current system OS.
warpos::Platformplatform ()
 Handle to the current system platform.
warpos::TelemetryManagertelemetryManager ()
 Handle to the telemetry manager.
warpos::StorageManagerstorageManager ()
 Handle to the storage manager.
warpos::CommandManagercommandManager ()
 Handle to the command manager.
int16 registerTlm (uint16 apid, uint8 instance=0)
 Register telemetry packet with storage and telemetry managers.
int16 sendStoreTlm (const cmd_tlm_base &pkt, uint8 instance=0)
 Send packet to telemetry and storage managers for send/store.
int16 startup ()
 Initialize the FlightExecutive and all elements therein.
int16 step (const clockwerk::Time &step_val)
 Step the FlightExecutive forward by a single step.
int16 run ()
 Run the FlightExecutive until the terminate flag is raised.
log_level_e logLevel ()
 Get the log level set for the executive.
void logLevel (log_level_e log_level)
 Set the executive log level.
int16 registerApp (warpos::App &app)
 Register an app with the flight executive.
int16 getAppPointer (uint16 apid, uint8 instance, warpos::App *&app_ptr)
 Get pointer to a registered app based on its apid and instance number.
warpos::App ** getRegistry ()
 Get pointer to app registry, used for testing.
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.
virtual ~GraphTreeObject ()
 Destructor.
GraphTreeObjectparent ()
 Functions to get object's parent/children.
GraphTreeObject ** children ()
GraphTreeObjectchildAtIndex (uint8 i) const
int16 parent (GraphTreeObject *new_parent)
 Function to assign the node's parent via pointer.
int16 parent (GraphTreeObject &new_parent)
 Function to assign the node's parent via reference.
uint8 nChildren () const
 Getters for number of children and descendants.
uint16 nDescendants () const
uint8 capacity () const
const char * name () const
 Getter and setter for object name.
int16 name (const char *new_name)
uint8 rank ()
 Getter for the object rank.
int8 type ()
 Function to indicate type – -1 by default unless implemented downstream.
bool loggable ()
 Getter for object logability flag – note no setter because should only be set by this or a derived class in its definition.
GraphTreeObjectgetRootDataPointer ()
 Get the pointer to the highest object in the graph tree.
virtual int16 str (char *output, size_t size) const
 Get object represented as string.
virtual int16 fromStr (const char *val)
 Set value of graphtreeobject from string.

Protected Attributes

warpos::Setup_setup
 System setup, which implicitly contains OS and Platform.
warpos::Scheduler_scheduler
 System schedule, which determines what apps and functions run when.
uint16 _registered_app_idx = 0
 Index of last registered app.
App_registered_apps [MAXIMUM_FLIGHT_EXECUTIVE_CHILDREN] = {nullptr}
 Buffer of pointers to registered apps.
warpos::TelemetryManager _telemetry_manager
 The telemetry manager for the flight executive.
warpos::StorageManager _storage_manager
 The storage manager for the flight executive.
warpos::CommandManager _command_manager
 The command manager for the flight executive.
log_level_e _exc_log_level = log_level_e::LOG_INFO
GraphTreeObject_fexec_children [MAXIMUM_FLIGHT_EXECUTIVE_CHILDREN]
 Local storage for App children so it can live on the graph tree.
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.
uint8 _num_children = 0
 Number of direct children of the tree (not including the tree itself).
uint8 _rank = 0
int8 _graph_tree_type = BASE_GRAPH_TREE
 Variable to store graph tree object type.
bool _loggable = false
 Variable to indicate whether the selected object is loggable. Set to false by default.
uint32 _index = 0
 Index pointing to the next write location for the graph tree children.

Additional Inherited Members

Protected Member Functions inherited from clockwerk::GraphTreeObject
int16 _setStorage (GraphTreeObject **storage_array, uint8 storage_size)
 Getter for object's string address.
void _recalculateDescendants ()
 Function to recursively re-calculate the number of descendants of a given node on the tree.
void _recalculateRank ()
 Function to recursively re-calculate the rank of a given node on the tree.
int16 _addChild (GraphTreeObject *child)
 Function to decompose a string into a series of substrings via indexing.
int16 _removeChild (GraphTreeObject *child)
 Function to remove a child from the graph node's children.

Detailed Description

Executive derivation specifically to run flight systems.

The flight executive is a special instance of the clockwerk executive derived for running flight systems. FlightExecutive contains handles to its internal "setup" which configures routing for commands, telemetry, etc. as well as OSAL and HAL items.

Flight executive also holds the telemetry, storage, and command manager tasks for access in all Apps.

Constructor & Destructor Documentation

◆ FlightExecutive() [1/2]

warpos::FlightExecutive::FlightExecutive ( warpos::Setup & setup,
warpos::Scheduler & schedule,
bool delay_parent_assignment = false )

Only valid FlightExecutive constructor.

Parameters
setupSetup object for the flight
scheduleSchedule object for the flight
delay_parent_assignmentFlag indicating whether to assign parent from schedule/setup. Should not be set under any circumstances except inside of SimulationExecutive.

◆ FlightExecutive() [2/2]

warpos::FlightExecutive::FlightExecutive ( const FlightExecutive & original)

◆ ~FlightExecutive()

virtual warpos::FlightExecutive::~FlightExecutive ( )
virtual

Member Function Documentation

◆ commandManager()

warpos::CommandManager & warpos::FlightExecutive::commandManager ( )
inline

Handle to the command manager.

Returns
Handle to command manager

◆ getAppPointer()

int16 warpos::FlightExecutive::getAppPointer ( uint16 apid,
uint8 instance,
warpos::App *& app_ptr )

Get pointer to a registered app based on its apid and instance number.

Parameters
apidAPID of the app to get
instanceInstance of app to get
app_ptrPointer to app pointer to populate
Returns
Error code corresponding to success/failure

◆ getRegistry()

warpos::App ** warpos::FlightExecutive::getRegistry ( )
inline

Get pointer to app registry, used for testing.

Returns
Pointer to location of first app

◆ logLevel() [1/2]

log_level_e warpos::FlightExecutive::logLevel ( )
inline

Get the log level set for the executive.

Returns
Log level for the executive

◆ logLevel() [2/2]

void warpos::FlightExecutive::logLevel ( log_level_e log_level)
inline

Set the executive log level.

Parameters
log_levelThe level to set logging to

◆ operator=()

const FlightExecutive & warpos::FlightExecutive::operator= ( const FlightExecutive & original)

◆ os()

warpos::OS & warpos::FlightExecutive::os ( )
inline

Handle to the current system OS.

Returns
Handle to OS

◆ platform()

warpos::Platform & warpos::FlightExecutive::platform ( )
inline

Handle to the current system platform.

Returns
Handle to Platform

◆ registerApp()

int16 warpos::FlightExecutive::registerApp ( warpos::App & app)

Register an app with the flight executive.

Parameters
appReference to the app to register
Returns
Error code corresponding to success/failure

◆ registerTlm()

int16 warpos::FlightExecutive::registerTlm ( uint16 apid,
uint8 instance = 0 )

Register telemetry packet with storage and telemetry managers.

Parameters
apidThe apid of the packet to register
instanceThe instance of the APID of the packet to register, defaults to 0
Returns
Error code corresponding to success/failure

◆ run()

int16 warpos::FlightExecutive::run ( )

Run the FlightExecutive until the terminate flag is raised.

Returns
Error code corresponding to success/failure

◆ schedule()

warpos::Scheduler & warpos::FlightExecutive::schedule ( )
inline

Handle to the current system schedule.

Returns
Handle to system schedule

◆ sendStoreTlm()

int16 warpos::FlightExecutive::sendStoreTlm ( const cmd_tlm_base & pkt,
uint8 instance = 0 )

Send packet to telemetry and storage managers for send/store.

Parameters
pktThe packet to send
instanceThe instance of the APID of the packet to send, defaults to 0
Returns
Error code corresponding to success/failure

◆ setup()

warpos::Setup & warpos::FlightExecutive::setup ( )
inline

Handle to the current system setup.

Returns
Handle to system setup

◆ startup()

int16 warpos::FlightExecutive::startup ( )

Initialize the FlightExecutive and all elements therein.

Returns
Error code corresponding to success/failure

◆ step()

int16 warpos::FlightExecutive::step ( const clockwerk::Time & step_val)

Step the FlightExecutive forward by a single step.

Parameters
step_valThe current time, which is used to determine the slot which runs If ran in a simulation environment, this is a time step
Returns
Error code corresponding to success/failure

◆ storageManager()

warpos::StorageManager & warpos::FlightExecutive::storageManager ( )
inline

Handle to the storage manager.

Returns
Handle to storage manager

◆ telemetryManager()

warpos::TelemetryManager & warpos::FlightExecutive::telemetryManager ( )
inline

Handle to the telemetry manager.

Returns
Handle to telemetry manager

Member Data Documentation

◆ _command_manager

warpos::CommandManager warpos::FlightExecutive::_command_manager
protected

The command manager for the flight executive.

◆ _exc_log_level

log_level_e warpos::FlightExecutive::_exc_log_level = log_level_e::LOG_INFO
protected

◆ _fexec_children

GraphTreeObject* warpos::FlightExecutive::_fexec_children[MAXIMUM_FLIGHT_EXECUTIVE_CHILDREN]
protected

Local storage for App children so it can live on the graph tree.

◆ _registered_app_idx

uint16 warpos::FlightExecutive::_registered_app_idx = 0
protected

Index of last registered app.

◆ _registered_apps

App* warpos::FlightExecutive::_registered_apps[MAXIMUM_FLIGHT_EXECUTIVE_CHILDREN] = {nullptr}
protected

Buffer of pointers to registered apps.

◆ _scheduler

warpos::Scheduler& warpos::FlightExecutive::_scheduler
protected

System schedule, which determines what apps and functions run when.

◆ _setup

warpos::Setup& warpos::FlightExecutive::_setup
protected

System setup, which implicitly contains OS and Platform.

◆ _storage_manager

warpos::StorageManager warpos::FlightExecutive::_storage_manager
protected

The storage manager for the flight executive.

◆ _telemetry_manager

warpos::TelemetryManager warpos::FlightExecutive::_telemetry_manager
protected

The telemetry manager for the flight executive.


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