API
 
Loading...
Searching...
No Matches
MagAOX::app::strehlEstimator Class Reference

Predicts Strehl and WFE from live WFS telemetry and optional planning overrides. More...

#include <strehlEstimator.hpp>

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

Classes

struct  predictionInputs
 Snapshot of the scalar inputs used to update the AO prediction model. More...
 

Public Types

typedef dev::shmimMonitor< strehlEstimator, wfsavgShmimTwfsavgShmimMonitorT
 
typedef dev::shmimMonitor< strehlEstimator, wfsmaskShmimTwfsmaskShmimMonitorT
 
typedef mx::AO::analysis::aoSystem< float, mx::AO::analysis::vonKarmanSpectrum< float > > aoSystemT
 
typedef XWC_DEFAULT_VERBOSITY verboseT
 
typedef logger::logManager< MagAOXApp< _useINDI >, logFileRaw< verboseT > > logManagerT
 The log manager type.
 

Public Member Functions

 strehlEstimator ()
 Construct the application with the compiled git-version metadata.
 
 ~strehlEstimator () noexcept
 Destroy the application.
 
virtual void setupConfig ()
 Declare configuration keys and initialize the AO models.
 
int loadConfigImpl (mx::app::appConfigurator &_config)
 Load configuration values after setupConfig() has registered them.
 
virtual void loadConfig ()
 Load the configured runtime values.
 
virtual int appStartup ()
 Register INDI properties and transition the app into the operating state.
 
virtual int appLogic ()
 Refresh the AO predictions and service the shmim-monitor state machine.
 
virtual int appShutdown ()
 Shut down the shmim monitors.
 
int allocate (const wfsavgShmimT &dummy)
 React to allocation of the WFS average shmim stream.
 
int processImage (void *curr_src, const wfsavgShmimT &dummy)
 Process one WFS average frame.
 
int allocate (const wfsmaskShmimT &dummy)
 React to allocation of the WFS mask shmim stream.
 
int processImage (void *curr_src, const wfsmaskShmimT &dummy)
 Process one WFS mask frame.
 
void calcMag ()
 Recalculate the live guide-star magnitude from the current WFS counts.
 
predictionInputs snapshotPredictionInputs () const
 Snapshot the scalar state used by the planning properties and AO-model calculations.
 
float selectedStarMag () const
 Return the selected star magnitude for prediction calculations.
 
float selectedSeeing () const
 Return the selected seeing for prediction calculations.
 
float selectedWindSpeed () const
 Return the selected wind speed for prediction calculations.
 
int createCurrentEstimatedProperty (pcf::IndiProperty &prop, const std::string &name, const std::string &label, const std::string &group)
 Create a writable number property with current and estimated elements.
 
void updatePlanningProperties ()
 Update the published planning-input properties from the current runtime state.
 
void configureAoSystem (aoSystemT &aosys, const predictionInputs &inputs, float fps, bool optimizeTau)
 Configure an AO model for the selected inputs and requested loop speed.
 
void updatePredictionOutputs ()
 Refresh the predicted Strehl, WFE, and optimum-loop-speed properties.
 
void updateOptimumLoopSpeed (const predictionInputs &inputs)
 Refresh the fixed-grid optimum-loop-speed summary property.
 
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.
 
Threads
int threadStart (std::thread &thrd, bool &thrdInit, pid_t &tpid, pcf::IndiProperty &thProp, int thrdPrio, const std::string &cpuset, const std::string &thrdName, thisPtr *thrdThis, Function &&thrdStart)
 Start a thread, using this class's privileges to set priority, etc.
 
Member Accessors
std::string basePath ()
 Get the.
 
std::string configName ()
 Get the config name.
 
std::string configDir ()
 Get the config directory.
 
std::string configBase ()
 Get the config base file.
 
std::string calibDir ()
 Get the calibration directory.
 
std::string sysPath ()
 Get the system path.
 
std::string secretsPath ()
 Get the secrets path.
 
std::string cpusetPath ()
 Get the cpuset path.
 
unsigned long loopPause ()
 Get the loop pause time.
 
int shutdown ()
 Get the value of the shutdown flag.
 
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.
 

Static Public Member Functions

static const std::vector< std::string > & windSpeedSelectionElements ()
 Return the supported wind-speed selection element names.
 
static const std::vector< std::string > & windSpeedSelectionLabels ()
 Return the supported wind-speed selection labels.
 
static float windSpeedSelectionValue (const std::string &selection)
 Convert a wind-speed selection element name into its configured speed in m/s.
 
static std::string windSpeedSelectionName (float windSpeed)
 Return the nearest supported wind-speed selection element name for a speed in m/s.
 
static float seeingToR0 (float seeing)
 Convert seeing in arcseconds to Fried parameter r0 in meters.
 
static bool finiteValue (float value)
 Return whether a value is finite.
 
static bool finitePositiveValue (float value)
 Return whether a value is finite and strictly positive.
 
static bool nearlyEqual (float a, float b, float relTol, float absTol)
 Return whether two scalar AO-model inputs are effectively equal.
 
static float wfeNm (float variance, float lam0)
 Convert AO model phase variance into WFE in nm RMS at the specified wavelength.
 

Protected Attributes

std::string m_basePath
 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 m_sysPath
 The path to the system directory, for PID file, etc.
 
std::string m_secretsPath
 Path to the secrets directory, where passwords, etc, are stored.
 
std::string m_cpusetPath
 Path to the cpusets mount.
 
unsigned long m_loopPause
 
int m_shutdown
 Flag to signal it's time to shutdown. When not 0, the main loop exits.
 
Configurable Parameters - Data
int m_loopNum { 1 }
 Loop number used to resolve the WFS shmim names.
 
std::string m_wfsDevice { "camwfs" }
 WFS device providing the live FPS property.
 
std::string m_stagebsDevice { "stagebs" }
 Beamsplitter stage device used to choose the active photometric calibration.
 
float m_again { 28.547f }
 Analog gain factor converting WFS counts into photo-electrons.
 
float m_qe { 0.53f }
 Active WFS quantum efficiency for the currently selected beamsplitter branch.
 
float m_F0_6535 { 4.2e10f }
 Zero-magnitude photon flux for the 65/35 beamsplitter branch.
 
float m_F0_HaIR { 5.3e10f }
 Zero-magnitude photon flux for the Ha/IR beamsplitter branch.
 
float m_lam0_6535 { 0.791f }
 Effective WFS wavelength in microns for the 65/35 beamsplitter branch.
 
float m_lam0_HaIR { 0.837f }
 Effective WFS wavelength in microns for the Ha/IR beamsplitter branch.
 
float m_qe_6535 { 0.53f }
 WFS QE for the 65/35 beamsplitter branch.
 
float m_qe_HaIR { 0.53f }
 WFS QE for the Ha/IR beamsplitter branch.
 
Runtime State - Data
float m_fps { 2000.0f }
 Live WFS frame rate in Hz.
 
float m_emg { 1.0f }
 Live EM gain reported by the WFS camera.
 
float m_F0 { m_F0_6535 }
 Active zero-magnitude photon flux for the selected beamsplitter branch.
 
float m_lam0 { m_lam0_6535 }
 Active WFS/science wavelength in microns for the selected beamsplitter branch.
 
float m_seeing { 0.64f }
 Live seeing estimate in arcseconds from tcsi.seeing.dimm_fwhm_corr.
 
float m_r0 { 0.2063f * 0.5f / 0.64f }
 Live Fried parameter corresponding to m_seeing.
 
float m_elevation { 90.0f }
 Telescope elevation in degrees.
 
int m_npix { 0 }
 Number of illuminated WFS pixels in the current mask.
 
float m_counts { 0.0f }
 Total masked WFS counts used to derive the live guide-star magnitude.
 
float m_mag { 0.0f }
 Live guide-star magnitude derived from m_counts.
 
float m_magEstimated { 0.0f }
 Operator-entered star magnitude used when planning overrides are enabled.
 
bool m_magEstimatedManual { false }
 Tracks whether the estimated star magnitude has been explicitly set by an operator.
 
float m_seeingEstimated { 0.64f }
 Operator-entered seeing in arcseconds used when planning overrides are enabled.
 
bool m_seeingEstimatedManual { false }
 Tracks whether the estimated seeing has been explicitly set by an operator.
 
float m_windSpeed { 9.4f }
 Operator-selected wind speed in m/s used for planning calculations.
 
bool m_useEstimates { false }
 Selects whether predicted outputs use the live or estimated planning inputs.
 
mx::improc::eigenImage< floatm_wfsmask
 Latest WFS mask image.
 
mx::improc::eigenImage< floatm_wfsavg
 Latest WFS average image.
 
aoSystemT m_aosys
 AO model used for the current predicted Strehl and WFE outputs.
 
aoSystemT m_aosysScan
 AO model dedicated to the fixed-FPS optimum-loop-speed scan.
 
double m_dimm_fwhm_corr { 0.0 }
 Latest DIMM elevation-corrected FWHM.
 
int m_dimm_time { 0 }
 Seconds since midnight of the latest DIMM measurement.
 
double m_mag1_fwhm_corr { 0.0 }
 Latest MAG1 elevation-corrected FWHM.
 
int m_mag1_time { 0 }
 Seconds since midnight of the latest MAG1 measurement.
 
double m_mag2_fwhm_corr { 0.0 }
 Latest MAG2 elevation-corrected FWHM.
 
int m_mag2_time { 0 }
 Seconds since midnight of the latest MAG2 measurement.
 
std::mutex m_stateMutex
 Protects the live telemetry and planning-input state while prediction snapshots are assembled.
 
std::mutex m_predictionMutex
 Serializes access to the shared AO-model instances and prediction-property updates.
 
float m_lastLoggedSuspiciousOptimumFps { -1.0f }
 Tracks the last suspicious optimum FPS reported in debug logging.
 

Private Member Functions

int clearFSMAlert ()
 Clear the FSM alert state.
 
const std::string & shmimName () const
 
const uint32_twidth () const
 
const uint32_theight () const
 
const uint32_tdepth () const
 
const uint8_tdataType () const
 
const size_ttypeSize () const
 
int setupConfig (mx::app::appConfigurator &config)
 Setup the configuration system.
 
int loadConfig (mx::app::appConfigurator &config)
 load the configuration system results
 
strehlEstimatorderived ()
 
