10 #ifndef logger_types_telem_zaber_hpp
11 #define logger_types_telem_zaber_hpp
13 #include "generated/telem_zaber_generated.h"
56 return VerifyTelem_zaber_fbBuffer(verifier);
64 static_cast<void>(len);
66 auto fbs = GetTelem_zaber_fb(msgBuffer);
68 std::string
msg =
"[zaber] ";
71 msg += std::to_string(fbs->pos()) +
" ";
74 msg += std::to_string(fbs->rawPos()) +
" ";
77 msg += std::to_string(fbs->temp());
83 static float pos(
void * msgBuffer )
85 auto fbs = GetTelem_zaber_fb(msgBuffer);
89 static float rawPos(
void * msgBuffer )
91 auto fbs = GetTelem_zaber_fb(msgBuffer);
95 static float temp(
void * msgBuffer )
97 auto fbs = GetTelem_zaber_fb(msgBuffer);
108 if( member ==
"pos")
return logMetaDetail({
"POS", logMeta::valTypes::Float, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
pos)});
109 else if(member ==
"rawPos")
return logMetaDetail({
"COUNTS", logMeta::valTypes::Float, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
rawPos)});
110 else if(member ==
"temp")
return logMetaDetail({
"TEMP", logMeta::valTypes::Float, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
temp)});
113 std::cerr <<
"No string member " << member <<
" in telem_zaber\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 float &pos, const float &rawPos, const float &temp)
Construct from components.
Log entry recording zaber stage specific status.
static float pos(void *msgBuffer)
static float temp(void *msgBuffer)
static const flatlogs::logPrioT defaultLevel
The default level.
static const flatlogs::eventCodeT eventCode
The event code.
static float rawPos(void *msgBuffer)
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static timespec lastRecord
The timestamp 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 formatte for human consumption.