A device base class which saves telemetry. More...
#include <telemeter.hpp>
Public Types | |
typedef logger::logManager< derivedT, logFileRaw > | logManagerT |
The log manager type. More... | |
Public Member Functions | |
telemeter () | |
template<typename telT > | |
int | telem (const typename telT::messageT &msg) |
Make a telemetry recording. More... | |
template<typename telT > | |
int | telem () |
Make a telemetry recording, for an empty record. More... | |
int | setupConfig (appConfigurator &config) |
Setup an application configurator for the device section. More... | |
int | loadConfig (appConfigurator &config) |
Load the device section from an application configurator. More... | |
int | appStartup () |
Starts the telemetry log thread. More... | |
int | appLogic () |
Perform telemeter application logic. More... | |
int | appShutdown () |
Perform telemeter application shutdown. More... | |
template<class telT , class... telTs> | |
int | checkRecordTimes (const telT &tel, telTs... tels) |
Check the time of the last record for each telemetry type and make an entry if needed. More... | |
template<class telT , class... telTs> | |
int | checkRecordTimes (timespec &ts, const telT &tel, telTs... tels) |
Worker function to actually perform the record time checking logic. More... | |
int | checkRecordTimes (timespec &ts) |
Empty function called at the end of the template list. More... | |
Public Attributes | |
logManagerT | m_tel |
double | m_maxInterval {10.0} |
The maximum interval, in seconds, between telemetry records. Default is 10.0 seconds. More... | |
Private Member Functions | |
derivedT & | derived () |
Access the derived class. More... | |
A device base class which saves telemetry.
CRTP class derivedT
has the following requirements:
derivedT
, with error checking. For convenience the following macros are defined to provide error checking: Definition at line 68 of file telemeter.hpp.
typedef logger::logManager<derivedT, logFileRaw> MagAOX::app::dev::telemeter< derivedT >::logManagerT |
The log manager type.
Definition at line 71 of file telemeter.hpp.
MagAOX::app::dev::telemeter< derivedT >::telemeter |
Definition at line 180 of file telemeter.hpp.
int MagAOX::app::dev::telemeter< derivedT >::appLogic |
Perform telemeter
application logic.
This calls derivedT::checkRecordTimes()
, and should be called from derivedT::appLogic
, but only when the FSM is in states where telemetry logging makes sense.
Definition at line 268 of file telemeter.hpp.
int MagAOX::app::dev::telemeter< derivedT >::appShutdown |
Perform telemeter
application shutdown.
This currently does nothing.
Definition at line 274 of file telemeter.hpp.
Referenced by MagAOX::app::andorCtrl::appShutdown(), MagAOX::app::dmSpeckle::appShutdown(), MagAOX::app::koolanceCtrl::appShutdown(), MagAOX::app::observerCtrl::appShutdown(), MagAOX::app::ocam2KCtrl::appShutdown(), MagAOX::app::qhyCtrl::appShutdown(), MagAOX::app::siglentSDG::appShutdown(), MagAOX::app::sparkleClock::appShutdown(), and MagAOX::app::sysMonitor::appShutdown().
int MagAOX::app::dev::telemeter< derivedT >::appStartup |
Starts the telemetry log thread.
This should be called from derivedT::appStartup
Definition at line 241 of file telemeter.hpp.
Referenced by MagAOX::app::smc100ccCtrl::appStartup().
int MagAOX::app::dev::telemeter< derivedT >::checkRecordTimes | ( | const telT & | tel, |
telTs... | tels | ||
) |
Check the time of the last record for each telemetry type and make an entry if needed.
This must be called from derivedT::checkRecordTimes()
, with one template parameter for ach telemetry log type being recorded.
[in] | tel | [unused] object of the telemetry type to record |
[in] | tels | [unused] objects of the additional telemetry types to record |
Definition at line 281 of file telemeter.hpp.
Referenced by MagAOX::app::filterWheelCtrl::checkRecordTimes(), MagAOX::app::hsfwCtrl::checkRecordTimes(), MagAOX::app::rhusbMon::checkRecordTimes(), and MagAOX::app::usbtempMon::checkRecordTimes().
int MagAOX::app::dev::telemeter< derivedT >::checkRecordTimes | ( | timespec & | ts | ) |
Empty function called at the end of the template list.
[in] | ts | [unused] the timestamp that records are compared to |
Definition at line 303 of file telemeter.hpp.
int MagAOX::app::dev::telemeter< derivedT >::checkRecordTimes | ( | timespec & | ts, |
const telT & | tel, | ||
telTs... | tels | ||
) |
Worker function to actually perform the record time checking logic.
Recursively calls itself until the variadic template list is exhausted.
[in] | ts | [unused] the timestamp that records are compared to |
[in] | tel | [unused] objects of the telemetry type to record |
[in] | tels | [unused] objects of the additional telemetry types to record |
Definition at line 291 of file telemeter.hpp.
|
inlineprivate |
Access the derived class.
Definition at line 173 of file telemeter.hpp.
int MagAOX::app::dev::telemeter< derivedT >::loadConfig | ( | appConfigurator & | config | ) |
Load the device section from an application configurator.
[in] | config | an application configuration from which to load values |
Definition at line 223 of file telemeter.hpp.
Referenced by MagAOX::app::andorCtrl::loadConfig(), MagAOX::app::filterWheelCtrl::loadConfig(), MagAOX::app::hsfwCtrl::loadConfig(), MagAOX::app::koolanceCtrl::loadConfig(), MagAOX::app::observerCtrl::loadConfig(), MagAOX::app::ocam2KCtrl::loadConfig(), MagAOX::app::picamCtrl::loadConfig(), MagAOX::app::qhyCtrl::loadConfig(), MagAOX::app::siglentSDG::loadConfig(), MagAOX::app::smc100ccCtrl::loadConfig(), MagAOX::app::sysMonitor::loadConfig(), MagAOX::app::zylaCtrl::loadConfig(), MagAOX::app::dmSpeckle::loadConfigImpl(), MagAOX::app::rhusbMon::loadConfigImpl(), MagAOX::app::sparkleClock::loadConfigImpl(), MagAOX::app::tcsInterface::loadConfigImpl(), MagAOX::app::usbtempMon::loadConfigImpl(), and MagAOX::app::zaberCtrl::loadConfigImpl().
int MagAOX::app::dev::telemeter< derivedT >::setupConfig | ( | appConfigurator & | config | ) |
Setup an application configurator for the device section.
[in] | config | an application configuration to setup |
Definition at line 211 of file telemeter.hpp.
Referenced by MagAOX::app::andorCtrl::setupConfig(), MagAOX::app::filterWheelCtrl::setupConfig(), MagAOX::app::hsfwCtrl::setupConfig(), MagAOX::app::koolanceCtrl::setupConfig(), MagAOX::app::observerCtrl::setupConfig(), MagAOX::app::ocam2KCtrl::setupConfig(), MagAOX::app::picamCtrl::setupConfig(), MagAOX::app::qhyCtrl::setupConfig(), MagAOX::app::rhusbMon::setupConfig(), MagAOX::app::siglentSDG::setupConfig(), MagAOX::app::smc100ccCtrl::setupConfig(), MagAOX::app::sysMonitor::setupConfig(), MagAOX::app::tcsInterface::setupConfig(), MagAOX::app::usbtempMon::setupConfig(), MagAOX::app::zaberCtrl::setupConfig(), and MagAOX::app::zylaCtrl::setupConfig().
int MagAOX::app::dev::telemeter< derivedT >::telem |
Make a telemetry recording, for an empty record.
Wrapper for logManager::log, which updates telT::lastRecord.
logT | the log entry type |
retval | the value returned by this method. |
Definition at line 199 of file telemeter.hpp.
Referenced by visxCtrl.xapp.VisX::emit_telem_stdcam(), audibleAlerts.core.AudibleAlerts::handle_reload_request(), and audibleAlerts.core.AudibleAlerts::handle_speech_request().
int MagAOX::app::dev::telemeter< derivedT >::telem | ( | const typename telT::messageT & | msg | ) |
Make a telemetry recording.
Wrapper for logManager::log, which updates telT::lastRecord.
logT | the log entry type |
retval | the value returned by this method. |
[in] | msg | the data to log |
Definition at line 186 of file telemeter.hpp.
Referenced by visxCtrl.xapp.VisX::emit_telem_stdcam(), audibleAlerts.core.AudibleAlerts::handle_reload_request(), and audibleAlerts.core.AudibleAlerts::handle_speech_request().
double MagAOX::app::dev::telemeter< derivedT >::m_maxInterval {10.0} |
The maximum interval, in seconds, between telemetry records. Default is 10.0 seconds.
Definition at line 75 of file telemeter.hpp.
logManagerT MagAOX::app::dev::telemeter< derivedT >::m_tel |
Definition at line 73 of file telemeter.hpp.