const std::string & shmimName () const
 
const uint32_twidth () const
 
const uint32_theight () const
 
const uint32_tdepth () const
 
const uint8_tdataType () const
 
const size_ttypeSize () const
 
int setupConfig (mx::app::appConfigurator &config)
 Setup the configuration system.
 
int loadConfig (mx::app::appConfigurator &config)
 load the configuration system results
 

Private Attributes

bool m_getExistingFirst
 
stateCodes::stateCodeT m_targetState
 
shmimMonitorState m_smState
 
int m_semaphoreNumber
 The image structure semaphore index.
 
uint32_t m_width
 The width of the images in the stream.
 
uint32_t m_height
 The height of the images in the stream.
 
uint32_t m_depth
 The depth of the circular buffer in the stream.
 
uint8_t m_dataType
 The ImageStreamIO type code.
 
size_t m_typeSize
 The size of the type, in bytes. Result of sizeof.
 
IMAGE m_imageStream
 The ImageStreamIO shared memory buffer.
 
ino_t m_inode
 The inode of the image stream file.
 
bool m_getExistingFirst
 
stateCodes::stateCodeT m_targetState
 
shmimMonitorState m_smState
 
int m_semaphoreNumber
 The image structure semaphore index.
 
uint32_t m_width
 The width of the images in the stream.
 
uint32_t m_height
 The height of the images in the stream.
 
uint32_t m_depth
 The depth of the circular buffer in the stream.
 
uint8_t m_dataType
 The ImageStreamIO type code.
 
size_t m_typeSize
 The size of the type, in bytes. Result of sizeof.
 
IMAGE m_imageStream
 The ImageStreamIO shared memory buffer.
 
ino_t m_inode
 The inode of the image stream file.
 
Configurable Parameters
std::string m_shmimName
 
int m_smThreadPrio
 Priority of the shmimMonitor thread, should normally be > 00.
 
std::string m_smCpuset
 The cpuset to assign the shmimMonitor thread to. Ignored if empty (the default).
 
std::string m_shmimName
 
int m_smThreadPrio
 Priority of the shmimMonitor thread, should normally be > 00.
 
std::string m_smCpuset
 The cpuset to assign the shmimMonitor thread to. Ignored if empty (the default).
 
SIGSEGV & SIGBUS signal handling

These signals occur as a result of a ImageStreamIO source server resetting (e.g. changing frame sizes). When they occur a restart of the shmim monitor thread main loops is triggered.

bool m_restart
 Flag indicating tha the shared memory should be reinitialized.
 
bool m_restart
 Flag indicating tha the shared memory should be reinitialized.
 

Friends

class strehlEstimator_test
 
class dev::shmimMonitor< strehlEstimator, wfsavgShmimT >
 
class dev::shmimMonitor< strehlEstimator, wfsmaskShmimT >
 

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, boolcallBackInsertResult
 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
 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.
 
indiDriver< MagAOXApp > * m_indiDriver
 The INDI driver wrapper. Constructed and initialized by execute, which starts and stops communications.
 
std::mutex m_indiMutex
 Mutex for locking INDI communications.
 
std::mutex m_indiCallBackMutex
 Mutex for locking INDI callback maps and per-entry callback state.
 
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.
 
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 resetIndiSetPropertyRetry (indiCallBack &callBack)
 Reset retry tracking for a monitored INDI Set-property subscription.
 
bool indiSetPropertyShouldRequest (const indiCallBack &callBack, bool all, const std::chrono::steady_clock::time_point &now) const
 Determine whether an unresolved Set-property subscription should be requested now.
 
void noteIndiSetPropertyRequested (indiCallBack &callBack, const std::chrono::steady_clock::time_point &now)
 Update retry tracking after sending a GetProperties request for a monitored Set-property.
 
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 constexpr bool m_useINDI
 Flag controlling whether INDI is used. If false, then no INDI code executes.
 
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.
 
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 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.
 
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.
 
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.
 
void updatesIfChanged (pcf::IndiProperty &p, const std::vector< const char * > &els, const std::vector< T > &newVals, pcf::IndiProperty::PropertyStateType newState=pcf::IndiProperty::Ok)
 
int indiTargetUpdate (pcf::IndiProperty &localProperty, T &localTarget, const pcf::IndiProperty &remoteProperty, bool setBusy=true)
 Get the target element value from an new property.
 
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
 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
 
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
 The INDI element name to monitor for this device's power state.
 
std::string m_powerTargetElement
 The INDI element name to monitor for this device's power state.
 
unsigned long m_powerOnWait
 Default time in sec to wait for device to boot after power on.
 
int m_powerOnCounter
 
int m_powerState
 Current power state, 1=On, 0=Off, -1=Unk.
 
int m_powerTargetState
 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.
 

INDI - Data

pcf::IndiProperty m_indiP_fps
 Subscription to the live WFS FPS property.
 
pcf::IndiProperty m_indiP_emg
 Subscription to the live WFS EM-gain property.
 
pcf::IndiProperty m_indiP_stage
 Subscription to the beamsplitter preset state.
 
pcf::IndiProperty m_indiP_tcsi_seeing
 Subscription to the TCS seeing property.
 
pcf::IndiProperty m_indiP_tcsi_telpos
 Subscription to the TCS telescope position property.
 
pcf::IndiProperty m_indiP_seeing_magaox
 Local writable seeing property exposing current and estimated.
 
pcf::IndiProperty m_indiP_mag
 Local writable star-magnitude property exposing current and estimated.
 
pcf::IndiProperty m_indiP_windSpeed
 Local writable wind-speed selection property exposing slow, normal, and fast.
 
pcf::IndiProperty m_indiP_useEstimates
 Local toggle selecting whether predicted outputs use estimated inputs.
 
pcf::IndiProperty m_indiP_strehl
 Predicted Strehl property for the currently selected conditions.
 
pcf::IndiProperty m_indiP_wfe
 Predicted WFE breakdown for the currently selected conditions.
 
pcf::IndiProperty m_indiP_loopSpeedOptimum
 Summary property for the best fixed-grid loop speed.
 
 INDI_SETCALLBACK_DECL (strehlEstimator, m_indiP_fps)
 Callback for live FPS updates.
 
 INDI_SETCALLBACK_DECL (strehlEstimator, m_indiP_emg)
 Callback for live EM-gain updates.
 
 INDI_SETCALLBACK_DECL (strehlEstimator, m_indiP_stage)
 Callback for beamsplitter preset updates.
 
 INDI_SETCALLBACK_DECL (strehlEstimator, m_indiP_tcsi_seeing)
 Callback for live TCS seeing updates.
 
 INDI_SETCALLBACK_DECL (strehlEstimator, m_indiP_tcsi_telpos)
 Callback for live TCS elevation updates.
 
 INDI_NEWCALLBACK_DECL (strehlEstimator, m_indiP_mag)
 Callback for local star-magnitude estimate writes.
 
 INDI_NEWCALLBACK_DECL (strehlEstimator, m_indiP_seeing_magaox)
 Callback for local seeing estimate writes.
 
 INDI_NEWCALLBACK_DECL (strehlEstimator, m_indiP_windSpeed)
 Callback for local wind-speed selection writes.
 
 INDI_NEWCALLBACK_DECL (strehlEstimator, m_indiP_useEstimates)
 Callback for the use_estimates toggle.
 

Logging

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

Application State

stateCodes::stateCodeT state ()
 Get the current state code.
 
void state (const stateCodes::stateCodeT &s, bool stateAlert=false)
 Set the current state code.
 
bool stateAlert ()
 Get the value of the state alert flag.
 
bool gitAlert ()
 Get the value of the git alert flag.
 
int stateLogged ()
 Updates and returns the value of m_stateLogged. Will be 0 on first call after a state change, >0 afterwards.
 
stateCodes::stateCodeT m_state
 
bool m_stateAlert
 
bool m_gitAlert
 
int m_stateLogged
 

Signal Handling

libMagAOX/logger/types/software_log.hpp

static MagAOXAppm_self
 
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.
 

shmimmonitor Thread

This thread actually monitors the shared memory buffer

bool m_smThreadInit
 Synchronizer for thread startup, to allow priority setting to finish.
 
pid_t m_smThreadID
 The s.m. thread PID.
 
pcf::IndiProperty m_smThreadProp
 The property to hold the s.m. thread details.
 
std::thread m_smThread
 A separate thread for the actual monitoring.
 
bool m_smThreadInit
 Synchronizer for thread startup, to allow priority setting to finish.
 
pid_t m_smThreadID
 The s.m. thread PID.
 
pcf::IndiProperty m_smThreadProp
 The property to hold the s.m. thread details.
 
std::thread m_smThread
 A separate thread for the actual monitoring.
 
void smThreadExec ()
 Execute the monitoring thread.
 
int create (uint32_t width, uint32_t height, uint32_t depth, uint8_t datatype, void *initData=nullptr)
 Create the image.
 
void smThreadExec ()
 Execute the monitoring thread.
 
int create (uint32_t width, uint32_t height, uint32_t depth, uint8_t datatype, void *initData=nullptr)
 Create the image.
 
static void smThreadStart (shmimMonitor *s)
 Thread starter, called by MagAOXApp::threadStart on thread construction. Calls smThreadExec.
 
static void smThreadStart (shmimMonitor *s)
 Thread starter, called by MagAOXApp::threadStart on thread construction. Calls smThreadExec.
 

INDI

pcf::IndiProperty m_indiP_shmimName
 Property used to report the shmim buffer name.
 
pcf::IndiProperty m_indiP_frameSize
 Property used to report the current frame size.
 
pcf::IndiProperty m_indiP_shmimName
 Property used to report the shmim buffer name.
 
pcf::IndiProperty m_indiP_frameSize
 Property used to report the current frame size.
 
int updateINDI ()
 Update the INDI properties for this device controller.
 
int updateINDI ()
 Update the INDI properties for this device controller.
 

Detailed Description

Predicts Strehl and WFE from live WFS telemetry and optional planning overrides.

Definition at line 75 of file strehlEstimator.hpp.


Class Documentation

◆ MagAOX::app::strehlEstimator::predictionInputs

struct MagAOX::app::strehlEstimator::predictionInputs

Snapshot of the scalar inputs used to update the AO prediction model.

Definition at line 276 of file strehlEstimator.hpp.

