API
MagAOX::app::tcsInterface Class Reference

The MagAO-X Clay Telescope TCS Interface. More...

#include <tcsInterface.hpp>

Inheritance diagram for MagAOX::app::tcsInterface:
Inheritance graph
Collaboration diagram for MagAOX::app::tcsInterface:
Collaboration graph

Public Types

typedef logger::logManager< MagAOXApp< _useINDI >, logFileRawlogManagerT
 The log manager type. More...
 
typedef logger::logManager< tcsInterface, logFileRaw > logManagerT
 The log manager type. More...
 

Public Member Functions

 tcsInterface ()
 Default c'tor. More...
 
 ~tcsInterface () noexcept
 D'tor, declared and defined for noexcept. More...
 
virtual void setupConfig ()
 
int loadConfigImpl (mx::app::appConfigurator &_config)
 Implementation of loadConfig logic, separated for testing. More...
 
virtual void loadConfig ()
 
virtual int appStartup ()
 Startup function. More...
 
virtual int appLogic ()
 Implementation of the FSM for tcsInterface. More...
 
virtual int appShutdown ()
 Shutdown the app. More...
 
int getMagTelStatus (std::string &response, const std::string &statreq)
 
int sendMagTelCommand (const std::string &command, int timeout)
 
int parse_xms (double &x, double &m, double &s, const std::string &xmsstr)
 
std::vector< std::string > parse_teldata (std::string &tdat)
 
int getTelTime ()
 
int getTelPos ()
 
int getTelData ()
 
int getCatData ()
 
int getVaneData ()
 
int getEnvData ()
 
int getSeeing ()
 
int updateINDI ()
 
 INDI_SETCALLBACK_DECL (tcsInterface, m_indiP_loopState)
 
int shutdown ()
 Get the value of the shutdown flag. More...
 
virtual void setDefaults (int argc, char **argv)
 Set the paths for config files. More...
 
virtual void setupBasicConfig ()
 The basic MagAO-X configuration setup method. Should not normally be overridden. More...
 
virtual void loadBasicConfig ()
 The basic MagAO-X configuration processing method. Should not normally be overridden. More...
 
virtual void checkConfig ()
 Check for unused and unrecognized config options and settings. More...
 
virtual int execute ()
 The execute method implementing the standard main loop. Should not normally be overridden. More...
 
int setupConfig (mx::app::appConfigurator &config)
 Setup an application configurator for the device section. More...
 
int loadConfig (mx::app::appConfigurator &config)
 Load the device section from an application configurator. More...
 
int telem (const typename telT::messageT &msg)
 Make a telemetry recording. More...
 
int telem ()
 Make a telemetry recording, for an empty record. More...
 
int setupConfig (appConfigurator &config)
 Setup an application configurator for the device section. More...
 
int loadConfig (appConfigurator &config)
 Load the device section from an application configurator. More...
 
int checkRecordTimes (const telT &tel, telTs... tels)
 Check the time of the last record for each telemetry type and make an entry if needed. More...
 
int checkRecordTimes (timespec &ts, const telT &tel, telTs... tels)
 Worker function to actually perform the record time checking logic. More...
 
int checkRecordTimes (timespec &ts)
 Empty function called at the end of the template list. More...
 
Telemeter Interface
int checkRecordTimes ()
 
int recordTelem (const telem_telpos *)
 
int recordTelem (const telem_teldata *)
 
int recordTelem (const telem_telvane *)
 
int recordTelem (const telem_telenv *)
 
int recordTelem (const telem_telcat *)
 
int recordTelem (const telem_telsee *)
 
int recordTelPos (bool force=false)
 
int recordTelData (bool force=false)
 
int recordTelVane (bool force=false)
 
int recordTelEnv (bool force=false)
 
int recordTelCat (bool force=false)
 
int recordTelSee (bool force=false)
 
Threads
int threadStart (std::thread &thrd, bool &thrdInit, pid_t &tpid, pcf::IndiProperty &thProp, int thrdPrio, const std::string &cpuset, const std::string &thrdName, thisPtr *thrdThis, Function &&thrdStart)
 Start a thread, using this class's privileges to set priority, etc. More...
 
Member Accessors
std::string configName ()
 Get the config name. More...
 
std::string configDir ()
 Get the config directory. More...
 
std::string driverInName ()
 Get the INDI input FIFO file name. More...
 
std::string driverOutName ()
 Get the INDI output FIFO file name. More...
 
std::string driverCtrlName ()
 Get the INDI control FIFO file name. More...
 

Public Attributes

int m_loopState {0}
 
pcf::IndiProperty m_indiP_loopState
 Property used to report the loop state. More...
 
unsigned m_readTimeout {1000}
 The read timeout [msec]. More...
 
unsigned m_writeTimeout {1000}
 The write timeout [msec]. More...
 
logManagerT m_tel
 
double m_maxInterval
 The maximum interval, in seconds, between telemetry records. Default is 10.0 seconds. More...
 

Protected Attributes

tty::netSerial m_sock
 
std::mutex m_tcsMutex
 Mutex for locking INDI communications. More...
 
double m_telST {0}
 
pcf::IndiProperty m_indiP_teltime
 
double m_telEpoch {0}
 
double m_telRA {0}
 
double m_telDec {0}
 
double m_telEl {0}
 
double m_telHA {0}
 
double m_telAM {0}
 
double m_telRotOff {0}
 
pcf::IndiProperty m_indiP_telpos
 
double m_telSecZ {0}
 
double m_telEncZ {0}
 
double m_telSecX {0}
 
double m_telEncX {0}
 
double m_telSecY {0}
 
double m_telEncY {0}
 
double m_telSecH {0}
 
double m_telEncH {0}
 
double m_telSecV {0}
 
double m_telEncV {0}
 
pcf::IndiProperty m_indiP_vaneend
 INDI Property for the vane end positions. More...
 
double m_wxtemp {0}
 Outside temperature, Celsius. More...
 
double m_wxpres {0}
 Outside pressue, millibars. More...
 
double m_wxhumid {0}
 Outside humidity, percent. More...
 
double m_wxwind {0}
 outside wind intensity, mph More...
 
double m_wxwdir {0}
 outside wind direction, degrees More...
 
double m_ttruss {0}
 Telescope truss temperature, Celsius. More...
 
double m_tcell {0}
 Primary mirror cell temperature, Celsius. More...
 
double m_tseccell {0}
 Secondary mirror cell temperature, Celsius. More...
 
double m_tambient {0}
 Dome air temperature, Celsius. More...
 
double m_wxdewpoint {0}
 Dew point from weather station. More...
 
pcf::IndiProperty m_indiP_env
 INDI Property for environment. More...
 
double m_dimm_el {0}
 DIMM elevation at time of seeing measurement. More...
 
double m_dimm_fwhm {0}
 DIMM raw FWHM. More...
 
double m_dimm_fwhm_corr {0}
 DIMM elevation corrected FWHM. More...
 
int m_dimm_time {0}
 Seconds since midnight of DIMM measurement. More...
 
double m_mag1_el {0}
 MAG1 elevation at time of seeing measurement. More...
 
double m_mag1_fwhm {0}
 MAG1 raw FWHM. More...
 
double m_mag1_fwhm_corr {0}
 MAG1 elevation corrected FWHM. More...
 
int m_mag1_time {0}
 Seconds since midnight of MAG1 measurement. More...
 
double m_mag2_el {0}
 MAG2 elevation at time of seeing measurement. More...
 
double m_mag2_fwhm {0}
 MAG2 raw FWHM. More...
 
double m_mag2_fwhm_corr {0}
 MAG2 elevation corrected FWHM. More...
 
int m_mag2_time {0}
 Seconds since midnight of MAG2 measurement. More...
 
pcf::IndiProperty m_indiP_seeing
 INDI Property for seeing. More...
 
std::string MagAOXPath
 The base path of the MagAO-X system. More...
 
std::string m_configName
 The name of the configuration file (minus .conf). More...
 
std::string m_configDir
 The path to configuration files for MagAOX. More...
 
std::string m_configBase
 The name of a base config class for this app (minus .conf). More...
 
std::string m_calibDir
 The path to calibration files for MagAOX. More...
 
std::string sysPath
 The path to the system directory, for PID file, etc. More...
 
std::string secretsPath
 Path to the secrets directory, where passwords, etc, are stored. More...
 
unsigned long m_loopPause
 The time in nanoseconds to pause the main loop. The appLogic() function of the derived class is called every m_loopPause nanoseconds. Default is 1,000,000,000 ns. Config with loopPause=X. More...
 
int m_shutdown
 Flag to signal it's time to shutdown. When not 0, the main loop exits. More...
 
Configurable Parameters
std::string m_deviceAddr {"localhost"}
 The IP address or resolvable name of the TCS. More...
 
int m_devicePort {5811}
 The IP port for TCS communications. Should be the command port. Default is 5811. More...
 
int m_seeingInterval {2}
 
bool m_labMode {true}
 
Telescope Data
int m_telROI {0}
 The rotator of interest. More...
 
int m_telTracking {0}
 tracking state More...
 
int m_telGuiding {0}
 guider moving state More...
 
int m_telSlewing {0}
 slewing state More...
 
int m_telGuiderMoving {0}
 guider moving state More...
 
double m_telAz {0}
 azimuth More...
 
double m_telZd {0}
 zenith distance More...
 
double m_telPA {0}
 parallactic angle More...
 
double m_telDomeAz {0}
 dome azimuth More...
 
int m_telDomeStat {0}
 dome status More...
 
pcf::IndiProperty m_indiP_teldata
 
Telescope Catalog Information
double m_catRA {0}
 Catalog right ascension [degrees]. More...
 
double m_catDec {0}
 Catalog declination [degrees]. More...
 
double m_catEp {0}
 Catalog epoch. More...
 
double m_catRo {0}
 Catalog rotator offset. More...
 
std::string m_catRm
 Catalog rotator mode. More...
 
std::string m_catObj
 Catalog object name. More...
 
pcf::IndiProperty m_indiP_catalog
 INDI Property for the catalog text information. More...
 
pcf::IndiProperty m_indiP_catdata
 INDI Property for the catalog data. More...
 
cpusets

The path to the cpusets mount is configured by the environment varialbe defined by MAGOX_env_cpuset in environment.hpp. This environment varialbe is normally named "CGROUPS1_CPUSET_MOUNTPOINT". If the environment variable is not set, the default defined by MAGAOX_cpusetPath in paths.hpp is used. This is normally "/opt/MagAOX/cpuset/"

std::string m_cpusetPath
 

Private Member Functions

int clearFSMAlert ()
 Clear the FSM alert state. More...
 
tcsInterfacederived ()
 Access the derived class. More...
 

Friends

class tcsInterface_test
 
class dev::telemeter< tcsInterface >
 

PID Locking

Each MagAOXApp has a PID lock file in the system directory. The app will not startup if it detects that the PID is already locked, preventing duplicates. This is based on the configured name, not the invoked name (argv[0]).

std::string pidFileName
 The name of the PID file. More...
 
pid_t m_pid
 This process's PID. More...
 
int lockPID ()
 Attempt to lock the PID by writing it to a file. Fails if a process is already running with the same config name. More...
 
int unlockPID ()
 Remove the PID file. More...
 

INDI Interface

For reference: "Get" and "New" refer to properties we own. "Set" refers to properties owned by others. So we respond to GetProperties by listing our own properties, and NewProperty is a request to change a property we own. Whereas SetProperty is a notification that someone else has changed a property.

std::unordered_map< std::string, indiCallBack > m_indiNewCallBacks
 Map to hold the NewProperty indiCallBacks for this App, with fast lookup by property name. More...
 
std::unordered_map< std::string, indiCallBack > m_indiSetCallBacks
 Map to hold the SetProperty indiCallBacks for this App, with fast lookup by property name. More...
 
bool m_allDefsReceived
 Flag indicating that all registered Set properties have been updated since last Get. More...
 
std::string m_driverInName
 Full path name of the INDI driver input FIFO. More...
 
std::string m_driverOutName
 Full path name of the INDI driver output FIFO. More...
 
std::string m_driverCtrlName
 Full path name of the INDI driver control FIFO. More...
 
pcf::IndiProperty m_indiP_state
 indi Property to report the application state. More...
 
pcf::IndiProperty m_indiP_clearFSMAlert
 indi Property to clear an FSM alert. More...
 
indiDriver< MagAOXApp > * m_indiDriver
 The INDI driver wrapper. Constructed and initialized by execute, which starts and stops communications. More...
 
std::mutex m_indiMutex
 Mutex for locking INDI communications. More...
 
int createStandardIndiText (pcf::IndiProperty &prop, const std::string &propName, const std::string &label="", const std::string &group="")
 Create a standard R/W INDI Text property with target and current elements. More...
 
int createROIndiText (pcf::IndiProperty &prop, const std::string &propName, const std::string &elName, const std::string &propLabel="", const std::string &propGroup="", const std::string &elLabel="")
 Create a standard ReadOnly INDI Text property, with at least one element. More...
 
int createStandardIndiNumber (pcf::IndiProperty &prop, const std::string &name, const T &min, const T &max, const T &step, const std::string &format, const std::string &label="", const std::string &group="")
 Create a standard R/W INDI Number property with target and current elements. More...
 
int createROIndiNumber (pcf::IndiProperty &prop, const std::string &propName, const std::string &propLabel="", const std::string &propGroup="")
 Create a ReadOnly INDI Number property. More...
 
int createStandardIndiToggleSw (pcf::IndiProperty &prop, const std::string &name, const std::string &label="", const std::string &group="")
 Create a standard R/W INDI switch with a single toggle element. More...
 
int createStandardIndiRequestSw (pcf::IndiProperty &prop, const std::string &name, const std::string &label="", const std::string &group="")
 Create a standard R/W INDI switch with a single request element. More...
 
int createStandardIndiSelectionSw (pcf::IndiProperty &prop, const std::string &name, const std::vector< std::string > &elements, const std::vector< std::string > &elementLabels, const std::string &label="", const std::string &group="")
 Create a standard R/W INDI selection (one of many) switch with vector of elements and element labels. More...
 
int createStandardIndiSelectionSw (pcf::IndiProperty &prop, const std::string &name, const std::vector< std::string > &elements, const std::string &label="", const std::string &group="")
 Create a standard R/W INDI selection (one of many) switch with vector of elements using the element strings as their own labels. More...
 
