10#ifndef logger_types_cred2_temps_hpp
11#define logger_types_cred2_temps_hpp
58 static_cast<size_t>( len ) );
67 static_cast<void>( len );
71 std::string msg =
"mb: ";
72 msg += std::to_string( fbs->motherboard() ) +
" C ";
75 msg += std::to_string( fbs->frontend() ) +
" C ";
78 msg += std::to_string( fbs->powerboard() ) +
" C ";
81 msg += std::to_string( fbs->snake() ) +
" C ";
84 msg += std::to_string( fbs->setpoint() ) +
" C ";
87 msg += std::to_string( fbs->peltier() ) +
" C ";
90 msg += std::to_string( fbs->heatsink() ) +
" C ";
98 return fbs->motherboard();
104 return fbs->frontend();
110 return fbs->powerboard();
113 static float snake(
void *msgBuffer )
122 return fbs->setpoint();
128 return fbs->peltier();
134 return fbs->heatsink();
144 if( member ==
"motherboard" )
146 "motherboard temperature [C]",
151 else if( member ==
"frontend" )
153 "front-end temperature [C]",
156 reinterpret_cast<void *
>( &
frontend ),
158 else if( member ==
"powerboard" )
160 "power-board temperature [C]",
165 else if( member ==
"snake" )
167 "detector temperature [C]",
170 reinterpret_cast<void *
>( &
snake ),
172 else if( member ==
"setpoint" )
174 "detector setpoint temperature [C]",
177 reinterpret_cast<void *
>( &
setpoint ),
179 else if( member ==
"peltier" )
181 "external TEC temperature [C]",
184 reinterpret_cast<void *
>( &
peltier ),
186 else if( member ==
"heatsink" )
188 "heatsink temperature [C]",
191 reinterpret_cast<void *
>( &
heatsink ),
195 std::cerr <<
"No member " << member <<
" in cred2_temps\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.
static constexpr flatlogs::eventCodeT CRED2_TEMPS
bool VerifyCred2_temps_fbBuffer(::flatbuffers::Verifier &verifier)
inline ::flatbuffers::Offset< Cred2_temps_fb > CreateCred2_temps_fb(::flatbuffers::FlatBufferBuilder &_fbb, float motherboard=0.0f, float frontend=0.0f, float powerboard=0.0f, float snake=0.0f, float setpoint=0.0f, float peltier=0.0f, float heatsink=0.0f)
const MagAOX::logger::Cred2_temps_fb * GetCred2_temps_fb(const void *buf)
static constexpr logPrioT LOG_TELEM
A telemetry recording.
The type of the input message.
messageT(const float &motherboard, const float &frontend, const float &powerboard, const float &snake, const float &setpoint, const float &peltier, const float &heatsink)
Construct from components.
Log entry recording the C-RED 2 detailed temperature channels.
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatted for human consumption.
static float powerboard(void *msgBuffer)
static timespec lastRecord
The timestamp of the last time this log was recorded. Used by telemetry.
static float peltier(void *msgBuffer)
static float setpoint(void *msgBuffer)
static float heatsink(void *msgBuffer)
static const flatlogs::eventCodeT eventCode
The event code.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static float motherboard(void *msgBuffer)
static float frontend(void *msgBuffer)
static float snake(void *msgBuffer)
static const flatlogs::logPrioT defaultLevel
The default level.
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.
Message type for resolving log messages with a f.b. builder.
flatbuffers::FlatBufferBuilder builder
Base class for logs consisting of a flatbuffer message.