Collaboration diagram for MagAOX::app::strehlEstimator::predictionInputs:
Collaboration graph
Class Members
float m_elevation { 0.0f } Telescope elevation in degrees.
float m_emg { 0.0f } Live EM gain.
float m_F0 { 0.0f } Active zero-magnitude photon flux.
float m_fps { 0.0f } Live loop speed in Hz.
float m_lam0 { 0.0f } Active wavelength in microns.
float m_mag { 0.0f } Live guide-star magnitude.
float m_magEstimated { 0.0f } Operator-entered guide-star magnitude estimate.
int m_npix { 0 } Current illuminated WFS-pixel count.
float m_qe { 0.0f } Active quantum efficiency.
float m_seeing { 0.0f } Live seeing in arcseconds.
float m_seeingEstimated { 0.0f } Operator-entered seeing estimate in arcseconds.
float m_selectedMag { 0.0f } Selected guide-star magnitude used for prediction.
float m_selectedSeeing { 0.0f } Selected seeing used for prediction.
float m_selectedWindSpeed { 0.0f } Selected wind speed used for prediction.
bool m_useEstimates { false } Whether estimated planning inputs are currently selected.
float m_windSpeed { 0.0f } Operator-selected wind speed in m/s.

Member Typedef Documentation

◆ aoSystemT

typedef mx::AO::analysis::aoSystem<float, mx::AO::analysis::vonKarmanSpectrum<float> > MagAOX::app::strehlEstimator::aoSystemT

Definition at line 89 of file strehlEstimator.hpp.

◆ callBackInsertResult

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

Return type of insert on the indiCallBack map.

Definition at line 701 of file MagAOXApp.hpp.

◆ callBackIterator

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

Iterator type of the indiCallBack map.

Definition at line 698 of file MagAOXApp.hpp.

◆ callBackValueType

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

Value type of the indiCallBack map.

Definition at line 695 of file MagAOXApp.hpp.

◆ logManagerT

The log manager type.

Definition at line 185 of file MagAOXApp.hpp.

◆ verboseT

Definition at line 182 of file MagAOXApp.hpp.

◆ wfsavgShmimMonitorT

◆ wfsmaskShmimMonitorT

Constructor & Destructor Documentation

◆ strehlEstimator()

MagAOX::app::strehlEstimator::strehlEstimator ( )

◆ ~strehlEstimator()

MagAOX::app::strehlEstimator::~strehlEstimator ( )
inlinenoexcept

Destroy the application.

Definition at line 229 of file strehlEstimator.hpp.

Member Function Documentation

◆ _handlerSigTerm()

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

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

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

Definition at line 404 of file MagAOXApp.hpp.

◆ allocate() [1/2]

int MagAOX::app::strehlEstimator::allocate ( const wfsavgShmimT dummy)

React to allocation of the WFS average shmim stream.

Parameters
[in]dummytag distinguishing the shmimMonitor parent

Definition at line 1053 of file strehlEstimator.hpp.

References MagAOX::app::MagAOXApp< true >::log(), MagAOX::app::dev::shmimMonitor< strehlEstimator, wfsavgShmimT >::m_height, and MagAOX::app::dev::shmimMonitor< strehlEstimator, wfsavgShmimT >::m_width.

◆ allocate() [2/2]

int MagAOX::app::strehlEstimator::allocate ( const wfsmaskShmimT dummy)

React to allocation of the WFS mask shmim stream.

Parameters
[in]dummytag distinguishing the shmimMonitor parent

Definition at line 1094 of file strehlEstimator.hpp.

References MagAOX::app::MagAOXApp< true >::log(), MagAOX::app::dev::shmimMonitor< strehlEstimator, wfsmaskShmimT >::m_height, and MagAOX::app::dev::shmimMonitor< strehlEstimator, wfsmaskShmimT >::m_width.

◆ appLogic()

int MagAOX::app::strehlEstimator::appLogic ( )
virtual

Refresh the AO predictions and service the shmim-monitor state machine.

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

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

Definition at line 1031 of file strehlEstimator.hpp.

References SHMIMMONITORT_APP_LOGIC, SHMIMMONITORT_UPDATE_INDI, updatePlanningProperties(), and updatePredictionOutputs().

◆ appShutdown()

int MagAOX::app::strehlEstimator::appShutdown ( )
virtual

Shut down the shmim monitors.

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

Definition at line 1045 of file strehlEstimator.hpp.

References SHMIMMONITORT_APP_SHUTDOWN.

◆ appStartup()

◆ basePath()

std::string MagAOX::app::MagAOXApp< _useINDI >::basePath ( )
inherited

Get the.

Returns
the value of m_ *

Definition at line 1251 of file MagAOXApp.hpp.

◆ calcMag()

◆ calibDir()

std::string MagAOX::app::MagAOXApp< _useINDI >::calibDir ( )
inherited

Get the calibration directory.

Returns
the value of m_calibDir

Definition at line 1273 of file MagAOXApp.hpp.

◆ checkConfig()

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

Check for unused and unrecognized config options and settings.

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

Definition at line 278 of file MagAOXApp.hpp.

◆ clearFSMAlert()

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

Clear the FSM alert state.

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

Definition at line 642 of file MagAOXApp.hpp.

◆ configBase()

std::string MagAOX::app::MagAOXApp< _useINDI >::configBase ( )
inherited

Get the config base file.

Returns
the value of m_confgBase

Definition at line 1268 of file MagAOXApp.hpp.

◆ configDir()

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

Get the config directory.

Returns
the current value of m_configDir

Definition at line 1263 of file MagAOXApp.hpp.

◆ configLog()

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

Callback for config system logging.

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

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

Definition at line 384 of file MagAOXApp.hpp.

◆ configName()

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

Get the config name.

Returns
the current value of m_configName

Definition at line 1257 of file MagAOXApp.hpp.

◆ configureAoSystem()

void MagAOX::app::strehlEstimator::configureAoSystem ( aoSystemT aosys,
const predictionInputs inputs,
float  fps,
bool  optimizeTau 
)

Configure an AO model for the selected inputs and requested loop speed.

Parameters
[in,out]aosysAO model instance to configure
[in]inputsscalar state snapshot to apply
[in]fpsloop speed in Hz
[in]optimizeTautrue to preserve the current optimal-tau behavior

Definition at line 765 of file strehlEstimator.hpp.

References MagAOX::app::MagAOXApp< true >::log(), and seeingToR0().

Referenced by updateOptimumLoopSpeed(), and updatePredictionOutputs().

◆ cpusetPath()

std::string MagAOX::app::MagAOXApp< _useINDI >::cpusetPath ( )
inherited

Get the cpuset path.

Returns
the value of m_cpusetPath

Definition at line 1288 of file MagAOXApp.hpp.

◆ create() [1/2]

int MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::create ( uint32_t  width,
uint32_t  height,
uint32_t  depth,
uint8_t  datatype,
void *  initData = nullptr 
)
protectedinherited

Create the image.

This will create the shared memory image, erasing an existing. This is independent of the actual shmim monitoring function, which will pick up the new inode change on its own and restart the allocate() and processImage() cycle.

Returns
0 on success
<0 on error
Parameters
[in]widthwidth of the new image
[in]heightheight of the new image
[in]depthdepth of the new image
[in]datatypeCACAO data type of the new image
[in]initData[optional] data to initialize the new image with. Must be of size width*height*depth*sizeof(dataType)

Definition at line 256 of file shmimMonitor.hpp.

◆ create() [2/2]

int MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::create ( uint32_t  width,
uint32_t  height,
uint32_t  depth,
uint8_t  datatype,
void *  initData = nullptr 
)
protectedinherited

Create the image.

This will create the shared memory image, erasing an existing. This is independent of the actual shmim monitoring function, which will pick up the new inode change on its own and restart the allocate() and processImage() cycle.

Returns
0 on success
<0 on error
Parameters
[in]widthwidth of the new image
[in]heightheight of the new image
[in]depthdepth of the new image
[in]datatypeCACAO data type of the new image
[in]initData[optional] data to initialize the new image with. Must be of size width*height*depth*sizeof(dataType)

Definition at line 256 of file shmimMonitor.hpp.

◆ createCurrentEstimatedProperty()

int MagAOX::app::strehlEstimator::createCurrentEstimatedProperty ( pcf::IndiProperty &  prop,
const std::string &  name,
const std::string &  label,
const std::string &  group 
)

Create a writable number property with current and estimated elements.

Parameters
[out]propproperty to initialize
[in]nameINDI property name
[in]labelsuggested GUI label
[in]groupsuggested GUI group

Definition at line 538 of file strehlEstimator.hpp.

References MagAOX::app::MagAOXApp< true >::configName(), and MagAOX::app::MagAOXApp< true >::log().

Referenced by appStartup().

◆ createINDIFIFOS()

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

Create the INDI FIFOs.

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

Todo:
make driver FIFO path full configurable.

Definition at line 960 of file MagAOXApp.hpp.

◆ createROIndiNumber()

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

Create a ReadOnly INDI Number property.

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

Definition at line 783 of file MagAOXApp.hpp.

◆ createROIndiText()

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

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

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

Definition at line 748 of file MagAOXApp.hpp.

◆ createStandardIndiNumber()

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

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

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

Definition at line 762 of file MagAOXApp.hpp.

◆ createStandardIndiRequestSw()

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

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

This switch is intended to function like a momentary switch.

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

Definition at line 809 of file MagAOXApp.hpp.

◆ createStandardIndiSelectionSw() [1/2]

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

Create a standard R/W INDI selection (one of many) switch with vector of elements using the element strings as their own labels This switch is intended to function like drop down menu.

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

Definition at line 840 of file MagAOXApp.hpp.

◆ createStandardIndiSelectionSw() [2/2]

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

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

This switch is intended to function like drop down menu.

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

Definition at line 822 of file MagAOXApp.hpp.

◆ createStandardIndiText()

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

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

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

Definition at line 735 of file MagAOXApp.hpp.

◆ createStandardIndiToggleSw()

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

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

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

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

Definition at line 796 of file MagAOXApp.hpp.

◆ dataType() [1/2]

Definition at line 156 of file shmimMonitor.hpp.

◆ dataType() [2/2]

Definition at line 156 of file shmimMonitor.hpp.

◆ depth() [1/2]

Definition at line 154 of file shmimMonitor.hpp.

◆ depth() [2/2]

