Class Interface

Class Documentation

class Interface

interface class for acam

This class defines the interface for the acam system and contains the functions used to communicate with it. The Target class is my friend so I share an instance of my *this pointer so that he can call my functions.

Public Functions

inline Interface()
inline bool is_target_acquired()
inline std::string get_imagename()
inline std::string get_wcsname()
inline void set_imagename(std::string name_in)
inline void set_wcsname(std::string name_in)
inline long init_pubsub(const std::initializer_list<std::string> &topics = {})

for calling Python fpoffsets, defined in ~/Software/common/skyinfo.h

inline void start_subscriber_thread()
inline void stop_subscriber_thread()
void handletopic_snapshot(const nlohmann::json &jmessage)
void handletopic_tcsd(const nlohmann::json &jmessage)
void handletopic_targetinfo(const nlohmann::json &jmessage)
void handletopic_slitd(const nlohmann::json &jmessage)
long bin(std::string args, std::string &retstring)
void publish_snapshot()
void publish_status(bool force = false)
void publish_temperature()

publish only the andor temperature on Topic::ACAMD (periodic)

void request_snapshot()
bool wait_for_snapshots()
long initialize_python_objects()
long test_image()

provides interface to initialize all Python modules for objects in this class

long open(std::string args, std::string &help)
long isopen(std::string component, bool &state, std::string &help)

wrapper to open all acam-related hardware components

bool isopen(std::string component)

wrapper for acam-related hardware components

void close()

wrapper for acam-related hardware components

long close(std::string component, std::string &help)
long tcs_init(std::string args, std::string &retstring)
long framegrab(std::string args, std::string &retstring)

initialize connection to TCS

long framegrab_fix(std::string args, std::string &retstring)

wrapper to control Andor frame grabbing

long saveframes(std::string args, std::string &retstring)

wrapper to control Andor frame grabbing

long skipframes(std::string args, std::string &retstring)

set/get number of frame grabgs to save during acquisition

long image_quality(std::string args, std::string &retstring)

set/get number of frame grabgs to skip before target acquisition

long solve(std::string args, std::string &retstring)

wrapper for Astrometry::image_quality

long guider_settings_control()

wrapper for Astrometry::solve

long guider_settings_control(std::string args, std::string &retstring)

get guider settings and push to Guider GUI display

long avg_frames(std::string args, std::string &retstring)

set or get and push to Guider GUI display

long offset_period(std::string args, std::string &retstring)
long acquire(std::string args, std::string &retstring)
long target_coords(std::string args, std::string &retstring)
long offset_cal(const std::string args, std::string &retstring)

set or get target coords for acquire

long offset_goal(const std::string args, std::string &retstring)
long put_on_slit(const std::string args, std::string &retstring)
void preserve_framegrab()
long shutdown(std::string args, std::string &retstring)
long test(std::string args, std::string &retstring)
long exptime(const std::string args, std::string &retstring)
long fan_mode(std::string args, std::string &retstring)
long assemble_header_info()
inline void init_names()
long configure_interface(Config &config)

Public Members

std::string acquire_mode = ""
bool is_acquired = false
int nacquired = 0
int attempts = 0
std::string filter = ""
std::string cover = ""
std::string motion_host
int motion_port
std::atomic<bool> should_framegrab_run

set if framegrab loop should run

std::atomic<bool> is_framegrab_running

set if framegrab loop is running

std::atomic<bool> is_shutting_down

set during shutdown

std::atomic<int> nskip_before_acquire

number of frame grabs to skip before using for target acquisition

std::atomic<int> nsave_preserve_frames

number of frames to preserve (normally overwritten)

these are set by Interface::saveframes()

std::atomic<int> nskip_preserve_frames

number of frames to skip before saving nsave… frames

std::condition_variable newframe
std::mutex newframe_mutex
std::atomic<bool> newframe_ready
std::vector<std::string> db_info

info for constructing telemetry Database object

std::string tcsname
bool is_tcs_open
double angle_scope
std::string ra_scope_hms
std::string dec_scope_dms
double ra_scope_h
double dec_scope_d
double offsetra
double offsetdec
double az
double telfocus
double airmass
struct Acam::Interface tcsdata
std::mutex tcsdata_mtx
std::mutex snapshot_mtx
std::unordered_map<std::string, bool> snapshot_status
nlohmann::json tcs_jmessage

JSON message containing TCS telemetry.

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

GuideManager guide_manager
Database::Database database
Acam::FitsInfo fitsinfo
Common::Header telemkeys

subscribed telemetry goes here

Target target
Common::Queue async

for target acquisition

Camera camera

asynchronous message queue

MotionInterface motion
Astrometry astrometry

this object provides the interface to the filter and dust cover

FITS_file fits_file

provides the interface to the Python astrometry packages

TcsDaemonClient tcsd

instantiate a FITS container object

SkyInfo::FPOffsets fpoffsets

for communicating with the TCS daemon, defined in ~/Software/tcsd/tcsd_client.h

Public Static Functions

static void dothread_fpoffset(Acam::Interface &iface)
static void dothread_framegrab(Acam::Interface &iface, const std::string whattodo, std::string sourcefile)
static void dothread_set_filter(Acam::Interface &iface, std::string filter_req)
static void dothread_set_focus(Acam::Interface &iface, double focus_req)
static void dothread_monitor_focus(Acam::Interface &iface)