![]() |
WarpTwin
Documentation for WarpTwin models and classes.
|
App which manages all storage output from the flight system. More...
#include <StorageManager.h>

Classes | |
| struct | Params |
Public Member Functions | |
| StorageManager (FlightExecutive &exc) | |
| Only available flight executive constructor. | |
| virtual | ~StorageManager () |
| int16 | storeTlm (const cmd_tlm_base &pkt, uint8 instance) |
| Add a telemetry packet to the queue. | |
| int16 | registerTlmPacket (uint16 tlm_apid, uint8 instance) |
| Register a telemetry packet by adding it to the table. | |
| int16 | configureTlmPacket (const PacketTypeInfo &info) |
| Configure values on telemetry packet. | |
| int16 | activate () override |
| Activate the app. The app will step when active. | |
| int16 | deactivate () override |
| Deactivate the app. The app will not step when deactivated. | |
| int16 | command (uint16 apid, uint8 *buffer, uint16 size) override |
| Process commands issued to the app. | |
| uint16 | numRegisteredPackets () |
| Get the number of registered telemetry packets. | |
| Public Member Functions inherited from warpos::App | |
| App (FlightExecutive &executive, const char *name, uint16 apid, uint8 instance=0) | |
| Executive-based constructor for the task. | |
| virtual | ~App () |
| Destructor. Doesn't really do anything. | |
| int16 | startup () |
| Initialize the app. Should be called once before step. | |
| int16 | step () |
| Step the app by a single step. Maps params, inputs, etc. to outputs. | |
| log_level_e | logLevel () |
| Get the log level set for the executive. | |
| void | logLevel (log_level_e log_level) |
| Set the executive log level. | |
| bool | isStarted () |
| Return whether task startup has been run. | |
| uint16 | apid () |
| Get the apid for this app. | |
| uint8 & | instance () |
| Get the instance of this app (used to differentiate between multiple instances of the same app). | |
| 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. | |
| GraphTreeObject * | parent () |
| Functions to get object's parent/children. | |
| GraphTreeObject ** | children () |
| GraphTreeObject * | childAtIndex (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. | |
| GraphTreeObject * | getRootDataPointer () |
| 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. | |
Public Attributes | |
| Params | params = Params(this, "params") |
| Public Attributes inherited from warpos::App | |
| clockwerk::DataIO< bool > | active = clockwerk::DataIO<bool>(this, "active", true) |
| The active flag for the task – set to true by default. | |
Protected Member Functions | |
| int16 | start () override |
| int16 | execute () override |
| int32 | _findPktIndex (uint16 apid, uint8 instance) |
| Find index of packet in tlm table matching apid. | |
| 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. | |
Protected Attributes | |
| PacketTypeInfo | _tlm_table [MAX_TLM_TABLE_SIZE] |
| uint16 | _tlm_table_idx = 0 |
| Table of telemetry packet metadata. | |
| char | _print_buff [200] |
| Buffer for printing error/warning/debug statements. | |
| int32 | _fd_table_1 [MAX_TLM_TABLE_SIZE] = {-1} |
| Table of file descriptors for individual packet files for SD card 1. | |
| int32 | _fd_table_2 [MAX_TLM_TABLE_SIZE] = {-1} |
| Table of file descriptors for individual packet files for SD card 2. | |
| char | _default_storage_loc [1] = "" |
| Default file storage location. | |
| bool | _fsys_working = false |
| Boolean to track and protect errors in file system. | |
| char | _time_str [TIME_STR_SIZE] |
| Variables for writing to file. | |
| char | _f_write_buf [CMD_TLM_STR_MAX_SIZE_BYTES] |
| Buffer for file write in both modes. | |
| char | _file_name [FILE_NAME_MAX] |
| Buffer to hold file names. | |
| Protected Attributes inherited from warpos::App | |
| FlightExecutive & | exc |
| Override our executive to include the FlightExecutive instead. | |
| int16 | _error = 0 |
| Internal variable to track and return error on app step through. | |
| uint16 | _apid = 0 |
| Internal variable to hold the APID for this app. | |
| bool | _is_started = false |
| Flag indicating whether app has been started or not. | |
| log_level_e | _local_log_level = log_level_e::LOG_WARNING |
| The log level for this particular app. | |
| GraphTreeObject * | _app_children [MAXIMUM_APP_CHILDREN] |
| Local storage for App children so it can live on the graph tree. | |
| uint8 | _instance |
| Instance number of this app. Used to differentiate between multiple instances of the same app. | |
| 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. | |
App which manages all storage output from the flight system.
The storage manager is a simple wrapper around the OS write functions which allows users to register telemetry packets to save at a fixed rate and writes to file at that rate.
TODOs:
| warpos::StorageManager::StorageManager | ( | FlightExecutive & | exc | ) |
Only available flight executive constructor.
| exc | Pointer to executive object |
|
virtual |
|
protected |
|
overridevirtual |
Activate the app. The app will step when active.
Reimplemented from warpos::App.
|
overridevirtual |
Process commands issued to the app.
| apid | The apid of the command to execute |
| buffer | The buffer of command data |
| size | The size of the command data buffer |
Reimplemented from warpos::App.
| int16 warpos::StorageManager::configureTlmPacket | ( | const PacketTypeInfo & | info | ) |
Configure values on telemetry packet.
| tlm_info | PacketTypeInfo instance containing data to configure on table |
|
overridevirtual |
Deactivate the app. The app will not step when deactivated.
Reimplemented from warpos::App.
|
overrideprotectedvirtual |
Reimplemented from warpos::App.
|
inline |
Get the number of registered telemetry packets.
| int16 warpos::StorageManager::registerTlmPacket | ( | uint16 | tlm_apid, |
| uint8 | instance ) |
Register a telemetry packet by adding it to the table.
| tlm_apid | The apid of the telemetry to register |
| instance | The instance of the telemetry APID |
|
overrideprotectedvirtual |
Reimplemented from warpos::App.
| int16 warpos::StorageManager::storeTlm | ( | const cmd_tlm_base & | pkt, |
| uint8 | instance ) |
Add a telemetry packet to the queue.
| pkt | An command/telemetry packet object with apid, size, and packetize function |
| instance | The instance of the packet |
|
protected |
Default file storage location.
|
protected |
Buffer for file write in both modes.
|
protected |
Table of file descriptors for individual packet files for SD card 1.
|
protected |
Table of file descriptors for individual packet files for SD card 2.
|
protected |
Buffer to hold file names.
|
protected |
Boolean to track and protect errors in file system.
|
protected |
Buffer for printing error/warning/debug statements.
|
protected |
Variables for writing to file.
For converting time to str in csv mode
|
protected |
|
protected |
Table of telemetry packet metadata.
Current index in the telemetry table