Definition at line 154 of file shmimMonitor.hpp.

◆ derived()

strehlEstimator & MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::derived ( )
inlineprivateinherited

Definition at line 289 of file shmimMonitor.hpp.

◆ driverCtrlName()

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

Get the INDI control FIFO file name.

Returns
the current value of m_driverCtrlName

Definition at line 1317 of file MagAOXApp.hpp.

◆ driverInName()

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

Get the INDI input FIFO file name.

Returns
the current value of m_driverInName

Definition at line 1305 of file MagAOXApp.hpp.

◆ driverOutName()

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

Get the INDI output FIFO file name.

Returns
the current value of m_driverOutName

Definition at line 1311 of file MagAOXApp.hpp.

◆ execute()

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

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

Performs final startup steps. That is:

  • Verifies correct effective user-id by comparison to logs directory.
  • PID locking lockPID()
  • log thread startup by logThreadStart()
  • signal handling installation by setSigTermHandler()
  • appStartup() is called
  • INDI communications started by startINDI()
  • power state is checked, pausing if unknown (if being managed)

Errors in the above steps will cause a process exit.

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

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

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

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

Todo:
Need a heartbeat update here.

Definition at line 308 of file MagAOXApp.hpp.

◆ finitePositiveValue()

bool MagAOX::app::strehlEstimator::finitePositiveValue ( float  value)
static

Return whether a value is finite and strictly positive.

Parameters
[in]valuevalue to test

Definition at line 694 of file strehlEstimator.hpp.

References finiteValue().

Referenced by calcMag(), and updatePredictionOutputs().

◆ finiteValue()

bool MagAOX::app::strehlEstimator::finiteValue ( float  value)
static

Return whether a value is finite.

Parameters
[in]valuevalue to test

Definition at line 689 of file strehlEstimator.hpp.

Referenced by finitePositiveValue(), and updateOptimumLoopSpeed().

◆ gitAlert()

bool MagAOX::app::MagAOXApp< _useINDI >::gitAlert ( )
inherited

Get the value of the git alert flag.

Returns
the current value of m_gitAlert

Definition at line 613 of file MagAOXApp.hpp.

◆ handleDefProperty()

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

Handler for the DEF INDI properties notification.

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

Parameters
[in]ipRecvThe property being sent.

Definition at line 976 of file MagAOXApp.hpp.

◆ handleGetProperties()

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

Handler for the get INDI properties request.

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

Parameters
[in]ipRecvThe property being requested.

Definition at line 982 of file MagAOXApp.hpp.

◆ handleNewProperty()

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

Handler for the new INDI property request.

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

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

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

Definition at line 992 of file MagAOXApp.hpp.

◆ handlerSigTerm()

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

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

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

Definition at line 410 of file MagAOXApp.hpp.

◆ handleSetProperty()

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

Handler for the set INDI property request.

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

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

Definition at line 1001 of file MagAOXApp.hpp.

◆ height() [1/2]

Definition at line 152 of file shmimMonitor.hpp.

◆ height() [2/2]

Definition at line 152 of file shmimMonitor.hpp.

◆ INDI_NEWCALLBACK_DECL() [1/4]

MagAOX::app::strehlEstimator::INDI_NEWCALLBACK_DECL ( strehlEstimator  ,
m_indiP_mag   
)

Callback for local star-magnitude estimate writes.

◆ INDI_NEWCALLBACK_DECL() [2/4]

MagAOX::app::strehlEstimator::INDI_NEWCALLBACK_DECL ( strehlEstimator  ,
m_indiP_seeing_magaox   
)

Callback for local seeing estimate writes.

◆ INDI_NEWCALLBACK_DECL() [3/4]

MagAOX::app::strehlEstimator::INDI_NEWCALLBACK_DECL ( strehlEstimator  ,
m_indiP_useEstimates   
)

Callback for the use_estimates toggle.

◆ INDI_NEWCALLBACK_DECL() [4/4]

MagAOX::app::strehlEstimator::INDI_NEWCALLBACK_DECL ( strehlEstimator  ,
m_indiP_windSpeed   
)

Callback for local wind-speed selection writes.

◆ INDI_SETCALLBACK_DECL() [1/6]

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

◆ INDI_SETCALLBACK_DECL() [2/6]

MagAOX::app::strehlEstimator::INDI_SETCALLBACK_DECL ( strehlEstimator  ,
m_indiP_emg   
)

Callback for live EM-gain updates.

◆ INDI_SETCALLBACK_DECL() [3/6]

MagAOX::app::strehlEstimator::INDI_SETCALLBACK_DECL ( strehlEstimator  ,
m_indiP_fps   
)

Callback for live FPS updates.

◆ INDI_SETCALLBACK_DECL() [4/6]

MagAOX::app::strehlEstimator::INDI_SETCALLBACK_DECL ( strehlEstimator  ,
m_indiP_stage   
)

Callback for beamsplitter preset updates.

◆ INDI_SETCALLBACK_DECL() [5/6]

MagAOX::app::strehlEstimator::INDI_SETCALLBACK_DECL ( strehlEstimator  ,
m_indiP_tcsi_seeing   
)

Callback for live TCS seeing updates.

◆ INDI_SETCALLBACK_DECL() [6/6]

MagAOX::app::strehlEstimator::INDI_SETCALLBACK_DECL ( strehlEstimator  ,
m_indiP_tcsi_telpos   
)

Callback for live TCS elevation updates.

◆ indiSetPropertyShouldRequest()

bool MagAOX::app::MagAOXApp< _useINDI >::indiSetPropertyShouldRequest ( const indiCallBack &  callBack,
bool  all,
const std::chrono::steady_clock::time_point &  now 
) const
inlineinherited

Determine whether an unresolved Set-property subscription should be requested now.

Parameters
[in]callBackthe subscription retry state to evaluate
[in]allif true, force an immediate refresh regardless of retry timing
[in]nowthe current monotonic time for scheduling

Definition at line 944 of file MagAOXApp.hpp.

◆ indiTargetUpdate()

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

Get the target element value from an new property.

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

Definition at line 1098 of file MagAOXApp.hpp.

◆ loadBasicConfig()

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

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

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

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

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

Definition at line 272 of file MagAOXApp.hpp.

◆ loadConfig() [1/3]

void MagAOX::app::strehlEstimator::loadConfig ( )
virtual

Load the configured runtime values.

Definition at line 533 of file strehlEstimator.hpp.

References loadConfigImpl().

◆ loadConfig() [2/3]

int MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::loadConfig ( mx::app::appConfigurator &  config)
inherited

load the configuration system results

This should be called in derivedT::loadConfig as

shmimMonitor<derivedT, specificT>::loadConfig(config);

with appropriate error checking.

Parameters
[in]configthe derived classes configurator

Definition at line 178 of file shmimMonitor.hpp.

◆ loadConfig() [3/3]

int MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::loadConfig ( mx::app::appConfigurator &  config)
inherited

load the configuration system results

This should be called in derivedT::loadConfig as

shmimMonitor<derivedT, specificT>::loadConfig(config);

with appropriate error checking.

Parameters
[in]configthe derived classes configurator

Definition at line 178 of file shmimMonitor.hpp.

◆ loadConfigImpl()

int MagAOX::app::strehlEstimator::loadConfigImpl ( mx::app::appConfigurator &  _config)

Load configuration values after setupConfig() has registered them.

This is split from loadConfig() so the unit tests can call it directly.

Parameters
[in]_configapplication configuration source to read from

Definition at line 514 of file strehlEstimator.hpp.

References MagAOX::app::MagAOXApp< true >::log(), m_loopNum, m_qe_6535, m_qe_HaIR, MagAOX::app::dev::shmimMonitor< strehlEstimator, wfsmaskShmimT >::m_shmimName, MagAOX::app::dev::shmimMonitor< strehlEstimator, wfsavgShmimT >::m_shmimName, and SHMIMMONITORT_LOAD_CONFIG.

Referenced by loadConfig().

◆ lockPID()

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

Attempt to lock the PID by writing it to a file. Fails if a process is already running with the same config name. First checks the PID file for an existing PID. If found, interrogates /proc to determine if that process is running and if so if the command line matches. If a matching process is currently running, then this returns an error.

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

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

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

Definition at line 522 of file MagAOXApp.hpp.

◆ log() [1/2]

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

Make a log entry.

Wrapper for logManager::log

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

Definition at line 355 of file MagAOXApp.hpp.

◆ log() [2/2]

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

Make a log entry.

Wrapper for logManager::log

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

Definition at line 368 of file MagAOXApp.hpp.

◆ logMessage()

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

Handle a log message from the logging system.

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

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

Definition at line 377 of file MagAOXApp.hpp.

◆ loopPause()

unsigned long MagAOX::app::MagAOXApp< _useINDI >::loopPause ( )
inherited

Get the loop pause time.

Returns
the value of m_loopPause

Definition at line 1293 of file MagAOXApp.hpp.

◆ nearlyEqual()

bool MagAOX::app::strehlEstimator::nearlyEqual ( float  a,
float  b,
float  relTol,
float  absTol 
)
static

Return whether two scalar AO-model inputs are effectively equal.

Parameters
[in]afirst value
[in]bsecond value
[in]relTolrelative tolerance
[in]absTolabsolute tolerance

Definition at line 699 of file strehlEstimator.hpp.

References a(), b(), and MagAOX::app::MagAOXApp< true >::log().

Referenced by updatePredictionOutputs().

◆ newCallBack_clearFSMAlert()

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

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

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

Definition at line 1155 of file MagAOXApp.hpp.

◆ noteIndiSetPropertyRequested()

void MagAOX::app::MagAOXApp< _useINDI >::noteIndiSetPropertyRequested ( indiCallBack &  callBack,
const std::chrono::steady_clock::time_point &  now 
)
inlineinherited

Update retry tracking after sending a GetProperties request for a monitored Set-property.

Parameters
callBack[in/out] the subscription retry state to update
[in]nowthe current monotonic time for scheduling

Definition at line 951 of file MagAOXApp.hpp.

◆ onPowerOff()

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

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

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

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

Definition at line 1200 of file MagAOXApp.hpp.

◆ powerOnWaitElapsed()

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

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

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

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

Definition at line 1216 of file MagAOXApp.hpp.

◆ powerState()

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

Returns the current power state.

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

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

Definition at line 1226 of file MagAOXApp.hpp.

