Class Interface#

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 open_campbell()#

Campbell functions

long close_campbell()#
long open_lakeshores()#

Lakeshore functions

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::unique_ptr<Common::PubSub> publisher#

publisher object

std::string publisher_address#

publish socket endpoint

std::string publisher_topic#

my default topic for publishing

std::unique_ptr<Common::PubSub> subscriber#

subscriber object

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

Common::Queue async#
std::map<int, Thermal::Lakeshore> lakeshore#

STL map of all Lakeshores indexed by LKS#.

Thermal::Campbell campbell#

Campbell object for datalogger.

std::mutex lakeshoredata_mtx#
std::mutex telemdata_mtx#
std::mutex externaldata_mtx#
std::map<std::string, mysqlx::Value> lakeshoredata#

map of Lakeshore readings indexed by label

std::map<std::string, mysqlx::Value> campbelldata#

map of Campbell readings indexed by label

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#

Public Members

std::string device#

device type e.g. LKS, CAMP, etc.

int unit#

user-assigned unit number

std::string name#

user-assigned name

std::string chan#

channel number e.g. A, B, C1, H1, 1, etc.

std::string label#

channel label (must be unique for indexing by label)