A device base class which saves telemetry. More...
#include <telemeter.hpp>

Public Types | |
| typedef XWC_DEFAULT_VERBOSITY | verboseT |
| typedef logger::logManager< derivedT, logFileRaw< verboseT > > | logManagerT |
| The log manager type. | |
Public Member Functions | |
| telemeter () | |
| template<typename telT > | |
| int | telem (const typename telT::messageT &msg) |
| Make a telemetry recording. | |
| int | setupConfig (appConfigurator &config) |
| Setup an application configurator for the device section. | |
| int | loadConfig (appConfigurator &config) |
| Load the device section from an application configurator. | |
| int | appStartup () |
| Starts the telemetry log thread. | |
| int | appLogic () |
Perform telemeter application logic. | |
| int | appShutdown () |
Perform telemeter application shutdown. | |
| 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. | |
| template<class telT , class... telTs> | |
| int | checkRecordTimes (timespec &ts, const telT &tel, telTs... tels) |
| Worker function to actually perform the record time checking logic. | |
| int | checkRecordTimes (timespec &ts) |
| Empty function called at the end of the template list. | |
Public Attributes | |
| logManagerT | m_tel |
| double | m_maxInterval {10.0} |
| The maximum interval, in seconds, between telemetry records. Default is 10.0 seconds. | |
Private Member Functions | |
| derivedT & | derived () |
| Access the derived class. | |
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 74 of file telemeter.hpp.
| typedef logger::logManager<derivedT, logFileRaw<verboseT> > MagAOX::app::dev::telemeter< derivedT >::logManagerT |
The log manager type.
Definition at line 79 of file telemeter.hpp.
| typedef XWC_DEFAULT_VERBOSITY MagAOX::app::dev::telemeter< derivedT >::verboseT |
Definition at line 76 of file telemeter.hpp.
| MagAOX::app::dev::telemeter< derivedT >::telemeter | ( | ) |
Definition at line 188 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 289 of file telemeter.hpp.
References MagAOX::app::dev::telemeter< derivedT >::checkRecordTimes().
Referenced by TEST_CASE().
| int MagAOX::app::dev::telemeter< derivedT >::appShutdown | ( | ) |
Perform telemeter application shutdown.
This currently does nothing.
Definition at line 307 of file telemeter.hpp.
Referenced by MagAOX::app::andorCtrl::appShutdown(), MagAOX::app::dmSpeckle::appShutdown(), MagAOX::app::koolanceCtrl::appShutdown(), MagAOX::app::ocam2KCtrl::appShutdown(), MagAOX::app::qhyCtrl::appShutdown(), MagAOX::app::siglentSDG::appShutdown(), MagAOX::app::sparkleClock::appShutdown(), MagAOX::app::sysMonitor::appShutdown(), and TEST_CASE().
| int MagAOX::app::dev::telemeter< derivedT >::appStartup | ( | ) |
Starts the telemetry log thread.
This should be called from derivedT::appStartup
Definition at line 256 of file telemeter.hpp.
Referenced by MagAOX::app::smc100ccCtrl::appStartup(), TEST_CASE(), and TEST_CASE().
| 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 314 of file telemeter.hpp.
Referenced by MagAOX::app::dev::telemeter< derivedT >::appLogic(), 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 336 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 324 of file telemeter.hpp.
|
inlineprivate |
Access the derived class.
Definition at line 181 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 232 of file telemeter.hpp.
References MAGAOX_env_telem, and MAGAOX_telRelPath.
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(), MagAOX::app::zaberCtrl::loadConfigImpl(), TEST_CASE(), TEST_CASE(), and TEST_CASE().
| 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 220 of file telemeter.hpp.
References MagAOX::app::dev::telemeter< derivedT >::setupConfig().
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(), MagAOX::app::zylaCtrl::setupConfig(), MagAOX::app::dev::telemeter< derivedT >::setupConfig(), TEST_CASE(), TEST_CASE(), and TEST_CASE().
| 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 194 of file telemeter.hpp.
References MagAOX::app::msg.
Referenced by visxCtrl.xapp.VisX::emit_telem_stdcam(), visxCtrl.xapp.VisX::handle_exptime(), 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 83 of file telemeter.hpp.
| logManagerT MagAOX::app::dev::telemeter< derivedT >::m_tel |
Definition at line 81 of file telemeter.hpp.