◆ powerStateTarget()

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

Returns the target power state.

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

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

Definition at line 1235 of file MagAOXApp.hpp.

◆ processImage() [1/2]

int MagAOX::app::strehlEstimator::processImage ( void curr_src,
const wfsavgShmimT dummy 
)

Process one WFS average frame.

Parameters
[in]curr_srcpointer to the start of the current frame
[in]dummytag distinguishing the shmimMonitor parent

Definition at line 1061 of file strehlEstimator.hpp.

References calcMag(), MagAOX::app::lock(), MagAOX::app::MagAOXApp< true >::log(), m_counts, MagAOX::app::dev::shmimMonitor< strehlEstimator, wfsavgShmimT >::m_height, m_stateMutex, m_wfsavg, m_wfsmask, and MagAOX::app::dev::shmimMonitor< strehlEstimator, wfsavgShmimT >::m_width.

◆ processImage() [2/2]

int MagAOX::app::strehlEstimator::processImage ( void curr_src,
const wfsmaskShmimT dummy 
)

Process one WFS mask frame.

Parameters
[in]curr_srcpointer to the start of the current frame
[in]dummytag distinguishing the shmimMonitor parent

Definition at line 1102 of file strehlEstimator.hpp.

References calcMag(), MagAOX::app::lock(), MagAOX::app::MagAOXApp< true >::log(), m_counts, MagAOX::app::dev::shmimMonitor< strehlEstimator, wfsmaskShmimT >::m_height, m_npix, m_stateMutex, m_wfsavg, m_wfsmask, and MagAOX::app::dev::shmimMonitor< strehlEstimator, wfsmaskShmimT >::m_width.

◆ registerIndiPropertyNew() [1/3]

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

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

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

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

◆ registerIndiPropertyNew() [2/3]

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

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

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

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

◆ registerIndiPropertyNew() [3/3]

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

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

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

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

◆ registerIndiPropertyReadOnly() [1/2]

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

Register an INDI property which is read only.

This version requires the property be fully set up.

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

Definition at line 856 of file MagAOXApp.hpp.

◆ registerIndiPropertyReadOnly() [2/2]

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

Register an INDI property which is read only.

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

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

Definition at line 866 of file MagAOXApp.hpp.

◆ registerIndiPropertySet()

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

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

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

Definition at line 933 of file MagAOXApp.hpp.

◆ resetIndiSetPropertyRetry()

void MagAOX::app::MagAOXApp< _useINDI >::resetIndiSetPropertyRetry ( indiCallBack &  callBack)
inlineinherited

Reset retry tracking for a monitored INDI Set-property subscription.

Parameters
callBack[in/out] the subscription retry state to reset

Definition at line 941 of file MagAOXApp.hpp.

◆ secretsPath()

std::string MagAOX::app::MagAOXApp< _useINDI >::secretsPath ( )
inherited

Get the secrets path.

Returns
the value of m_secretsPath

Definition at line 1283 of file MagAOXApp.hpp.

◆ seeingToR0()

float MagAOX::app::strehlEstimator::seeingToR0 ( float  seeing)
static

Convert seeing in arcseconds to Fried parameter r0 in meters.

Parameters
[in]seeingseeing in arcseconds

Definition at line 684 of file strehlEstimator.hpp.

Referenced by configureAoSystem().

◆ selectedSeeing()

float MagAOX::app::strehlEstimator::selectedSeeing ( ) const

Return the selected seeing for prediction calculations.

Definition at line 577 of file strehlEstimator.hpp.

References MagAOX::app::lock(), m_seeing, m_seeingEstimated, m_stateMutex, and m_useEstimates.

◆ selectedStarMag()

float MagAOX::app::strehlEstimator::selectedStarMag ( ) const

Return the selected star magnitude for prediction calculations.

Definition at line 565 of file strehlEstimator.hpp.

References MagAOX::app::lock(), m_mag, m_magEstimated, m_stateMutex, and m_useEstimates.

◆ selectedWindSpeed()

float MagAOX::app::strehlEstimator::selectedWindSpeed ( ) const

Return the selected wind speed for prediction calculations.

Definition at line 589 of file strehlEstimator.hpp.

References MagAOX::app::lock(), m_stateMutex, and m_windSpeed.

◆ sendGetPropertySetList()

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

Definition at line 970 of file MagAOXApp.hpp.

◆ sendNewProperty() [1/2]

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

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

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

Definition at line 1121 of file MagAOXApp.hpp.

◆ sendNewProperty() [2/2]

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

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

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

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

Definition at line 1111 of file MagAOXApp.hpp.

◆ sendNewStandardIndiToggle()

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

Send a new property commmand for a standard toggle switch.

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

Definition at line 1128 of file MagAOXApp.hpp.

◆ setDefaults()

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

Set the paths for config files.

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

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

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

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

Definition at line 250 of file MagAOXApp.hpp.

◆ setEuidCalled()

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

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

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

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

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

Definition at line 481 of file MagAOXApp.hpp.

◆ setEuidReal()

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

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

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

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

Definition at line 490 of file MagAOXApp.hpp.

◆ setSigTermHandler()

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

Sets the handler for SIGTERM, SIGQUIT, and SIGINT.

Definition at line 401 of file MagAOXApp.hpp.

◆ setupBasicConfig()

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

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

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

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

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

Definition at line 262 of file MagAOXApp.hpp.

◆ setupConfig() [1/3]

void MagAOX::app::strehlEstimator::setupConfig ( )
virtual

Declare configuration keys and initialize the AO models.

Definition at line 473 of file strehlEstimator.hpp.

References m_aosys, m_aosysScan, m_windSpeed, SHMIMMONITORT_SETUP_CONFIG, windSpeedSelectionName(), and windSpeedSelectionValue().

◆ setupConfig() [2/3]

int MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::setupConfig ( mx::app::appConfigurator &  config)
inherited

Setup the configuration system.

This should be called in derivedT::setupConfig as

shmimMonitor<derivedT, specificT>::setupConfig(config);

with appropriate error checking.

Parameters
[out]configthe derived classes configurator

Definition at line 168 of file shmimMonitor.hpp.

◆ setupConfig() [3/3]

int MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::setupConfig ( mx::app::appConfigurator &  config)
inherited

Setup the configuration system.

This should be called in derivedT::setupConfig as

shmimMonitor<derivedT, specificT>::setupConfig(config);

with appropriate error checking.

Parameters
[out]configthe derived classes configurator

Definition at line 168 of file shmimMonitor.hpp.

◆ shmimName() [1/2]

const std::string & MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::shmimName ( ) const
inherited

Definition at line 148 of file shmimMonitor.hpp.

◆ shmimName() [2/2]

const std::string & MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::shmimName ( ) const
inherited

Definition at line 148 of file shmimMonitor.hpp.

◆ shutdown()

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

Get the value of the shutdown flag.

Returns
the current value of m_shutdown

Definition at line 1299 of file MagAOXApp.hpp.

◆ smThreadExec() [1/2]

void MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::smThreadExec ( )
protectedinherited

Execute the monitoring thread.

< The semaphore to monitor for new image data

Todo:
change to naxis?
Todo:
change to naxis?

Definition at line 246 of file shmimMonitor.hpp.

◆ smThreadExec() [2/2]

void MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::smThreadExec ( )
protectedinherited

Execute the monitoring thread.

< The semaphore to monitor for new image data

Todo:
change to naxis?
Todo:
change to naxis?

Definition at line 246 of file shmimMonitor.hpp.

◆ smThreadStart() [1/2]

Thread starter, called by MagAOXApp::threadStart on thread construction. Calls smThreadExec.

Parameters
[in]sa pointer to a shmimMonitor instance (normally this)

Definition at line 243 of file shmimMonitor.hpp.

◆ smThreadStart() [2/2]

Thread starter, called by MagAOXApp::threadStart on thread construction. Calls smThreadExec.

Parameters
[in]sa pointer to a shmimMonitor instance (normally this)

Definition at line 243 of file shmimMonitor.hpp.

◆ snapshotPredictionInputs()

strehlEstimator::predictionInputs MagAOX::app::strehlEstimator::snapshotPredictionInputs ( ) const

Snapshot the scalar state used by the planning properties and AO-model calculations.

Definition at line 646 of file strehlEstimator.hpp.

References MagAOX::app::lock(), MagAOX::app::MagAOXApp< true >::log(), m_elevation, m_emg, m_F0, m_fps, m_lam0, m_mag, m_magEstimated, m_npix, m_qe, m_seeing, m_seeingEstimated, m_stateMutex, m_useEstimates, and m_windSpeed.

Referenced by updatePlanningProperties(), and updatePredictionOutputs().

◆ st_newCallBack_clearFSMAlert()

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

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

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

Definition at line 1144 of file MagAOXApp.hpp.

◆ startINDI()

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

Start INDI Communications.

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

Definition at line 967 of file MagAOXApp.hpp.

◆ state() [1/2]

Get the current state code.

Returns
m_state

Definition at line 591 of file MagAOXApp.hpp.

◆ state() [2/2]

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

Set the current state code.

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

Definition at line 599 of file MagAOXApp.hpp.

◆ stateAlert()

bool MagAOX::app::MagAOXApp< _useINDI >::stateAlert ( )
inherited

Get the value of the state alert flag.

Returns
the current value of m_stateAlert

Definition at line 607 of file MagAOXApp.hpp.

◆ stateLogged()

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

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

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

if( connection_failed ) //some condition set this to true
{
if(!stateLogged()) log<text_log>("Not connected");
}
stateCodes::stateCodeT state()
Get the current state code.
int stateLogged()
Updates and returns the value of m_stateLogged. Will be 0 on first call after a state change,...
static int log(const typename logT::messageT &msg, logPrioT level=logPrio::LOG_DEFAULT)
Make a log entry.
@ NOTCONNECTED
The application is not connected to the device or service.

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

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

Definition at line 632 of file MagAOXApp.hpp.

◆ sysPath()

std::string MagAOX::app::MagAOXApp< _useINDI >::sysPath ( )
inherited

Get the system path.

Returns
the value of m_sysPath

Definition at line 1278 of file MagAOXApp.hpp.

◆ threadStart()

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

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

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

The interface of the thread start function is:

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

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

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

Definition at line 556 of file MagAOXApp.hpp.

◆ typeSize() [1/2]