int registerIndiPropertyReadOnly (pcf::IndiProperty &prop)
 Register an INDI property which is read only. More...
 
int registerIndiPropertyReadOnly (pcf::IndiProperty &prop, const std::string &propName, const pcf::IndiProperty::Type &propType, const pcf::IndiProperty::PropertyPermType &propPerm, const pcf::IndiProperty::PropertyStateType &propState)
 Register an INDI property which is read only. More...
 
int registerIndiPropertyNew (pcf::IndiProperty &prop, int(*)(void *, const pcf::IndiProperty &))
 Register an INDI property which is exposed for others to request a New Property for. More...
 
int registerIndiPropertyNew (pcf::IndiProperty &prop, const std::string &propName, const pcf::IndiProperty::Type &propType, const pcf::IndiProperty::PropertyPermType &propPerm, const pcf::IndiProperty::PropertyStateType &propState, int(*)(void *, const pcf::IndiProperty &))
 Register an INDI property which is exposed for others to request a New Property for. More...
 
int registerIndiPropertyNew (pcf::IndiProperty &prop, const std::string &propName, const pcf::IndiProperty::Type &propType, const pcf::IndiProperty::PropertyPermType &propPerm, const pcf::IndiProperty::PropertyStateType &propState, const pcf::IndiProperty::SwitchRuleType &propRule, int(*)(void *, const pcf::IndiProperty &))
 Register an INDI property which is exposed for others to request a New Property for, with a switch rule. More...
 
int registerIndiPropertySet (pcf::IndiProperty &prop, const std::string &devName, const std::string &propName, int(*)(void *, const pcf::IndiProperty &))
 Register an INDI property which is monitored for updates from others. More...
 
void sendGetPropertySetList (bool all=false)
 
void handleDefProperty (const pcf::IndiProperty &ipRecv)
 Handler for the DEF INDI properties notification. More...
 
void handleGetProperties (const pcf::IndiProperty &ipRecv)
 Handler for the get INDI properties request. More...
 
void handleNewProperty (const pcf::IndiProperty &ipRecv)
 Handler for the new INDI property request. More...
 
void handleSetProperty (const pcf::IndiProperty &ipRecv)
 Handler for the set INDI property request. More...
 
typedef std::pair< std::string, indiCallBack > callBackValueType
 Value type of the indiCallBack map. More...
 
typedef std::unordered_map< std::string, indiCallBack >::iterator callBackIterator
 Iterator type of the indiCallBack map. More...
 
typedef std::pair< callBackIterator, bool > callBackInsertResult
 Return type of insert on the indiCallBack map. More...
 
constexpr static bool m_useINDI
 Flag controlling whether INDI is used. If false, then no INDI code executes. More...
 
int createINDIFIFOS ()
 Create the INDI FIFOs. More...
 
int startINDI ()
 Start INDI Communications. More...
 
void updateIfChanged (pcf::IndiProperty &p, const std::string &el, const T &newVal, pcf::IndiProperty::PropertyStateType ipState=pcf::IndiProperty::Ok)
 Update an INDI property element value if it has changed. More...
 
void updateIfChanged (pcf::IndiProperty &p, const std::string &el, const char *newVal, pcf::IndiProperty::PropertyStateType ipState=pcf::IndiProperty::Ok)
 Update an INDI property element value if it has changed. More...
 
void updateIfChanged (pcf::IndiProperty &p, const std::string &el, const std::vector< T > &newVals, pcf::IndiProperty::PropertyStateType ipState=pcf::IndiProperty::Ok)
 Update an INDI property if values have changed. More...
 
void updateIfChanged (pcf::IndiProperty &p, const std::vector< std::string > &els, const std::vector< T > &newVals)
 Update an INDI property if values have changed. More...
 
void updateSwitchIfChanged (pcf::IndiProperty &p, const std::string &el, const pcf::IndiElement::SwitchStateType &newVal, pcf::IndiProperty::PropertyStateType ipState=pcf::IndiProperty::Ok)
 Update an INDI switch element value if it has changed. More...
 
int indiTargetUpdate (pcf::IndiProperty &localProperty, T &localTarget, const pcf::IndiProperty &remoteProperty, bool setBusy=true)
 Get the target element value from an new property. More...
 
int sendNewProperty (const pcf::IndiProperty &ipSend, const std::string &el, const T &newVal)
 Send a newProperty command to another device (using the INDI Client interface) More...
 
int sendNewProperty (const pcf::IndiProperty &ipSend)
 Send a newProperty command to another device (using the INDI Client interface) More...
 
int sendNewStandardIndiToggle (const std::string &device, const std::string &property, bool onoff)
 Send a new property commmand for a standard toggle switch. More...
 
int newCallBack_clearFSMAlert (const pcf::IndiProperty &ipRecv)
 The callback called by the static version, to actually process the FSM Alert Clear request. More...
 
static int st_newCallBack_clearFSMAlert (void *app, const pcf::IndiProperty &ipRecv)
 The static callback function to be registered for requesting to clear the FSM alert. More...
 

Power Management

For devices which have remote power management (e.g. from one of the PDUs) we implement a standard power state monitoring and management component for the FSM. This needs to be enabled in the derived app constructor. To stay enabled, m_powerDevice and m_powerChannel must be not empty strings after the configuration. These could be set in the derived app defaults.

If power management is enabled, then while power is off, appLogic will not be called. Instead a parrallel set of virtual functions is called, onPowerOff (to allow apps to perform cleanup) and whilePowerOff (to allow apps to keep variables updated, etc). Note that these could merely call appLogic if desired.

bool m_powerMgtEnabled
 Flag controls whether power mgt is used. Set this in the constructor of a derived app. If true, then if after loadConfig the powerDevice and powerChannel are empty, then the app will exit with a critical error. More...
 
std::string m_powerDevice
 The INDI device name of the power controller. More...
 
std::string m_powerChannel
 The INDI property name of the channel controlling this device's power. More...
 
std::string m_powerElement
 The INDI element name to monitor for this device's power state. More...
 
std::string m_powerTargetElement
 The INDI element name to monitor for this device's power state. More...
 
unsigned long m_powerOnWait
 Time in sec to wait for device to boot after power on. More...
 
int m_powerOnCounter
 Counts numer of loops after power on, implements delay for device bootup. If -1, then device was NOT powered off on app startup. More...
 
int m_powerState
 Current power state, 1=On, 0=Off, -1=Unk. More...
 
int m_powerTargetState
 Current target power state, 1=On, 0=Off, -1=Unk. More...
 
pcf::IndiProperty m_indiP_powerChannel
 INDI property used to communicate power state. More...
 
int powerState ()
 Returns the current power state. More...
 
int powerStateTarget ()
 Returns the target power state. More...
 
 INDI_SETCALLBACK_DECL (MagAOXApp, m_indiP_powerChannel)
 
virtual int onPowerOff ()
 This method is called when the change to poweroff is detected. More...
 
virtual int whilePowerOff ()
 This method is called while the power is off, once per FSM loop. More...
 
bool powerOnWaitElapsed ()
 This method tests whether the power on wait time has elapsed. More...
 

Pyramid Nudging and Acquisition

Handling of nudges on pyramid tip.

float m_pyrNudge_C_00 {1}
 
float m_pyrNudge_C_01 {0}
 
float m_pyrNudge_C_10 {0}
 
float m_pyrNudge_C_11 {1}
 
float m_pyrNudge_F_sign {1}
 
float m_pyrNudge_ang {45.0}
 
float m_pyrNudge_ang0 {0.0}
 
float m_pyrNudge_parity {-1}
 
pcf::IndiProperty m_indiP_pyrNudge
 Property used to request a pyramid nudge. More...
 
int m_acqZdSign {-1}
 
float m_acqAz0 {18.5}
 
float m_acqAzOff {0}
 
float m_acqEl0 {10}
 
float m_acqElOff {0}
 
float m_acqFocus {1400}
 
pcf::IndiProperty m_indiP_acqFromGuider
 Property used to request a pyramid nudge. More...
 
int sendPyrNudge (float x, float y, float z)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_pyrNudge)
 
int acquireFromGuider ()
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_acqFromGuider)
 

Woofer Offloading

Handling of offloads from the average woofer shape to the telescope

bool m_offloadThreadInit {true}
 Initialization flag for the offload thread. More...
 
pid_t m_offloadThreadID {0}
 Offload thread pid. More...
 
pcf::IndiProperty m_offloadThreadProp
 Offload thread INDI property. More...
 
std::thread m_offloadThread
 The offloading thread. More...
 
pcf::IndiProperty m_indiP_offloadCoeffs
 Property used to report the latest woofer modal coefficients for offloading. More...
 
std::vector< std::vector< float > > m_offloadRequests
 
size_t m_firstRequest {0}
 
size_t m_lastRequest {std::numeric_limits<size_t>::max()}
 
size_t m_nRequests {0}
 
size_t m_last_nRequests {0}
 
float m_lab_offlTT_C_00 {0.17}
 
float m_lab_offlTT_C_01 {1.03}
 
float m_lab_offlTT_C_10 {-1.03}
 
float m_lab_offlTT_C_11 {0.48}
 
float m_offlTT_C_00 {-0.5}
 
float m_offlTT_C_01 {0}
 
float m_offlTT_C_10 {0}
 
float m_offlTT_C_11 {-0.25}
 
bool m_offlTT_enabled {false}
 
bool m_offlTT_dump {false}
 
float m_offlTT_avgInt {1.0}
 
float m_offlTT_gain {0.1}
 
float m_offlTT_thresh {0.1}
 
pcf::IndiProperty m_indiP_offlTTenable
 
pcf::IndiProperty m_indiP_offlTTdump
 
pcf::IndiProperty m_indiP_offlTTavgInt
 
pcf::IndiProperty m_indiP_offlTTgain
 
pcf::IndiProperty m_indiP_offlTTthresh
 
float m_offlCFocus_00 {1}
 
bool m_offlF_enabled {false}
 
bool m_offlF_dump {false}
 
float m_offlF_avgInt {1.0}
 
float m_offlF_gain {0.1}
 
float m_offlF_thresh {0.1}
 
pcf::IndiProperty m_indiP_offlFenable
 
pcf::IndiProperty m_indiP_offlFdump
 
pcf::IndiProperty m_indiP_offlFavgInt
 
pcf::IndiProperty m_indiP_offlFgain
 
pcf::IndiProperty m_indiP_offlFthresh
 
float m_offlCComa_00 {1}
 
float m_offlCComa_01 {0}
 
float m_offlCComa_10 {1}
 
float m_offlCComa_11 {0}
 
void offloadThreadExec ()
 Offload thread function. More...
 
int doTToffload (float TT_0, float TT_1)
 
int sendTToffload (float TT_0, float TT_1)
 
int doFoffload (float F_0)
 
int sendFoffload (float F_0)
 
 INDI_SETCALLBACK_DECL (tcsInterface, m_indiP_offloadCoeffs)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_offlTTenable)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_offlTTdump)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_offlTTavgInt)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_offlTTgain)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_offlTTthresh)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_offlFenable)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_offlFdump)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_offlFavgInt)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_offlFgain)
 
 INDI_NEWCALLBACK_DECL (tcsInterface, m_indiP_offlFthresh)
 
static void offloadThreadStart (tcsInterface *t)
 Offload thread starter function. More...
 

Logging

void logMessage (bufferPtrT &b)
 Handle a log message from the logging system. More...
 
static int log (const typename logT::messageT &msg, logPrioT level=logPrio::LOG_DEFAULT)
 Make a log entry. More...
 
static int log (logPrioT level=logPrio::LOG_DEFAULT)
 Make a log entry. More...
 
static logManagerT m_log
 
static void configLog (const std::string &name, const int &code, const std::string &value, const std::string &source)
 Callback for config system logging. More...
 

Application State

stateCodes::stateCodeT state ()
 Get the current state code. More...
 
void state (const stateCodes::stateCodeT &s, bool stateAlert=false)
 Set the current state code. More...
 
int stateLogged ()
 Updates and returns the value of m_stateLogged. Will be 0 on first call after a state change, >0 afterwards. More...
 
stateCodes::stateCodeT m_state
 The application's state. Never ever set this directly, use state(const stateCodeT & s). More...
 
bool m_stateAlert
 
bool m_gitAlert
 
int m_stateLogged
 Counter and flag for use to log errors just once. Never ever access directly, use stateLogged(). More...
 

Signal Handling

libMagAOX/logger/types/software_log.hpp

static MagAOXAppm_self
 Static pointer to this (set in constructor). Used to test whether a a MagAOXApp is already instatiated (a fatal error) and used for getting out of static signal handlers. More...
 
static void _handlerSigTerm (int signum, siginfo_t *siginf, void *ucont)
 The handler called when SIGTERM, SIGQUIT, or SIGINT is received. Just a wrapper for handlerSigTerm. More...
 
int setSigTermHandler ()
 Sets the handler for SIGTERM, SIGQUIT, and SIGINT. More...
 
void handlerSigTerm (int signum, siginfo_t *siginf, void *ucont)
 Handles SIGTERM, SIGQUIT, and SIGINT. Sets m_shutdown to 1 and logs the signal. More...
 

Privilege Management

uid_t m_euidReal
 The real user id of the proces (i.e. the lower privileged id of the user) More...
 
uid_t m_euidCalled
 The user id of the process as called (i.e. the higher privileged id of the owner, root if setuid). More...
 
uid_t m_suid
 The save-set user id of the process. More...
 
int setEuidCalled ()
 Set the effective user ID to the called value, i.e. the highest possible. More...
 
int setEuidReal ()
 Set the effective user ID to the real value, i.e. the file owner. More...
 

Detailed Description

The MagAO-X Clay Telescope TCS Interface.

Definition at line 42 of file tcsInterface.hpp.

Member Typedef Documentation

◆ callBackInsertResult

typedef std::pair<callBackIterator,bool> MagAOX::app::MagAOXApp< _useINDI >::callBackInsertResult
inherited

Return type of insert on the indiCallBack map.

Definition at line 561 of file MagAOXApp.hpp.

◆ callBackIterator

typedef std::unordered_map<std::string, indiCallBack>::iterator MagAOX::app::MagAOXApp< _useINDI >::callBackIterator
inherited

Iterator type of the indiCallBack map.

