Class Interface#
Defined in File thermal_interface.h
Nested Relationships#
Nested Types#
Class Documentation#
-
class Interface#
interface class for a thermal device
This class defines the interface for each temperature controller and contains the functions used to communicate with it.
Public Functions
-
inline Interface()#
-
inline long init_pubsub(const std::initializer_list<std::string> &topics = {})#
-
inline void start_subscriber_thread()#
-
inline void stop_subscriber_thread()#
-
void handletopic_snapshot(const nlohmann::json &jmessage)#
respond to a snapshot request
-
void handletopic_acamd(const nlohmann::json &jmessage)#
stash acam CCD temperature into externaldata
-
void handletopic_slicecamd(const nlohmann::json &jmessage)#
stash slicecam CCD temperatures into externaldata
-
void publish_status()#
publish thermalinfo on Topic::THERMALD
-
void request_snapshot()#
ask subscribed daemons to publish their status
-
void process_external_data(const nlohmann::json &jmessage)#
apply DB-bound JSON keys from a pub/sub message to externaldata
Iterates DbColumnDefs::ExternalDataColumns; for each entry whose jkey appears in the message with a non-null value, stores the value into externaldata under the bound column name.
- Parameters:
jmessage – [in] json message received via pub/sub
-
long reconnect(std::string args, std::string &retstring)#
close,open all hardware devices
-
long close_campbell()#
-
long close_lakeshores()#
-
long parse_unit_chan(std::string args, int &unit, std::string &chan)#
-
long lakeshore_readall()#
read all Lakeshores into memory
-
long get(std::string args, std::string &retstring)#
read specified channel from specified LKS unit
-
long print_labels(std::string args, std::string &retstring)#
print lakeshore channel labels
-
long show_telemdata(std::string args, std::string &retstring)#
-
long native(std::string cmd, std::string &retstring)#
send Lakeshore-native command to specified unit
-
long setpoint(std::string args, std::string &retstring)#
set or get setpoint for specified output
Public Members
-
std::string publisher_address#
publish socket endpoint
-
std::string publisher_topic#
my default topic for publishing
-
std::string subscriber_address#
subscribe socket endpoint
-
std::vector<std::string> subscriber_topics#
list of topics I subscribe to
-
std::atomic<bool> is_subscriber_thread_running#
is my subscriber thread running?
-
std::atomic<bool> should_subscriber_thread_run#
should my subscriber thread run?
-
std::unordered_map<std::string, std::function<void(const nlohmann::json&)>> topic_handlers#
maps a handler function to each topic
-
std::mutex lakeshoredata_mtx#
-
std::mutex telemdata_mtx#
-
std::mutex externaldata_mtx#
-
std::map<std::string, mysqlx::Value> telemdata#
map of all readings (merge lakeshore+campbell)
-
std::map<std::string, mysqlx::Value> externaldata#
map of telemetry received from other daemons
-
std::map<std::string, thermal_info_t> thermal_info#
thermal info database, indexed by channel label
-
struct thermal_info_t#
-
inline Interface()#