10 #ifndef logger_types_telem_telpos_hpp
11 #define logger_types_telem_telpos_hpp
13 #include "generated/telem_telpos_generated.h"
64 return VerifyTelem_telpos_fbBuffer(verifier);
72 static_cast<void>(len);
74 auto fbs = GetTelem_telpos_fb(msgBuffer);
76 std::string
msg =
"[telpos] ";
79 msg += std::to_string(fbs->epoch()) +
" ";
82 msg += std::to_string(fbs->ra()) +
" ";
85 msg += std::to_string(fbs->dec()) +
" ";
88 msg += std::to_string(fbs->el()) +
" ";
91 msg += std::to_string(fbs->ha()) +
" ";
94 msg += std::to_string(fbs->am()) +
" ";
97 msg += std::to_string(fbs->rotoff());
103 static double epoch(
void * msgBuffer )
105 auto fbs = GetTelem_telpos_fb(msgBuffer);
109 static double ra(
void * msgBuffer )
111 auto fbs = GetTelem_telpos_fb(msgBuffer);
115 static double dec(
void * msgBuffer )
117 auto fbs = GetTelem_telpos_fb(msgBuffer);
121 static double el(
void * msgBuffer )
123 auto fbs = GetTelem_telpos_fb(msgBuffer);
127 static double ha(
void * msgBuffer )
129 auto fbs = GetTelem_telpos_fb(msgBuffer);
133 static double am(
void * msgBuffer )
135 auto fbs = GetTelem_telpos_fb(msgBuffer);
139 static double ro(
void * msgBuffer )
141 auto fbs = GetTelem_telpos_fb(msgBuffer);
142 return fbs->rotoff();
153 if(
member ==
"epoch")
return logMetaDetail({
"EPOCH", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
epoch),
false});
154 else if(
member ==
"ra")
return logMetaDetail({
"RA",
"right ascension [degrees]",
"%0.8f", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
ra),
false});
155 else if(
member ==
"dec")
return logMetaDetail({
"DEC",
"declination [degrees]",
"%0.8f", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
dec),
false});
156 else if(
member ==
"el")
return logMetaDetail({
"EL",
"elevation [degrees]",
"%0.8f", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
el),
false});
157 else if(
member ==
"ha")
return logMetaDetail({
"HA",
"hour angle [degrees]",
"%0.8f", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
ha),
false});
158 else if(
member ==
"am")
return logMetaDetail({
"AIRMASS",
"airmass",
"%0.2f", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
am),
false});
159 else if(
member ==
"ro")
return logMetaDetail({
"RO",
"rotator offset [degrees]",
"%0.8f", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
ro),
false});
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 &epoch, const double &ra, const double &dec, const double &el, const double &ha, const double &am, const double &rotoff)
Construct from components.
Log entry recording the build-time git state.
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.
static double dec(void *msgBuffer)
static timespec lastRecord
The time of the last time this log was recorded. Used by the telemetry system.
static double epoch(void *msgBuffer)
static double el(void *msgBuffer)
static const flatlogs::eventCodeT eventCode
The event code.
static double ra(void *msgBuffer)
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static double ro(void *msgBuffer)
static double am(void *msgBuffer)
static const flatlogs::logPrioT defaultLevel
The default level.
static double ha(void *msgBuffer)