The base-class for XWCTk applications. More...
#include <MagAOXApp.hpp>
Classes | |
class | elevatedPrivileges |
Internal class to manage setuid privilege escalation with RAII. More... | |
struct | indiCallBack |
Structure to hold the call-back details for handling INDI communications. More... | |
Public Types | |
typedef logger::logManager< MagAOXApp< _useINDI >, logFileRaw > | logManagerT |
The log manager type. | |
Public Member Functions | |
MagAOXApp (const std::string &git_sha1, const bool git_modified) | |
Public c'tor. Handles uid, logs git repo status, and initializes static members. | |
~MagAOXApp () noexcept(true) | |
int | shutdown () |
Get the value of the shutdown flag. | |
virtual void | setDefaults (int argc, char **argv) |
Set the paths for config files. | |
virtual void | setupBasicConfig () |
The basic MagAO-X configuration setup method. Should not normally be overridden. | |
virtual void | loadBasicConfig () |
The basic MagAO-X configuration processing method. Should not normally be overridden. | |
virtual void | checkConfig () |
Check for unused and unrecognized config options and settings. | |
virtual int | execute () |
The execute method implementing the standard main loop. Should not normally be overridden. | |
Pure Virtual Functions | |
Derived applications must implement these. | |
virtual int | appStartup ()=0 |
Any tasks to perform prior to the main event loop go here. | |
virtual int | appLogic ()=0 |
This is where derived applications implement their main FSM logic. | |
virtual int | appShutdown ()=0 |
Any tasks to perform after main loop exit go here. | |
Threads | |
template<class thisPtr , class Function > | |
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. | |
Member Accessors | |
std::string | configName () |
Get the config name. | |
std::string | configDir () |
Get the config directory. | |
std::string | driverInName () |
Get the INDI input FIFO file name. | |
std::string | driverOutName () |
Get the INDI output FIFO file name. | |
std::string | driverCtrlName () |
Get the INDI control FIFO file name. | |
Protected Attributes | |
std::string | MagAOXPath |
The base path of the MagAO-X system. | |
std::string | m_configName |
The name of the configuration file (minus .conf). | |
std::string | m_configDir |
The path to configuration files for MagAOX. | |
std::string | m_configBase |
The name of a base config class for this app (minus .conf). | |
std::string | m_calibDir |
The path to calibration files for MagAOX. | |
std::string | sysPath |
The path to the system directory, for PID file, etc. | |
std::string | secretsPath |
Path to the secrets directory, where passwords, etc, are stored. | |
unsigned long | m_loopPause { MAGAOX_default_loopPause } |
int | m_shutdown { 0 } |
Flag to signal it's time to shutdown. When not 0, the main loop exits. | |
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 { MAGAOX_cpusetPath } |
Private Member Functions | |
MagAOXApp ()=delete | |
Default c'tor is deleted. | |
int | clearFSMAlert () |
Clear the FSM alert state. | |
Friends | |
class | MagAOXApp_test |
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. | |
typedef std::pair< std::string, indiCallBack > | callBackValueType |
Value type of the indiCallBack map. | |
typedef std::unordered_map< std::string, indiCallBack >::iterator | callBackIterator |
Iterator type of the indiCallBack map. | |
typedef std::pair< callBackIterator, bool > | callBackInsertResult |
Return type of insert on the indiCallBack map. | |
std::unordered_map< std::string, indiCallBack > | m_indiNewCallBacks |
Map to hold the NewProperty indiCallBacks for this App, with fast lookup by property name. | |
std::unordered_map< std::string, indiCallBack > | m_indiSetCallBacks |
Map to hold the SetProperty indiCallBacks for this App, with fast lookup by property name. | |
bool | m_allDefsReceived { false } |
Flag indicating that all registered Set properties have been updated since last Get. | |
std::string | m_driverInName |
Full path name of the INDI driver input FIFO. | |
std::string | m_driverOutName |
Full path name of the INDI driver output FIFO. | |
std::string | m_driverCtrlName |
Full path name of the INDI driver control FIFO. | |
pcf::IndiProperty | m_indiP_state |
indi Property to report the application state. | |
pcf::IndiProperty | m_indiP_clearFSMAlert |
indi Property to clear an FSM alert. | |
static constexpr bool | m_useINDI = _useINDI |
Flag controlling whether INDI is used. If false, then no INDI code executes. | |
indiDriver< MagAOXApp > * | m_indiDriver { nullptr } |
The INDI driver wrapper. Constructed and initialized by execute, which starts and stops communications. | |
std::mutex | m_indiMutex |
Mutex for locking INDI communications. | |
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. | |
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. | |
template<typename T > | |
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. | |
int | createROIndiNumber (pcf::IndiProperty &prop, const std::string &propName, const std::string &propLabel="", const std::string &propGroup="") |
Create a ReadOnly INDI Number property. | |
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. | |
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. | |
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. | |
int | createStandardIndiSelectionSw (pcf::IndiProperty &prop, const std::string &name, const std::vector< std::string > &elements, const std::string &label="", const std::string &group="") |
int | registerIndiPropertyReadOnly (pcf::IndiProperty &prop) |
Register an INDI property which is read only. | |
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. | |
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. | |
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. | |
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. | |
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. | |
void | sendGetPropertySetList (bool all=false) |
void | handleDefProperty (const pcf::IndiProperty &ipRecv) |
Handler for the DEF INDI properties notification. | |
void | handleGetProperties (const pcf::IndiProperty &ipRecv) |
Handler for the get INDI properties request. | |
void | handleNewProperty (const pcf::IndiProperty &ipRecv) |
Handler for the new INDI property request. | |
void | handleSetProperty (const pcf::IndiProperty &ipRecv) |
Handler for the set INDI property request. | |
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. | |
int | createINDIFIFOS () |
Create the INDI FIFOs. | |
int | startINDI () |
Start INDI Communications. | |
template<typename T > | |
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. | |
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. | |
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. | |
template<typename T > | |
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. | |
template<typename T > | |
void | updateIfChanged (pcf::IndiProperty &p, const std::vector< std::string > &els, const std::vector< T > &newVals, pcf::IndiProperty::PropertyStateType newState=pcf::IndiProperty::Ok) |
Update an INDI property if values have changed. | |
template<typename T > | |
void | updatesIfChanged (pcf::IndiProperty &p, const std::vector< const char * > &els, const std::vector< T > &newVals, pcf::IndiProperty::PropertyStateType newState=pcf::IndiProperty::Ok) |
template<typename T > | |
int | indiTargetUpdate (pcf::IndiProperty &localProperty, T &localTarget, const pcf::IndiProperty &remoteProperty, bool setBusy=true) |
Get the target element value from an new property. | |
template<typename T > | |
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) | |
int | sendNewProperty (const pcf::IndiProperty &ipSend) |
Send a newProperty command to another device (using the INDI Client interface) | |
int | sendNewStandardIndiToggle (const std::string &device, const std::string &property, bool onoff) |
Send a new property commmand for a standard toggle switch. | |
int | newCallBack_clearFSMAlert (const pcf::IndiProperty &ipRecv) |
The callback called by the static version, to actually process the FSM Alert Clear request. | |
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. | |
pid_t | m_pid { 0 } |
This process's PID. | |
int | lockPID () |
int | unlockPID () |
Remove the PID file. | |
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 { false } |
std::string | m_powerDevice |
The INDI device name of the power controller. | |
std::string | m_powerChannel |
The INDI property name of the channel controlling this device's power. | |
std::string | m_powerElement { "state" } |
The INDI element name to monitor for this device's power state. | |
std::string | m_powerTargetElement { "target" } |
The INDI element name to monitor for this device's power state. | |
unsigned long | m_powerOnWait { 0 } |
Time in sec to wait for device to boot after power on. | |
int | m_powerOnCounter { -1 } |
int | m_powerState { -1 } |
Current power state, 1=On, 0=Off, -1=Unk. | |
int | m_powerTargetState { -1 } |
Current target power state, 1=On, 0=Off, -1=Unk. | |
pcf::IndiProperty | m_indiP_powerChannel |
INDI property used to communicate power state. | |
int | powerState () |
Returns the current power state. | |
int | powerStateTarget () |
Returns the target power state. | |
INDI_SETCALLBACK_DECL (MagAOXApp, m_indiP_powerChannel) | |
virtual int | onPowerOff () |
This method is called when the change to poweroff is detected. | |
virtual int | whilePowerOff () |
This method is called while the power is off, once per FSM loop. | |
bool | powerOnWaitElapsed () |
This method tests whether the power on wait time has elapsed. | |
Logging | |
static logManagerT | m_log |
void | logMessage (bufferPtrT &b) |
Handle a log message from the logging system. | |
template<typename logT , int retval = 0> | |
static int | log (const typename logT::messageT &msg, logPrioT level=logPrio::LOG_DEFAULT) |
Make a log entry. | |
template<typename logT , int retval = 0> | |
static int | log (logPrioT level=logPrio::LOG_DEFAULT) |
Make a log entry. | |
static void | configLog (const std::string &name, const int &code, const std::string &value, const std::string &source) |
Callback for config system logging. | |
Signal Handling | |
static MagAOXApp * | m_self = nullptr |
int | setSigTermHandler () |
Sets the handler for SIGTERM, SIGQUIT, and SIGINT. | |
void | handlerSigTerm (int signum, siginfo_t *siginf, void *ucont) |
Handles SIGTERM, SIGQUIT, and SIGINT. Sets m_shutdown to 1 and logs the signal. | |
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. | |
Privilege Management | |
uid_t | m_euidReal |
The real user id of the proces (i.e. the lower privileged id of the user) | |
uid_t | m_euidCalled |
uid_t | m_suid |
The save-set user id of the process. | |
int | setEuidCalled () |
Set the effective user ID to the called value, i.e. the highest possible. | |
int | setEuidReal () |
Set the effective user ID to the real value, i.e. the file owner. | |
Application State | |
stateCodes::stateCodeT | m_state { stateCodes::UNINITIALIZED } |
bool | m_stateAlert { false } |
bool | m_gitAlert { false } |
int | m_stateLogged { 0 } |
stateCodes::stateCodeT | state () |
Get the current state code. | |
void | state (const stateCodes::stateCodeT &s, bool stateAlert=false) |
Set the current state code. | |
int | stateLogged () |
Updates and returns the value of m_stateLogged. Will be 0 on first call after a state change, >0 afterwards. | |
The base-class for XWCTk applications.
This class implements the standard logic for an XWCTk application, including PID locking, privilege management, configuration, logging, INDI communications, and a finite state machine (FSM).
A typical XWCApp is the interface to a single piece of hardware, such as a camera or a filter wheel. Through various optional CRTP base classes, many different standard functionalities can be included. The following figure illustrates the facilities provided by a typical app.
This class is inherited using standard virtual inheritance. The virtual interface consists of the following functions:
The following figure illustrates the logic of the XWCApp FSM.
Standard configurable options are set in setupBasicConfig(). See either the source code for that function or run an application with -h
.
You can define a base configuration file for this class by defining
in the derived class constructor. This would be used, for instance to have a config common to all filter wheels.
Definition at line 112 of file MagAOXApp.hpp.
typedef std::pair<callBackIterator, bool> MagAOX::app::MagAOXApp< _useINDI >::callBackInsertResult |
Return type of insert on the indiCallBack map.
Definition at line 607 of file MagAOXApp.hpp.
typedef std::unordered_map<std::string,indiCallBack>::iterator MagAOX::app::MagAOXApp< _useINDI >::callBackIterator |
Iterator type of the indiCallBack map.
Definition at line 604 of file MagAOXApp.hpp.
typedef std::pair<std::string, indiCallBack> MagAOX::app::MagAOXApp< _useINDI >::callBackValueType |
Value type of the indiCallBack map.
Definition at line 601 of file MagAOXApp.hpp.
typedef logger::logManager<MagAOXApp<_useINDI>, logFileRaw> MagAOX::app::MagAOXApp< _useINDI >::logManagerT |
The log manager type.
Definition at line 118 of file MagAOXApp.hpp.
|
privatedelete |
Default c'tor is deleted.
MagAOX::app::MagAOXApp< _useINDI >::MagAOXApp | ( | const std::string & | git_sha1, |
const bool | git_modified | ||
) |
Public c'tor. Handles uid, logs git repo status, and initializes static members.
Only one MagAOXApp can be instantiated per program. Hence this c'tor will issue exit(-1) if the static self-pointer m_self is already initialized.
euid is set to 'real' to ensure that the application has normal privileges unless explicitly needed.
Reference: http://man7.org/linux/man-pages/man2/getresuid.2.html
The git repository status is required to create a MagAOXApp. Derived classes should include the results of running gengithead.sh
and pass the defined sha1 and modified flags.
[in] | git_sha1 | The current SHA1 hash of the git repository |
[in] | git_modified | Whether or not the repo is modified. |
Definition at line 1180 of file MagAOXApp.hpp.
|
noexcept |
Definition at line 1220 of file MagAOXApp.hpp.
|
staticprivate |
The handler called when SIGTERM, SIGQUIT, or SIGINT is received. Just a wrapper for handlerSigTerm.
[in] | signum | specifies the signal. |
[in] | siginf | ignored by MagAOXApp |
[in] | ucont | ignored by MagAOXApp |
Definition at line 1969 of file MagAOXApp.hpp.
|
pure virtual |
This is where derived applications implement their main FSM logic.
This will be called every m_loopPause nanoseconds until the application terminates.
FSM state will be whatever it is on exti from appStartup.
Should return -1 on an any unrecoverable errors which will caues app to terminate. Could also set m_shutdown=1. Return 0 on success, or at least intent to continue.
Implemented in MagAOX::app::acesxeCtrl, MagAOX::app::acronameUsbHub, MagAOX::app::adcTracker, MagAOX::app::alignLoop, MagAOX::app::alpaoCtrl, MagAOX::app::andorCtrl, MagAOX::app::baslerCtrl, MagAOX::app::bmcCtrl, MagAOX::app::cacaoInterface, MagAOX::app::cameraSim, MagAOX::app::closedLoopIndi, MagAOX::app::dlDataCollection, MagAOX::app::dmMode, MagAOX::app::dmPokeCenter, MagAOX::app::dmPokeXCorr, MagAOX::app::dmSpeckle, MagAOX::app::filterWheelCtrl, MagAOX::app::flipperCtrl, MagAOX::app::hoPredCtrl, MagAOX::app::hsfwCtrl, MagAOX::app::indiTSAccumulator, MagAOX::app::irisaoCtrl, MagAOX::app::kcubeCtrl, MagAOX::app::koolanceCtrl, MagAOX::app::kTracker, MagAOX::app::loPredCtrl, MagAOX::app::magAOXMaths, MagAOX::app::mcp3008Ctrl, MagAOX::app::modalFilter, MagAOX::app::modalGainOpt, MagAOX::app::modalPSDs, MagAOX::app::mzmqClient, MagAOX::app::mzmqServer, MagAOX::app::nnReconstructor, MagAOX::app::nnReconstructor, MagAOX::app::observerCtrl, MagAOX::app::ocam2KCtrl, MagAOX::app::photonCounter, MagAOX::app::pi335Ctrl, MagAOX::app::picamCtrl, MagAOX::app::picoMotorCtrl, MagAOX::app::po4ao, MagAOX::app::psfAcq, MagAOX::app::psfFit, MagAOX::app::pupilAlign, MagAOX::app::pupilFit, MagAOX::app::pvcamCtrl, MagAOX::app::pwfsSlopeCalc, MagAOX::app::qhyCtrl, MagAOX::app::refRMS, MagAOX::app::rhusbMon, MagAOX::app::shmimIntegrator, MagAOX::app::siglentSDG, MagAOX::app::smc100ccCtrl, MagAOX::app::sparkleClock, MagAOX::app::sshDigger, MagAOX::app::stateRuleEngine, MagAOX::app::streamCircBuff, MagAOX::app::streamWriter, MagAOX::app::strehlEstimator, MagAOX::app::sysMonitor, MagAOX::app::t2wOffloader, MagAOX::app::tcsInterface, MagAOX::app::timeSeriesSimulator, MagAOX::app::trippLitePDU, MagAOX::app::ttmModulator, MagAOX::app::usbtempMon, MagAOX::app::userGainCtrl, MagAOX::app::w2tcsOffloader, MagAOX::app::xindiserver, MagAOX::app::xt1121Ctrl, MagAOX::app::xt1121DCDU, MagAOX::app::zaberCtrl, MagAOX::app::zaberLowLevel, MagAOX::app::zylaCtrl, and MagAOXApp_tests::MagAOXApp_test.
|
pure virtual |
Any tasks to perform after main loop exit go here.
Should be able to handle case where appStartup and/or appLogic have not run.
Implemented in MagAOX::app::acesxeCtrl, MagAOX::app::acronameUsbHub, MagAOX::app::adcTracker, MagAOX::app::alignLoop, MagAOX::app::alpaoCtrl, MagAOX::app::andorCtrl, MagAOX::app::baslerCtrl, MagAOX::app::bmcCtrl, MagAOX::app::cacaoInterface, MagAOX::app::cameraSim, MagAOX::app::closedLoopIndi, MagAOX::app::dlDataCollection, MagAOX::app::dmMode, MagAOX::app::dmPokeCenter, MagAOX::app::dmPokeXCorr, MagAOX::app::dmSpeckle, MagAOX::app::filterWheelCtrl, MagAOX::app::flipperCtrl, MagAOX::app::hoPredCtrl, MagAOX::app::hsfwCtrl, MagAOX::app::indiTSAccumulator, MagAOX::app::irisaoCtrl, MagAOX::app::kcubeCtrl, MagAOX::app::koolanceCtrl, MagAOX::app::kTracker, MagAOX::app::loPredCtrl, MagAOX::app::magAOXMaths, MagAOX::app::mcp3008Ctrl, MagAOX::app::modalFilter, MagAOX::app::modalGainOpt, MagAOX::app::modalPSDs, MagAOX::app::mzmqClient, MagAOX::app::mzmqServer, MagAOX::app::nnReconstructor, MagAOX::app::nnReconstructor, MagAOX::app::observerCtrl, MagAOX::app::ocam2KCtrl, MagAOX::app::photonCounter, MagAOX::app::pi335Ctrl, MagAOX::app::picamCtrl, MagAOX::app::picoMotorCtrl, MagAOX::app::po4ao, MagAOX::app::psfAcq, MagAOX::app::psfFit, MagAOX::app::pupilAlign, MagAOX::app::pupilFit, MagAOX::app::pvcamCtrl, MagAOX::app::pwfsSlopeCalc, MagAOX::app::qhyCtrl, MagAOX::app::refRMS, MagAOX::app::rhusbMon, MagAOX::app::shmimIntegrator, MagAOX::app::siglentSDG, MagAOX::app::smc100ccCtrl, MagAOX::app::sparkleClock, MagAOX::app::sshDigger, MagAOX::app::stateRuleEngine, MagAOX::app::streamCircBuff, MagAOX::app::streamWriter, MagAOX::app::strehlEstimator, MagAOX::app::sysMonitor, MagAOX::app::t2wOffloader, MagAOX::app::tcsInterface, MagAOX::app::timeSeriesSimulator, MagAOX::app::trippLitePDU, MagAOX::app::ttmModulator, MagAOX::app::usbtempMon, MagAOX::app::userGainCtrl, MagAOX::app::w2tcsOffloader, MagAOX::app::xindiserver, MagAOX::app::xt1121Ctrl, MagAOX::app::xt1121DCDU, MagAOX::app::zaberCtrl, MagAOX::app::zaberLowLevel, MagAOX::app::zylaCtrl, and MagAOXApp_tests::MagAOXApp_test.
|
pure virtual |
Any tasks to perform prior to the main event loop go here.
This is called after signal handling is installed. FSM state is stateCodes::INITIALIZED when this is called.
Set m_shutdown = 1 on any fatal errors here.
Implemented in MagAOX::app::acesxeCtrl, MagAOX::app::acronameUsbHub, MagAOX::app::adcTracker, MagAOX::app::alignLoop, MagAOX::app::alpaoCtrl, MagAOX::app::andorCtrl, MagAOX::app::baslerCtrl, MagAOX::app::bmcCtrl, MagAOX::app::cacaoInterface, MagAOX::app::cameraSim, MagAOX::app::closedLoopIndi, MagAOX::app::dlDataCollection, MagAOX::app::dmMode, MagAOX::app::dmPokeCenter, MagAOX::app::dmPokeXCorr, MagAOX::app::dmSpeckle, MagAOX::app::filterWheelCtrl, MagAOX::app::flipperCtrl, MagAOX::app::hoPredCtrl, MagAOX::app::hsfwCtrl, MagAOX::app::indiTSAccumulator, MagAOX::app::irisaoCtrl, MagAOX::app::kcubeCtrl, MagAOX::app::koolanceCtrl, MagAOX::app::kTracker, MagAOX::app::loPredCtrl, MagAOX::app::magAOXMaths, MagAOX::app::mcp3008Ctrl, MagAOX::app::modalFilter, MagAOX::app::modalGainOpt, MagAOX::app::modalPSDs, MagAOX::app::mzmqClient, MagAOX::app::mzmqServer, MagAOX::app::nnReconstructor, MagAOX::app::nnReconstructor, MagAOX::app::observerCtrl, MagAOX::app::ocam2KCtrl, MagAOX::app::photonCounter, MagAOX::app::pi335Ctrl, MagAOX::app::picamCtrl, MagAOX::app::picoMotorCtrl, MagAOX::app::po4ao, MagAOX::app::psfAcq, MagAOX::app::psfFit, MagAOX::app::pupilAlign, MagAOX::app::pupilFit, MagAOX::app::pvcamCtrl, MagAOX::app::pwfsSlopeCalc, MagAOX::app::qhyCtrl, MagAOX::app::refRMS, MagAOX::app::rhusbMon, MagAOX::app::shmimIntegrator, MagAOX::app::siglentSDG, MagAOX::app::smc100ccCtrl, MagAOX::app::sparkleClock, MagAOX::app::sshDigger, MagAOX::app::stateRuleEngine, MagAOX::app::streamCircBuff, MagAOX::app::streamWriter, MagAOX::app::strehlEstimator, MagAOX::app::sysMonitor, MagAOX::app::t2wOffloader, MagAOX::app::tcsInterface, MagAOX::app::timeSeriesSimulator, MagAOX::app::trippLitePDU, MagAOX::app::ttmModulator, MagAOX::app::usbtempMon, MagAOX::app::userGainCtrl, MagAOX::app::w2tcsOffloader, MagAOX::app::xindiserver, MagAOX::app::xt1121Ctrl, MagAOX::app::xt1121DCDU, MagAOX::app::zaberCtrl, MagAOX::app::zaberLowLevel, MagAOX::app::zylaCtrl, and MagAOXApp_tests::MagAOXApp_test.
|
virtual |
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 1489 of file MagAOXApp.hpp.
|
private |
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 2424 of file MagAOXApp.hpp.
std::string MagAOX::app::MagAOXApp< _useINDI >::configDir | ( | ) |
Get the config directory.
Definition at line 3553 of file MagAOXApp.hpp.
|
staticprotected |
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.
[in] | name | The name of the config value |
[in] | code | numeric code specifying the type |
[in] | value | the value read by the config system |
[in] | source | the source of the value. |
Definition at line 1911 of file MagAOXApp.hpp.
std::string MagAOX::app::MagAOXApp< _useINDI >::configName | ( | ) |
Get the config name.
Definition at line 3547 of file MagAOXApp.hpp.
Referenced by MagAOXApp_tests::MagAOXApp_test::configName(), MagAOX::app::andorCtrl::loadConfig(), and MagAOX::app::andorCtrl::writeConfig().
|
protected |
Create the INDI FIFOs.
Changes permissions to max available and creates the FIFOs at the configured path.
Definition at line 2876 of file MagAOXApp.hpp.
int MagAOX::app::MagAOXApp< _useINDI >::createROIndiNumber | ( | pcf::IndiProperty & | prop, |
const std::string & | propName, | ||
const std::string & | propLabel = "" , |
||
const std::string & | propGroup = "" |
||
) |
Create a ReadOnly INDI Number property.
[out] | prop | the property to create and setup |
[in] | propName | the 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 2565 of file MagAOXApp.hpp.
Referenced by MagAOX::app::picamCtrl::appStartup(), and MagAOX::app::zaberCtrl::appStartup().
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 = "" |
||
) |
Create a standard ReadOnly INDI Text property, with at least one element.
[out] | prop | the property to create and setup |
[in] | propName | the name of the property |
[in] | elName | the 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 2482 of file MagAOXApp.hpp.
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 = "" |
||
) |
Create a standard R/W INDI Number property with target and current elements.
[out] | prop | the property to create and setup |
[in] | name | the name of the property |
[in] | min | the minimum value for the elements, applied to both target and current |
[in] | max | the minimum value for the elements, applied to both target and current |
[in] | step | the step size for the elements, applied to both target and current |
[in] | format | the _ 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 2518 of file MagAOXApp.hpp.
Referenced by MagAOX::app::picoMotorCtrl::appStartup().
int MagAOX::app::MagAOXApp< _useINDI >::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.
This switch is intended to function like a momentary switch.
[out] | prop | the property to create and setup |
[in] | name | the 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 2621 of file MagAOXApp.hpp.
Referenced by MagAOX::app::ocam2KCtrl::appStartup().
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 = "" |
||
) |
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.
[out] | prop | the property to create and setup |
[in] | name | the name of the property, |
[in] | elements | the 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 2693 of file MagAOXApp.hpp.
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 = "" |
||
) |
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.
[out] | prop | the property to create and setup |
[in] | name | the name of the property, |
[in] | elements | the element names to give to the switches |
[in] | elementLabels | the 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 2651 of file MagAOXApp.hpp.
Referenced by MagAOX::app::picoMotorCtrl::appStartup().
int MagAOX::app::MagAOXApp< _useINDI >::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.
[out] | prop | the property to create and setup |
[in] | propName | the 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 2454 of file MagAOXApp.hpp.
int MagAOX::app::MagAOXApp< _useINDI >::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.
This switch is intended to function like an on/off toggle switch.
[out] | prop | the property to create and setup |
[in] | name | the 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 2591 of file MagAOXApp.hpp.
Referenced by MagAOX::app::siglentSDG::appStartup(), MagAOX::app::streamWriter::appStartup(), and MagAOX::app::sysMonitor::appStartup().
std::string MagAOX::app::MagAOXApp< _useINDI >::driverCtrlName | ( | ) |
Get the INDI control FIFO file name.
Definition at line 3571 of file MagAOXApp.hpp.
std::string MagAOX::app::MagAOXApp< _useINDI >::driverInName | ( | ) |
Get the INDI input FIFO file name.
Definition at line 3559 of file MagAOXApp.hpp.
std::string MagAOX::app::MagAOXApp< _useINDI >::driverOutName | ( | ) |
Get the INDI output FIFO file name.
Definition at line 3565 of file MagAOXApp.hpp.
|
virtual |
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:
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.
Definition at line 1556 of file MagAOXApp.hpp.
void MagAOX::app::MagAOXApp< _useINDI >::handleDefProperty | ( | const pcf::IndiProperty & | ipRecv | ) |
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.
[in] | ipRecv | The property being sent. |
Definition at line 3037 of file MagAOXApp.hpp.
void MagAOX::app::MagAOXApp< _useINDI >::handleGetProperties | ( | const pcf::IndiProperty & | ipRecv | ) |
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.
[in] | ipRecv | The property being requested. |
Definition at line 3043 of file MagAOXApp.hpp.
void MagAOX::app::MagAOXApp< _useINDI >::handleNewProperty | ( | const pcf::IndiProperty & | ipRecv | ) |
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.
[in] | ipRecv | The property being changed. |
Definition at line 3112 of file MagAOXApp.hpp.
Referenced by MagAOXApp_tests::SCENARIO().
|
private |
Handles SIGTERM, SIGQUIT, and SIGINT. Sets m_shutdown to 1 and logs the signal.
[in] | signum | specifies the signal. |
[in] | siginf | ignored by MagAOXApp |
[in] | ucont | ignored by MagAOXApp |
Definition at line 1975 of file MagAOXApp.hpp.
void MagAOX::app::MagAOXApp< _useINDI >::handleSetProperty | ( | const pcf::IndiProperty & | ipRecv | ) |
Handler for the set INDI property request.
This is called by m_indiDriver's indiDriver::handleSetProperties.
[in] | ipRecv | The property being changed. |
Definition at line 3137 of file MagAOXApp.hpp.
MagAOX::app::MagAOXApp< _useINDI >::INDI_SETCALLBACK_DECL | ( | MagAOXApp< _useINDI > | , |
m_indiP_powerChannel | |||
) |
|
protected |
Get the target element value from an new property.
[out] | localProperty | The local property to update |
[out] | localTarget | The local value to update |
[in] | remoteProperty | the new property received |
[in] | setBusy | [optional] set property to busy if true |
Definition at line 3265 of file MagAOXApp.hpp.
Referenced by MagAOX::app::picoMotorCtrl::newCallBack_picopos().
|
virtual |
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 1431 of file MagAOXApp.hpp.
|
protected |
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
Definition at line 2047 of file MagAOXApp.hpp.
|
static |
Make a log entry.
Wrapper for logManager::log
logT | the log entry type |
retval | the value returned by this method. |
[in] | msg | the message to log |
[in] | level | [optional] the log level. The default is used if not specified. |
Definition at line 1852 of file MagAOXApp.hpp.
Referenced by SMCTEST::cameraSim_test::cameraSim_test(), MagAOX::app::picoMotorCtrl::motorChannel::motorChannel(), SDGTEST::siglentSDG_test::siglentSDG_test(), SMCTEST::smc100ccCtrl_test::smc100ccCtrl_test(), SYSMONTEST::sysMonitor_test::sysMonitor_test(), ZCTRLTEST::zaberCtrl_test::zaberCtrl_test(), MagAOX::app::zylaCtrl::zylaCtrl(), MagAOX::app::picamCtrl::~picamCtrl(), MagAOX::app::streamWriter::~streamWriter(), MagAOX::app::zylaCtrl::~zylaCtrl(), visxCtrl.xapp.VisX::_gather_metadata(), MagAOX::app::mzmqClient::_handlerSigSegv(), MagAOX::app::mzmqServer::_handlerSigSegv(), MagAOX::app::streamWriter::_handlerSigSegv(), visxCtrl.xapp.VisX::_init_properties(), MagAOX::app::qhyCtrl::AbortAcquisition(), MagAOX::app::andorCtrl::acquireAndCheckValid(), MagAOX::app::baslerCtrl::acquireAndCheckValid(), MagAOX::app::cameraSim::acquireAndCheckValid(), MagAOX::app::ocam2KCtrl::acquireAndCheckValid(), MagAOX::app::picamCtrl::acquireAndCheckValid(), MagAOX::app::zylaCtrl::acquireAndCheckValid(), MagAOX::app::streamWriter::allocate_circbufs(), MagAOX::app::streamWriter::allocate_xrif(), MagAOX::app::acronameUsbHub::appLogic(), MagAOX::app::andorCtrl::appLogic(), MagAOX::app::baslerCtrl::appLogic(), MagAOX::app::cameraSim::appLogic(), MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::hsfwCtrl::appLogic(), MagAOX::app::mzmqClient::appLogic(), MagAOX::app::mzmqServer::appLogic(), MagAOX::app::ocam2KCtrl::appLogic(), MagAOX::app::picamCtrl::appLogic(), MagAOX::app::picoMotorCtrl::appLogic(), MagAOX::app::qhyCtrl::appLogic(), MagAOX::app::siglentSDG::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::streamWriter::appLogic(), MagAOX::app::sysMonitor::appLogic(), MagAOX::app::trippLitePDU::appLogic(), MagAOX::app::ttmModulator::appLogic(), MagAOX::app::xt1121Ctrl::appLogic(), MagAOX::app::xt1121DCDU::appLogic(), MagAOX::app::zaberCtrl::appLogic(), MagAOX::app::zylaCtrl::appLogic(), MagAOX::app::andorCtrl::appShutdown(), MagAOX::app::baslerCtrl::appShutdown(), MagAOX::app::hsfwCtrl::appShutdown(), MagAOX::app::mzmqClient::appShutdown(), MagAOX::app::mzmqServer::appShutdown(), MagAOX::app::picamCtrl::appShutdown(), MagAOX::app::picoMotorCtrl::appShutdown(), MagAOX::app::qhyCtrl::appShutdown(), MagAOX::app::streamWriter::appShutdown(), MagAOX::app::zylaCtrl::appShutdown(), MagAOX::app::acronameUsbHub::appStartup(), MagAOX::app::andorCtrl::appStartup(), MagAOX::app::baslerCtrl::appStartup(), MagAOX::app::cameraSim::appStartup(), MagAOX::app::filterWheelCtrl::appStartup(), MagAOX::app::hsfwCtrl::appStartup(), MagAOX::app::magAOXMaths::appStartup(), MagAOX::app::mzmqClient::appStartup(), MagAOX::app::mzmqServer::appStartup(), MagAOX::app::ocam2KCtrl::appStartup(), MagAOX::app::picamCtrl::appStartup(), MagAOX::app::picoMotorCtrl::appStartup(), MagAOX::app::qhyCtrl::appStartup(), MagAOX::app::siglentSDG::appStartup(), MagAOX::app::smc100ccCtrl::appStartup(), MagAOX::app::streamWriter::appStartup(), MagAOX::app::sysMonitor::appStartup(), MagAOX::app::trippLitePDU::appStartup(), MagAOX::app::xt1121DCDU::appStartup(), MagAOX::app::zaberCtrl::appStartup(), MagAOX::app::zylaCtrl::appStartup(), MagAOX::app::ttmModulator::calcState(), MagAOX::app::andorCtrl::cameraSelect(), MagAOX::app::zylaCtrl::cameraSelect(), visxCtrl.xapp.VisX::cancel_exposure(), MagAOX::app::picamCtrl::capExpTime(), MagAOX::app::siglentSDG::changeAmp(), MagAOX::app::siglentSDG::changeAmp(), MagAOX::app::siglentSDG::changeFreq(), MagAOX::app::siglentSDG::changeFreq(), MagAOX::app::siglentSDG::changeOfst(), MagAOX::app::siglentSDG::changeOfst(), MagAOX::app::siglentSDG::changeOutp(), MagAOX::app::siglentSDG::changeOutp(), MagAOX::app::siglentSDG::changePhse(), MagAOX::app::siglentSDG::changePhse(), MagAOX::app::siglentSDG::changeSync(), MagAOX::app::siglentSDG::changeSync(), MagAOX::app::siglentSDG::changeWdth(), MagAOX::app::siglentSDG::changeWdth(), MagAOX::app::siglentSDG::changeWvtp(), MagAOX::app::siglentSDG::changeWvtp(), MagAOX::app::xt1121Ctrl::channelSetCallback(), MagAOX::app::picoMotorCtrl::channelThreadExec(), MagAOX::app::picoMotorCtrl::channelThreadStart(), MagAOX::app::baslerCtrl::checkNextROI(), MagAOX::app::andorCtrl::checkRecordTimes(), MagAOX::app::baslerCtrl::checkRecordTimes(), MagAOX::app::cameraSim::checkRecordTimes(), MagAOX::app::ocam2KCtrl::checkRecordTimes(), MagAOX::app::picamCtrl::checkRecordTimes(), MagAOX::app::qhyCtrl::checkRecordTimes(), MagAOX::app::siglentSDG::checkRecordTimes(), MagAOX::app::smc100ccCtrl::checkRecordTimes(), MagAOX::app::sysMonitor::checkRecordTimes(), MagAOX::app::zaberCtrl::checkRecordTimes(), MagAOX::app::zylaCtrl::checkRecordTimes(), MagAOX::app::siglentSDG::checkSetup(), MagAOX::app::andorCtrl::configureAcquisition(), MagAOX::app::baslerCtrl::configureAcquisition(), MagAOX::app::cameraSim::configureAcquisition(), MagAOX::app::ocam2KCtrl::configureAcquisition(), MagAOX::app::picamCtrl::configureAcquisition(), MagAOX::app::qhyCtrl::configureAcquisition(), MagAOX::app::zylaCtrl::configureAcquisition(), MagAOX::app::baslerCtrl::connect(), MagAOX::app::picamCtrl::connect(), MagAOX::app::qhyCtrl::connect(), MagAOX::app::sysMonitor::criticalCoreTemperature(), MagAOX::app::sysMonitor::criticalDiskTemperature(), MagAOX::app::trippLitePDU::devConnect(), MagAOX::app::trippLitePDU::devLogin(), MagAOX::app::trippLitePDU::devPostLogin(), MagAOX::app::trippLitePDU::devStatus(), MagAOX::app::streamWriter::doEncode(), MagAOX::app::streamWriter::fgThreadExec(), MagAOX::app::streamWriter::fgThreadStart(), visxCtrl.xapp.VisX::finalize_exposure(), MagAOX::app::sysMonitor::findChronyStatus(), MagAOX::app::sysMonitor::findCPULoads(), MagAOX::app::sysMonitor::findCPUTemperatures(), MagAOX::app::sysMonitor::findDiskTemperature(), MagAOX::app::sysMonitor::findDiskUsage(), MagAOX::app::sysMonitor::findRamUsage(), camtipSR.core.camtipSR::fit_SR_EE(), camtipSR.core.camtipSR::fit_SR_gauss(), MagAOX::app::picamCtrl::getAcquisitionState(), MagAOX::app::streamWriter::getCircBuffLengths(), MagAOX::app::smc100ccCtrl::getCtrlState(), MagAOX::app::andorCtrl::getEMGain(), MagAOX::app::ocam2KCtrl::getEMGain(), MagAOX::app::baslerCtrl::getExpTime(), MagAOX::app::qhyCtrl::getExpTime(), MagAOX::app::andorCtrl::getFPS(), MagAOX::app::ocam2KCtrl::getFPS(), MagAOX::app::smc100ccCtrl::getLastError(), MagAOX::app::filterWheelCtrl::getMoving(), MagAOX::app::picamCtrl::getPicamParameter(), MagAOX::app::picamCtrl::getPicamParameter(), MagAOX::app::filterWheelCtrl::getPos(), MagAOX::app::smc100ccCtrl::getPosition(), MagAOX::app::xt1121Ctrl::getState(), MagAOX::app::filterWheelCtrl::getSwitch(), MagAOX::app::andorCtrl::getTemp(), MagAOX::app::baslerCtrl::getTemp(), MagAOX::app::qhyCtrl::getTemp(), MagAOX::app::zylaCtrl::getTemp(), MagAOX::app::ocam2KCtrl::getTemps(), MagAOX::app::picamCtrl::getTemps(), camtipSR.core.camtipSR::grab_img(), camtipSR.core.camtipSR::grab_stack(), corAlign.corAlign::handle_closed_loop(), adcCtrl.adcCtrl::handle_ctrl_mtx(), visxCtrl.xapp.VisX::handle_expose(), visxCtrl.xapp.VisX::handle_exptime(), adcCtrl.adcCtrl::handle_gain(), visxCtrl.xapp.VisX::handle_gain(), adcCtrl.adcCtrl::handle_knife_edge(), adcCtrl.adcCtrl::handle_knife_edge_findzero(), adcCtrl.adcCtrl::handle_labmode(), adcCtrl.adcCtrl::handle_n_avg(), camtipSR.core.camtipSR::handle_n_avg(), corAlign.corAlign::handle_n_avg(), camtipSR.core.camtipSR::handle_n_jitter(), adcCtrl.adcCtrl::handle_no_measurements(), adcCtrl.adcCtrl::handle_offset(), audibleAlerts.core.AudibleAlerts::handle_personality_switch(), corAlign.corAlign::handle_ref_x(), corAlign.corAlign::handle_ref_y(), adcCtrl.adcCtrl::handle_reset(), audibleAlerts.core.AudibleAlerts::handle_soundboard_switch(), audibleAlerts.core.AudibleAlerts::handle_speech_request(), audibleAlerts.core.AudibleAlerts::handle_speech_text(), adcCtrl.adcCtrl::handle_state(), corAlign.corAlign::handle_state(), visxCtrl.xapp.VisX::handle_temp_ccd(), MagAOX::app::mzmqClient::handlerSigSegv(), MagAOX::app::mzmqServer::handlerSigSegv(), MagAOX::app::streamWriter::handlerSigSegv(), MagAOX::app::filterWheelCtrl::home(), MagAOX::app::INDI_NEWCALLBACK_DEFN(), dbIngest.dbIngest::ingest_line(), MagAOX::app::streamWriter::initialize_xrif(), dbIngest.dbIngest::launch_followers(), audibleAlerts.core.AudibleAlerts::load_personality(), MagAOX::app::andorCtrl::loadConfig(), MagAOX::app::filterWheelCtrl::loadConfig(), MagAOX::app::hsfwCtrl::loadConfig(), MagAOX::app::mzmqClient::loadConfig(), MagAOX::app::mzmqServer::loadConfig(), MagAOX::app::ocam2KCtrl::loadConfig(), MagAOX::app::picoMotorCtrl::loadConfig(), MagAOX::app::qhyCtrl::loadConfig(), MagAOX::app::smc100ccCtrl::loadConfig(), MagAOX::app::streamWriter::loadConfig(), MagAOX::app::sysMonitor::loadConfig(), MagAOX::app::xt1121Ctrl::loadConfig(), MagAOX::app::picoMotorCtrl::loadConfigImpl(), MagAOX::app::zaberCtrl::loadConfigImpl(), MagAOX::app::cameraSim::loadConfigImpl(), MagAOX::app::andorCtrl::loadImageIntoStream(), MagAOX::app::baslerCtrl::loadImageIntoStream(), MagAOX::app::cameraSim::loadImageIntoStream(), MagAOX::app::ocam2KCtrl::loadImageIntoStream(), MagAOX::app::picamCtrl::loadImageIntoStream(), MagAOX::app::qhyCtrl::loadImageIntoStream(), MagAOX::app::zylaCtrl::loadImageIntoStream(), adcCtrl.adcCtrl::loop(), audibleAlerts.core.AudibleAlerts::loop(), corAlign.corAlign::loop(), visxCtrl.xapp.VisX::loop(), MagAOX::app::smc100ccCtrl::makeCom(), corAlign.corAlign::measure_fpm_mask_shift(), MagAOX::app::ttmModulator::modTTM(), MagAOX::app::filterWheelCtrl::moveTo(), MagAOX::app::hsfwCtrl::moveTo(), MagAOX::app::zaberCtrl::moveTo(), MagAOX::app::smc100ccCtrl::moveTo(), MagAOX::app::filterWheelCtrl::moveToRaw(), MagAOX::app::filterWheelCtrl::moveToRawRelative(), MagAOX::app::picoMotorCtrl::newCallBack_picopos(), MagAOX::app::picoMotorCtrl::newCallBack_presetName(), MagAOX::app::siglentSDG::normalizeSetup(), MagAOX::app::ttmModulator::offset12(), MagAOX::app::ttmModulator::offsetXY(), MagAOX::app::acronameUsbHub::onPowerOff(), MagAOX::app::andorCtrl::onPowerOff(), MagAOX::app::filterWheelCtrl::onPowerOff(), MagAOX::app::hsfwCtrl::onPowerOff(), MagAOX::app::ocam2KCtrl::onPowerOff(), MagAOX::app::picamCtrl::onPowerOff(), MagAOX::app::zylaCtrl::onPowerOff(), MagAOX::app::filterWheelCtrl::onPowerOnConnect(), MagAOX::app::sysMonitor::parseCPULoads(), MagAOX::app::sysMonitor::parseCPUTemperatures(), MagAOX::app::sysMonitor::parseCPUTemperaturesAMD(), MagAOX::app::sysMonitor::parseCPUTemperaturesIntel(), MagAOX::app::sysMonitor::parseDiskTemperature(), MagAOX::app::sysMonitor::parseDiskUsage(), MagAOX::app::trippLitePDU::parsePDUStatus(), MagAOX::app::sysMonitor::parseRamUsage(), MagAOX::app::zylaCtrl::powerOnDefaults(), audibleAlerts.core.AudibleAlerts::preprocess(), MagAOX::app::filterWheelCtrl::presetNumber(), MagAOX::app::smc100ccCtrl::presetNumber(), MagAOX::app::zaberCtrl::presetNumber(), MagAOX::app::siglentSDG::queryARWV(), MagAOX::app::siglentSDG::queryBSWV(), MagAOX::app::siglentSDG::queryBTWV(), MagAOX::app::siglentSDG::queryMDWV(), MagAOX::app::siglentSDG::queryOUTP(), MagAOX::app::siglentSDG::querySWWV(), MagAOX::app::siglentSDG::querySYNC(), audibleAlerts.core.AudibleAlerts::reaction_handler(), MagAOX::app::picoMotorCtrl::readChannelCounts(), MagAOX::app::andorCtrl::reconfig(), MagAOX::app::ocam2KCtrl::reconfig(), MagAOX::app::picamCtrl::reconfig(), MagAOX::app::zylaCtrl::reconfig(), MagAOX::app::sysMonitor::recordChronyStatus(), MagAOX::app::sysMonitor::recordCoreLoads(), MagAOX::app::sysMonitor::recordCoreTemps(), MagAOX::app::sysMonitor::recordDriveTemps(), MagAOX::app::siglentSDG::recordParams(), MagAOX::app::streamWriter::recordSavingState(), MagAOX::app::streamWriter::recordSavingStats(), MagAOX::app::filterWheelCtrl::recordStage(), MagAOX::app::smc100ccCtrl::recordStage(), MagAOX::app::zaberCtrl::recordTelem(), MagAOX::app::sysMonitor::recordUsage(), MagAOX::app::zaberCtrl::recordZaber(), dbIngest.dbIngest::refresh_properties(), visxCtrl.xapp.VisX::refresh_properties(), MagAOX::app::mzmqClient::reportError(), MagAOX::app::mzmqServer::reportError(), MagAOX::app::mzmqClient::reportInfo(), MagAOX::app::mzmqServer::reportInfo(), MagAOX::app::mzmqClient::reportNotice(), MagAOX::app::mzmqServer::reportNotice(), MagAOX::app::mzmqClient::reportWarning(), MagAOX::app::mzmqServer::reportWarning(), dbIngest.dbIngest::rescan_files(), MagAOX::app::ocam2KCtrl::resetEMProtection(), MagAOX::app::ttmModulator::restTTM(), adcCtrl.adcCtrl::send_command(), MagAOX::app::andorCtrl::setCropMode(), MagAOX::app::andorCtrl::setEMGain(), MagAOX::app::ocam2KCtrl::setEMGain(), MagAOX::app::picamCtrl::setEMGain(), MagAOX::app::andorCtrl::setExpTime(), MagAOX::app::baslerCtrl::setExpTime(), MagAOX::app::cameraSim::setExpTime(), MagAOX::app::picamCtrl::setExpTime(), MagAOX::app::qhyCtrl::setExpTime(), MagAOX::app::baslerCtrl::setFPS(), MagAOX::app::cameraSim::setFPS(), MagAOX::app::ocam2KCtrl::setFPS(), MagAOX::app::sysMonitor::setlatThreadExec(), MagAOX::app::sysMonitor::setlatThreadStart(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameterOnline(), MagAOX::app::picamCtrl::setPicamParameterOnline(), MagAOX::app::picamCtrl::setPicamParameterOnline(), MagAOX::app::picamCtrl::setPicamParameterOnline(), MagAOX::app::andorCtrl::setReadoutSpeed(), MagAOX::app::ocam2KCtrl::setShutter(), MagAOX::app::picamCtrl::setShutter(), MagAOX::app::zylaCtrl::setShutter(), MagAOX::app::cameraSim::setShutter(), MagAOX::app::andorCtrl::setShutter(), MagAOX::app::mzmqClient::setSigSegvHandler(), MagAOX::app::mzmqServer::setSigSegvHandler(), MagAOX::app::streamWriter::setSigSegvHandler(), MagAOX::app::ocam2KCtrl::setSynchro(), MagAOX::app::andorCtrl::setTempControl(), MagAOX::app::ocam2KCtrl::setTempControl(), MagAOX::app::zylaCtrl::setTempControl(), MagAOX::app::andorCtrl::setTempSetPt(), MagAOX::app::ocam2KCtrl::setTempSetPt(), MagAOX::app::ttmModulator::setTTM(), adcCtrl.adcCtrl::setup(), camtipSR.core.camtipSR::setup(), corAlign.corAlign::setup(), efcControl.efcControl::setup(), MagAOX::app::andorCtrl::setVShiftSpeed(), MagAOX::app::smc100ccCtrl::splitResponse(), MagAOX::app::andorCtrl::startAcquisition(), MagAOX::app::baslerCtrl::startAcquisition(), MagAOX::app::ocam2KCtrl::startAcquisition(), MagAOX::app::zylaCtrl::startAcquisition(), MagAOX::app::hsfwCtrl::startHoming(), MagAOX::app::smc100ccCtrl::startHoming(), MagAOX::app::zaberCtrl::startHoming(), MagAOX::app::baslerCtrl::stateString(), MagAOX::app::ocam2KCtrl::stateString(), MagAOX::app::filterWheelCtrl::stop(), MagAOX::app::smc100ccCtrl::stop(), MagAOX::app::zaberCtrl::stop(), visxCtrl.xapp.VisX::subscribe_to_other_devices(), MagAOX::app::streamWriter::swThreadExec(), MagAOX::app::streamWriter::swThreadStart(), MagAOX::app::smc100ccCtrl::testConnection(), adcCtrl.adcCtrl::transition_to_idle(), camtipSR.core.camtipSR::transition_to_idle(), corAlign.corAlign::transition_to_idle(), MagAOX::app::acronameUsbHub::turnOutletOff(), MagAOX::app::trippLitePDU::turnOutletOff(), MagAOX::app::xt1121DCDU::turnOutletOff(), MagAOX::app::acronameUsbHub::turnOutletOn(), MagAOX::app::trippLitePDU::turnOutletOn(), MagAOX::app::xt1121DCDU::turnOutletOn(), adcCtrl.adcCtrl::update_wavelength(), MagAOX::app::trippLitePDU::updateAlarmsAndWarnings(), MagAOX::app::acronameUsbHub::updateOutletState(), MagAOX::app::trippLitePDU::updateOutletState(), MagAOX::app::xt1121DCDU::updateOutletState(), MagAOX::app::trippLitePDU::updateOutletStates(), MagAOX::app::magAOXMaths::updateVals(), MagAOX::app::sysMonitor::updateVals(), audibleAlerts.core.AudibleAlerts::walkup_handler(), MagAOX::app::andorCtrl::whilePowerOff(), MagAOX::app::filterWheelCtrl::whilePowerOff(), MagAOX::app::hsfwCtrl::whilePowerOff(), MagAOX::app::ocam2KCtrl::whilePowerOff(), MagAOX::app::picamCtrl::whilePowerOff(), MagAOX::app::zylaCtrl::whilePowerOff(), MagAOX::app::picoMotorCtrl::writeChannelCounts(), MagAOX::app::siglentSDG::writeCommand(), MagAOX::app::andorCtrl::writeConfig(), MagAOX::app::siglentSDG::writeRead(), MagAOX::app::xt1121DCDU::xtChannelName(), and MagAOX::app::xt1121DCDU::xtChannelProperty().
|
static |
Make a log entry.
Wrapper for logManager::log
logT | the log entry type |
retval | the value returned by this method. |
[in] | level | [optional] the log level. The default is used if not specified. |
Definition at line 1860 of file MagAOXApp.hpp.
Referenced by visxCtrl.xapp.VisX::_gather_metadata(), visxCtrl.xapp.VisX::_init_properties(), visxCtrl.xapp.VisX::cancel_exposure(), visxCtrl.xapp.VisX::finalize_exposure(), camtipSR.core.camtipSR::fit_SR_EE(), camtipSR.core.camtipSR::fit_SR_gauss(), camtipSR.core.camtipSR::grab_img(), camtipSR.core.camtipSR::grab_stack(), corAlign.corAlign::handle_closed_loop(), adcCtrl.adcCtrl::handle_ctrl_mtx(), visxCtrl.xapp.VisX::handle_expose(), visxCtrl.xapp.VisX::handle_exptime(), adcCtrl.adcCtrl::handle_gain(), visxCtrl.xapp.VisX::handle_gain(), adcCtrl.adcCtrl::handle_knife_edge(), adcCtrl.adcCtrl::handle_knife_edge_findzero(), adcCtrl.adcCtrl::handle_labmode(), adcCtrl.adcCtrl::handle_n_avg(), camtipSR.core.camtipSR::handle_n_avg(), corAlign.corAlign::handle_n_avg(), camtipSR.core.camtipSR::handle_n_jitter(), adcCtrl.adcCtrl::handle_no_measurements(), adcCtrl.adcCtrl::handle_offset(), audibleAlerts.core.AudibleAlerts::handle_personality_switch(), corAlign.corAlign::handle_ref_x(), corAlign.corAlign::handle_ref_y(), adcCtrl.adcCtrl::handle_reset(), audibleAlerts.core.AudibleAlerts::handle_soundboard_switch(), audibleAlerts.core.AudibleAlerts::handle_speech_request(), audibleAlerts.core.AudibleAlerts::handle_speech_text(), adcCtrl.adcCtrl::handle_state(), corAlign.corAlign::handle_state(), visxCtrl.xapp.VisX::handle_temp_ccd(), dbIngest.dbIngest::ingest_line(), dbIngest.dbIngest::launch_followers(), audibleAlerts.core.AudibleAlerts::load_personality(), adcCtrl.adcCtrl::loop(), audibleAlerts.core.AudibleAlerts::loop(), corAlign.corAlign::loop(), visxCtrl.xapp.VisX::loop(), corAlign.corAlign::measure_fpm_mask_shift(), audibleAlerts.core.AudibleAlerts::preprocess(), audibleAlerts.core.AudibleAlerts::reaction_handler(), dbIngest.dbIngest::refresh_properties(), visxCtrl.xapp.VisX::refresh_properties(), dbIngest.dbIngest::rescan_files(), adcCtrl.adcCtrl::send_command(), adcCtrl.adcCtrl::setup(), camtipSR.core.camtipSR::setup(), corAlign.corAlign::setup(), efcControl.efcControl::setup(), visxCtrl.xapp.VisX::subscribe_to_other_devices(), adcCtrl.adcCtrl::transition_to_idle(), camtipSR.core.camtipSR::transition_to_idle(), corAlign.corAlign::transition_to_idle(), adcCtrl.adcCtrl::update_wavelength(), and audibleAlerts.core.AudibleAlerts::walkup_handler().
void MagAOX::app::MagAOXApp< _useINDI >::logMessage | ( | bufferPtrT & | b | ) |
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 1867 of file MagAOXApp.hpp.
|
protected |
The callback called by the static version, to actually process the FSM Alert Clear request.
[in] | ipRecv | the INDI property sent with the new property request. |
Definition at line 3432 of file MagAOXApp.hpp.
|
protectedvirtual |
This method is called when the change to poweroff is detected.
Reimplemented in MagAOX::app::acronameUsbHub, MagAOX::app::alpaoCtrl, MagAOX::app::andorCtrl, MagAOX::app::bmcCtrl, MagAOX::app::filterWheelCtrl, MagAOX::app::hsfwCtrl, MagAOX::app::irisaoCtrl, MagAOX::app::ocam2KCtrl, MagAOX::app::picamCtrl, MagAOX::app::picoMotorCtrl, MagAOX::app::siglentSDG, MagAOX::app::smc100ccCtrl, MagAOX::app::xt1121Ctrl, MagAOX::app::zaberLowLevel, and MagAOX::app::zylaCtrl.
Definition at line 3453 of file MagAOXApp.hpp.
|
protected |
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.
Definition at line 3465 of file MagAOXApp.hpp.
Referenced by MagAOX::app::picoMotorCtrl::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), and MagAOX::app::xt1121Ctrl::appLogic().
int MagAOX::app::MagAOXApp< _useINDI >::powerState | ( | ) |
Returns the current power state.
If power management is not enabled, this always returns 1=On.
Definition at line 3484 of file MagAOXApp.hpp.
Referenced by MagAOX::app::ocam2KCtrl::acquireAndCheckValid(), MagAOX::app::andorCtrl::appLogic(), MagAOX::app::hsfwCtrl::appLogic(), MagAOX::app::ocam2KCtrl::appLogic(), MagAOX::app::picamCtrl::appLogic(), MagAOX::app::picoMotorCtrl::appLogic(), MagAOX::app::picamCtrl::capExpTime(), MagAOX::app::picoMotorCtrl::channelThreadExec(), MagAOX::app::ocam2KCtrl::configureAcquisition(), MagAOX::app::picamCtrl::configureAcquisition(), MagAOX::app::picamCtrl::connect(), MagAOX::app::picamCtrl::getAcquisitionState(), MagAOX::app::ocam2KCtrl::getEMGain(), MagAOX::app::ocam2KCtrl::getFPS(), MagAOX::app::picamCtrl::getPicamParameter(), MagAOX::app::picamCtrl::getPicamParameter(), MagAOX::app::ocam2KCtrl::getTemps(), MagAOX::app::picamCtrl::getTemps(), MagAOX::app::hsfwCtrl::moveTo(), MagAOX::app::ocam2KCtrl::resetEMProtection(), MagAOX::app::ocam2KCtrl::setEMGain(), MagAOX::app::picamCtrl::setEMGain(), MagAOX::app::picamCtrl::setExpTime(), MagAOX::app::ocam2KCtrl::setFPS(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameterOnline(), MagAOX::app::picamCtrl::setPicamParameterOnline(), MagAOX::app::ocam2KCtrl::setSynchro(), MagAOX::app::ocam2KCtrl::setTempControl(), MagAOX::app::ocam2KCtrl::setTempSetPt(), and MagAOX::app::hsfwCtrl::startHoming().
int MagAOX::app::MagAOXApp< _useINDI >::powerStateTarget | ( | ) |
Returns the target power state.
If power management is not enabled, this always returns 1=On.
Definition at line 3493 of file MagAOXApp.hpp.
Referenced by MagAOX::app::ocam2KCtrl::acquireAndCheckValid(), MagAOX::app::andorCtrl::appLogic(), MagAOX::app::hsfwCtrl::appLogic(), MagAOX::app::ocam2KCtrl::appLogic(), MagAOX::app::picamCtrl::appLogic(), MagAOX::app::picoMotorCtrl::appLogic(), MagAOX::app::picamCtrl::capExpTime(), MagAOX::app::picoMotorCtrl::channelThreadExec(), MagAOX::app::ocam2KCtrl::configureAcquisition(), MagAOX::app::picamCtrl::configureAcquisition(), MagAOX::app::picamCtrl::connect(), MagAOX::app::picamCtrl::getAcquisitionState(), MagAOX::app::ocam2KCtrl::getEMGain(), MagAOX::app::ocam2KCtrl::getFPS(), MagAOX::app::picamCtrl::getPicamParameter(), MagAOX::app::picamCtrl::getPicamParameter(), MagAOX::app::ocam2KCtrl::getTemps(), MagAOX::app::picamCtrl::getTemps(), MagAOX::app::hsfwCtrl::moveTo(), MagAOX::app::ocam2KCtrl::resetEMProtection(), MagAOX::app::ocam2KCtrl::setEMGain(), MagAOX::app::picamCtrl::setEMGain(), MagAOX::app::picamCtrl::setExpTime(), MagAOX::app::ocam2KCtrl::setFPS(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameter(), MagAOX::app::picamCtrl::setPicamParameterOnline(), MagAOX::app::picamCtrl::setPicamParameterOnline(), MagAOX::app::ocam2KCtrl::setSynchro(), MagAOX::app::ocam2KCtrl::setTempControl(), MagAOX::app::ocam2KCtrl::setTempSetPt(), and MagAOX::app::hsfwCtrl::startHoming().
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 &) | |||
) |
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.
[out] | prop | the property to register |
[in] | propName | the name of the property |
[in] | propType | the type of the property |
[in] | propPerm | the permissions of the property |
[in] | propState | the state of the property |
[in] | propRule | the switch rule type |
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 &) | |||
) |
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.
[out] | prop | the property to register |
[in] | propName | the name of the property |
[in] | propType | the type of the property |
[in] | propPerm | the permissions of the property |
[in] | propState | the state of the property |
int MagAOX::app::MagAOXApp< _useINDI >::registerIndiPropertyNew | ( | pcf::IndiProperty & | prop, |
int(*)(void *, const pcf::IndiProperty &) | |||
) |
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.
[in] | prop | the property to register, must be fully set up |
Referenced by MagAOX::app::filterWheelCtrl::appStartup(), MagAOX::app::magAOXMaths::appStartup(), MagAOX::app::ocam2KCtrl::appStartup(), MagAOX::app::picoMotorCtrl::appStartup(), MagAOX::app::siglentSDG::appStartup(), MagAOX::app::streamWriter::appStartup(), MagAOX::app::sysMonitor::appStartup(), MagAOX::app::zaberCtrl::appStartup(), and MagAOXApp_tests::SCENARIO().
int MagAOX::app::MagAOXApp< _useINDI >::registerIndiPropertyReadOnly | ( | pcf::IndiProperty & | prop | ) |
Register an INDI property which is read only.
This version requires the property be fully set up.
[in] | prop | the property to register, must be completely setup |
Definition at line 2703 of file MagAOXApp.hpp.
Referenced by MagAOX::app::picamCtrl::appStartup(), and MagAOX::app::zaberCtrl::appStartup().
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 | ||
) |
Register an INDI property which is read only.
This verison sets up the INDI property according to the arguments.
[out] | prop | the property to register, will be configured |
[in] | propName | the name of the property |
[in] | propType | the type of the property |
[in] | propPerm | the permissions of the property |
[in] | propState | the state of the property |
Definition at line 2732 of file MagAOXApp.hpp.
int MagAOX::app::MagAOXApp< _useINDI >::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.
[out] | prop | the property to register |
[in] | devName | the device which owns this property |
[in] | propName | the name of the property |
Definition at line 2840 of file MagAOXApp.hpp.
void MagAOX::app::MagAOXApp< _useINDI >::sendGetPropertySetList | ( | bool | all = false | ) |
Definition at line 2997 of file MagAOXApp.hpp.
|
protected |
Send a newProperty command to another device (using the INDI Client interface)
[in] | ipSend | The property to send a "new" INDI command for |
Definition at line 3370 of file MagAOXApp.hpp.
|
protected |
Send a newProperty command to another device (using the INDI Client interface)
Copies the input IndiProperty, then updates the element with the new value.
[in] | ipSend | The property to send a "new" INDI command for |
[in] | el | The element of the property to change |
[in] | newVal | The value to request for the element. |
Definition at line 3336 of file MagAOXApp.hpp.
Referenced by MagAOX::app::ttmModulator::modTTM(), MagAOX::app::zaberCtrl::moveTo(), MagAOX::app::ttmModulator::offset12(), MagAOX::app::ttmModulator::offsetXY(), MagAOX::app::ttmModulator::restTTM(), MagAOX::app::ocam2KCtrl::setFPS(), MagAOX::app::ttmModulator::setTTM(), MagAOX::app::zaberCtrl::startHoming(), MagAOX::app::zaberCtrl::stop(), MagAOX::app::xt1121DCDU::turnOutletOff(), and MagAOX::app::xt1121DCDU::turnOutletOn().
|
protected |
Send a new property commmand for a standard toggle switch.
[in] | device | The device name |
[in] | property | The property name |
[in] | onoff | Switch state to send: true = on, false = off |
Definition at line 3389 of file MagAOXApp.hpp.
|
virtual |
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.
[in] | argc | standard command line result specifying number of arguments in argv |
[in] | argv | standard command line result containing the arguments. |
Definition at line 1236 of file MagAOXApp.hpp.
|
private |
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
Definition at line 2009 of file MagAOXApp.hpp.
Referenced by MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges::elevate().
|
private |
Set the effective user ID to the real value, i.e. the file owner.
Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/seteuid.html
Definition at line 2028 of file MagAOXApp.hpp.
Referenced by MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges::restore().
|
private |
Sets the handler for SIGTERM, SIGQUIT, and SIGINT.
Definition at line 1920 of file MagAOXApp.hpp.
|
virtual |
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 1342 of file MagAOXApp.hpp.
int MagAOX::app::MagAOXApp< _useINDI >::shutdown | ( | ) |
Get the value of the shutdown flag.
Definition at line 1230 of file MagAOXApp.hpp.
Referenced by MagAOX::app::streamWriter::swThreadExec().
|
staticprotected |
The static callback function to be registered for requesting to clear the FSM alert.
[in] | app | a pointer to this, will be static_cast-ed to MagAOXApp. |
[in] | ipRecv | the INDI property sent with the new property request. |
Definition at line 3426 of file MagAOXApp.hpp.
|
protected |
Start INDI Communications.
Definition at line 2940 of file MagAOXApp.hpp.
stateCodes::stateCodeT MagAOX::app::MagAOXApp< _useINDI >::state | ( | ) |
Get the current state code.
Definition at line 2345 of file MagAOXApp.hpp.
Referenced by MagAOX::app::baslerCtrl::acquireAndCheckValid(), MagAOX::app::picamCtrl::acquireAndCheckValid(), MagAOX::app::qhyCtrl::acquireAndCheckValid(), MagAOX::app::acronameUsbHub::appLogic(), MagAOX::app::andorCtrl::appLogic(), MagAOX::app::baslerCtrl::appLogic(), MagAOX::app::cameraSim::appLogic(), MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::hsfwCtrl::appLogic(), MagAOX::app::ocam2KCtrl::appLogic(), MagAOX::app::picamCtrl::appLogic(), MagAOX::app::picoMotorCtrl::appLogic(), MagAOX::app::siglentSDG::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::streamWriter::appLogic(), MagAOX::app::trippLitePDU::appLogic(), MagAOX::app::ttmModulator::appLogic(), MagAOX::app::xt1121Ctrl::appLogic(), MagAOX::app::xt1121DCDU::appLogic(), MagAOX::app::zaberCtrl::appLogic(), MagAOX::app::zylaCtrl::appLogic(), MagAOX::app::acronameUsbHub::appStartup(), MagAOX::app::andorCtrl::appStartup(), MagAOX::app::baslerCtrl::appStartup(), MagAOX::app::cameraSim::appStartup(), MagAOX::app::filterWheelCtrl::appStartup(), MagAOX::app::hsfwCtrl::appStartup(), MagAOX::app::magAOXMaths::appStartup(), MagAOX::app::qhyCtrl::appStartup(), MagAOX::app::smc100ccCtrl::appStartup(), MagAOX::app::sysMonitor::appStartup(), MagAOX::app::trippLitePDU::appStartup(), MagAOX::app::xt1121DCDU::appStartup(), MagAOX::app::zylaCtrl::appStartup(), MagAOX::app::andorCtrl::cameraSelect(), MagAOX::app::siglentSDG::changeAmp(), MagAOX::app::siglentSDG::changeFreq(), MagAOX::app::siglentSDG::changeOfst(), MagAOX::app::siglentSDG::changeOutp(), MagAOX::app::siglentSDG::changePhse(), MagAOX::app::siglentSDG::changeSync(), MagAOX::app::siglentSDG::changeWdth(), MagAOX::app::siglentSDG::changeWvtp(), MagAOX::app::picoMotorCtrl::channelThreadExec(), MagAOX::app::siglentSDG::checkSetup(), MagAOX::app::andorCtrl::configureAcquisition(), MagAOX::app::baslerCtrl::configureAcquisition(), MagAOX::app::cameraSim::configureAcquisition(), MagAOX::app::ocam2KCtrl::configureAcquisition(), MagAOX::app::picamCtrl::configureAcquisition(), MagAOX::app::qhyCtrl::configureAcquisition(), MagAOX::app::baslerCtrl::connect(), MagAOX::app::picamCtrl::connect(), MagAOX::app::qhyCtrl::connect(), MagAOX::app::picamCtrl::getAcquisitionState(), MagAOX::app::smc100ccCtrl::getCtrlState(), MagAOX::app::baslerCtrl::getExpTime(), MagAOX::app::qhyCtrl::getExpTime(), MagAOX::app::baslerCtrl::getFPS(), MagAOX::app::baslerCtrl::getTemp(), MagAOX::app::qhyCtrl::getTemp(), MagAOX::app::picamCtrl::getTemps(), MagAOX::app::filterWheelCtrl::home(), MagAOX::app::baslerCtrl::loadImageIntoStream(), MagAOX::app::qhyCtrl::loadImageIntoStream(), MagAOX::app::hsfwCtrl::moveTo(), MagAOX::app::smc100ccCtrl::moveTo(), MagAOX::app::siglentSDG::queryBTWV(), MagAOX::app::siglentSDG::queryMDWV(), MagAOX::app::siglentSDG::querySWWV(), MagAOX::app::andorCtrl::reconfig(), MagAOX::app::ocam2KCtrl::reconfig(), MagAOX::app::picamCtrl::reconfig(), MagAOX::app::streamWriter::recordSavingState(), MagAOX::app::andorCtrl::setCropMode(), MagAOX::app::picamCtrl::setEMGain(), MagAOX::app::andorCtrl::setExpTime(), MagAOX::app::picamCtrl::setExpTime(), MagAOX::app::andorCtrl::setNextROI(), MagAOX::app::qhyCtrl::setNextROI(), MagAOX::app::andorCtrl::setReadoutSpeed(), MagAOX::app::andorCtrl::setShutter(), MagAOX::app::andorCtrl::setVShiftSpeed(), MagAOX::app::andorCtrl::startAcquisition(), MagAOX::app::baslerCtrl::startAcquisition(), MagAOX::app::cameraSim::startAcquisition(), MagAOX::app::qhyCtrl::startAcquisition(), MagAOX::app::hsfwCtrl::startHoming(), MagAOX::app::ocam2KCtrl::stateStringValid(), MagAOX::app::streamWriter::swThreadExec(), MagAOX::app::acronameUsbHub::updateOutletState(), MagAOX::app::trippLitePDU::updateOutletStates(), and MagAOX::app::siglentSDG::writeRead().
void MagAOX::app::MagAOXApp< _useINDI >::state | ( | const stateCodes::stateCodeT & | s, |
bool | stateAlert = false |
||
) |
Set the current state code.
[in] | s | The new application state |
[in] | stateAlert | [optional] flag to set the alert state of the FSM property. |
Definition at line 2351 of file MagAOXApp.hpp.
int MagAOX::app::MagAOXApp< _useINDI >::stateLogged | ( | ) |
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:
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.
Definition at line 2409 of file MagAOXApp.hpp.
Referenced by MagAOX::app::acronameUsbHub::appLogic(), MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::hsfwCtrl::appLogic(), MagAOX::app::picoMotorCtrl::appLogic(), MagAOX::app::siglentSDG::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::trippLitePDU::appLogic(), MagAOX::app::ttmModulator::appLogic(), MagAOX::app::xt1121Ctrl::appLogic(), MagAOX::app::andorCtrl::cameraSelect(), MagAOX::app::baslerCtrl::connect(), MagAOX::app::picamCtrl::connect(), and MagAOX::app::qhyCtrl::connect().
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 | ||
) |
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:
where impl
is the derived class, and mThreadStart
and myThreadExec
are members of impl
.
[out] | thrd | The 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] | thrdPrio | The r/t priority to set for this thread |
[in] | cpuset | the cpuset to place this thread on. Ignored if "". |
[in] | thrdName | The name of the thread (just for logging) |
[in] | thrdThis | The this pointer to pass to the thread starter function |
[in] | thrdStart | The thread starting function, a static function taking a this pointer as argument. |
Definition at line 2205 of file MagAOXApp.hpp.
Referenced by MagAOX::app::picoMotorCtrl::appStartup(), MagAOX::app::streamWriter::appStartup(), and MagAOX::app::sysMonitor::appStartup().
|
protected |
Remove the PID file.
Definition at line 2181 of file MagAOXApp.hpp.
|
protected |
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.
p | [in/out] The property containing the element to possibly update | |
[in] | el | The element name |
[in] | newVal | the new value |
Definition at line 3183 of file MagAOXApp.hpp.
|
protected |
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.
p | [in/out] The property containing the element to possibly update | |
[in] | el | Beginning of each element name |
[in] | newVals | the new values |
[in] | ipState | [optional] the new state |
Definition at line 3208 of file MagAOXApp.hpp.
|
protected |
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.
p | [in/out] The property containing the element to possibly update | |
[in] | el | The element name |
[in] | newVal | the new value |
Definition at line 3168 of file MagAOXApp.hpp.
Referenced by MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::ocam2KCtrl::appLogic(), MagAOX::app::picoMotorCtrl::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::ttmModulator::appLogic(), MagAOX::app::zaberCtrl::appLogic(), MagAOX::app::xt1121Ctrl::channelSetCallback(), MagAOX::app::baslerCtrl::checkNextROI(), MagAOX::app::cameraSim::checkNextROI(), MagAOX::app::andorCtrl::configureAcquisition(), MagAOX::app::baslerCtrl::configureAcquisition(), MagAOX::app::picamCtrl::configureAcquisition(), MagAOX::app::qhyCtrl::configureAcquisition(), MagAOX::app::zylaCtrl::configureAcquisition(), MagAOX::app::ocam2KCtrl::getEMGain(), MagAOX::app::xt1121Ctrl::getState(), MagAOX::app::ocam2KCtrl::getTemps(), MagAOX::app::INDI_NEWCALLBACK_DEFN(), MagAOX::app::smc100ccCtrl::moveTo(), MagAOX::app::filterWheelCtrl::moveToRaw(), MagAOX::app::acronameUsbHub::onPowerOff(), MagAOX::app::ocam2KCtrl::onPowerOff(), MagAOX::app::siglentSDG::onPowerOff(), MagAOX::app::xt1121Ctrl::onPowerOff(), MagAOX::app::siglentSDG::queryBSWV(), MagAOX::app::siglentSDG::queryOUTP(), MagAOX::app::ocam2KCtrl::resetEMProtection(), MagAOX::app::picamCtrl::setExpTime(), MagAOX::app::trippLitePDU::updateOutletStates(), MagAOX::app::magAOXMaths::updateVals(), and MagAOX::app::sysMonitor::updateVals().
|
protected |
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.
p | [in/out] The property containing the element to possibly update | |
[in] | els | String vector of element names |
[in] | newVals | the new values |
[in] | newState | [optional] The state of the property |
Definition at line 3229 of file MagAOXApp.hpp.
|
protected |
p | [in/out] The property containing the element to possibly update | |
[in] | els | String vector of element names |
[in] | newVals | the new values |
[in] | newState | [optional] The state of the property |
Definition at line 3245 of file MagAOXApp.hpp.
|
protected |
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.
p | [in/out] The property containing the element to possibly update | |
[in] | el | The element name |
[in] | newVal | the new value |
Definition at line 3192 of file MagAOXApp.hpp.
Referenced by MagAOX::app::siglentSDG::appLogic(), MagAOX::app::siglentSDG::onPowerOff(), MagAOX::app::andorCtrl::setNextROI(), MagAOX::app::baslerCtrl::setNextROI(), MagAOX::app::cameraSim::setNextROI(), MagAOX::app::picamCtrl::setNextROI(), MagAOX::app::qhyCtrl::setNextROI(), MagAOX::app::zylaCtrl::setNextROI(), MagAOX::app::ocam2KCtrl::setSynchro(), MagAOX::app::picamCtrl::setTempControl(), MagAOX::app::filterWheelCtrl::startHoming(), MagAOX::app::hsfwCtrl::startHoming(), MagAOX::app::smc100ccCtrl::startHoming(), MagAOX::app::zaberCtrl::startHoming(), MagAOX::app::filterWheelCtrl::stop(), MagAOX::app::hsfwCtrl::stop(), MagAOX::app::smc100ccCtrl::stop(), MagAOX::app::zaberCtrl::stop(), and MagAOX::app::sysMonitor::updateVals().
|
protectedvirtual |
This method is called while the power is off, once per FSM loop.
Reimplemented in MagAOX::app::acronameUsbHub, MagAOX::app::alpaoCtrl, MagAOX::app::andorCtrl, MagAOX::app::bmcCtrl, MagAOX::app::filterWheelCtrl, MagAOX::app::hsfwCtrl, MagAOX::app::irisaoCtrl, MagAOX::app::ocam2KCtrl, MagAOX::app::picamCtrl, MagAOX::app::picoMotorCtrl, MagAOX::app::siglentSDG, MagAOX::app::xt1121Ctrl, MagAOX::app::zaberLowLevel, and MagAOX::app::zylaCtrl.
Definition at line 3459 of file MagAOXApp.hpp.
Definition at line 114 of file MagAOXApp.hpp.
|
protected |
Flag indicating that all registered Set properties have been updated since last Get.
Definition at line 622 of file MagAOXApp.hpp.
|
protected |
The path to calibration files for MagAOX.
Definition at line 129 of file MagAOXApp.hpp.
|
protected |
The name of a base config class for this app (minus .conf).
Definition at line 127 of file MagAOXApp.hpp.
|
protected |
The path to configuration files for MagAOX.
Definition at line 125 of file MagAOXApp.hpp.
Referenced by MagAOX::app::ocam2KCtrl::configureAcquisition().
|
protected |
The name of the configuration file (minus .conf).
Definition at line 123 of file MagAOXApp.hpp.
Referenced by SMCTEST::cameraSim_test::cameraSim_test(), SDGTEST::siglentSDG_test::siglentSDG_test(), SMCTEST::smc100ccCtrl_test::smc100ccCtrl_test(), SYSMONTEST::sysMonitor_test::sysMonitor_test(), ZCTRLTEST::zaberCtrl_test::zaberCtrl_test(), MagAOX::app::mzmqClient::loadConfig(), MagAOX::app::mzmqServer::loadConfig(), MagAOX::app::zaberCtrl::loadConfigImpl(), MagAOX::app::picoMotorCtrl::readChannelCounts(), and MagAOX::app::picoMotorCtrl::writeChannelCounts().
|
protected |
Definition at line 464 of file MagAOXApp.hpp.
|
protected |
Full path name of the INDI driver control FIFO.
This is currently only used to signal restarts.
Definition at line 633 of file MagAOXApp.hpp.
|
protected |
Full path name of the INDI driver input FIFO.
Definition at line 625 of file MagAOXApp.hpp.
|
protected |
Full path name of the INDI driver output FIFO.
Definition at line 628 of file MagAOXApp.hpp.
|
private |
The user id of the process as called (i.e. the higher privileged id of the owner, root if setuid).
Definition at line 354 of file MagAOXApp.hpp.
|
private |
The real user id of the proces (i.e. the lower privileged id of the user)
Definition at line 353 of file MagAOXApp.hpp.
|
private |
Definition at line 518 of file MagAOXApp.hpp.
indiDriver<MagAOXApp>* MagAOX::app::MagAOXApp< _useINDI >::m_indiDriver { nullptr } |
The INDI driver wrapper. Constructed and initialized by execute, which starts and stops communications.
Definition at line 582 of file MagAOXApp.hpp.
Referenced by MagAOX::app::picoMotorCtrl::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::zaberCtrl::appLogic(), MagAOX::app::streamWriter::updateINDI(), and MagAOX::app::magAOXMaths::updateVals().
std::mutex MagAOX::app::MagAOXApp< _useINDI >::m_indiMutex |
Mutex for locking INDI communications.
Definition at line 585 of file MagAOXApp.hpp.
Referenced by MagAOX::app::acronameUsbHub::appLogic(), MagAOX::app::andorCtrl::appLogic(), MagAOX::app::baslerCtrl::appLogic(), MagAOX::app::cameraSim::appLogic(), MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::hsfwCtrl::appLogic(), MagAOX::app::ocam2KCtrl::appLogic(), MagAOX::app::picamCtrl::appLogic(), MagAOX::app::picoMotorCtrl::appLogic(), MagAOX::app::siglentSDG::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::trippLitePDU::appLogic(), MagAOX::app::ttmModulator::appLogic(), MagAOX::app::xt1121Ctrl::appLogic(), MagAOX::app::xt1121DCDU::appLogic(), MagAOX::app::zaberCtrl::appLogic(), MagAOX::app::zylaCtrl::appLogic(), MagAOX::app::siglentSDG::changeAmp(), MagAOX::app::siglentSDG::changeFreq(), MagAOX::app::siglentSDG::changeOfst(), MagAOX::app::siglentSDG::changeOutp(), MagAOX::app::siglentSDG::changePhse(), MagAOX::app::siglentSDG::changeSync(), MagAOX::app::siglentSDG::changeWdth(), MagAOX::app::siglentSDG::changeWvtp(), MagAOX::app::xt1121Ctrl::channelSetCallback(), MagAOX::app::andorCtrl::configureAcquisition(), MagAOX::app::ocam2KCtrl::configureAcquisition(), MagAOX::app::picamCtrl::configureAcquisition(), MagAOX::app::qhyCtrl::configureAcquisition(), MagAOX::app::zylaCtrl::configureAcquisition(), MagAOX::app::INDI_NEWCALLBACK_DEFN(), MagAOX::app::picoMotorCtrl::newCallBack_picopos(), MagAOX::app::picoMotorCtrl::newCallBack_presetName(), MagAOX::app::acronameUsbHub::onPowerOff(), MagAOX::app::andorCtrl::onPowerOff(), MagAOX::app::ocam2KCtrl::onPowerOff(), MagAOX::app::picamCtrl::onPowerOff(), MagAOX::app::siglentSDG::onPowerOff(), MagAOX::app::xt1121Ctrl::onPowerOff(), MagAOX::app::zylaCtrl::onPowerOff(), MagAOX::app::filterWheelCtrl::onPowerOnConnect(), MagAOX::app::ocam2KCtrl::reconfig(), MagAOX::app::zylaCtrl::reconfig(), MagAOX::app::filterWheelCtrl::stop(), MagAOX::app::trippLitePDU::turnOutletOff(), MagAOX::app::xt1121DCDU::turnOutletOff(), MagAOX::app::trippLitePDU::turnOutletOn(), MagAOX::app::xt1121DCDU::turnOutletOn(), MagAOX::app::ocam2KCtrl::whilePowerOff(), and MagAOX::app::zylaCtrl::whilePowerOff().
|
protected |
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 613 of file MagAOXApp.hpp.
|
protected |
indi Property to clear an FSM alert.
Definition at line 1028 of file MagAOXApp.hpp.
|
protected |
INDI property used to communicate power state.
Definition at line 1084 of file MagAOXApp.hpp.
|
protected |
indi Property to report the application state.
Definition at line 1025 of file MagAOXApp.hpp.
|
protected |
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 618 of file MagAOXApp.hpp.
|
static |
Definition at line 277 of file MagAOXApp.hpp.
|
protected |
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 135 of file MagAOXApp.hpp.
Referenced by MagAOX::app::trippLitePDU::trippLitePDU(), and MagAOX::app::siglentSDG::appLogic().
|
protected |
This process's PID.
Definition at line 434 of file MagAOXApp.hpp.
|
protected |
The INDI property name of the channel controlling this device's power.
Definition at line 1070 of file MagAOXApp.hpp.
|
protected |
The INDI device name of the power controller.
Definition at line 1069 of file MagAOXApp.hpp.
|
protected |
The INDI element name to monitor for this device's power state.
Definition at line 1071 of file MagAOXApp.hpp.
|
protected |
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 1064 of file MagAOXApp.hpp.
Referenced by MagAOX::app::acronameUsbHub::acronameUsbHub(), MagAOX::app::andorCtrl::andorCtrl(), MagAOX::app::baslerCtrl::baslerCtrl(), MagAOX::app::cameraSim::cameraSim(), MagAOX::app::filterWheelCtrl::filterWheelCtrl(), MagAOX::app::hsfwCtrl::hsfwCtrl(), MagAOX::app::mzmqClient::mzmqClient(), MagAOX::app::mzmqServer::mzmqServer(), MagAOX::app::ocam2KCtrl::ocam2KCtrl(), MagAOX::app::picamCtrl::picamCtrl(), MagAOX::app::picoMotorCtrl::picoMotorCtrl(), MagAOX::app::qhyCtrl::qhyCtrl(), MagAOX::app::siglentSDG::siglentSDG(), MagAOX::app::smc100ccCtrl::smc100ccCtrl(), MagAOX::app::streamWriter::streamWriter(), MagAOX::app::ttmModulator::ttmModulator(), MagAOX::app::xt1121Ctrl::xt1121Ctrl(), MagAOX::app::xt1121DCDU::xt1121DCDU(), and MagAOX::app::zylaCtrl::zylaCtrl().
|
protected |
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 1077 of file MagAOXApp.hpp.
Referenced by MagAOX::app::andorCtrl::onPowerOff(), MagAOX::app::ocam2KCtrl::onPowerOff(), and MagAOX::app::zylaCtrl::onPowerOff().
|
protected |
Time in sec to wait for device to boot after power on.
Definition at line 1074 of file MagAOXApp.hpp.
Referenced by MagAOX::app::andorCtrl::andorCtrl(), MagAOX::app::ocam2KCtrl::ocam2KCtrl(), MagAOX::app::smc100ccCtrl::smc100ccCtrl(), MagAOX::app::xt1121Ctrl::xt1121Ctrl(), and MagAOX::app::zylaCtrl::zylaCtrl().
|
protected |
Current power state, 1=On, 0=Off, -1=Unk.
Definition at line 1081 of file MagAOXApp.hpp.
Referenced by MagAOX::app::andorCtrl::appLogic(), MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::ocam2KCtrl::appLogic(), MagAOX::app::siglentSDG::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::xt1121Ctrl::appLogic(), MagAOX::app::zylaCtrl::appLogic(), MagAOX::app::siglentSDG::changeAmp(), MagAOX::app::siglentSDG::changeFreq(), MagAOX::app::siglentSDG::changeOfst(), MagAOX::app::siglentSDG::changeOutp(), MagAOX::app::siglentSDG::changePhse(), MagAOX::app::siglentSDG::changeSync(), MagAOX::app::siglentSDG::changeWdth(), MagAOX::app::siglentSDG::changeWvtp(), MagAOX::app::xt1121Ctrl::channelSetCallback(), MagAOX::app::siglentSDG::checkSetup(), MagAOX::app::picamCtrl::getAcquisitionState(), MagAOX::app::picamCtrl::getPicamParameter(), MagAOX::app::picamCtrl::getPicamParameter(), MagAOX::app::xt1121Ctrl::getState(), MagAOX::app::INDI_NEWCALLBACK_DEFN(), MagAOX::app::siglentSDG::queryARWV(), MagAOX::app::siglentSDG::queryBSWV(), MagAOX::app::siglentSDG::queryBTWV(), MagAOX::app::siglentSDG::queryMDWV(), MagAOX::app::siglentSDG::queryOUTP(), MagAOX::app::siglentSDG::querySWWV(), MagAOX::app::siglentSDG::querySYNC(), MagAOX::app::picamCtrl::reconfig(), MagAOX::app::siglentSDG::writeCommand(), and MagAOX::app::siglentSDG::writeRead().
|
protected |
The INDI element name to monitor for this device's power state.
Definition at line 1072 of file MagAOXApp.hpp.
|
protected |
Current target power state, 1=On, 0=Off, -1=Unk.
Definition at line 1082 of file MagAOXApp.hpp.
Referenced by MagAOX::app::siglentSDG::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::siglentSDG::changeAmp(), MagAOX::app::siglentSDG::changeFreq(), MagAOX::app::siglentSDG::changeOfst(), MagAOX::app::siglentSDG::changeOutp(), MagAOX::app::siglentSDG::changePhse(), MagAOX::app::siglentSDG::changeSync(), MagAOX::app::siglentSDG::changeWdth(), MagAOX::app::siglentSDG::changeWvtp(), MagAOX::app::siglentSDG::checkSetup(), MagAOX::app::smc100ccCtrl::getCtrlState(), MagAOX::app::smc100ccCtrl::getLastError(), MagAOX::app::smc100ccCtrl::getPosition(), MagAOX::app::smc100ccCtrl::moveTo(), MagAOX::app::siglentSDG::queryARWV(), MagAOX::app::siglentSDG::queryBSWV(), MagAOX::app::siglentSDG::queryBTWV(), MagAOX::app::siglentSDG::queryMDWV(), MagAOX::app::siglentSDG::queryOUTP(), MagAOX::app::siglentSDG::querySWWV(), MagAOX::app::siglentSDG::querySYNC(), MagAOX::app::smc100ccCtrl::startHoming(), MagAOX::app::smc100ccCtrl::stop(), MagAOX::app::smc100ccCtrl::testConnection(), MagAOX::app::siglentSDG::writeCommand(), and MagAOX::app::siglentSDG::writeRead().
|
staticprivate |
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 329 of file MagAOXApp.hpp.
|
protected |
Flag to signal it's time to shutdown. When not 0, the main loop exits.
Definition at line 140 of file MagAOXApp.hpp.
Referenced by MagAOX::app::siglentSDG::appLogic(), MagAOX::app::smc100ccCtrl::appStartup(), MagAOX::app::picoMotorCtrl::channelThreadExec(), MagAOX::app::siglentSDG::checkSetup(), MagAOX::app::streamWriter::fgThreadExec(), MagAOX::app::andorCtrl::loadConfig(), MagAOX::app::cameraSim::loadConfig(), MagAOX::app::picoMotorCtrl::loadConfig(), MagAOX::app::smc100ccCtrl::loadConfig(), MagAOX::app::streamWriter::loadConfig(), MagAOX::app::sysMonitor::loadConfig(), MagAOX::app::siglentSDG::queryARWV(), MagAOX::app::siglentSDG::queryBSWV(), MagAOX::app::siglentSDG::queryBTWV(), MagAOX::app::siglentSDG::queryMDWV(), MagAOX::app::siglentSDG::queryOUTP(), MagAOX::app::siglentSDG::querySWWV(), MagAOX::app::siglentSDG::querySYNC(), MagAOX::app::sysMonitor::setlatThreadExec(), MagAOX::app::streamWriter::swThreadExec(), MagAOX::app::siglentSDG::writeCommand(), and MagAOX::app::siglentSDG::writeRead().
|
private |
The application's state. Never ever set this directly, use state(const stateCodeT & s).
Definition at line 512 of file MagAOXApp.hpp.
|
private |
Definition at line 515 of file MagAOXApp.hpp.
|
private |
Counter and flag for use to log errors just once. Never ever access directly, use stateLogged().
Definition at line 520 of file MagAOXApp.hpp.
|
private |
The save-set user id of the process.
Definition at line 356 of file MagAOXApp.hpp.
|
staticconstexprprotected |
Flag controlling whether INDI is used. If false, then no INDI code executes.
Definition at line 577 of file MagAOXApp.hpp.
|
protected |
The base path of the MagAO-X system.
Definition at line 121 of file MagAOXApp.hpp.
Referenced by MagAOX::app::streamWriter::loadConfig().
|
protected |
The name of the PID file.
Definition at line 432 of file MagAOXApp.hpp.
|
protected |
Path to the secrets directory, where passwords, etc, are stored.
Definition at line 133 of file MagAOXApp.hpp.
|
protected |
The path to the system directory, for PID file, etc.
Definition at line 131 of file MagAOXApp.hpp.
Referenced by MagAOX::app::picoMotorCtrl::readChannelCounts(), and MagAOX::app::picoMotorCtrl::writeChannelCounts().