Definition at line 558 of file MagAOXApp.hpp.

◆ callBackValueType

typedef std::pair<std::string, indiCallBack> MagAOX::app::MagAOXApp< _useINDI >::callBackValueType
inherited

Value type of the indiCallBack map.

Definition at line 555 of file MagAOXApp.hpp.

◆ logManagerT [1/2]

The log manager type.

Definition at line 54 of file telemeter.hpp.

◆ logManagerT [2/2]

typedef logger::logManager<MagAOXApp<_useINDI>, logFileRaw> MagAOX::app::MagAOXApp< _useINDI >::logManagerT
inherited

The log manager type.

Definition at line 82 of file MagAOXApp.hpp.

Constructor & Destructor Documentation

◆ tcsInterface()

MagAOX::app::tcsInterface::tcsInterface ( )
inline

Default c'tor.

Definition at line 419 of file tcsInterface.hpp.

◆ ~tcsInterface()

MagAOX::app::tcsInterface::~tcsInterface ( )
inlinenoexcept

D'tor, declared and defined for noexcept.

Definition at line 171 of file tcsInterface.hpp.

Member Function Documentation

◆ _handlerSigTerm()

void MagAOX::app::MagAOXApp< _useINDI >::_handlerSigTerm ( int  signum,
siginfo_t *  siginf,
void *  ucont 
)
staticprivateinherited

The handler called when SIGTERM, SIGQUIT, or SIGINT is received. Just a wrapper for handlerSigTerm.

Parameters
[in]signumspecifies the signal.
[in]siginfignored by MagAOXApp
[in]ucontignored by MagAOXApp

Definition at line 297 of file MagAOXApp.hpp.

◆ acquireFromGuider()

int MagAOX::app::tcsInterface::acquireFromGuider ( )
Todo:
need logtypes for nudges and offloads

Definition at line 2429 of file tcsInterface.hpp.

◆ appLogic()

int MagAOX::app::tcsInterface::appLogic ( )
inlinevirtual

Implementation of the FSM for tcsInterface.

Returns
0 on no critical error
-1 on an error requiring shutdown

Implements MagAOX::app::MagAOXApp< true >.

Definition at line 826 of file tcsInterface.hpp.

◆ appShutdown()

int MagAOX::app::tcsInterface::appShutdown ( )
inlinevirtual

Shutdown the app.

Implements MagAOX::app::MagAOXApp< true >.

Definition at line 941 of file tcsInterface.hpp.

◆ appStartup()

int MagAOX::app::tcsInterface::appStartup ( )
inlinevirtual

Startup function.

Implements MagAOX::app::MagAOXApp< true >.

Definition at line 545 of file tcsInterface.hpp.

◆ checkConfig()

void MagAOX::app::MagAOXApp< _useINDI >::checkConfig
virtualinherited

Check for unused and unrecognized config options and settings.

Logs the unused targets as warnings. Unrecognized and unused options are logged as critical, and m_shutdown is set. Any command line argument (not an option) will also be critical and cause shutdown.

Definition at line 174 of file MagAOXApp.hpp.

◆ checkRecordTimes() [1/4]

int MagAOX::app::tcsInterface::checkRecordTimes ( )
inline

Definition at line 2094 of file tcsInterface.hpp.

◆ checkRecordTimes() [2/4]

int MagAOX::app::dev::telemeter< tcsInterface >::checkRecordTimes ( const telT &  tel,
telTs...  tels 
)
inherited

Check the time of the last record for each telemetry type and make an entry if needed.

This must be called from derivedT::checkRecordTimes(), with one template parameter for ach telemetry log type being recorded.

Returns
0 on succcess
-1 on error
Parameters
[in]tel[unused] object of the telemetry type to record
[in]tels[unused] objects of the additional telemetry types to record

Definition at line 131 of file telemeter.hpp.

◆ checkRecordTimes() [3/4]

int MagAOX::app::dev::telemeter< tcsInterface >::checkRecordTimes ( timespec &  ts)
inherited

Empty function called at the end of the template list.

Returns
0 on succcess
-1 on error
Parameters
[in]ts[unused] the timestamp that records are compared to

Definition at line 152 of file telemeter.hpp.

◆ checkRecordTimes() [4/4]

int MagAOX::app::dev::telemeter< tcsInterface >::checkRecordTimes ( timespec &  ts,
const telT &  tel,
telTs...  tels 
)
inherited

Worker function to actually perform the record time checking logic.

Recursively calls itself until the variadic template list is exhausted.

Returns
0 on succcess
-1 on error
Parameters
[in]ts[unused] the timestamp that records are compared to
[in]tel[unused] objects of the telemetry type to record
[in]tels[unused] objects of the additional telemetry types to record

Definition at line 142 of file telemeter.hpp.

◆ clearFSMAlert()

int MagAOX::app::MagAOXApp< _useINDI >::clearFSMAlert
privateinherited

Clear the FSM alert state.

This can only be done from within this class, and this should only be possible via user action via INDI.

Definition at line 519 of file MagAOXApp.hpp.

◆ configDir()

std::string MagAOX::app::MagAOXApp< _useINDI >::configDir
inherited

Get the config directory.

Returns
the current value of m_configDir

Definition at line 1064 of file MagAOXApp.hpp.

◆ configLog()

void MagAOX::app::MagAOXApp< _useINDI >::configLog ( const std::string &  name,
const int &  code,
const std::string &  value,
const std::string &  source 
)
staticprivateinherited

Callback for config system logging.

Called by appConfigurator each time a value is set using the config() operator. You never need to call this directly.

Parameters
[in]nameThe name of the config value
[in]codenumeric code specifying the type
[in]valuethe value read by the config system
[in]sourcethe source of the value.

Definition at line 278 of file MagAOXApp.hpp.

◆ configName()

std::string MagAOX::app::MagAOXApp< _useINDI >::configName
inherited

Get the config name.

Returns
the current value of m_configName

Definition at line 1058 of file MagAOXApp.hpp.

◆ createINDIFIFOS()

int MagAOX::app::MagAOXApp< _useINDI >::createINDIFIFOS
protectedinherited

Create the INDI FIFOs.

Changes permissions to max available and creates the FIFOs at the configured path.

Todo:
make driver FIFO path full configurable.

Definition at line 776 of file MagAOXApp.hpp.

◆ createROIndiNumber()

int MagAOX::app::MagAOXApp< _useINDI >::createROIndiNumber ( pcf::IndiProperty &  prop,
const std::string &  propName,
const std::string &  propLabel = "",
const std::string &  propGroup = "" 
)
inherited

Create a ReadOnly INDI Number property.

Returns
0 on success
-1 on error
Parameters
[out]propthe property to create and setup
[in]propNamethe name of the property
[in]propLabel[optional] the GUI label suggestion for this property
[in]propGroup[optional] the group for this property

Definition at line 636 of file MagAOXApp.hpp.

◆ createROIndiText()

int MagAOX::app::MagAOXApp< _useINDI >::createROIndiText ( pcf::IndiProperty &  prop,
const std::string &  propName,
const std::string &  elName,
const std::string &  propLabel = "",
const std::string &  propGroup = "",
const std::string &  elLabel = "" 
)
inherited

Create a standard ReadOnly INDI Text property, with at least one element.

Returns
0 on success
-1 on error
Parameters
[out]propthe property to create and setup
[in]propNamethe name of the property
[in]elNamethe name of the element
[in]propLabel[optional] the GUI label suggestion for this property
[in]propGroup[optional] the group for this property
[in]elLabel[optional] the GUI label suggestion for the element

Definition at line 607 of file MagAOXApp.hpp.

◆ createStandardIndiNumber()

int MagAOX::app::MagAOXApp< _useINDI >::createStandardIndiNumber ( pcf::IndiProperty &  prop,
const std::string &  name,
const T &  min,
const T &  max,
const T &  step,
const std::string &  format,
const std::string &  label = "",
const std::string &  group = "" 
)
inherited

Create a standard R/W INDI Number property with target and current elements.

Returns
0 on success
-1 on error
Parameters
[out]propthe property to create and setup
[in]namethe name of the property
[in]minthe minimum value for the elements, applied to both target and current
[in]maxthe minimum value for the elements, applied to both target and current
[in]stepthe step size for the elements, applied to both target and current
[in]formatthe _ value for the elements, applied to both target and current. Set to "" to use the MagAO-X standard for type.
[in]label[optional] the GUI label suggestion for this property
[in]group[optional] the group for this property

Definition at line 621 of file MagAOXApp.hpp.

◆ createStandardIndiRequestSw()

int MagAOX::app::MagAOXApp< _useINDI >::createStandardIndiRequestSw ( pcf::IndiProperty &  prop,
const std::string &  name,
const std::string &  label = "",
const std::string &  group = "" 
)
inherited

Create a standard R/W INDI switch with a single request element.

This switch is intended to function like a momentary switch.

Returns
0 on success
-1 on error
Parameters
[out]propthe property to create and setup
[in]namethe name of the property
[in]label[optional] the GUI label suggestion for this property
[in]group[optional] the group for this property

Definition at line 660 of file MagAOXApp.hpp.

◆ createStandardIndiSelectionSw() [1/2]

int MagAOX::app::MagAOXApp< _useINDI >::createStandardIndiSelectionSw ( pcf::IndiProperty &  prop,
const std::string &  name,
const std::vector< std::string > &  elements,
const std::string &  label = "",
const std::string &  group = "" 
)
inherited

Create a standard R/W INDI selection (one of many) switch with vector of elements using the element strings as their own labels.

This switch is intended to function like drop down menu.

Returns
0 on success
-1 on error
Parameters
[out]propthe property to create and setup
[in]namethe name of the property,
[in]elementsthe element names to give to the switches
[in]label[optional] the GUI label suggestion for this property
[in]group[optional] the group for this property

Definition at line 686 of file MagAOXApp.hpp.

◆ createStandardIndiSelectionSw() [2/2]

int MagAOX::app::MagAOXApp< _useINDI >::createStandardIndiSelectionSw ( pcf::IndiProperty &  prop,
const std::string &  name,
const std::vector< std::string > &  elements,
const std::vector< std::string > &  elementLabels,
const std::string &  label = "",
const std::string &  group = "" 
)
inherited

Create a standard R/W INDI selection (one of many) switch with vector of elements and element labels.

This switch is intended to function like drop down menu.

Returns
0 on success
-1 on error
Parameters
[out]propthe property to create and setup
[in]namethe name of the property,
[in]elementsthe element names to give to the switches
[in]elementLabelsthe element labels to give to the switches
[in]label[optional] the GUI label suggestion for this property
[in]group[optional] the group for this property

Definition at line 672 of file MagAOXApp.hpp.

◆ createStandardIndiText()

int MagAOX::app::MagAOXApp< _useINDI >::createStandardIndiText ( pcf::IndiProperty &  prop,
const std::string &  propName,
const std::string &  label = "",
const std::string &  group = "" 
)
inherited

Create a standard R/W INDI Text property with target and current elements.

Returns
0 on success
-1 on error
Parameters
[out]propthe property to create and setup
[in]propNamethe name of the property
[in]label[optional] the GUI label suggestion for this property
[in]group[optional] the group for this property

Definition at line 596 of file MagAOXApp.hpp.

◆ createStandardIndiToggleSw()

int MagAOX::app::MagAOXApp< _useINDI >::createStandardIndiToggleSw ( pcf::IndiProperty &  prop,
const std::string &  name,
const std::string &  label = "",
const std::string &  group = "" 
)
inherited

Create a standard R/W INDI switch with a single toggle element.

This switch is intended to function like an on/off toggle switch.

Returns
0 on success
-1 on error
Parameters
[out]propthe property to create and setup
[in]namethe name of the property
[in]label[optional] the GUI label suggestion for this property
[in]group[optional] the group for this property

Definition at line 648 of file MagAOXApp.hpp.

◆ derived()

tcsInterface & MagAOX::app::dev::telemeter< tcsInterface >::derived ( )
inlineprivateinherited

Access the derived class.

Definition at line 157 of file telemeter.hpp.

◆ doFoffload()

int MagAOX::app::tcsInterface::doFoffload ( float  F_0)

Definition at line 2667 of file tcsInterface.hpp.

Referenced by offloadThreadExec().

◆ doTToffload()

int MagAOX::app::tcsInterface::doTToffload ( float  TT_0,
float  TT_1 
)

Definition at line 2598 of file tcsInterface.hpp.

Referenced by offloadThreadExec().

◆ driverCtrlName()

std::string MagAOX::app::MagAOXApp< _useINDI >::driverCtrlName
inherited

Get the INDI control FIFO file name.

Returns
the current value of m_driverCtrlName

Definition at line 1082 of file MagAOXApp.hpp.

◆ driverInName()

std::string MagAOX::app::MagAOXApp< _useINDI >::driverInName
inherited

Get the INDI input FIFO file name.

Returns
the current value of m_driverInName

Definition at line 1070 of file MagAOXApp.hpp.

◆ driverOutName()

std::string MagAOX::app::MagAOXApp< _useINDI >::driverOutName
inherited

Get the INDI output FIFO file name.

Returns
the current value of m_driverOutName

Definition at line 1076 of file MagAOXApp.hpp.

◆ execute()

int MagAOX::app::MagAOXApp< _useINDI >::execute ( void  )
virtualinherited

The execute method implementing the standard main loop. Should not normally be overridden.

Performs final startup steps. That is:

Errors in the above steps will cause a process exit.

Then commences the main event loop. Conditions on entry to the main loop:

  • PID locked
  • Log thread running
  • Signal handling installed
  • appStartup successful
  • INDI communications started successfully (if being used)
  • power state known (if being managed)

In the event loop, the power state is checked (if being managed). If power is off, then onPowerOff is called. If power is on, or power is not managed, appLogic is called. These methods are implemented in derived classes, and are called every m_loopPause interval.

If an error is returned by either onPowerOff or appLogic, or a signal is handled, then the shutdown is managed. This includes shutting down INDI, calling appShutdown, and unlocking the PID. The log thread will shutdown.

Todo:
Need a heartbeat update here.

Definition at line 204 of file MagAOXApp.hpp.

◆ getCatData()

int MagAOX::app::tcsInterface::getCatData ( )
inline

Definition at line 1409 of file tcsInterface.hpp.

Referenced by appLogic().

◆ getEnvData()

