Class CalibInfo#

Class Documentation#

class CalibInfo#

holds the most recently published calibd telemetry

Written by the subscriber thread, read by the sequence threads; the caller serializes all access under Sequence::calibd_mtx.

Public Functions

inline CalibInfo()#
inline void init()#

initialize all class member variables to “non-values”

inline void store(const nlohmann::json &jmessage)#

store a received calibd telemetry message

calibd publishes strings: the actuators as a position name, the modulators as “<pow> <dut> <per>”. Both reduce to a tri-state here so comparing against a desired state is uniform.

Parameters:

jmessage[in] subscribed-received JSON message

inline bool is_valid() const#

is there cached telemetry to act on?

Not an age check, unlike TcsInfo::is_fresh(). calibd publishes only on change, plus a forced publish at startup and on request, so telemetry hours old is still current and an age check would reject all of it. Anything that can invalidate the cache without calibd publishing must clear it.

Returns:

true|false

inline void invalidate()#

discard the cache, e.g. when calibd is known to have restarted

inline int lampmod_state(const std::string &name) const#

cached state of the named modulator

Parameters:

name[in] Lamp::Mod name

Returns:

1=on 0=off -1=undefined or unknown modulator

Public Members

int caldoor#

1=open 0=closed -1=undefined

int calcover#

1=open 0=closed -1=undefined

std::map<std::string, int> lampmod#

1=on 0=off -1=undefined, indexed by Lamp::Mod name