10 #ifndef logger_types_telem_teldata_hpp
11 #define logger_types_telem_teldata_hpp
13 #include "generated/telem_teldata_generated.h"
15 #include "../logMeta.hpp"
52 auto fp = CreateTelem_teldata_fb(
builder,
roi,
tracking,
guiding,
slewing,
guiderMoving,
az,
zd,
pa,
domeAz,
domeStat);
63 return VerifyTelem_teldata_fbBuffer(verifier);
71 static_cast<void>(len);
73 auto fbs = GetTelem_teldata_fb(msgBuffer);
75 std::string
msg =
"[teldata] ";
78 msg += std::to_string(fbs->roi()) +
" ";
81 msg += std::to_string(fbs->tracking()) +
" ";
84 msg += std::to_string(fbs->guiding()) +
" ";
87 msg += std::to_string(fbs->slewing()) +
" ";
90 msg += std::to_string(fbs->guiderMoving()) +
" ";
93 msg += std::to_string(fbs->az()) +
" ";
96 msg += std::to_string(fbs->zd()) +
" ";
99 msg += std::to_string(fbs->pa()) +
" ";
102 msg += std::to_string(fbs->domeAz()) +
" ";
105 msg += std::to_string(fbs->domeStat());
111 static int roi(
void * msgBuffer )
113 auto fbs = GetTelem_teldata_fb(msgBuffer);
119 auto fbs = GetTelem_teldata_fb(msgBuffer);
120 return fbs->tracking();
125 auto fbs = GetTelem_teldata_fb(msgBuffer);
126 return fbs->guiding();
131 auto fbs = GetTelem_teldata_fb(msgBuffer);
132 return fbs->slewing();
137 auto fbs = GetTelem_teldata_fb(msgBuffer);
138 return fbs->guiderMoving();
141 static double az(
void * msgBuffer )
143 auto fbs = GetTelem_teldata_fb(msgBuffer);
147 static double zd(
void * msgBuffer )
149 auto fbs = GetTelem_teldata_fb(msgBuffer);
153 static double pa(
void * msgBuffer )
155 auto fbs = GetTelem_teldata_fb(msgBuffer);
161 auto fbs = GetTelem_teldata_fb(msgBuffer);
162 return fbs->domeAz();
167 auto fbs = GetTelem_teldata_fb(msgBuffer);
168 return fbs->domeStat();
178 if( member ==
"roi")
return logMetaDetail({
"ROI", logMeta::valTypes::Int, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
roi)});
179 else if(member ==
"tracking")
return logMetaDetail({
"TRACKING", logMeta::valTypes::Int, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
tracking)});
180 else if(member ==
"guiding")
return logMetaDetail({
"GUIDING", logMeta::valTypes::Int, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
guiding)});
181 else if(member ==
"slewing")
return logMetaDetail({
"SLEWING", logMeta::valTypes::Int, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
slewing)});
182 else if(member ==
"guiderMoving")
return logMetaDetail({
"GUIDER MOVING", logMeta::valTypes::Int, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
guiderMoving)});
183 else if(member ==
"az")
return logMetaDetail({
"AZ", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
az),
false});
184 else if(member ==
"zd")
return logMetaDetail({
"ZD", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
zd),
false});
185 else if(member ==
"pa")
return logMetaDetail({
"PARANG", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
pa),
false});
186 else if(member ==
"domeAz")
return logMetaDetail({
"DOME AZ", logMeta::valTypes::Double, logMeta::metaTypes::Continuous,
reinterpret_cast<void*
>(&
domeAz)});
187 else if(member ==
"domeStat")
return logMetaDetail({
"DOME STATUS", logMeta::valTypes::Int, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
domeStat)});
190 std::cerr <<
"No string member " << member <<
" in telem_teldata\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 int &roi, const int &tracking, const int &guiding, const int &slewing, const int &guiderMoving, const double &az, const double &zd, const double &pa, const double &domeAz, const int &domeStat)
Construct from components.
Log entry recording the build-time git state.
static const flatlogs::logPrioT defaultLevel
The default level.
static int roi(void *msgBuffer)
static double domeAz(void *msgBuffer)
static double pa(void *msgBuffer)
static int domeStat(void *msgBuffer)
static int guiding(void *msgBuffer)
static double zd(void *msgBuffer)
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
static int tracking(void *msgBuffer)
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.
static const flatlogs::eventCodeT eventCode
The event code.
static timespec lastRecord
The time of the last time this log was recorded. Used by the telemetry system.
static int guiderMoving(void *msgBuffer)
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static double az(void *msgBuffer)
static int slewing(void *msgBuffer)