int MagAOX::app::tcsInterface::getEnvData ( )
inline

Definition at line 1528 of file tcsInterface.hpp.

Referenced by appLogic().

◆ getMagTelStatus()

int MagAOX::app::tcsInterface::getMagTelStatus ( std::string &  response,
const std::string &  statreq 
)
inline

Definition at line 959 of file tcsInterface.hpp.

Referenced by getCatData(), getEnvData(), getTelData(), getTelPos(), getTelTime(), and getVaneData().

◆ getSeeing()

int MagAOX::app::tcsInterface::getSeeing ( )
inline

Definition at line 1576 of file tcsInterface.hpp.

Referenced by appLogic().

◆ getTelData()

int MagAOX::app::tcsInterface::getTelData ( )
inline

Definition at line 1341 of file tcsInterface.hpp.

Referenced by appLogic().

◆ getTelPos()

int MagAOX::app::tcsInterface::getTelPos ( )
inline

Definition at line 1268 of file tcsInterface.hpp.

Referenced by appLogic().

◆ getTelTime()

int MagAOX::app::tcsInterface::getTelTime ( )
inline

Definition at line 1226 of file tcsInterface.hpp.

Referenced by appLogic().

◆ getVaneData()

int MagAOX::app::tcsInterface::getVaneData ( )
inline

Definition at line 1479 of file tcsInterface.hpp.

Referenced by appLogic().

◆ handleDefProperty()

void MagAOX::app::MagAOXApp< _useINDI >::handleDefProperty ( const pcf::IndiProperty &  ipRecv)
inherited

Handler for the DEF INDI properties notification.

Uses the properties registered in m_indiSetCallBacks to process the notification. This is called by m_indiDriver's indiDriver::handleDefProperties.

Parameters
[in]ipRecvThe property being sent.

Definition at line 793 of file MagAOXApp.hpp.

◆ handleGetProperties()

void MagAOX::app::MagAOXApp< _useINDI >::handleGetProperties ( const pcf::IndiProperty &  ipRecv)
inherited

Handler for the get INDI properties request.

Uses the properties registered in m_indiCallBacks to respond to the request. This is called by m_indiDriver's indiDriver::handleGetProperties.

Parameters
[in]ipRecvThe property being requested.

Definition at line 799 of file MagAOXApp.hpp.

◆ handleNewProperty()

void MagAOX::app::MagAOXApp< _useINDI >::handleNewProperty ( const pcf::IndiProperty &  ipRecv)
inherited

Handler for the new INDI property request.

Uses the properties registered in m_indiCallBacks to respond to the request, looking up the callback for this property and calling it.

This is called by m_indiDriver's indiDriver::handleGetProperties.

Todo:
handle errors, are they FATAL?
Parameters
[in]ipRecvThe property being changed.

Definition at line 809 of file MagAOXApp.hpp.

◆ handlerSigTerm()

void MagAOX::app::MagAOXApp< _useINDI >::handlerSigTerm ( int  signum,
siginfo_t *  siginf,
void *  ucont 
)
privateinherited

Handles SIGTERM, SIGQUIT, and SIGINT. Sets m_shutdown to 1 and logs the signal.

Parameters
[in]signumspecifies the signal.
[in]siginfignored by MagAOXApp
[in]ucontignored by MagAOXApp

Definition at line 303 of file MagAOXApp.hpp.

◆ handleSetProperty()

void MagAOX::app::MagAOXApp< _useINDI >::handleSetProperty ( const pcf::IndiProperty &  ipRecv)
inherited

Handler for the set INDI property request.

This is called by m_indiDriver's indiDriver::handleSetProperties.

Todo:
handle errors, are they FATAL?
Todo:
log an error here because callBack should not be null
Todo:
log invalid SetProperty request.
Parameters
[in]ipRecvThe property being changed.

Definition at line 818 of file MagAOXApp.hpp.

◆ INDI_NEWCALLBACK_DECL() [1/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_acqFromGuider   
)

◆ INDI_NEWCALLBACK_DECL() [2/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_offlFavgInt   
)

◆ INDI_NEWCALLBACK_DECL() [3/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_offlFdump   
)

◆ INDI_NEWCALLBACK_DECL() [4/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_offlFenable   
)

◆ INDI_NEWCALLBACK_DECL() [5/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_offlFgain   
)

◆ INDI_NEWCALLBACK_DECL() [6/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_offlFthresh   
)

◆ INDI_NEWCALLBACK_DECL() [7/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_offlTTavgInt   
)

◆ INDI_NEWCALLBACK_DECL() [8/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_offlTTdump   
)

◆ INDI_NEWCALLBACK_DECL() [9/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_offlTTenable   
)

◆ INDI_NEWCALLBACK_DECL() [10/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_offlTTgain   
)

◆ INDI_NEWCALLBACK_DECL() [11/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_offlTTthresh   
)

◆ INDI_NEWCALLBACK_DECL() [12/12]

MagAOX::app::tcsInterface::INDI_NEWCALLBACK_DECL ( tcsInterface  ,
m_indiP_pyrNudge   
)

◆ INDI_SETCALLBACK_DECL() [1/3]

MagAOX::app::MagAOXApp< _useINDI >::INDI_SETCALLBACK_DECL ( MagAOXApp< true >  ,
m_indiP_powerChannel   
)
inherited

◆ INDI_SETCALLBACK_DECL() [2/3]

MagAOX::app::tcsInterface::INDI_SETCALLBACK_DECL ( tcsInterface  ,
m_indiP_loopState   
)

◆ INDI_SETCALLBACK_DECL() [3/3]

MagAOX::app::tcsInterface::INDI_SETCALLBACK_DECL ( tcsInterface  ,
m_indiP_offloadCoeffs   
)

◆ indiTargetUpdate()

int MagAOX::app::MagAOXApp< _useINDI >::indiTargetUpdate ( pcf::IndiProperty &  localProperty,
T &  localTarget,
const pcf::IndiProperty &  remoteProperty,
bool  setBusy = true 
)
protectedinherited

Get the target element value from an new property.

Returns
0 on success
-1 on error
Parameters
[out]localPropertyThe local property to update
[out]localTargetThe local value to update
[in]remotePropertythe new property received
[in]setBusy[optional] set property to busy if true

Definition at line 908 of file MagAOXApp.hpp.

◆ loadBasicConfig()

void MagAOX::app::MagAOXApp< _useINDI >::loadBasicConfig
virtualinherited

The basic MagAO-X configuration processing method. Should not normally be overridden.

This method processes the standard MagAO-X key=value pairs.

Though it is virtual, it should not normally be overridden unless you need to depart from the MagAO-X standard.

Processing of app specific config goes in loadConfig() implemented by the derived class.

Definition at line 168 of file MagAOXApp.hpp.

◆ loadConfig() [1/3]

void MagAOX::app::tcsInterface::loadConfig ( )
inlinevirtual

Definition at line 539 of file tcsInterface.hpp.

◆ loadConfig() [2/3]

int MagAOX::app::dev::telemeter< tcsInterface >::loadConfig ( appConfigurator &  config)
inherited

Load the device section from an application configurator.

Returns
0 on success
-1 on error (nothing implemented yet)
Parameters
[in]configan application configuration from which to load values

Definition at line 95 of file telemeter.hpp.

◆ loadConfig() [3/3]

int MagAOX::app::dev::ioDevice::loadConfig ( mx::app::appConfigurator &  config)
inherited

Load the device section from an application configurator.

Returns
0 on success
-1 on error (nothing implemented yet)
Parameters
[in]configan application configuration from which to load values

Definition at line 28 of file ioDevice.cpp.

Referenced by MagAOX::app::picoMotorCtrl::loadConfig(), MagAOX::app::smc100ccCtrl::loadConfig(), MagAOX::app::trippLitePDU::loadConfig(), MagAOX::app::dev::edtCamera< derivedT >::loadConfig(), MagAOX::app::flipperCtrl::loadConfigImpl(), MagAOX::app::pi335Ctrl::loadConfigImpl(), MagAOX::app::rhusbMon::loadConfigImpl(), and loadConfigImpl().

◆ loadConfigImpl()

int MagAOX::app::tcsInterface::loadConfigImpl ( mx::app::appConfigurator &  _config)
inline

Implementation of loadConfig logic, separated for testing.

This is called by loadConfig().

Parameters
[in]_configan application configuration from which to load values

Definition at line 481 of file tcsInterface.hpp.

Referenced by loadConfig().

◆ lockPID()

int MagAOX::app::MagAOXApp< _useINDI >::lockPID
protectedinherited

Attempt to lock the PID by writing it to a file. Fails if a process is already running with the same config name.

First checks the PID file for an existing PID. If found, interrogates /proc to determine if that process is running and if so if the command line matches. If a matching process is currently running, then this returns an error.

Will not fail if a PID file exists but the stored PID does not correspond to a running process with the same command line name.

Reference: https://linux.die.net/man/3/getpid

Returns
0 on success.
-1 on any error, including creating the PID file or if this app is already running.

Definition at line 407 of file MagAOXApp.hpp.

◆ log() [1/2]

int MagAOX::app::MagAOXApp< _useINDI >::log ( const typename logT::messageT &  msg,
logPrioT  level = logPrio::LOG_DEFAULT 
)
staticinherited

Make a log entry.

Wrapper for logManager::log

Template Parameters
logTthe log entry type
retvalthe value returned by this method.
Parameters
[in]msgthe message to log
[in]level[optional] the log level. The default is used if not specified.

Definition at line 252 of file MagAOXApp.hpp.

◆ log() [2/2]

int MagAOX::app::MagAOXApp< _useINDI >::log ( logPrioT  level = logPrio::LOG_DEFAULT)
staticinherited

Make a log entry.

Wrapper for logManager::log

Template Parameters
logTthe log entry type
retvalthe value returned by this method.
Parameters
[in]level[optional] the log level. The default is used if not specified.

Definition at line 264 of file MagAOXApp.hpp.

◆ logMessage()

void MagAOX::app::MagAOXApp< _useINDI >::logMessage ( bufferPtrT b)
inherited

Handle a log message from the logging system.

This is a callback from the logManager, and is called when the log thread is processing log entries.

Decides whether to display to stderr and whether to send via INDI.

Definition at line 271 of file MagAOXApp.hpp.

◆ newCallBack_clearFSMAlert()

int MagAOX::app::MagAOXApp< _useINDI >::newCallBack_clearFSMAlert ( const pcf::IndiProperty &  ipRecv)
protectedinherited

The callback called by the static version, to actually process the FSM Alert Clear request.

Returns
0 on success.
-1 on error.
Parameters
[in]ipRecvthe INDI property sent with the the new property request.

Definition at line 964 of file MagAOXApp.hpp.

◆ offloadThreadExec()

void MagAOX::app::tcsInterface::offloadThreadExec ( )

Offload thread function.

Runs until m_shutdown is true.

Todo:
offloading: These sections ought to be separate functions for clarity

Definition at line 2467 of file tcsInterface.hpp.

Referenced by offloadThreadStart().

◆ offloadThreadStart()

void MagAOX::app::tcsInterface::offloadThreadStart ( tcsInterface t)
static

Offload thread starter function.

Parameters
[in]tpointer to this

Definition at line 2462 of file tcsInterface.hpp.

Referenced by appStartup().

◆ onPowerOff()

int MagAOX::app::MagAOXApp< _useINDI >::onPowerOff
protectedvirtualinherited

This method is called when the change to poweroff is detected.

Returns
0 on success.
-1 on any error which means the app should exit.

Reimplemented in MagAOX::app::zaberLowLevel, MagAOX::app::irisaoCtrl, MagAOX::app::bmcCtrl, and MagAOX::app::alpaoCtrl.

Definition at line 1005 of file MagAOXApp.hpp.

◆ parse_teldata()

std::vector< std::string > MagAOX::app::tcsInterface::parse_teldata ( std::string &  tdat)
inline

◆ parse_xms()

int MagAOX::app::tcsInterface::parse_xms ( double &  x,
double &  m,
double &  s,
const std::string &  xmsstr 
)
inline

Definition at line 1102 of file tcsInterface.hpp.

Referenced by getCatData(), getSeeing(), getTelPos(), getTelTime(), and TCSITEST::SCENARIO().

◆ powerOnWaitElapsed()

bool MagAOX::app::MagAOXApp< _useINDI >::powerOnWaitElapsed
protectedinherited

This method tests whether the power on wait time has elapsed.

You would call this once per appLogic loop while in state POWERON. While false, you would return 0.
Once it becomes true, take post-power-on actions and go on with life.

Returns
true if the time since POWERON is greater than the power-on wait, or if power management is not enabled
false otherwise

Definition at line 1021 of file MagAOXApp.hpp.

◆ powerState()

int MagAOX::app::MagAOXApp< _useINDI >::powerState
inherited

Returns the current power state.

If power management is not enabled, this always returns 1=On.

Returns
-1 if power state is unknown
0 if power is off
1 if power is on or m_powerMgtEnabled==false

Definition at line 1032 of file MagAOXApp.hpp.

◆ powerStateTarget()

int MagAOX::app::MagAOXApp< _useINDI >::powerStateTarget
inherited

Returns the target power state.

If power management is not enabled, this always returns 1=On.

Returns
-1 if target power state is unknown
0 if target power state is off
1 if target power is on or m_powerMgtEnabled==false

Definition at line 1041 of file MagAOXApp.hpp.

◆ recordTelCat()

int MagAOX::app::tcsInterface::recordTelCat ( bool  force = false)
inline

Definition at line 2303 of file tcsInterface.hpp.

Referenced by recordTelem().

◆ recordTelData()

int MagAOX::app::tcsInterface::recordTelData ( bool  force = false)
inline

Definition at line 2175 of file tcsInterface.hpp.

Referenced by getTelData(), and recordTelem().

◆ recordTelem() [1/6]

int MagAOX::app::tcsInterface::recordTelem ( const telem_telcat )
inline

Definition at line 2128 of file tcsInterface.hpp.

◆ recordTelem() [2/6]

int MagAOX::app::tcsInterface::recordTelem ( const telem_teldata )
inline

Definition at line 2107 of file tcsInterface.hpp.

◆ recordTelem() [3/6]

int MagAOX::app::tcsInterface::recordTelem ( const telem_telenv )
inline

Definition at line 2121 of file tcsInterface.hpp.

