10 #ifndef logger_types_telem_loopgain_hpp
11 #define logger_types_telem_loopgain_hpp
13 #include "generated/telem_loopgain_generated.h"
56 return VerifyTelem_loopgain_fbBuffer(verifier);
64 static_cast<void>(len);
66 auto fbs = GetTelem_loopgain_fb(msgBuffer);
68 std::string
msg =
"[loopgain] ";
73 msg += std::to_string(fbs->state()) +
" ";
76 msg += std::to_string(fbs->gain()) +
" ";
79 msg += std::to_string(fbs->multcoef()) +
" ";
82 msg += std::to_string(fbs->limit());
88 static uint8_t
state(
void * msgBuffer)
90 auto fbs = GetTelem_loopgain_fb(msgBuffer);
94 static float gain(
void * msgBuffer)
96 auto fbs = GetTelem_loopgain_fb(msgBuffer);
102 auto fbs = GetTelem_loopgain_fb(msgBuffer);
103 return fbs->multcoef();
106 static float limit(
void * msgBuffer)
108 auto fbs = GetTelem_loopgain_fb(msgBuffer);
119 if( member ==
"state")
return logMetaDetail({
"LOOP STATE", logMeta::valTypes::Int, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
state)});
120 else if( member ==
"gain")
return logMetaDetail({
"LOOP GAIN", logMeta::valTypes::Float, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
gain)});
121 else if( member ==
"multcoef")
return logMetaDetail({
"LOOP MULTCOEF", logMeta::valTypes::Float, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
multcoef)});
122 else if( member ==
"limit")
return logMetaDetail({
"LOOP LIMIT", logMeta::valTypes::Float, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
limit)});
125 std::cerr <<
"No string member " << member <<
" in telem_loopgain\n";
The MagAO-X logger flatbuffer log base type.
uint16_t eventCodeT
The type of an event code (16-bit unsigned int).
msgLen2T msgLenT
The type used to refer to the message length, regardless of length.
int8_t logPrioT
The type of the log priority code.
static void * messageBuffer(bufferPtrT &logBuffer)
Get the message buffer address.
std::shared_ptr< char > bufferPtrT
The log entry buffer smart pointer.
constexpr static logPrioT LOG_TELEM
A telemetry recording.
Message type for resolving log messages with a f.b. builder.
flatbuffers::FlatBufferBuilder builder
Base class for logs consisting of a flatbuffer message.
The type of the input message.
messageT(const uint8_t &state, const float &gain, const float &multcoef, const float &limit)
Construct from components.
Log entry recording the build-time git state.
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
static float multcoef(void *msgBuffer)
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static const flatlogs::eventCodeT eventCode
The event code.
static float limit(void *msgBuffer)
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.
static const flatlogs::logPrioT defaultLevel
The default level.
static uint8_t state(void *msgBuffer)
static timespec lastRecord
The time of the last time this log was recorded. Used by the telemetry system.
static float gain(void *msgBuffer)