Definition at line 158 of file shmimMonitor.hpp.

◆ typeSize() [2/2]

Definition at line 158 of file shmimMonitor.hpp.

◆ unlockPID()

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

Remove the PID file.

Definition at line 525 of file MagAOXApp.hpp.

◆ updateIfChanged() [1/4]

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

Update an INDI property element value if it has changed.

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

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

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

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

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

Definition at line 1031 of file MagAOXApp.hpp.

◆ updateIfChanged() [2/4]

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

Update an INDI property if values have changed.

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

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

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

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

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

Definition at line 1060 of file MagAOXApp.hpp.

◆ updateIfChanged() [3/4]

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

Update an INDI property element value if it has changed.

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

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

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

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

Definition at line 1014 of file MagAOXApp.hpp.

◆ updateIfChanged() [4/4]

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

Update an INDI property if values have changed.

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

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

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

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

Definition at line 1077 of file MagAOXApp.hpp.

◆ updateINDI() [1/2]

Update the INDI properties for this device controller.

You should call this once per main loop. It is not called automatically.

Returns
0 on success.
-1 on error.

Definition at line 284 of file shmimMonitor.hpp.

◆ updateINDI() [2/2]

Update the INDI properties for this device controller.

You should call this once per main loop. It is not called automatically.

Returns
0 on success.
-1 on error.

Definition at line 284 of file shmimMonitor.hpp.

◆ updateOptimumLoopSpeed()

void MagAOX::app::strehlEstimator::updateOptimumLoopSpeed ( const predictionInputs inputs)

Refresh the fixed-grid optimum-loop-speed summary property.

Parameters
[in]inputsscalar state snapshot to evaluate

Definition at line 781 of file strehlEstimator.hpp.

References configureAoSystem(), finiteValue(), INDI_OK, MagAOX::app::MagAOXApp< true >::log(), m_aosysScan, MagAOX::app::MagAOXApp< true >::m_indiDriver, m_indiP_loopSpeedOptimum, m_lastLoggedSuspiciousOptimumFps, and wfeNm().

Referenced by libXWCTest::strehlEstimatorTest::TEST_CASE(), and updatePredictionOutputs().

◆ updatePlanningProperties()

◆ updatePredictionOutputs()

◆ updatesIfChanged()

void MagAOX::app::MagAOXApp< _useINDI >::updatesIfChanged ( pcf::IndiProperty &  p,
const std::vector< const char * > &  els,
const std::vector< T > &  newVals,
pcf::IndiProperty::PropertyStateType  newState = pcf::IndiProperty::Ok 
)
protectedinherited
Parameters
p[in/out] The property containing the element to possibly update
[in]elsString vector of element names
[in]newValsthe new values
[in]newState[optional] The state of the property

Definition at line 1085 of file MagAOXApp.hpp.

◆ updateSwitchIfChanged()

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

Update an INDI switch element value if it has changed.

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

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

Definition at line 1042 of file MagAOXApp.hpp.

◆ wfeNm()

float MagAOX::app::strehlEstimator::wfeNm ( float  variance,
float  lam0 
)
static

Convert AO model phase variance into WFE in nm RMS at the specified wavelength.

Parameters
[in]variancephase variance at the science wavelength
[in]lam0active wavelength in microns

Definition at line 716 of file strehlEstimator.hpp.

References MagAOX::app::MagAOXApp< true >::log(), and variance().

Referenced by updateOptimumLoopSpeed(), and updatePredictionOutputs().

◆ whilePowerOff()

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

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

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

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

Definition at line 1207 of file MagAOXApp.hpp.

◆ width() [1/2]

Definition at line 150 of file shmimMonitor.hpp.

◆ width() [2/2]

Definition at line 150 of file shmimMonitor.hpp.

◆ windSpeedSelectionElements()

const std::vector< std::string > & MagAOX::app::strehlEstimator::windSpeedSelectionElements ( )
static

Return the supported wind-speed selection element names.

Definition at line 595 of file strehlEstimator.hpp.

References MagAOX::app::MagAOXApp< true >::log().

Referenced by appStartup(), and windSpeedSelectionName().

◆ windSpeedSelectionLabels()

const std::vector< std::string > & MagAOX::app::strehlEstimator::windSpeedSelectionLabels ( )
static

Return the supported wind-speed selection labels.

Definition at line 601 of file strehlEstimator.hpp.

References MagAOX::app::MagAOXApp< true >::log().

Referenced by appStartup().

◆ windSpeedSelectionName()

std::string MagAOX::app::strehlEstimator::windSpeedSelectionName ( float  windSpeed)
static

Return the nearest supported wind-speed selection element name for a speed in m/s.

Parameters
[in]windSpeedwind speed in m/s

Definition at line 628 of file strehlEstimator.hpp.

References MagAOX::app::MagAOXApp< true >::log(), windSpeedSelectionElements(), and windSpeedSelectionValue().

Referenced by setupConfig(), and updatePlanningProperties().

◆ windSpeedSelectionValue()

float MagAOX::app::strehlEstimator::windSpeedSelectionValue ( const std::string &  selection)
static

Convert a wind-speed selection element name into its configured speed in m/s.

Parameters
[in]selectionselected wind-speed element name

Definition at line 608 of file strehlEstimator.hpp.

References MagAOX::app::MagAOXApp< true >::log().

Referenced by setupConfig(), and windSpeedSelectionName().

Friends And Related Symbol Documentation

◆ dev::shmimMonitor< strehlEstimator, wfsavgShmimT >

◆ dev::shmimMonitor< strehlEstimator, wfsmaskShmimT >

◆ strehlEstimator_test

friend class strehlEstimator_test
friend

Definition at line 81 of file strehlEstimator.hpp.

Member Data Documentation

◆ m_again

float MagAOX::app::strehlEstimator::m_again { 28.547f }
protected

Analog gain factor converting WFS counts into photo-electrons.

Definition at line 106 of file strehlEstimator.hpp.

Referenced by calcMag().

◆ m_allDefsReceived

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

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

Definition at line 716 of file MagAOXApp.hpp.

◆ m_aosys

aoSystemT MagAOX::app::strehlEstimator::m_aosys
protected

AO model used for the current predicted Strehl and WFE outputs.

Definition at line 190 of file strehlEstimator.hpp.

Referenced by setupConfig(), and updatePredictionOutputs().

◆ m_aosysScan

aoSystemT MagAOX::app::strehlEstimator::m_aosysScan
protected

AO model dedicated to the fixed-FPS optimum-loop-speed scan.

Definition at line 193 of file strehlEstimator.hpp.

Referenced by setupConfig(), and updateOptimumLoopSpeed().

◆ m_basePath

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

The base path of the MagAO-X system.

Definition at line 188 of file MagAOXApp.hpp.

◆ m_calibDir

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

The path to calibration files for MagAOX.

Definition at line 196 of file MagAOXApp.hpp.

◆ m_configBase

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

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

Definition at line 194 of file MagAOXApp.hpp.

◆ m_configDir

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

The path to configuration files for MagAOX.

Definition at line 192 of file MagAOXApp.hpp.

◆ m_configName

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

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

Definition at line 190 of file MagAOXApp.hpp.

◆ m_counts

float MagAOX::app::strehlEstimator::m_counts { 0.0f }
protected

Total masked WFS counts used to derive the live guide-star magnitude.

Definition at line 160 of file strehlEstimator.hpp.

Referenced by calcMag(), processImage(), and processImage().

◆ m_cpusetPath

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

Path to the cpusets mount.

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

Definition at line 207 of file MagAOXApp.hpp.

◆ m_dataType [1/2]

The ImageStreamIO type code.

Definition at line 140 of file shmimMonitor.hpp.

◆ m_dataType [2/2]

The ImageStreamIO type code.

Definition at line 140 of file shmimMonitor.hpp.

◆ m_depth [1/2]

The depth of the circular buffer in the stream.

Definition at line 138 of file shmimMonitor.hpp.

◆ m_depth [2/2]

The depth of the circular buffer in the stream.

Definition at line 138 of file shmimMonitor.hpp.

◆ m_dimm_fwhm_corr

double MagAOX::app::strehlEstimator::m_dimm_fwhm_corr { 0.0 }
protected

Latest DIMM elevation-corrected FWHM.

Definition at line 196 of file strehlEstimator.hpp.

◆ m_dimm_time

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

Seconds since midnight of the latest DIMM measurement.

Definition at line 199 of file strehlEstimator.hpp.

◆ m_driverCtrlName

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

Full path name of the INDI driver control FIFO.

This is currently only used to signal restarts.

Definition at line 727 of file MagAOXApp.hpp.

◆ m_driverInName

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

Full path name of the INDI driver input FIFO.

Definition at line 719 of file MagAOXApp.hpp.

◆ m_driverOutName

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

Full path name of the INDI driver output FIFO.

Definition at line 722 of file MagAOXApp.hpp.

◆ m_elevation

float MagAOX::app::strehlEstimator::m_elevation { 90.0f }
protected

Telescope elevation in degrees.

Definition at line 154 of file strehlEstimator.hpp.

Referenced by snapshotPredictionInputs().

◆ m_emg

float MagAOX::app::strehlEstimator::m_emg { 1.0f }
protected

Live EM gain reported by the WFS camera.

Definition at line 139 of file strehlEstimator.hpp.

Referenced by calcMag(), and snapshotPredictionInputs().

◆ m_euidCalled

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

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

Definition at line 422 of file MagAOXApp.hpp.

◆ m_euidReal

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

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

Definition at line 421 of file MagAOXApp.hpp.

◆ m_F0

float MagAOX::app::strehlEstimator::m_F0 { m_F0_6535 }
protected

Active zero-magnitude photon flux for the selected beamsplitter branch.

Definition at line 142 of file strehlEstimator.hpp.

Referenced by calcMag(), and snapshotPredictionInputs().

◆ m_F0_6535

float MagAOX::app::strehlEstimator::m_F0_6535 { 4.2e10f }
protected

Zero-magnitude photon flux for the 65/35 beamsplitter branch.

Definition at line 112 of file strehlEstimator.hpp.

◆ m_F0_HaIR

float MagAOX::app::strehlEstimator::m_F0_HaIR { 5.3e10f }
protected

Zero-magnitude photon flux for the Ha/IR beamsplitter branch.

Definition at line 115 of file strehlEstimator.hpp.

◆ m_fps