◆ recordTelem() [4/6]

int MagAOX::app::tcsInterface::recordTelem ( const telem_telpos )
inline

Definition at line 2100 of file tcsInterface.hpp.

◆ recordTelem() [5/6]

int MagAOX::app::tcsInterface::recordTelem ( const telem_telsee )
inline

Definition at line 2135 of file tcsInterface.hpp.

◆ recordTelem() [6/6]

int MagAOX::app::tcsInterface::recordTelem ( const telem_telvane )
inline

Definition at line 2114 of file tcsInterface.hpp.

◆ recordTelEnv()

int MagAOX::app::tcsInterface::recordTelEnv ( bool  force = false)
inline

Definition at line 2259 of file tcsInterface.hpp.

Referenced by getEnvData(), and recordTelem().

◆ recordTelPos()

int MagAOX::app::tcsInterface::recordTelPos ( bool  force = false)
inline

Definition at line 2142 of file tcsInterface.hpp.

Referenced by getTelPos(), and recordTelem().

◆ recordTelSee()

int MagAOX::app::tcsInterface::recordTelSee ( bool  force = false)
inline

Definition at line 2333 of file tcsInterface.hpp.

Referenced by getSeeing(), and recordTelem().

◆ recordTelVane()

int MagAOX::app::tcsInterface::recordTelVane ( bool  force = false)
inline

Definition at line 2217 of file tcsInterface.hpp.

Referenced by getVaneData(), and recordTelem().

◆ registerIndiPropertyNew() [1/3]

int MagAOX::app::MagAOXApp< _useINDI >::registerIndiPropertyNew ( pcf::IndiProperty &  prop,
const std::string &  propName,
const pcf::IndiProperty::Type &  propType,
const pcf::IndiProperty::PropertyPermType &  propPerm,
const pcf::IndiProperty::PropertyStateType &  propState,
const pcf::IndiProperty::SwitchRuleType &  propRule,
int(*)(void *, const pcf::IndiProperty &)   
)
inherited

Register an INDI property which is exposed for others to request a New Property for, with a switch rule.

This verison sets up the INDI property according to the arguments.

Returns
0 on success.
-1 on error.
Parameters
[out]propthe property to register
[in]propNamethe name of the property
[in]propTypethe type of the property
[in]propPermthe permissions of the property
[in]propStatethe state of the property
[in]propRulethe switch rule type

◆ registerIndiPropertyNew() [2/3]

int MagAOX::app::MagAOXApp< _useINDI >::registerIndiPropertyNew ( pcf::IndiProperty &  prop,
const std::string &  propName,
const pcf::IndiProperty::Type &  propType,
const pcf::IndiProperty::PropertyPermType &  propPerm,
const pcf::IndiProperty::PropertyStateType &  propState,
int(*)(void *, const pcf::IndiProperty &)   
)
inherited

Register an INDI property which is exposed for others to request a New Property for.

This verison sets up the INDI property according to the arguments.

Returns
0 on success.
-1 on error.
Parameters
[out]propthe property to register
[in]propNamethe name of the property
[in]propTypethe type of the property
[in]propPermthe permissions of the property
[in]propStatethe state of the property

◆ registerIndiPropertyNew() [3/3]

int MagAOX::app::MagAOXApp< _useINDI >::registerIndiPropertyNew ( pcf::IndiProperty &  prop,
int(*)(void *, const pcf::IndiProperty &)   
)
inherited

Register an INDI property which is exposed for others to request a New Property for.

In this version the supplied IndiProperty must be fully set up before passing in.

Returns
0 on success.
-1 on error.
Parameters
[in]propthe property to register, must be fully set up

◆ registerIndiPropertyReadOnly() [1/2]

int MagAOX::app::MagAOXApp< _useINDI >::registerIndiPropertyReadOnly ( pcf::IndiProperty &  prop)
inherited

Register an INDI property which is read only.

This version requires the property be fully set up.

Returns
0 on success.
-1 on error.
Parameters
[in]propthe property to register, must be completely setup

Definition at line 700 of file MagAOXApp.hpp.

◆ registerIndiPropertyReadOnly() [2/2]

int MagAOX::app::MagAOXApp< _useINDI >::registerIndiPropertyReadOnly ( pcf::IndiProperty &  prop,
const std::string &  propName,
const pcf::IndiProperty::Type &  propType,
const pcf::IndiProperty::PropertyPermType &  propPerm,
const pcf::IndiProperty::PropertyStateType &  propState 
)
inherited

Register an INDI property which is read only.

This verison sets up the INDI property according to the arguments.

Returns
0 on success.
-1 on error.
Parameters
[out]propthe property to register, will be configured
[in]propNamethe name of the property
[in]propTypethe type of the property
[in]propPermthe permissions of the property
[in]propStatethe state of the property

Definition at line 709 of file MagAOXApp.hpp.

◆ registerIndiPropertySet()

int MagAOX::app::MagAOXApp< _useINDI >::registerIndiPropertySet ( pcf::IndiProperty &  prop,
const std::string &  devName,
const std::string &  propName,
int(*)(void *, const pcf::IndiProperty &)   
)
inherited

Register an INDI property which is monitored for updates from others.

Returns
0 on success.
-1 on error.
Parameters
[out]propthe property to register
[in]devNamethe device which owns this property
[in]propNamethe name of the property

Definition at line 765 of file MagAOXApp.hpp.

◆ sendFoffload()

int MagAOX::app::tcsInterface::sendFoffload ( float  F_0)

Definition at line 2699 of file tcsInterface.hpp.

Referenced by doFoffload().

◆ sendGetPropertySetList()

void MagAOX::app::MagAOXApp< _useINDI >::sendGetPropertySetList ( bool  all = false)
inherited

Definition at line 787 of file MagAOXApp.hpp.

◆ sendMagTelCommand()

int MagAOX::app::tcsInterface::sendMagTelCommand ( const std::string &  command,
int  timeout 
)
inline

Definition at line 1007 of file tcsInterface.hpp.

Referenced by acquireFromGuider(), sendFoffload(), sendPyrNudge(), and sendTToffload().

◆ sendNewProperty() [1/2]

int MagAOX::app::MagAOXApp< _useINDI >::sendNewProperty ( const pcf::IndiProperty &  ipSend)
protectedinherited

Send a newProperty command to another device (using the INDI Client interface)

Returns
0 on success.
-1 on an error, which will be logged
Parameters
[in]ipSendThe property to send a "new" INDI command for

Definition at line 931 of file MagAOXApp.hpp.

◆ sendNewProperty() [2/2]

int MagAOX::app::MagAOXApp< _useINDI >::sendNewProperty ( const pcf::IndiProperty &  ipSend,
const std::string &  el,
const T &  newVal 
)
protectedinherited

Send a newProperty command to another device (using the INDI Client interface)

Copies the input IndiProperty, then updates the element with the new value.

Returns
0 on success.
-1 on an errory.
Parameters
[in]ipSendThe property to send a "new" INDI command for
[in]elThe element of the property to change
[in]newValThe value to request for the element.

Definition at line 921 of file MagAOXApp.hpp.

◆ sendNewStandardIndiToggle()

int MagAOX::app::MagAOXApp< _useINDI >::sendNewStandardIndiToggle ( const std::string &  device,
const std::string &  property,
bool  onoff 
)
protectedinherited

Send a new property commmand for a standard toggle switch.

Returns
0 on success
-1 on an error, which will be logged.
Parameters
[in]deviceThe device name
[in]propertyThe property name
[in]onoffSwitch state to send: true = on, false = off

Definition at line 938 of file MagAOXApp.hpp.

◆ sendPyrNudge()

int MagAOX::app::tcsInterface::sendPyrNudge ( float  x,
float  y,
float  z 
)
Todo:
need logtypes for nudges and offloads

Definition at line 2385 of file tcsInterface.hpp.

◆ sendTToffload()

int MagAOX::app::tcsInterface::sendTToffload ( float  TT_0,
float  TT_1 
)

Definition at line 2635 of file tcsInterface.hpp.

Referenced by doTToffload().

◆ setDefaults()

void MagAOX::app::MagAOXApp< _useINDI >::setDefaults ( int  argc,
char **  argv 
)
virtualinherited

Set the paths for config files.

Replaces the mx::application defaults with the MagAO-X config system.

This function parses the CL for "-n" or "--name".

Do not override this unless you intend to depart from the MagAO-X standard.

Parameters
[in]argcstandard command line result specifying number of arguments in argv
[in]argvstandard command line result containing the arguments.

Definition at line 146 of file MagAOXApp.hpp.

◆ setEuidCalled()

int MagAOX::app::MagAOXApp< _useINDI >::setEuidCalled
privateinherited

Set the effective user ID to the called value, i.e. the highest possible.

If setuid is set on the file, this will be super-user privileges.

Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/seteuid.html

Returns
0 on success
-1 on error from setuid().

Definition at line 368 of file MagAOXApp.hpp.

◆ setEuidReal()

int MagAOX::app::MagAOXApp< _useINDI >::setEuidReal
privateinherited

Set the effective user ID to the real value, i.e. the file owner.

Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/seteuid.html

Returns
0 on success
-1 on error from setuid().

Definition at line 377 of file MagAOXApp.hpp.

◆ setSigTermHandler()

int MagAOX::app::MagAOXApp< _useINDI >::setSigTermHandler
privateinherited

Sets the handler for SIGTERM, SIGQUIT, and SIGINT.

Definition at line 294 of file MagAOXApp.hpp.

◆ setupBasicConfig()

void MagAOX::app::MagAOXApp< _useINDI >::setupBasicConfig
virtualinherited

The basic MagAO-X configuration setup method. Should not normally be overridden.

This method sets up the config system with the standard MagAO-X key=value pairs.

Though it is virtual, it should not normally be overridden unless you need to depart from the MagAO-X standard.

Setting up app specific config goes in setupConfig() implemented in the derived class.

Definition at line 158 of file MagAOXApp.hpp.

◆ setupConfig() [1/3]

void MagAOX::app::tcsInterface::setupConfig ( )
inlinevirtual

Definition at line 425 of file tcsInterface.hpp.

◆ setupConfig() [2/3]

int MagAOX::app::dev::telemeter< tcsInterface >::setupConfig ( appConfigurator &  config)
inherited

Setup an application configurator for the device section.

Returns
0 on success.
-1 on error (nothing implemented yet)
Parameters
[in]configan application configuration to setup

Definition at line 87 of file telemeter.hpp.

◆ setupConfig() [3/3]

int MagAOX::app::dev::ioDevice::setupConfig ( mx::app::appConfigurator &  config)
inherited

Setup an application configurator for the device section.

Returns
0 on success.
-1 on error (nothing implemented yet)
Parameters
[in]configan application configuration to setup

Definition at line 20 of file ioDevice.cpp.

Referenced by MagAOX::app::flipperCtrl::setupConfig(), MagAOX::app::pi335Ctrl::setupConfig(), MagAOX::app::picoMotorCtrl::setupConfig(), MagAOX::app::rhusbMon::setupConfig(), MagAOX::app::smc100ccCtrl::setupConfig(), setupConfig(), MagAOX::app::trippLitePDU::setupConfig(), and MagAOX::app::dev::edtCamera< derivedT >::setupConfig().

◆ shutdown()

int MagAOX::app::MagAOXApp< _useINDI >::shutdown
inherited

Get the value of the shutdown flag.

Returns
the current value of m_shutdown

Definition at line 136 of file MagAOXApp.hpp.

◆ st_newCallBack_clearFSMAlert()

int MagAOX::app::MagAOXApp< _useINDI >::st_newCallBack_clearFSMAlert ( void *  app,
const pcf::IndiProperty &  ipRecv 
)
staticprotectedinherited

The static callback function to be registered for requesting to clear the FSM alert.

Returns
0 on success.
-1 on error.
Parameters
[in]appa pointer to this, will be static_cast-ed to MagAOXApp.
[in]ipRecvthe INDI property sent with the the new property request.

Definition at line 955 of file MagAOXApp.hpp.

◆ startINDI()

int MagAOX::app::MagAOXApp< _useINDI >::startINDI
protectedinherited

Start INDI Communications.

Returns
0 on success
-1 on error. This is fatal.

Definition at line 783 of file MagAOXApp.hpp.

◆ state() [1/2]

stateCodes::stateCodeT MagAOX::app::MagAOXApp< _useINDI >::state
inherited

Get the current state code.

Returns
m_state

Definition at line 480 of file MagAOXApp.hpp.

◆ state() [2/2]

void MagAOX::app::MagAOXApp< _useINDI >::state ( const stateCodes::stateCodeT s,
bool  stateAlert = false 
)
inherited

Set the current state code.

Todo:
move this to a function in stateCodes
Parameters
[in]sThe new application state
[in]stateAlert[optional] flag to set the alert state of the FSM property.

Definition at line 488 of file MagAOXApp.hpp.

◆ stateLogged()

int MagAOX::app::MagAOXApp< _useINDI >::stateLogged
inherited

Updates and returns the value of m_stateLogged. Will be 0 on first call after a state change, >0 afterwards.

This method exists to facilitate logging the reason for a state change once, but not logging it on subsequent event loops. Returns the current value upon entry, but updates before returning so that the next call returns the incremented value. Example usage:

if( connection_failed ) //some condition set this to true
{
if(!stateLogged()) log<text_log>("Not connected");
}
stateCodes::stateCodeT state()
Get the current state code.
Definition: MagAOXApp.hpp:2082
int stateLogged()
Updates and returns the value of m_stateLogged. Will be 0 on first call after a state change,...
Definition: MagAOXApp.hpp:2140
@ NOTCONNECTED
The application is not connected to the device or service.
Definition: stateCodes.hpp:44

In this example, the log entry is made the first time the state changes. If there are no changes to a different state in the mean time, then when the event loop gets here again and decides it is not connected, the log entry will not be made.

Returns
current value of m_stateLogged, that is the value before it is incremented.

Definition at line 509 of file MagAOXApp.hpp.

◆ telem() [1/2]

int MagAOX::app::dev::telemeter< tcsInterface >::telem
inherited

Make a telemetry recording, for an empty record.

Wrapper for logManager::log, which updates telT::lastRecord.

Template Parameters
logTthe log entry type
retvalthe value returned by this method.

Definition at line 80 of file telemeter.hpp.

◆ telem() [2/2]

