10 #ifndef logger_types_telem_sparkleclock_hpp
11 #define logger_types_telem_sparkleclock_hpp
13 #include "generated/telem_sparkleclock_generated.h"
42 const float & interval,
64 return VerifyTelem_sparkleclock_fbBuffer(verifier);
72 static_cast<void>(len);
74 auto fbs = GetTelem_sparkleclock_fb(msgBuffer);
76 std::string
msg =
"[sparkleclock] ";
78 if(!fbs->modulating())
80 msg +=
"not modulating";
87 msg +=
" by trigger ";
92 msg += std::to_string(fbs->frequency());
97 for(flatbuffers::Vector<float>::const_iterator
it = fbs->separations()->begin();
it != fbs->separations()->end(); ++
it)
99 msg+= std::to_string(*
it);
102 msg +=
"angle offset: ";
103 msg += std::to_string(fbs->angleOffset());
105 msg += std::to_string(fbs->amplitude());
113 auto fbs = GetTelem_sparkleclock_fb(msgBuffer);
114 return fbs->modulating();
119 auto fbs = GetTelem_sparkleclock_fb(msgBuffer);
120 return fbs->trigger();
125 auto fbs = GetTelem_sparkleclock_fb(msgBuffer);
126 return fbs->frequency();
131 std::vector<float> v;
133 auto fbs = GetTelem_sparkleclock_fb(msgBuffer);
135 for(flatbuffers::Vector<float>::const_iterator
it = fbs->separations()->begin();
it != fbs->separations()->end(); ++
it)
145 auto fbs = GetTelem_sparkleclock_fb(msgBuffer);
146 return fbs->angleOffset();
150 auto fbs = GetTelem_sparkleclock_fb(msgBuffer);
151 return fbs->amplitude();
161 if(member ==
"modulating")
return logMetaDetail({
"MODULATING", logMeta::valTypes::Bool, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
modulating)});
162 else if(member ==
"trigger")
return logMetaDetail({
"TRIGGERED", logMeta::valTypes::Bool, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
trigger)});
163 else if(member ==
"frequency")
return logMetaDetail({
"FREQUENCY", logMeta::valTypes::Float, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
frequency)});
164 else if(member ==
"separations")
return logMetaDetail({
"SEPARATIONS", logMeta::valTypes::Vector_Float, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
separations)});
165 else if(member ==
"angleOffset")
return logMetaDetail({
"ANGLEOFFSET", logMeta::valTypes::Float, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
angleOffset)});
166 else if(member ==
"amplitude")
return logMetaDetail({
"AMPLITUDES", logMeta::valTypes::Float, logMeta::metaTypes::State,
reinterpret_cast<void*
>(&
amplitude)});
169 std::cerr <<
"No string member " << member <<
" in telem_sparkleclock\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 bool &modulating, const bool &trigger, const float &frequency, const float &interval, const std::vector< float > &separations, const float &angleOffset, const float &litude)
Construct from components.
Log entry recording sparkle clock status.
static bool trigger(void *msgBuffer)
static bool modulating(void *msgBuffer)
static logMetaDetail getAccessor(const std::string &member)
Get pointer to the accessor for a member by name.
static float frequency(void *msgBuffer)
static const flatlogs::eventCodeT eventCode
The event code.
static float amplitude(void *msgBuffer)
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
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 std::vector< float > separations(void *msgBuffer)
static float angleOffset(void *msgBuffer)
static const flatlogs::logPrioT defaultLevel
The default level.