float MagAOX::app::strehlEstimator::m_fps { 2000.0f }
protected

Live WFS frame rate in Hz.

Definition at line 136 of file strehlEstimator.hpp.

Referenced by calcMag(), and snapshotPredictionInputs().

◆ m_getExistingFirst [1/2]

bool MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_getExistingFirst
protectedinherited

If set to true by derivedT, any existing image will be grabbed and sent to processImage before waiting on the semaphore.

Definition at line 127 of file shmimMonitor.hpp.

◆ m_getExistingFirst [2/2]

bool MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_getExistingFirst
protectedinherited

If set to true by derivedT, any existing image will be grabbed and sent to processImage before waiting on the semaphore.

Definition at line 127 of file shmimMonitor.hpp.

◆ m_gitAlert

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

Definition at line 582 of file MagAOXApp.hpp.

◆ m_height [1/2]

The height of the images in the stream.

Definition at line 137 of file shmimMonitor.hpp.

◆ m_height [2/2]

The height of the images in the stream.

Definition at line 137 of file shmimMonitor.hpp.

◆ m_imageStream [1/2]

IMAGE MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_imageStream
protectedinherited

The ImageStreamIO shared memory buffer.

Definition at line 143 of file shmimMonitor.hpp.

◆ m_imageStream [2/2]

IMAGE MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_imageStream
protectedinherited

The ImageStreamIO shared memory buffer.

Definition at line 143 of file shmimMonitor.hpp.

◆ m_indiCallBackMutex

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

Mutex for locking INDI callback maps and per-entry callback state.

Lock ordering policy: 1) Prefer never holding both m_indiMutex and m_indiCallBackMutex at the same time. 2) If both are required in future code, always acquire m_indiMutex before m_indiCallBackMutex.

Definition at line 669 of file MagAOXApp.hpp.

◆ m_indiDriver

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

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

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

Definition at line 659 of file MagAOXApp.hpp.

◆ m_indiMutex

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

Mutex for locking INDI communications.

Definition at line 662 of file MagAOXApp.hpp.

◆ m_indiNewCallBacks

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

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

The key for these is the property name.

Definition at line 707 of file MagAOXApp.hpp.

◆ m_indiP_clearFSMAlert

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

indi Property to clear an FSM alert.

Definition at line 1137 of file MagAOXApp.hpp.

◆ m_indiP_emg

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_emg

Subscription to the live WFS EM-gain property.

Definition at line 403 of file strehlEstimator.hpp.

Referenced by appStartup().

◆ m_indiP_fps

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_fps

Subscription to the live WFS FPS property.

Definition at line 400 of file strehlEstimator.hpp.

Referenced by appStartup().

◆ m_indiP_frameSize [1/2]

pcf::IndiProperty MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_indiP_frameSize
protectedinherited

Property used to report the current frame size.

Definition at line 274 of file shmimMonitor.hpp.

◆ m_indiP_frameSize [2/2]

pcf::IndiProperty MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_indiP_frameSize
protectedinherited

Property used to report the current frame size.

Definition at line 274 of file shmimMonitor.hpp.

◆ m_indiP_loopSpeedOptimum

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_loopSpeedOptimum

Summary property for the best fixed-grid loop speed.

Definition at line 433 of file strehlEstimator.hpp.

Referenced by appStartup(), and updateOptimumLoopSpeed().

◆ m_indiP_mag

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_mag

Local writable star-magnitude property exposing current and estimated.

Definition at line 418 of file strehlEstimator.hpp.

Referenced by appStartup(), and updatePlanningProperties().

◆ m_indiP_powerChannel

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

INDI property used to communicate power state.

Definition at line 1193 of file MagAOXApp.hpp.

◆ m_indiP_seeing_magaox

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_seeing_magaox

Local writable seeing property exposing current and estimated.

Definition at line 415 of file strehlEstimator.hpp.

Referenced by appStartup(), and updatePlanningProperties().

◆ m_indiP_shmimName [1/2]

pcf::IndiProperty MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_indiP_shmimName
protectedinherited

Property used to report the shmim buffer name.

Definition at line 272 of file shmimMonitor.hpp.

◆ m_indiP_shmimName [2/2]

pcf::IndiProperty MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_indiP_shmimName
protectedinherited

Property used to report the shmim buffer name.

Definition at line 272 of file shmimMonitor.hpp.

◆ m_indiP_stage

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_stage

Subscription to the beamsplitter preset state.

Definition at line 406 of file strehlEstimator.hpp.

Referenced by appStartup().

◆ m_indiP_state

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

indi Property to report the application state.

Definition at line 1134 of file MagAOXApp.hpp.

◆ m_indiP_strehl

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_strehl

Predicted Strehl property for the currently selected conditions.

Definition at line 427 of file strehlEstimator.hpp.

Referenced by appStartup(), and updatePredictionOutputs().

◆ m_indiP_tcsi_seeing

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_tcsi_seeing

Subscription to the TCS seeing property.

Definition at line 409 of file strehlEstimator.hpp.

Referenced by appStartup().

◆ m_indiP_tcsi_telpos

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_tcsi_telpos

Subscription to the TCS telescope position property.

Definition at line 412 of file strehlEstimator.hpp.

Referenced by appStartup().

◆ m_indiP_useEstimates

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_useEstimates

Local toggle selecting whether predicted outputs use estimated inputs.

Definition at line 424 of file strehlEstimator.hpp.

Referenced by appStartup(), and updatePlanningProperties().

◆ m_indiP_wfe

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_wfe

Predicted WFE breakdown for the currently selected conditions.

Definition at line 430 of file strehlEstimator.hpp.

Referenced by appStartup(), and updatePredictionOutputs().

◆ m_indiP_windSpeed

pcf::IndiProperty MagAOX::app::strehlEstimator::m_indiP_windSpeed

Local writable wind-speed selection property exposing slow, normal, and fast.

Definition at line 421 of file strehlEstimator.hpp.

Referenced by appStartup(), and updatePlanningProperties().

◆ m_indiSetCallBacks

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

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

The key for these is device.name

Definition at line 712 of file MagAOXApp.hpp.

◆ m_inode [1/2]

The inode of the image stream file.

Definition at line 145 of file shmimMonitor.hpp.

◆ m_inode [2/2]

The inode of the image stream file.

Definition at line 145 of file shmimMonitor.hpp.

◆ m_lam0

float MagAOX::app::strehlEstimator::m_lam0 { m_lam0_6535 }
protected

Active WFS/science wavelength in microns for the selected beamsplitter branch.

Definition at line 145 of file strehlEstimator.hpp.

Referenced by snapshotPredictionInputs().

◆ m_lam0_6535

float MagAOX::app::strehlEstimator::m_lam0_6535 { 0.791f }
protected

Effective WFS wavelength in microns for the 65/35 beamsplitter branch.

Definition at line 118 of file strehlEstimator.hpp.

◆ m_lam0_HaIR

float MagAOX::app::strehlEstimator::m_lam0_HaIR { 0.837f }
protected

Effective WFS wavelength in microns for the Ha/IR beamsplitter branch.

Definition at line 121 of file strehlEstimator.hpp.

◆ m_lastLoggedSuspiciousOptimumFps

float MagAOX::app::strehlEstimator::m_lastLoggedSuspiciousOptimumFps { -1.0f }
protected

Tracks the last suspicious optimum FPS reported in debug logging.

Definition at line 220 of file strehlEstimator.hpp.

Referenced by updateOptimumLoopSpeed().

◆ m_log

Definition at line 345 of file MagAOXApp.hpp.

◆ m_loopNum

int MagAOX::app::strehlEstimator::m_loopNum { 1 }
protected

Loop number used to resolve the WFS shmim names.

Definition at line 97 of file strehlEstimator.hpp.

Referenced by loadConfigImpl().

◆ m_loopPause

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

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

Definition at line 209 of file MagAOXApp.hpp.

◆ m_mag

float MagAOX::app::strehlEstimator::m_mag { 0.0f }
protected

Live guide-star magnitude derived from m_counts.

Definition at line 163 of file strehlEstimator.hpp.

Referenced by calcMag(), selectedStarMag(), and snapshotPredictionInputs().

◆ m_mag1_fwhm_corr

double MagAOX::app::strehlEstimator::m_mag1_fwhm_corr { 0.0 }
protected

Latest MAG1 elevation-corrected FWHM.

Definition at line 202 of file strehlEstimator.hpp.

◆ m_mag1_time

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

Seconds since midnight of the latest MAG1 measurement.

Definition at line 205 of file strehlEstimator.hpp.

◆ m_mag2_fwhm_corr

double MagAOX::app::strehlEstimator::m_mag2_fwhm_corr { 0.0 }
protected

Latest MAG2 elevation-corrected FWHM.

Definition at line 208 of file strehlEstimator.hpp.

◆ m_mag2_time

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

Seconds since midnight of the latest MAG2 measurement.

Definition at line 211 of file strehlEstimator.hpp.

◆ m_magEstimated

float MagAOX::app::strehlEstimator::m_magEstimated { 0.0f }
protected

Operator-entered star magnitude used when planning overrides are enabled.

Definition at line 166 of file strehlEstimator.hpp.

Referenced by calcMag(), selectedStarMag(), and snapshotPredictionInputs().

◆ m_magEstimatedManual

bool MagAOX::app::strehlEstimator::m_magEstimatedManual { false }
protected

Tracks whether the estimated star magnitude has been explicitly set by an operator.

Definition at line 169 of file strehlEstimator.hpp.

Referenced by calcMag().

◆ m_npix

int MagAOX::app::strehlEstimator::m_npix { 0 }
protected

Number of illuminated WFS pixels in the current mask.

Definition at line 157 of file strehlEstimator.hpp.

Referenced by processImage(), and snapshotPredictionInputs().

◆ m_pid

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

This process's PID.

Definition at line 506 of file MagAOXApp.hpp.

◆ m_powerChannel

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

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

Definition at line 1179 of file MagAOXApp.hpp.

◆ m_powerDevice

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

The INDI device name of the power controller.

Definition at line 1178 of file MagAOXApp.hpp.

◆ m_powerElement

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

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

Definition at line 1180 of file MagAOXApp.hpp.

◆ m_powerMgtEnabled

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

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

Definition at line 1173 of file MagAOXApp.hpp.

◆ m_powerOnCounter

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

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