int MagAOX::app::dev::telemeter< tcsInterface >::telem ( const typename telT::messageT &  msg)
inherited

Make a telemetry recording.

Wrapper for logManager::log, which updates telT::lastRecord.

Template Parameters
logTthe log entry type
retvalthe value returned by this method.
Parameters
[in]msgthe data to log

Definition at line 70 of file telemeter.hpp.

◆ threadStart()

int MagAOX::app::MagAOXApp< _useINDI >::threadStart ( std::thread &  thrd,
bool &  thrdInit,
pid_t &  tpid,
pcf::IndiProperty &  thProp,
int  thrdPrio,
const std::string &  cpuset,
const std::string &  thrdName,
thisPtr *  thrdThis,
Function &&  thrdStart 
)
inherited

Start a thread, using this class's privileges to set priority, etc.

The thread initialization synchronizer bool is set to true at the beginning of this function, then is set to false once all initialization is complete. The thread exec function should wait until this is false before doing anything except setting the pid. This is to avoid privilege escalation bugs.

The interface of the thread start function is:

static void impl::myThreadStart( impl * o )
{
o->myThreadExec(); //A member function which actually executes the thread
}

where impl is the derived class, and mThreadStart and myThreadExec are members of impl.

Returns
0 on success
-1 on error
Parameters
[out]thrdThe thread object to start executing
thrdInit[in/out] The thread initilization synchronizer.
tpid[in/out] The thread pid to be filled in by thrdStart immediately upon call
thProp[in/out] The INDI property to publish the thread details
[in]thrdPrioThe r/t priority to set for this thread
[in]cpusetthe cpuset to place this thread on. Ignored if "".
[in]thrdNameThe name of the thread (just for logging)
[in]thrdThisThe `this` pointer to pass to the thread starter function
[in]thrdStartThe thread starting function, a static function taking a `this` pointer as argument.

Definition at line 450 of file MagAOXApp.hpp.

◆ unlockPID()

int MagAOX::app::MagAOXApp< _useINDI >::unlockPID
protectedinherited

Remove the PID file.

Definition at line 410 of file MagAOXApp.hpp.

◆ updateIfChanged() [1/4]

void MagAOX::app::MagAOXApp< _useINDI >::updateIfChanged ( pcf::IndiProperty &  p,
const std::string &  el,
const char *  newVal,
pcf::IndiProperty::PropertyStateType  ipState = pcf::IndiProperty::Ok 
)
protectedinherited

Update an INDI property element value if it has changed.

Will only peform a SetProperty if the new element value has changed compared to the stored value, or if the property state has changed.

This comparison is done in the true type of the value.

This is a specialization for const char * to std::string.

For a property with multiple elements, you should use the vector version to minimize network traffic. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
p[in/out] The property containing the element to possibly update
[in]elThe element name
[in]newValthe new value

Definition at line 850 of file MagAOXApp.hpp.

◆ updateIfChanged() [2/4]

void MagAOX::app::MagAOXApp< _useINDI >::updateIfChanged ( pcf::IndiProperty &  p,
const std::string &  el,
const std::vector< T > &  newVals,
pcf::IndiProperty::PropertyStateType  ipState = pcf::IndiProperty::Ok 
)
protectedinherited

Update an INDI property if values have changed.

Will only peform a SetProperty if at least one value has changed compared to the stored value, or if the property state has changed.

Constructs the element names for each value as elX where X is the index of the vector.

This comparison is done in the true type of the value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
p[in/out] The property containing the element to possibly update
[in]elBeginning of each element name
[in]newValsthe new values
[in]ipState[optional] the new state

Definition at line 880 of file MagAOXApp.hpp.

◆ updateIfChanged() [3/4]

void MagAOX::app::MagAOXApp< _useINDI >::updateIfChanged ( pcf::IndiProperty &  p,
const std::string &  el,
const T &  newVal,
pcf::IndiProperty::PropertyStateType  ipState = pcf::IndiProperty::Ok 
)
protectedinherited

Update an INDI property element value if it has changed.

Will only peform a SetProperty if the new element value has changed compared to the stored value, or if the property state has changed.

This comparison is done in the true type of the value.

For a property with multiple elements, you should use the vector version to minimize network traffic.

Parameters
p[in/out] The property containing the element to possibly update
[in]elThe element name
[in]newValthe new value

Definition at line 832 of file MagAOXApp.hpp.

◆ updateIfChanged() [4/4]

void MagAOX::app::MagAOXApp< _useINDI >::updateIfChanged ( pcf::IndiProperty &  p,
const std::vector< std::string > &  els,
const std::vector< T > &  newVals 
)
protectedinherited

Update an INDI property if values have changed.

Will only peform a SetProperty if at least one value has changed compared to the stored value, or if the property state has changed.

This comparison is done in the true type of the value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
p[in/out] The property containing the element to possibly update
[in]elsString vector of element names
[in]newValsthe new values

Definition at line 897 of file MagAOXApp.hpp.

◆ updateINDI()

int MagAOX::app::tcsInterface::updateINDI ( )
inline

Definition at line 1721 of file tcsInterface.hpp.

Referenced by appLogic().

◆ updateSwitchIfChanged()

void MagAOX::app::MagAOXApp< _useINDI >::updateSwitchIfChanged ( pcf::IndiProperty &  p,
const std::string &  el,
const pcf::IndiElement::SwitchStateType &  newVal,
pcf::IndiProperty::PropertyStateType  ipState = pcf::IndiProperty::Ok 
)
protectedinherited

Update an INDI switch element value if it has changed.

Will only peform a SetProperty if the new element switch state has changed, or the propery state has changed.

Parameters
p[in/out] The property containing the element to possibly update
[in]elThe element name
[in]newValthe new value

Definition at line 861 of file MagAOXApp.hpp.

◆ whilePowerOff()

int MagAOX::app::MagAOXApp< _useINDI >::whilePowerOff
protectedvirtualinherited

This method is called while the power is off, once per FSM loop.

Returns
0 on success.
-1 on any error which means the app should exit.

Reimplemented in MagAOX::app::zaberLowLevel, MagAOX::app::irisaoCtrl, MagAOX::app::bmcCtrl, and MagAOX::app::alpaoCtrl.

Definition at line 1012 of file MagAOXApp.hpp.

Friends And Related Function Documentation

◆ dev::telemeter< tcsInterface >

friend class dev::telemeter< tcsInterface >
friend

Definition at line 46 of file tcsInterface.hpp.

◆ tcsInterface_test

friend class tcsInterface_test
friend

Definition at line 46 of file tcsInterface.hpp.

Member Data Documentation

◆ m_acqAz0

float MagAOX::app::tcsInterface::m_acqAz0 {18.5}

Definition at line 292 of file tcsInterface.hpp.

Referenced by acquireFromGuider(), and loadConfigImpl().

◆ m_acqAzOff

float MagAOX::app::tcsInterface::m_acqAzOff {0}

Definition at line 293 of file tcsInterface.hpp.

Referenced by acquireFromGuider(), and loadConfigImpl().

◆ m_acqEl0

float MagAOX::app::tcsInterface::m_acqEl0 {10}

Definition at line 294 of file tcsInterface.hpp.

Referenced by acquireFromGuider(), and loadConfigImpl().

◆ m_acqElOff

float MagAOX::app::tcsInterface::m_acqElOff {0}

Definition at line 295 of file tcsInterface.hpp.

Referenced by acquireFromGuider(), and loadConfigImpl().

◆ m_acqFocus

float MagAOX::app::tcsInterface::m_acqFocus {1400}

Definition at line 296 of file tcsInterface.hpp.

Referenced by acquireFromGuider(), and loadConfigImpl().

◆ m_acqZdSign

int MagAOX::app::tcsInterface::m_acqZdSign {-1}

Definition at line 291 of file tcsInterface.hpp.

Referenced by acquireFromGuider(), and loadConfigImpl().

◆ m_allDefsReceived

bool MagAOX::app::MagAOXApp< _useINDI >::m_allDefsReceived
protectedinherited

Flag indicating that all registered Set properties have been updated since last Get.

Definition at line 576 of file MagAOXApp.hpp.

◆ m_calibDir

std::string MagAOX::app::MagAOXApp< _useINDI >::m_calibDir
protectedinherited

The path to calibration files for MagAOX.

Definition at line 94 of file MagAOXApp.hpp.

◆ m_catDec

double MagAOX::app::tcsInterface::m_catDec {0}
protected

Catalog declination [degrees].

Definition at line 109 of file tcsInterface.hpp.

Referenced by appStartup(), getCatData(), recordTelCat(), and updateINDI().

◆ m_catEp

double MagAOX::app::tcsInterface::m_catEp {0}
protected

Catalog epoch.

Definition at line 110 of file tcsInterface.hpp.

Referenced by appStartup(), getCatData(), recordTelCat(), and updateINDI().

◆ m_catObj

std::string MagAOX::app::tcsInterface::m_catObj
protected

Catalog object name.

Definition at line 113 of file tcsInterface.hpp.

Referenced by getCatData(), recordTelCat(), and updateINDI().

◆ m_catRA

double MagAOX::app::tcsInterface::m_catRA {0}
protected

Catalog right ascension [degrees].

Definition at line 108 of file tcsInterface.hpp.

Referenced by appStartup(), getCatData(), recordTelCat(), and updateINDI().

◆ m_catRm

std::string MagAOX::app::tcsInterface::m_catRm
protected

Catalog rotator mode.

Definition at line 112 of file tcsInterface.hpp.

Referenced by getCatData(), recordTelCat(), and updateINDI().

◆ m_catRo

double MagAOX::app::tcsInterface::m_catRo {0}
protected

Catalog rotator offset.

Definition at line 111 of file tcsInterface.hpp.

Referenced by appStartup(), getCatData(), recordTelCat(), and updateINDI().

◆ m_configBase

std::string MagAOX::app::MagAOXApp< _useINDI >::m_configBase
protectedinherited

The name of a base config class for this app (minus .conf).

Definition at line 92 of file MagAOXApp.hpp.

◆ m_configDir

std::string MagAOX::app::MagAOXApp< _useINDI >::m_configDir
protectedinherited

The path to configuration files for MagAOX.

Definition at line 90 of file MagAOXApp.hpp.

◆ m_configName

std::string MagAOX::app::MagAOXApp< _useINDI >::m_configName
protectedinherited

The name of the configuration file (minus .conf).

Definition at line 88 of file MagAOXApp.hpp.

◆ m_cpusetPath

std::string MagAOX::app::MagAOXApp< _useINDI >::m_cpusetPath
protectedinherited

Definition at line 421 of file MagAOXApp.hpp.

◆ m_deviceAddr

std::string MagAOX::app::tcsInterface::m_deviceAddr {"localhost"}
protected

The IP address or resolvable name of the TCS.

Definition at line 57 of file tcsInterface.hpp.

Referenced by appLogic(), and loadConfigImpl().

◆ m_devicePort

int MagAOX::app::tcsInterface::m_devicePort {5811}
protected

The IP port for TCS communications. Should be the command port. Default is 5811.

Definition at line 58 of file tcsInterface.hpp.

Referenced by appLogic(), and loadConfigImpl().

◆ m_dimm_el

double MagAOX::app::tcsInterface::m_dimm_el {0}
protected

DIMM elevation at time of seeing measurement.

Definition at line 149 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_dimm_fwhm

double MagAOX::app::tcsInterface::m_dimm_fwhm {0}
protected

DIMM raw FWHM.

Definition at line 150 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_dimm_fwhm_corr

double MagAOX::app::tcsInterface::m_dimm_fwhm_corr {0}
protected

DIMM elevation corrected FWHM.

Definition at line 151 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), and updateINDI().

◆ m_dimm_time

int MagAOX::app::tcsInterface::m_dimm_time {0}
protected

Seconds since midnight of DIMM measurement.

Definition at line 152 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_driverCtrlName

std::string MagAOX::app::MagAOXApp< _useINDI >::m_driverCtrlName
protectedinherited

Full path name of the INDI driver control FIFO.

This is currently only used to signal restarts.

Definition at line 587 of file MagAOXApp.hpp.

◆ m_driverInName

std::string MagAOX::app::MagAOXApp< _useINDI >::m_driverInName
protectedinherited

Full path name of the INDI driver input FIFO.

Definition at line 579 of file MagAOXApp.hpp.

◆ m_driverOutName

std::string MagAOX::app::MagAOXApp< _useINDI >::m_driverOutName
protectedinherited

Full path name of the INDI driver output FIFO.

Definition at line 582 of file MagAOXApp.hpp.

◆ m_euidCalled

uid_t MagAOX::app::MagAOXApp< _useINDI >::m_euidCalled
privateinherited

The user id of the process as called (i.e. the higher privileged id of the owner, root if setuid).

Definition at line 315 of file MagAOXApp.hpp.

◆ m_euidReal

uid_t MagAOX::app::MagAOXApp< _useINDI >::m_euidReal
privateinherited

The real user id of the proces (i.e. the lower privileged id of the user)

Definition at line 314 of file MagAOXApp.hpp.

◆ m_firstRequest

size_t MagAOX::app::tcsInterface::m_firstRequest {0}

Definition at line 344 of file tcsInterface.hpp.

Referenced by offloadThreadExec().

◆ m_gitAlert

bool MagAOX::app::MagAOXApp< _useINDI >::m_gitAlert
privateinherited

Definition at line 472 of file MagAOXApp.hpp.

◆ m_indiDriver

indiDriver<MagAOXApp>* MagAOX::app::MagAOXApp< _useINDI >::m_indiDriver
inherited

The INDI driver wrapper. Constructed and initialized by execute, which starts and stops communications.

Todo:
instead of making this public, provide an accessor.

Definition at line 537 of file MagAOXApp.hpp.

◆ m_indiMutex

std::mutex MagAOX::app::MagAOXApp< _useINDI >::m_indiMutex
inherited

Mutex for locking INDI communications.

Definition at line 540 of file MagAOXApp.hpp.

◆ m_indiNewCallBacks

std::unordered_map< std::string, indiCallBack> MagAOX::app::MagAOXApp< _useINDI >::m_indiNewCallBacks
protectedinherited

Map to hold the NewProperty indiCallBacks for this App, with fast lookup by property name.

The key for these is the property name.

Definition at line 567 of file MagAOXApp.hpp.

