7#ifndef logger_types_telem_w2tcsoffloader_hpp
8#define logger_types_telem_w2tcsoffloader_hpp
49 static_cast<size_t>( len ) );
58 static_cast<void>( len );
62 std::string msg =
"[w2tcsoffloader coeffs] ";
64 if( fbs->coeffs() !=
nullptr )
66 for( flatbuffers::Vector<float>::const_iterator it = fbs->coeffs()->begin(); it != fbs->coeffs()->end();
69 msg += std::to_string( *it );
78 static std::vector<float>
coeffs(
void *msgBuffer )
80 std::vector<float> coeffVec;
83 if( fbs->coeffs() !=
nullptr )
85 for( flatbuffers::Vector<float>::const_iterator it = fbs->coeffs()->begin(); it != fbs->coeffs()->end();
88 coeffVec.push_back( *it );
102 if( member ==
"coeffs" )
107 reinterpret_cast<void *
>( &
coeffs ),
112 std::cerr <<
"No member " << member <<
" in telem_w2tcsoffloader\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.
static constexpr flatlogs::eventCodeT TELEM_W2TCSOFFLOADER
bool VerifyTelem_w2tcsoffloader_fbBuffer(::flatbuffers::Verifier &verifier)
const MagAOX::logger::Telem_w2tcsoffloader_fb * GetTelem_w2tcsoffloader_fb(const void *buf)
inline ::flatbuffers::Offset< Telem_w2tcsoffloader_fb > CreateTelem_w2tcsoffloader_fb(::flatbuffers::FlatBufferBuilder &_fbb, ::flatbuffers::Offset<::flatbuffers::Vector< float > > coeffs=0)
static constexpr 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 std::vector< float > &coeffs)
Construct from components.
Log entry recording the woofer-to-TCS Zernike coefficient vector.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static const flatlogs::logPrioT defaultLevel
The default level.
static const flatlogs::eventCodeT eventCode
The event code.
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.
static timespec lastRecord
The time of the last time this log was recorded. Used by the telemetry system.
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatted for human consumption.
static std::vector< float > coeffs(void *msgBuffer)
Recover the coefficient vector from a serialized message.