Definition at line 1186 of file MagAOXApp.hpp.

◆ m_powerOnWait

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

Default time in sec to wait for device to boot after power on.

Definition at line 1183 of file MagAOXApp.hpp.

◆ m_powerState

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

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

Definition at line 1190 of file MagAOXApp.hpp.

◆ m_powerTargetElement

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

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

Definition at line 1181 of file MagAOXApp.hpp.

◆ m_powerTargetState

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

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

Definition at line 1191 of file MagAOXApp.hpp.

◆ m_predictionMutex

std::mutex MagAOX::app::strehlEstimator::m_predictionMutex
mutableprotected

Serializes access to the shared AO-model instances and prediction-property updates.

Definition at line 217 of file strehlEstimator.hpp.

Referenced by updatePredictionOutputs().

◆ m_qe

float MagAOX::app::strehlEstimator::m_qe { 0.53f }
protected

Active WFS quantum efficiency for the currently selected beamsplitter branch.

Definition at line 109 of file strehlEstimator.hpp.

Referenced by calcMag(), and snapshotPredictionInputs().

◆ m_qe_6535

float MagAOX::app::strehlEstimator::m_qe_6535 { 0.53f }
protected

WFS QE for the 65/35 beamsplitter branch.

Definition at line 124 of file strehlEstimator.hpp.

Referenced by loadConfigImpl().

◆ m_qe_HaIR

float MagAOX::app::strehlEstimator::m_qe_HaIR { 0.53f }
protected

WFS QE for the Ha/IR beamsplitter branch.

Definition at line 127 of file strehlEstimator.hpp.

Referenced by loadConfigImpl().

◆ m_r0

float MagAOX::app::strehlEstimator::m_r0 { 0.2063f * 0.5f / 0.64f }
protected

Live Fried parameter corresponding to m_seeing.

Definition at line 151 of file strehlEstimator.hpp.

◆ m_restart [1/2]

Flag indicating tha the shared memory should be reinitialized.

Definition at line 224 of file shmimMonitor.hpp.

◆ m_restart [2/2]

Flag indicating tha the shared memory should be reinitialized.

Definition at line 224 of file shmimMonitor.hpp.

◆ m_secretsPath

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

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

Definition at line 200 of file MagAOXApp.hpp.

◆ m_seeing

float MagAOX::app::strehlEstimator::m_seeing { 0.64f }
protected

Live seeing estimate in arcseconds from tcsi.seeing.dimm_fwhm_corr.

Definition at line 148 of file strehlEstimator.hpp.

Referenced by selectedSeeing(), and snapshotPredictionInputs().

◆ m_seeingEstimated

float MagAOX::app::strehlEstimator::m_seeingEstimated { 0.64f }
protected

Operator-entered seeing in arcseconds used when planning overrides are enabled.

Definition at line 172 of file strehlEstimator.hpp.

Referenced by selectedSeeing(), and snapshotPredictionInputs().

◆ m_seeingEstimatedManual

bool MagAOX::app::strehlEstimator::m_seeingEstimatedManual { false }
protected

Tracks whether the estimated seeing has been explicitly set by an operator.

Definition at line 175 of file strehlEstimator.hpp.

◆ m_self

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

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

Definition at line 397 of file MagAOXApp.hpp.

◆ m_semaphoreNumber [1/2]

int MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_semaphoreNumber
protectedinherited

The image structure semaphore index.

Definition at line 134 of file shmimMonitor.hpp.

◆ m_semaphoreNumber [2/2]

int MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_semaphoreNumber
protectedinherited

The image structure semaphore index.

Definition at line 134 of file shmimMonitor.hpp.

◆ m_shmimName [1/2]

std::string MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_shmimName
protectedinherited

The name of the shared memory image, is used in /tmp/<shmimName>.im.shm. Derived classes should set a default.

Definition at line 118 of file shmimMonitor.hpp.

◆ m_shmimName [2/2]

std::string MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_shmimName
protectedinherited

The name of the shared memory image, is used in /tmp/<shmimName>.im.shm. Derived classes should set a default.

Definition at line 118 of file shmimMonitor.hpp.

◆ m_shutdown

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

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

Definition at line 214 of file MagAOXApp.hpp.

◆ m_smCpuset [1/2]

std::string MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_smCpuset
protectedinherited

The cpuset to assign the shmimMonitor thread to. Ignored if empty (the default).

Definition at line 123 of file shmimMonitor.hpp.

◆ m_smCpuset [2/2]

std::string MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_smCpuset
protectedinherited

The cpuset to assign the shmimMonitor thread to. Ignored if empty (the default).

Definition at line 123 of file shmimMonitor.hpp.

◆ m_smState [1/2]

shmimMonitorState MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_smState
protectedinherited

Definition at line 132 of file shmimMonitor.hpp.

◆ m_smState [2/2]

shmimMonitorState MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_smState
protectedinherited

Definition at line 132 of file shmimMonitor.hpp.

◆ m_smThread [1/2]

std::thread MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_smThread
protectedinherited

A separate thread for the actual monitoring.

Definition at line 240 of file shmimMonitor.hpp.

◆ m_smThread [2/2]

std::thread MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_smThread
protectedinherited

A separate thread for the actual monitoring.

Definition at line 240 of file shmimMonitor.hpp.

◆ m_smThreadID [1/2]

pid_t MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_smThreadID
protectedinherited

The s.m. thread PID.

Definition at line 236 of file shmimMonitor.hpp.

◆ m_smThreadID [2/2]

pid_t MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_smThreadID
protectedinherited

The s.m. thread PID.

Definition at line 236 of file shmimMonitor.hpp.

◆ m_smThreadInit [1/2]

bool MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_smThreadInit
protectedinherited

Synchronizer for thread startup, to allow priority setting to finish.

Definition at line 234 of file shmimMonitor.hpp.

◆ m_smThreadInit [2/2]

bool MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_smThreadInit
protectedinherited

Synchronizer for thread startup, to allow priority setting to finish.

Definition at line 234 of file shmimMonitor.hpp.

◆ m_smThreadPrio [1/2]

int MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_smThreadPrio
protectedinherited

Priority of the shmimMonitor thread, should normally be > 00.

Definition at line 121 of file shmimMonitor.hpp.

◆ m_smThreadPrio [2/2]

int MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_smThreadPrio
protectedinherited

Priority of the shmimMonitor thread, should normally be > 00.

Definition at line 121 of file shmimMonitor.hpp.

◆ m_smThreadProp [1/2]

pcf::IndiProperty MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsavgShmimT >::m_smThreadProp
protectedinherited

The property to hold the s.m. thread details.

Definition at line 238 of file shmimMonitor.hpp.

◆ m_smThreadProp [2/2]

pcf::IndiProperty MagAOX::app::dev::shmimMonitor< strehlEstimator , wfsmaskShmimT >::m_smThreadProp
protectedinherited

The property to hold the s.m. thread details.

Definition at line 238 of file shmimMonitor.hpp.

◆ m_stagebsDevice

std::string MagAOX::app::strehlEstimator::m_stagebsDevice { "stagebs" }
protected

Beamsplitter stage device used to choose the active photometric calibration.

Definition at line 103 of file strehlEstimator.hpp.

Referenced by appStartup().

◆ m_state

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

Definition at line 576 of file MagAOXApp.hpp.

◆ m_stateAlert

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

Definition at line 579 of file MagAOXApp.hpp.

◆ m_stateLogged

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

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

Definition at line 584 of file MagAOXApp.hpp.

◆ m_stateMutex

std::mutex MagAOX::app::strehlEstimator::m_stateMutex
mutableprotected

Protects the live telemetry and planning-input state while prediction snapshots are assembled.

Definition at line 214 of file strehlEstimator.hpp.

Referenced by calcMag(), processImage(), processImage(), selectedSeeing(), selectedStarMag(), selectedWindSpeed(), and snapshotPredictionInputs().

◆ m_suid

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

The save-set user id of the process.

Definition at line 424 of file MagAOXApp.hpp.

◆ m_sysPath

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

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

Definition at line 198 of file MagAOXApp.hpp.

◆ m_targetState [1/2]

Definition at line 130 of file shmimMonitor.hpp.

◆ m_targetState [2/2]

Definition at line 130 of file shmimMonitor.hpp.

◆ m_typeSize [1/2]

The size of the type, in bytes. Result of sizeof.

Definition at line 141 of file shmimMonitor.hpp.

◆ m_typeSize [2/2]

The size of the type, in bytes. Result of sizeof.

Definition at line 141 of file shmimMonitor.hpp.

◆ m_useEstimates

bool MagAOX::app::strehlEstimator::m_useEstimates { false }
protected

Selects whether predicted outputs use the live or estimated planning inputs.

Definition at line 181 of file strehlEstimator.hpp.

Referenced by calcMag(), selectedSeeing(), selectedStarMag(), and snapshotPredictionInputs().

◆ m_useINDI

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

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

Definition at line 654 of file MagAOXApp.hpp.

◆ m_wfsavg

mx::improc::eigenImage<float> MagAOX::app::strehlEstimator::m_wfsavg
protected

Latest WFS average image.

Definition at line 187 of file strehlEstimator.hpp.

Referenced by processImage(), and processImage().

◆ m_wfsDevice

std::string MagAOX::app::strehlEstimator::m_wfsDevice { "camwfs" }
protected

WFS device providing the live FPS property.

Definition at line 100 of file strehlEstimator.hpp.

Referenced by appStartup().

◆ m_wfsmask

mx::improc::eigenImage<float> MagAOX::app::strehlEstimator::m_wfsmask
protected

Latest WFS mask image.

Definition at line 184 of file strehlEstimator.hpp.

Referenced by processImage(), and processImage().

◆ m_width [1/2]

The width of the images in the stream.

Definition at line 136 of file shmimMonitor.hpp.

◆ m_width [2/2]

The width of the images in the stream.

Definition at line 136 of file shmimMonitor.hpp.

◆ m_windSpeed

float MagAOX::app::strehlEstimator::m_windSpeed { 9.4f }
protected

Operator-selected wind speed in m/s used for planning calculations.

Definition at line 178 of file strehlEstimator.hpp.

Referenced by selectedWindSpeed(), setupConfig(), and snapshotPredictionInputs().

◆ pidFileName

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

The name of the PID file.

Definition at line 504 of file MagAOXApp.hpp.


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