◆ m_indiP_acqFromGuider

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_acqFromGuider

Property used to request a pyramid nudge.

Definition at line 300 of file tcsInterface.hpp.

Referenced by appStartup().

◆ m_indiP_catalog

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_catalog
protected

INDI Property for the catalog text information.

Definition at line 115 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_catdata

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_catdata
protected

INDI Property for the catalog data.

Definition at line 116 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_clearFSMAlert

pcf::IndiProperty MagAOX::app::MagAOXApp< _useINDI >::m_indiP_clearFSMAlert
protectedinherited

indi Property to clear an FSM alert.

Definition at line 948 of file MagAOXApp.hpp.

◆ m_indiP_env

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_env
protected

INDI Property for environment.

Definition at line 146 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_loopState

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_loopState

Property used to report the loop state.

Definition at line 263 of file tcsInterface.hpp.

Referenced by appStartup().

◆ m_indiP_offlFavgInt

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offlFavgInt

Definition at line 397 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_offlFdump

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offlFdump

Definition at line 394 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_offlFenable

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offlFenable

Definition at line 391 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_offlFgain

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offlFgain

Definition at line 400 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_offlFthresh

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offlFthresh

Definition at line 403 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_offloadCoeffs

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offloadCoeffs

Property used to report the latest woofer modal coefficients for offloading.

Definition at line 339 of file tcsInterface.hpp.

Referenced by appStartup().

◆ m_indiP_offlTTavgInt

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offlTTavgInt

Definition at line 373 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_offlTTdump

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offlTTdump

Definition at line 370 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_offlTTenable

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offlTTenable

Definition at line 367 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_offlTTgain

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offlTTgain

Definition at line 376 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_offlTTthresh

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_offlTTthresh

Definition at line 379 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_powerChannel

pcf::IndiProperty MagAOX::app::MagAOXApp< _useINDI >::m_indiP_powerChannel
protectedinherited

INDI property used to communicate power state.

Definition at line 998 of file MagAOXApp.hpp.

◆ m_indiP_pyrNudge

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_pyrNudge

Property used to request a pyramid nudge.

Definition at line 288 of file tcsInterface.hpp.

Referenced by appStartup().

◆ m_indiP_seeing

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_seeing
protected

INDI Property for seeing.

Definition at line 164 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_state

pcf::IndiProperty MagAOX::app::MagAOXApp< _useINDI >::m_indiP_state
protectedinherited

indi Property to report the application state.

Definition at line 945 of file MagAOXApp.hpp.

◆ m_indiP_teldata

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_teldata
protected

Definition at line 102 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_telpos

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_telpos
protected

Definition at line 86 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_teltime

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_teltime
protected

Definition at line 74 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiP_vaneend

pcf::IndiProperty MagAOX::app::tcsInterface::m_indiP_vaneend
protected

INDI Property for the vane end positions.

Definition at line 131 of file tcsInterface.hpp.

Referenced by appStartup(), and updateINDI().

◆ m_indiSetCallBacks

std::unordered_map< std::string, indiCallBack> MagAOX::app::MagAOXApp< _useINDI >::m_indiSetCallBacks
protectedinherited

Map to hold the SetProperty indiCallBacks for this App, with fast lookup by property name.

The key for these is device.name

Definition at line 572 of file MagAOXApp.hpp.

◆ m_lab_offlTT_C_00

float MagAOX::app::tcsInterface::m_lab_offlTT_C_00 {0.17}

Definition at line 350 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_lab_offlTT_C_01

float MagAOX::app::tcsInterface::m_lab_offlTT_C_01 {1.03}

Definition at line 351 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_lab_offlTT_C_10

float MagAOX::app::tcsInterface::m_lab_offlTT_C_10 {-1.03}

Definition at line 352 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_lab_offlTT_C_11

float MagAOX::app::tcsInterface::m_lab_offlTT_C_11 {0.48}

Definition at line 353 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_labMode

bool MagAOX::app::tcsInterface::m_labMode {true}
protected

Definition at line 61 of file tcsInterface.hpp.

Referenced by loadConfigImpl(), and sendTToffload().

◆ m_last_nRequests

size_t MagAOX::app::tcsInterface::m_last_nRequests {0}

Definition at line 347 of file tcsInterface.hpp.

Referenced by offloadThreadExec().

◆ m_lastRequest

size_t MagAOX::app::tcsInterface::m_lastRequest {std::numeric_limits<size_t>::max()}

Definition at line 345 of file tcsInterface.hpp.

Referenced by offloadThreadExec().

◆ m_log

MagAOXApp< _useINDI >::logManagerT MagAOX::app::MagAOXApp< _useINDI >::m_log
staticinherited

Definition at line 242 of file MagAOXApp.hpp.

◆ m_loopPause

unsigned long MagAOX::app::MagAOXApp< _useINDI >::m_loopPause
protectedinherited

The time in nanoseconds to pause the main loop. The appLogic() function of the derived class is called every m_loopPause nanoseconds. Default is 1,000,000,000 ns. Config with loopPause=X.

Definition at line 100 of file MagAOXApp.hpp.

◆ m_loopState

int MagAOX::app::tcsInterface::m_loopState {0}

Definition at line 262 of file tcsInterface.hpp.

Referenced by offloadThreadExec().

◆ m_mag1_el

double MagAOX::app::tcsInterface::m_mag1_el {0}
protected

MAG1 elevation at time of seeing measurement.

Definition at line 154 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_mag1_fwhm

double MagAOX::app::tcsInterface::m_mag1_fwhm {0}
protected

MAG1 raw FWHM.

Definition at line 155 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_mag1_fwhm_corr

double MagAOX::app::tcsInterface::m_mag1_fwhm_corr {0}
protected

MAG1 elevation corrected FWHM.

Definition at line 156 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_mag1_time

int MagAOX::app::tcsInterface::m_mag1_time {0}
protected

Seconds since midnight of MAG1 measurement.

Definition at line 157 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_mag2_el

double MagAOX::app::tcsInterface::m_mag2_el {0}
protected

MAG2 elevation at time of seeing measurement.

Definition at line 159 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_mag2_fwhm

double MagAOX::app::tcsInterface::m_mag2_fwhm {0}
protected

MAG2 raw FWHM.

Definition at line 160 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_mag2_fwhm_corr

double MagAOX::app::tcsInterface::m_mag2_fwhm_corr {0}
protected

MAG2 elevation corrected FWHM.

Definition at line 161 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_mag2_time

int MagAOX::app::tcsInterface::m_mag2_time {0}
protected

Seconds since midnight of MAG2 measurement.

Definition at line 162 of file tcsInterface.hpp.

Referenced by appStartup(), getSeeing(), recordTelSee(), and updateINDI().

◆ m_maxInterval

double MagAOX::app::dev::telemeter< tcsInterface >::m_maxInterval
inherited

The maximum interval, in seconds, between telemetry records. Default is 10.0 seconds.

Definition at line 58 of file telemeter.hpp.

◆ m_nRequests

size_t MagAOX::app::tcsInterface::m_nRequests {0}

Definition at line 346 of file tcsInterface.hpp.

Referenced by offloadThreadExec().

◆ m_offlCComa_00

float MagAOX::app::tcsInterface::m_offlCComa_00 {1}

Definition at line 410 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_offlCComa_01

float MagAOX::app::tcsInterface::m_offlCComa_01 {0}

Definition at line 411 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_offlCComa_10

float MagAOX::app::tcsInterface::m_offlCComa_10 {1}

Definition at line 412 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_offlCComa_11

float MagAOX::app::tcsInterface::m_offlCComa_11 {0}

Definition at line 413 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_offlCFocus_00

float MagAOX::app::tcsInterface::m_offlCFocus_00 {1}

Definition at line 383 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_offlF_avgInt

float MagAOX::app::tcsInterface::m_offlF_avgInt {1.0}

Definition at line 387 of file tcsInterface.hpp.

Referenced by appStartup(), loadConfigImpl(), offloadThreadExec(), and updateINDI().

◆ m_offlF_dump

bool MagAOX::app::tcsInterface::m_offlF_dump {false}

Definition at line 386 of file tcsInterface.hpp.

Referenced by doFoffload(), and updateINDI().

◆ m_offlF_enabled

bool MagAOX::app::tcsInterface::m_offlF_enabled {false}

Definition at line 385 of file tcsInterface.hpp.

Referenced by doFoffload(), and updateINDI().

◆ m_offlF_gain

float MagAOX::app::tcsInterface::m_offlF_gain {0.1}

Definition at line 388 of file tcsInterface.hpp.

Referenced by appStartup(), doFoffload(), loadConfigImpl(), and updateINDI().

◆ m_offlF_thresh

float MagAOX::app::tcsInterface::m_offlF_thresh {0.1}

Definition at line 389 of file tcsInterface.hpp.

Referenced by appStartup(), doFoffload(), loadConfigImpl(), and updateINDI().

◆ m_offloadRequests

std::vector<std::vector<float> > MagAOX::app::tcsInterface::m_offloadRequests

Definition at line 343 of file tcsInterface.hpp.

Referenced by appStartup(), and offloadThreadExec().

◆ m_offloadThread

std::thread MagAOX::app::tcsInterface::m_offloadThread

The offloading thread.

Definition at line 316 of file tcsInterface.hpp.

Referenced by appShutdown(), and appStartup().

◆ m_offloadThreadID

pid_t MagAOX::app::tcsInterface::m_offloadThreadID {0}

Offload thread pid.

Definition at line 312 of file tcsInterface.hpp.

Referenced by appStartup(), and offloadThreadExec().

◆ m_offloadThreadInit

bool MagAOX::app::tcsInterface::m_offloadThreadInit {true}

Initialization flag for the offload thread.

Definition at line 310 of file tcsInterface.hpp.

Referenced by appStartup(), and offloadThreadExec().

◆ m_offloadThreadProp

pcf::IndiProperty MagAOX::app::tcsInterface::m_offloadThreadProp

Offload thread INDI property.

Definition at line 314 of file tcsInterface.hpp.

Referenced by appStartup().

◆ m_offlTT_avgInt

float MagAOX::app::tcsInterface::m_offlTT_avgInt {1.0}

Definition at line 363 of file tcsInterface.hpp.

Referenced by appStartup(), loadConfigImpl(), offloadThreadExec(), and updateINDI().

◆ m_offlTT_C_00

float MagAOX::app::tcsInterface::m_offlTT_C_00 {-0.5}

Definition at line 356 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_offlTT_C_01

float MagAOX::app::tcsInterface::m_offlTT_C_01 {0}

Definition at line 357 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_offlTT_C_10

float MagAOX::app::tcsInterface::m_offlTT_C_10 {0}

Definition at line 358 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_offlTT_C_11

float MagAOX::app::tcsInterface::m_offlTT_C_11 {-0.25}

Definition at line 359 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_offlTT_dump

bool MagAOX::app::tcsInterface::m_offlTT_dump {false}

Definition at line 362 of file tcsInterface.hpp.

Referenced by doTToffload(), and updateINDI().

◆ m_offlTT_enabled

bool MagAOX::app::tcsInterface::m_offlTT_enabled {false}

Definition at line 361 of file tcsInterface.hpp.

Referenced by doTToffload(), and updateINDI().

◆ m_offlTT_gain

float MagAOX::app::tcsInterface::m_offlTT_gain {0.1}

Definition at line 364 of file tcsInterface.hpp.

Referenced by appStartup(), doTToffload(), loadConfigImpl(), and updateINDI().

◆ m_offlTT_thresh

float MagAOX::app::tcsInterface::m_offlTT_thresh {0.1}

Definition at line 365 of file tcsInterface.hpp.

Referenced by appStartup(), doTToffload(), loadConfigImpl(), and updateINDI().

◆ m_pid

pid_t MagAOX::app::MagAOXApp< _useINDI >::m_pid
protectedinherited

This process's PID.

Definition at line 394 of file MagAOXApp.hpp.

◆ m_powerChannel

std::string MagAOX::app::MagAOXApp< _useINDI >::m_powerChannel
protectedinherited

The INDI property name of the channel controlling this device's power.

Definition at line 985 of file MagAOXApp.hpp.

◆ m_powerDevice

std::string MagAOX::app::MagAOXApp< _useINDI >::m_powerDevice
protectedinherited

The INDI device name of the power controller.

Definition at line 984 of file MagAOXApp.hpp.

◆ m_powerElement

std::string MagAOX::app::MagAOXApp< _useINDI >::m_powerElement
protectedinherited

The INDI element name to monitor for this device's power state.

Definition at line 986 of file MagAOXApp.hpp.

◆ m_powerMgtEnabled

bool MagAOX::app::MagAOXApp< _useINDI >::m_powerMgtEnabled
protectedinherited

Flag controls whether power mgt is used. Set this in the constructor of a derived app. If true, then if after loadConfig the powerDevice and powerChannel are empty, then the app will exit with a critical error.

Definition at line 981 of file MagAOXApp.hpp.

◆ m_powerOnCounter

int MagAOX::app::MagAOXApp< _useINDI >::m_powerOnCounter
protectedinherited

Counts numer of loops after power on, implements delay for device bootup. If -1, then device was NOT powered off on app startup.

Definition at line 992 of file MagAOXApp.hpp.

◆ m_powerOnWait

unsigned long MagAOX::app::MagAOXApp< _useINDI >::m_powerOnWait
protectedinherited

Time in sec to wait for device to boot after power on.

Definition at line 989 of file MagAOXApp.hpp.

◆ m_powerState

int MagAOX::app::MagAOXApp< _useINDI >::m_powerState
protectedinherited

Current power state, 1=On, 0=Off, -1=Unk.

Definition at line 995 of file MagAOXApp.hpp.

◆ m_powerTargetElement

std::string MagAOX::app::MagAOXApp< _useINDI >::m_powerTargetElement
protectedinherited

The INDI element name to monitor for this device's power state.

Definition at line 987 of file MagAOXApp.hpp.

◆ m_powerTargetState

int MagAOX::app::MagAOXApp< _useINDI >::m_powerTargetState
protectedinherited

Current target power state, 1=On, 0=Off, -1=Unk.

Definition at line 996 of file MagAOXApp.hpp.

◆ m_pyrNudge_ang

float MagAOX::app::tcsInterface::m_pyrNudge_ang {45.0}

Definition at line 279 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_pyrNudge_ang0

