10 #ifndef logger_types_telem_fgtimings_hpp
11 #define logger_types_telem_fgtimings_hpp
13 #include "generated/telem_fgtimings_generated.h"
43 const double & mawtime,
44 const double & mawtime_jitter
58 return VerifyTelem_fgtimings_fbBuffer(verifier);
66 static_cast<void>(len);
70 auto fbs = GetTelem_fgtimings_fb(msgBuffer);
72 std::string
msg =
"[fgtimes]";
76 snprintf(buf,
sizeof(buf),
"%0.10e", fbs->atime());
79 snprintf(buf,
sizeof(buf),
"%0.5e", fbs->atime_jitter());
84 snprintf(buf,
sizeof(buf),
"%0.10e", fbs->wtime());
87 snprintf(buf,
sizeof(buf),
"%0.5e", fbs->wtime_jitter());
92 snprintf(buf,
sizeof(buf),
"%0.10e", fbs->wmatime());
95 snprintf(buf,
sizeof(buf),
"%0.5e", fbs->wmatime_jitter());
102 static double atime(
void * msgBuffer )
104 auto fbs = GetTelem_fgtimings_fb(msgBuffer);
110 auto fbs = GetTelem_fgtimings_fb(msgBuffer);
111 return fbs->atime_jitter();
114 static double wtime(
void * msgBuffer )
116 auto fbs = GetTelem_fgtimings_fb(msgBuffer);
122 auto fbs = GetTelem_fgtimings_fb(msgBuffer);
123 return fbs->wtime_jitter();
128 auto fbs = GetTelem_fgtimings_fb(msgBuffer);
129 return fbs->wmatime();
134 auto fbs = GetTelem_fgtimings_fb(msgBuffer);
135 return fbs->wmatime_jitter();
145 if(member ==
"atime")
return logMetaDetail({
"ACQ TIME", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
atime)});
146 else if(member ==
"atime_jitter")
return logMetaDetail({
"ACQ JITTER", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
atime_jitter)});
147 else if(member ==
"wtime")
return logMetaDetail({
"WRT TIME", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
wtime)});
148 else if(member ==
"wtime_jitter")
return logMetaDetail({
"WRT JITTER", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
wtime_jitter)});
149 else if(member ==
"wmatime")
return logMetaDetail({
"WRT-ACQ TIME", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
wmatime)});
150 else if(member ==
"wmatime_jitter")
return logMetaDetail({
"WRT-ACQ JITTER", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
wmatime_jitter)});
154 std::cerr <<
"No string member " << member <<
" in telem_fgtimings\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 double &atime, const double &atime_jitter, const double &wtime, const double &wtime_jitter, const double &mawtime, const double &mawtime_jitter)
Construct from components.
Log entry recording framegrabber timings.
static double wtime(void *msgBuffer)
static timespec lastRecord
The timestamp of the last time this log was recorded. Used by the telemetry system.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static double wtime_jitter(void *msgBuffer)
static const flatlogs::eventCodeT eventCode
The event code.
static const flatlogs::logPrioT defaultLevel
The default level.
static double wmatime_jitter(void *msgBuffer)
static double atime_jitter(void *msgBuffer)
static double atime(void *msgBuffer)
static logMetaDetail getAccessor(const std::string &member)
Get pointer to the accessor for a member by name.
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
static double wmatime(void *msgBuffer)