10 #ifndef logger_types_telem_telcat_hpp
11 #define logger_types_telem_telcat_hpp
13 #include "generated/telem_telcat_generated.h"
40 const std::string &
catRm,
60 return VerifyTelem_telcat_fbBuffer(verifier);
68 static_cast<void>(len);
70 auto fbs = GetTelem_telcat_fb(msgBuffer);
72 std::string
msg =
"[telcat] ";
74 if(fbs->catObj() !=
nullptr)
77 msg += fbs->catObj()->c_str() ;
82 msg += std::to_string(fbs->catRa()) +
" ";
85 msg += std::to_string(fbs->catDec()) +
" ";
88 msg += std::to_string(fbs->catEp()) +
" ";
90 if(fbs->catRm() !=
nullptr)
93 msg += fbs->catRm()->c_str() ;
98 msg += std::to_string(fbs->catRo()) +
" ";
106 static std::string
catObj(
void * msgBuffer)
108 auto fbs = GetTelem_telcat_fb(msgBuffer);
109 if(fbs->catObj() !=
nullptr)
111 return std::string(fbs->catObj()->c_str());
115 return std::string(
"");
119 static std::string
catRm(
void * msgBuffer)
121 auto fbs = GetTelem_telcat_fb(msgBuffer);
122 if(fbs->catRm() !=
nullptr)
124 return std::string(fbs->catRm()->c_str());
128 return std::string(
"");
132 static double catRA(
void * msgBuffer)
134 auto fbs = GetTelem_telcat_fb(msgBuffer);
140 auto fbs = GetTelem_telcat_fb(msgBuffer);
141 return fbs->catDec();
144 static double catEp(
void * msgBuffer)
146 auto fbs = GetTelem_telcat_fb(msgBuffer);
150 static double catRo(
void * msgBuffer)
152 auto fbs = GetTelem_telcat_fb(msgBuffer);
163 if( member ==
"catObj")
return logMetaDetail({
"OBJECT", logMeta::valTypes::String, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
catObj),
false});
164 else if(member ==
"catRm")
return logMetaDetail({
"CATRM", logMeta::valTypes::String, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
catRm),
false});
165 else if(member ==
"catRA")
return logMetaDetail({
"CATRA", logMeta::valTypes::Double, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
catRA),
false});
166 else if(member ==
"catDec")
return logMetaDetail({
"CATDEC", logMeta::valTypes::Double, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
catDec),
false});
167 else if(member ==
"catEp")
return logMetaDetail({
"CATEP", logMeta::valTypes::Double, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
catEp),
false});
168 else if(member ==
"catRo")
return logMetaDetail({
"CATRO", logMeta::valTypes::Double, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
catRo),
false});
171 std::cerr <<
"No string member " << member <<
" in telem_telcat\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 std::string &catObj, const std::string &catRm, const double &catRa, const double &catDec, const double &catEp, const double &catRo)
Construct from components.
Log entry recording the build-time git state.
static const flatlogs::logPrioT defaultLevel
The default level.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
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 formatte for human consumption.
static std::string catObj(void *msgBuffer)
static double catRo(void *msgBuffer)
static std::string catRm(void *msgBuffer)
static double catRA(void *msgBuffer)
static const flatlogs::eventCodeT eventCode
The event code.
static double catEp(void *msgBuffer)
static double catDec(void *msgBuffer)