float MagAOX::app::tcsInterface::m_pyrNudge_ang0 {0.0}

Definition at line 280 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_pyrNudge_C_00

float MagAOX::app::tcsInterface::m_pyrNudge_C_00 {1}

Definition at line 273 of file tcsInterface.hpp.

Referenced by loadConfigImpl(), and sendPyrNudge().

◆ m_pyrNudge_C_01

float MagAOX::app::tcsInterface::m_pyrNudge_C_01 {0}

Definition at line 274 of file tcsInterface.hpp.

Referenced by loadConfigImpl(), and sendPyrNudge().

◆ m_pyrNudge_C_10

float MagAOX::app::tcsInterface::m_pyrNudge_C_10 {0}

Definition at line 275 of file tcsInterface.hpp.

Referenced by loadConfigImpl(), and sendPyrNudge().

◆ m_pyrNudge_C_11

float MagAOX::app::tcsInterface::m_pyrNudge_C_11 {1}

Definition at line 276 of file tcsInterface.hpp.

Referenced by loadConfigImpl(), and sendPyrNudge().

◆ m_pyrNudge_F_sign

float MagAOX::app::tcsInterface::m_pyrNudge_F_sign {1}

Definition at line 277 of file tcsInterface.hpp.

Referenced by acquireFromGuider(), and sendPyrNudge().

◆ m_pyrNudge_parity

float MagAOX::app::tcsInterface::m_pyrNudge_parity {-1}

Definition at line 281 of file tcsInterface.hpp.

Referenced by loadConfigImpl().

◆ m_readTimeout

◆ m_seeingInterval

int MagAOX::app::tcsInterface::m_seeingInterval {2}
protected

Definition at line 59 of file tcsInterface.hpp.

Referenced by getSeeing().

◆ m_self

MagAOXApp< _useINDI > * MagAOX::app::MagAOXApp< _useINDI >::m_self
staticprivateinherited

Static pointer to this (set in constructor). Used to test whether a a MagAOXApp is already instatiated (a fatal error) and used for getting out of static signal handlers.

Definition at line 291 of file MagAOXApp.hpp.

◆ m_shutdown

int MagAOX::app::MagAOXApp< _useINDI >::m_shutdown
protectedinherited

Flag to signal it's time to shutdown. When not 0, the main loop exits.

Definition at line 102 of file MagAOXApp.hpp.

◆ m_sock

tty::netSerial MagAOX::app::tcsInterface::m_sock
protected

Definition at line 66 of file tcsInterface.hpp.

Referenced by appLogic(), getMagTelStatus(), and sendMagTelCommand().

◆ m_state

stateCodes::stateCodeT MagAOX::app::MagAOXApp< _useINDI >::m_state
privateinherited

The application's state. Never ever set this directly, use state(const stateCodeT & s).

Definition at line 468 of file MagAOXApp.hpp.

◆ m_stateAlert

bool MagAOX::app::MagAOXApp< _useINDI >::m_stateAlert
privateinherited

Definition at line 470 of file MagAOXApp.hpp.

◆ m_stateLogged

int MagAOX::app::MagAOXApp< _useINDI >::m_stateLogged
privateinherited

Counter and flag for use to log errors just once. Never ever access directly, use stateLogged().

Definition at line 474 of file MagAOXApp.hpp.

◆ m_suid

uid_t MagAOX::app::MagAOXApp< _useINDI >::m_suid
privateinherited

The save-set user id of the process.

Definition at line 316 of file MagAOXApp.hpp.

◆ m_tambient

double MagAOX::app::tcsInterface::m_tambient {0}
protected

Dome air temperature, Celsius.

Definition at line 143 of file tcsInterface.hpp.

Referenced by appStartup(), getEnvData(), recordTelEnv(), and updateINDI().

◆ m_tcell

double MagAOX::app::tcsInterface::m_tcell {0}
protected

Primary mirror cell temperature, Celsius.

Definition at line 141 of file tcsInterface.hpp.

Referenced by appStartup(), getEnvData(), recordTelEnv(), and updateINDI().

◆ m_tcsMutex

std::mutex MagAOX::app::tcsInterface::m_tcsMutex
protected

Mutex for locking INDI communications.

Definition at line 69 of file tcsInterface.hpp.

Referenced by getMagTelStatus(), and sendMagTelCommand().

◆ m_tel

Definition at line 56 of file telemeter.hpp.

◆ m_telAM

double MagAOX::app::tcsInterface::m_telAM {0}
protected

Definition at line 83 of file tcsInterface.hpp.

Referenced by appStartup(), getTelPos(), recordTelPos(), and updateINDI().

◆ m_telAz

double MagAOX::app::tcsInterface::m_telAz {0}
protected

azimuth

Definition at line 96 of file tcsInterface.hpp.

Referenced by appStartup(), getTelData(), recordTelData(), and updateINDI().

◆ m_telDec

double MagAOX::app::tcsInterface::m_telDec {0}
protected

Definition at line 80 of file tcsInterface.hpp.

Referenced by appStartup(), getTelPos(), recordTelPos(), and updateINDI().

◆ m_telDomeAz

double MagAOX::app::tcsInterface::m_telDomeAz {0}
protected

dome azimuth

Definition at line 99 of file tcsInterface.hpp.

Referenced by appStartup(), getTelData(), recordTelData(), and updateINDI().

◆ m_telDomeStat

int MagAOX::app::tcsInterface::m_telDomeStat {0}
protected

dome status

Definition at line 100 of file tcsInterface.hpp.

Referenced by appStartup(), getTelData(), recordTelData(), and updateINDI().

◆ m_telEl

double MagAOX::app::tcsInterface::m_telEl {0}
protected

Definition at line 81 of file tcsInterface.hpp.

Referenced by appStartup(), getTelData(), recordTelPos(), and updateINDI().

◆ m_telEncH

double MagAOX::app::tcsInterface::m_telEncH {0}
protected

Definition at line 127 of file tcsInterface.hpp.

Referenced by appStartup(), getVaneData(), recordTelVane(), and updateINDI().

◆ m_telEncV

double MagAOX::app::tcsInterface::m_telEncV {0}
protected

Definition at line 129 of file tcsInterface.hpp.

Referenced by appStartup(), getVaneData(), recordTelVane(), and updateINDI().

◆ m_telEncX

double MagAOX::app::tcsInterface::m_telEncX {0}
protected

Definition at line 123 of file tcsInterface.hpp.

Referenced by appStartup(), getVaneData(), recordTelVane(), and updateINDI().

◆ m_telEncY

double MagAOX::app::tcsInterface::m_telEncY {0}
protected

Definition at line 125 of file tcsInterface.hpp.

Referenced by appStartup(), getVaneData(), recordTelVane(), and updateINDI().

◆ m_telEncZ

double MagAOX::app::tcsInterface::m_telEncZ {0}
protected

Definition at line 121 of file tcsInterface.hpp.

Referenced by appStartup(), getVaneData(), recordTelVane(), and updateINDI().

◆ m_telEpoch

double MagAOX::app::tcsInterface::m_telEpoch {0}
protected

Definition at line 78 of file tcsInterface.hpp.

Referenced by appStartup(), getTelPos(), recordTelPos(), and updateINDI().

◆ m_telGuiderMoving

int MagAOX::app::tcsInterface::m_telGuiderMoving {0}
protected

guider moving state

Definition at line 95 of file tcsInterface.hpp.

Referenced by appStartup(), getTelData(), recordTelData(), and updateINDI().

◆ m_telGuiding

int MagAOX::app::tcsInterface::m_telGuiding {0}
protected

guider moving state

Definition at line 93 of file tcsInterface.hpp.

Referenced by appStartup(), getTelData(), recordTelData(), and updateINDI().

◆ m_telHA

double MagAOX::app::tcsInterface::m_telHA {0}
protected

Definition at line 82 of file tcsInterface.hpp.

Referenced by appStartup(), getTelPos(), recordTelPos(), and updateINDI().

◆ m_telPA

double MagAOX::app::tcsInterface::m_telPA {0}
protected

parallactic angle

Definition at line 98 of file tcsInterface.hpp.

Referenced by appStartup(), getTelData(), recordTelData(), and updateINDI().

◆ m_telRA

double MagAOX::app::tcsInterface::m_telRA {0}
protected

Definition at line 79 of file tcsInterface.hpp.

Referenced by appStartup(), getTelPos(), recordTelPos(), and updateINDI().

◆ m_telROI

int MagAOX::app::tcsInterface::m_telROI {0}
protected

The rotator of interest.

Definition at line 91 of file tcsInterface.hpp.

Referenced by appStartup(), getTelData(), recordTelData(), and updateINDI().

◆ m_telRotOff

double MagAOX::app::tcsInterface::m_telRotOff {0}
protected

Definition at line 84 of file tcsInterface.hpp.

Referenced by appStartup(), getTelPos(), recordTelPos(), and updateINDI().

◆ m_telSecH

double MagAOX::app::tcsInterface::m_telSecH {0}
protected

Definition at line 126 of file tcsInterface.hpp.

Referenced by appStartup(), getVaneData(), recordTelVane(), and updateINDI().

◆ m_telSecV

double MagAOX::app::tcsInterface::m_telSecV {0}
protected

Definition at line 128 of file tcsInterface.hpp.

Referenced by appStartup(), getVaneData(), recordTelVane(), and updateINDI().

◆ m_telSecX

double MagAOX::app::tcsInterface::m_telSecX {0}
protected

Definition at line 122 of file tcsInterface.hpp.

Referenced by appStartup(), getVaneData(), recordTelVane(), and updateINDI().

◆ m_telSecY

double MagAOX::app::tcsInterface::m_telSecY {0}
protected

Definition at line 124 of file tcsInterface.hpp.

Referenced by appStartup(), getVaneData(), recordTelVane(), and updateINDI().

◆ m_telSecZ

double MagAOX::app::tcsInterface::m_telSecZ {0}
protected

Definition at line 120 of file tcsInterface.hpp.

Referenced by appStartup(), getVaneData(), recordTelVane(), and updateINDI().

◆ m_telSlewing

int MagAOX::app::tcsInterface::m_telSlewing {0}
protected

slewing state

Definition at line 94 of file tcsInterface.hpp.

Referenced by appStartup(), getTelData(), recordTelData(), and updateINDI().

◆ m_telST

double MagAOX::app::tcsInterface::m_telST {0}
protected

Definition at line 72 of file tcsInterface.hpp.

Referenced by appStartup(), getTelTime(), and updateINDI().

◆ m_telTracking

int MagAOX::app::tcsInterface::m_telTracking {0}
protected

tracking state

Definition at line 92 of file tcsInterface.hpp.

Referenced by appStartup(), getTelData(), recordTelData(), and updateINDI().

◆ m_telZd

double MagAOX::app::tcsInterface::m_telZd {0}
protected

zenith distance

Definition at line 97 of file tcsInterface.hpp.

Referenced by acquireFromGuider(), appStartup(), getTelData(), recordTelData(), and updateINDI().

◆ m_tseccell

double MagAOX::app::tcsInterface::m_tseccell {0}
protected

Secondary mirror cell temperature, Celsius.

Definition at line 142 of file tcsInterface.hpp.

Referenced by appStartup(), getEnvData(), recordTelEnv(), and updateINDI().

◆ m_ttruss

double MagAOX::app::tcsInterface::m_ttruss {0}
protected

Telescope truss temperature, Celsius.

Definition at line 140 of file tcsInterface.hpp.

Referenced by appStartup(), getEnvData(), recordTelEnv(), and updateINDI().

◆ m_useINDI

constexpr static bool MagAOX::app::MagAOXApp< _useINDI >::m_useINDI
staticconstexprprotectedinherited

Flag controlling whether INDI is used. If false, then no INDI code executes.

Definition at line 532 of file MagAOXApp.hpp.

◆ m_writeTimeout

◆ m_wxdewpoint

double MagAOX::app::tcsInterface::m_wxdewpoint {0}
protected

Dew point from weather station.

Definition at line 144 of file tcsInterface.hpp.

Referenced by appStartup(), getEnvData(), recordTelEnv(), and updateINDI().

◆ m_wxhumid

double MagAOX::app::tcsInterface::m_wxhumid {0}
protected

Outside humidity, percent.

Definition at line 137 of file tcsInterface.hpp.

Referenced by appStartup(), getEnvData(), recordTelEnv(), and updateINDI().

◆ m_wxpres

double MagAOX::app::tcsInterface::m_wxpres {0}
protected

Outside pressue, millibars.

Definition at line 136 of file tcsInterface.hpp.

Referenced by appStartup(), getEnvData(), recordTelEnv(), and updateINDI().

◆ m_wxtemp

double MagAOX::app::tcsInterface::m_wxtemp {0}
protected

Outside temperature, Celsius.

Definition at line 135 of file tcsInterface.hpp.

Referenced by appStartup(), getEnvData(), recordTelEnv(), and updateINDI().

◆ m_wxwdir

double MagAOX::app::tcsInterface::m_wxwdir {0}
protected

outside wind direction, degrees

Definition at line 139 of file tcsInterface.hpp.

Referenced by appStartup(), getEnvData(), recordTelEnv(), and updateINDI().

◆ m_wxwind

double MagAOX::app::tcsInterface::m_wxwind {0}
protected

outside wind intensity, mph

Definition at line 138 of file tcsInterface.hpp.

Referenced by appStartup(), getEnvData(), recordTelEnv(), and updateINDI().

◆ MagAOXPath

std::string MagAOX::app::MagAOXApp< _useINDI >::MagAOXPath
protectedinherited

The base path of the MagAO-X system.

Definition at line 86 of file MagAOXApp.hpp.

◆ pidFileName

std::string MagAOX::app::MagAOXApp< _useINDI >::pidFileName
protectedinherited

The name of the PID file.

Definition at line 392 of file MagAOXApp.hpp.

◆ secretsPath

std::string MagAOX::app::MagAOXApp< _useINDI >::secretsPath
protectedinherited

Path to the secrets directory, where passwords, etc, are stored.

Definition at line 98 of file MagAOXApp.hpp.

◆ sysPath

std::string MagAOX::app::MagAOXApp< _useINDI >::sysPath
protectedinherited

The path to the system directory, for PID file, etc.

Definition at line 96 of file MagAOXApp.hpp.


The documentation for this class was generated from the following file: