10 #ifndef logger_types_telem_dmmodes_hpp
11 #define logger_types_telem_dmmodes_hpp
13 #include "generated/telem_dmmodes_generated.h"
41 auto fp = CreateTelem_dmmodes_fb(
builder, _ampsVec );
53 return VerifyTelem_dmmodes_fbBuffer(verifier);
62 static_cast<void>(len);
64 auto rgs = GetTelem_dmmodes_fb(msgBuffer);
68 msg+=
"[dmmodes amps] ";
70 if (rgs->amps() !=
nullptr)
72 for(flatbuffers::Vector<float>::const_iterator
it = rgs->amps()->begin();
it != rgs->amps()->end(); ++
it)
74 msg+= std::to_string(*
it);
83 static std::vector<float>
amps(
void * msgBuffer )
85 std::vector<float>
amps;
86 auto fbs = GetTelem_dmmodes_fb(msgBuffer);
88 if (fbs->amps() !=
nullptr)
90 for(flatbuffers::Vector<float>::const_iterator
it = fbs->amps()->begin();
it != fbs->amps()->end(); ++
it)
106 if(member ==
"amps")
return logMetaDetail({
"AMPS", logMeta::valTypes::Vector_Float, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
amps),
false});
109 std::cerr <<
"No string member " << member <<
" in telem_dmmodes\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(std::vector< float > &s)
Construct from components.
Log entry recording DM Mode Amplitudes.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static timespec lastRecord
The time of the last time this log was recorded. Used by the telemetry system.
static std::vector< float > amps(void *msgBuffer)
static const flatlogs::logPrioT defaultLevel
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.
static const flatlogs::eventCodeT eventCode