#include <mcp3208Ctrl.hpp>


Public Types | |
| typedef XWC_DEFAULT_VERBOSITY | verboseT |
| typedef logger::logManager< MagAOXApp< _useINDI >, logFileRaw< verboseT > > | logManagerT |
| The log manager type. | |
| enum | fgFlip |
| typedef int32_t | cbIndexT |
| typedef XWC_DEFAULT_VERBOSITY | verboseT |
| typedef logger::logManager< mcp3208Ctrl, logFileRaw< verboseT > > | logManagerT |
| The log manager type. | |
Public Member Functions | |
| 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. | |
| int | setupConfig (mx::app::appConfigurator &config) |
| Setup the configuration system. | |
| int | loadConfig (mx::app::appConfigurator &config) |
| load the configuration system results | |
| int | onPowerOff () |
| On power off, sets m_reconfig to true. | |
| int | configCircBuffs () |
| int | telem (const typename telT::messageT &msg) |
| Make a telemetry recording. | |
| int | setupConfig (appConfigurator &config) |
| Setup an application configurator for the device section. | |
| int | loadConfig (appConfigurator &config) |
| Load the device section from an application configurator. | |
| int | checkRecordTimes (const telT &tel, telTs... tels) |
| Check the time of the last record for each telemetry type and make an entry if needed. | |
| int | checkRecordTimes (timespec &ts, const telT &tel, telTs... tels) |
| Worker function to actually perform the record time checking logic. | |
| int | checkRecordTimes (timespec &ts) |
| Empty function called at the end of the template list. | |
Application Lifecycle | |
| mcp3208Ctrl () | |
| Construct the application with the current repository version metadata. | |
| ~mcp3208Ctrl () noexcept | |
| Destroy the application. | |
| virtual void | setupConfig () |
| Register configuration entries for the application and helper devices. | |
| int | loadConfigImpl (mx::app::appConfigurator &_config) |
| Load configuration values into the application state. | |
| virtual void | loadConfig () |
| Load the configured application state. | |
| virtual int | appStartup () |
| Start the application and initialize its INDI and hardware state. | |
| virtual int | appLogic () |
| Execute one iteration of the application FSM. | |
| virtual int | appShutdown () |
| Shutdown the application and release synchronization resources. | |
Framegrabber Interface | |
| int | configureAcquisition () |
| Configure the output image geometry and acquisition mode. | |
| float | fps () |
| Report the current acquisition rate metadata to the framegrabber. | |
| int | startAcquisition () |
| Prepare the selected acquisition mode to begin producing samples. | |
| int | acquireAndCheckValid () |
| Acquire one sample and indicate whether it should be published. | |
| int | loadImageIntoStream (void *dest) |
| Copy the current MCP3208 values into the output image buffer. | |
| int | reconfig () |
| Reset synchronization resources before the next acquisition configuration. | |
Telemeter Interface | |
| int | checkRecordTimes () |
| Check whether framegrabber timing telemetry should be recorded this cycle. | |
| int | recordTelem (const telem_fgtimings *telem) |
| Record framegrabber timing telemetry. | |
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. | |
Telemeter Interface | |
| int | recordFGTimings (bool force=false) |
Public Attributes | |
| logManagerT | m_tel |
| double | m_maxInterval |
| The maximum interval, in seconds, between telemetry records. Default is 10.0 seconds. | |
Protected Member Functions | |
| void * | loadImageIntoStreamCopy (void *dest, void *src, size_t width, size_t height, size_t szof) |
| int | openShmim () |
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. | |
| uint32_t | m_width |
| The width of the image, once deinterlaced etc. | |
| uint32_t | m_height |
| The height of the image, once deinterlaced etc. | |
| uint8_t | m_dataType |
| The ImageStreamIO type code. | |
| size_t | m_typeSize |
| The size of the type, in bytes. Result of sizeof. | |
| int | m_xbinning |
| The x-binning according to the framegrabber. | |
| int | m_ybinning |
| The y-binning according to the framegrabber. | |
| timespec | m_currImageTimestamp |
| The timestamp of the current image. | |
| bool | m_reconfig |
| Flag to set if a camera reconfiguration requires a framegrabber reset. | |
| IMAGE * | m_imageStream |
| The ImageStreamIO shared memory buffer. | |
| bool | m_ownShmim |
| Flag controlling if the shmim is owned. If true it will be destroyed as needed. | |
| ino_t | m_inode |
| The inode of the image stream file. | |
| float | m_cbFPS |
| The FPS used to configure the circular buffers. | |
| mx::sigproc::circularBufferIndex< timespec, cbIndexT > | m_atimes |
| mx::sigproc::circularBufferIndex< timespec, cbIndexT > | m_wtimes |
| std::vector< double > | m_atimesD |
| std::vector< double > | m_wtimesD |
| std::vector< double > | m_watimesD |
| timespec | m_dummy_ts |
| uint64_t | m_dummy_cnt |
| char | m_dummy_c |
| double | m_mna |
| double | m_vara |
| double | m_mina |
| double | m_maxa |
| double | m_mnw |
| double | m_varw |
| double | m_minw |
| double | m_maxw |
| double | m_mnwa |
| double | m_varwa |
Configurable Parameters - Data | |
| int | m_numChannels { 2 } |
| The number of MCP3208 channels read into each output frame. | |
| std::string | m_fpsDevice |
| Device name providing external fps metadata for framegrabber sizing. | |
| std::string | m_fpsProperty { "fps" } |
| Property name providing external fps metadata. | |
| std::string | m_fpsElement { "current" } |
| Property element containing the fps value. | |
| float | m_fpsTol { 0 } |
| The tolerance used when monitoring fps metadata changes. | |
| std::string | m_numChannelsDevice |
| Device name for getting numChannels to set circular buffer length. | |
| std::string | m_numChannelsProperty { "numChannels" } |
| Property name for getting numChannels to set circular buffer length. | |
| std::string | m_numChannelsElement { "current" } |
| Element name for getting numChannels to set circular buffer length. | |
| float | m_numChannelsTol { 0 } |
| The tolerance for detecting a change in numChannels. | |
| std::string | m_synchroShmimName |
| The synchronization ImageStreamIO stream name; empty selects timer mode. | |
| int | m_synchroPostDelay { 0 } |
| Signed microsecond phase offset added to synchronized delay-model predictions. | |
| double | m_synchroDtTransfer_ns { 3e3 } |
| Transfer-latency term in the synchronized delay model. | |
| double | m_synchroWfsProcess_ns { 51.5e3 } |
| WFS processing-latency term in the synchronized delay model. | |
| double | m_synchroDtF_ns { 10e3 } |
| Filter/transport-latency term in the synchronized delay model. | |
| double | m_synchroWfsRead_ns { 276.1e3 } |
| WFS read-latency term in the synchronized delay model. | |
| double | m_delayLockAbsThreshold_ns { 50e3 } |
| Absolute phase-error threshold for declaring delay lock. | |
| double | m_delayLockFracThreshold { 0.1 } |
| Fractional period phase-error threshold for declaring delay lock. | |
| double | m_cadenceGuard_ns { 20e3 } |
| Reserved per-frame margin protecting synchronized cadence from overruns. | |
| float | m_alpha { 0.01f } |
| Global exponential moving-average coefficient applied to timing smoothers. | |
Configurable Parameters | |
| std::string | m_shmimName |
| int | m_fgThreadPrio |
| Priority of the framegrabber thread, should normally be > 00. | |
| std::string | m_fgCpuset |
| The cpuset to assign the framegrabber thread to. Not used if empty, the default. | |
| uint32_t | m_circBuffLength |
| Length of the circular buffer, in frames. | |
| cbIndexT | m_latencyCircBuffMaxLength |
| Maximum length of the latency measurement circular buffers. | |
| float | m_latencyCircBuffMaxTime |
| Maximum time of the latency meaurement circular buffers. | |
| int | m_defaultFlip |
Private Types | |
| typedef dev::frameGrabber< mcp3208Ctrl > | frameGrabberT |
| typedef dev::telemeter< mcp3208Ctrl > | telemeterT |
Private Member Functions | |
| int | clearFSMAlert () |
| Clear the FSM alert state. | |
| mcp3208Ctrl & | derived () |
Static Private Member Functions | |
| static auto | postPublishHook (hookT &hookOwner, IMAGE *imageStream, int callPriorityTag) -> decltype(hookOwner.frameGrabberPostPublish(imageStream)) |
| Call an optional derived-class hook after the main stream publication completes. | |
| static int | postPublishHook (mcp3208Ctrl &hookOwner, IMAGE *imageStream, long callPriorityTag) |
| Return success when the derived class does not expose a post-publication hook. | |
Private Attributes | |
| MCP3208Lib::MCP3208 | m_adc |
| The active MCP3208 device interface used for hardware access. | |
Static Private Attributes | |
| static constexpr bool | c_frameGrabber_flippable = false |
Friends | |
| class | mcp3208Ctrl_test |
| class | dev::frameGrabber< mcp3208Ctrl > |
| class | dev::telemeter< mcp3208Ctrl > |
Privilege Management | |
| uid_t | m_euidReal |
| The real user id of the proces (i.e. the lower privileged id of the user) | |
| uid_t | m_euidCalled |
| uid_t | m_suid |
| The save-set user id of the process. | |
| int | setEuidCalled () |
| Set the effective user ID to the called value, i.e. the highest possible. | |
| int | setEuidReal () |
| Set the effective user ID to the real value, i.e. the file owner. | |
Application State | |
| stateCodes::stateCodeT | m_state |
| bool | m_stateAlert |
| bool | m_gitAlert |
| int | m_stateLogged |
| 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. | |
Signal Handling | |
| static MagAOXApp * | m_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. | |
Runtime State - Data | |
| pcf::IndiProperty | m_indiP_numChannels |
| pcf::IndiProperty | m_indiP_numChannelsSource |
| pcf::IndiProperty | m_indiP_fps |
| INDI property exposing the local fps target. | |
| float | m_fps { 2000 } |
| The target acquisition rate in frames per second. | |
| pcf::IndiProperty | m_indiP_fpsSource |
| INDI property subscription used to follow an external fps source. | |
| pcf::IndiProperty | m_indiP_alpha |
| INDI property exposing the global EMA alpha used by timing smoothers. | |
| pcf::IndiProperty | m_indiP_synchroDelay |
| INDI property exposing the synchronized-mode signed phase offset in microseconds. | |
| pcf::IndiProperty | m_indiP_timingDiag |
| INDI property exposing runtime timing diagnostics for acquisition health checks. | |
| float | m_trigger { 1e9f / m_fps } |
| The timer-mode read interval in nanoseconds. | |
| float | m_gain { .1 } |
| The simple integrator gain used for timer and synchro delay control. | |
| float | nano_sec_target { 1e9f / m_fps } |
| The timer-mode target interval in nanoseconds. | |
| float | m_synchroDelay { 0 } |
| The commanded pre-read delay in synchronized mode, in nanoseconds. | |
| float | m_synchroDelayTarget { 0 } |
| The synchronized-mode effective delay target in nanoseconds after applying signed offset and wrap. | |
| MCP3208Lib::MCP3208 | adc |
| Secondary MCP3208 handle retained with the legacy class state. | |
| std::chrono::time_point< std::chrono::high_resolution_clock > | m_time_start |
| The timer-mode reference point for the next internal acquisition cycle. | |
| std::vector< uint16_t > | m_values |
| The most recently read MCP3208 channel values published to the output stream. | |
| IMAGE | m_synchroStream {} |
| The opened synchronization stream used for semaphore-triggered reads. | |
| bool | m_synchroStreamOpen { false } |
| Tracks whether the synchronization stream is currently open. | |
| ino_t | m_synchroStreamInode { 0 } |
| Cached inode used to detect synchronization stream recreation. | |
| int | m_synchroSemaphoreNumber { 5 } |
| The claimed semaphore slot for synchronization waits. | |
| sem_t * | m_synchroSemaphore { nullptr } |
| Cached pointer to the claimed synchronization semaphore. | |
| timespec | m_atime {} |
| The most recent semaphore-arrival timestamp on the local realtime clock. | |
| timespec | m_lastAtime {} |
| The previous semaphore-arrival timestamp used for period estimation. | |
| double | m_avgSemaphorePeriod_ns { 0.0 } |
| Exponential moving-average estimate of semaphore period in nanoseconds. | |
| double | m_wfsPeriodMeasured_ns { 0.0 } |
| Measured semaphore period used as the synchronized delay-model WFS period. | |
| timespec | m_lastProducerAtime {} |
| Previous producer atime from the synchronization stream metadata. | |
| uint64_t | m_lastProducerCnt0 { 0 } |
| Previous producer frame counter from the synchronization stream metadata. | |
| double | m_producerPeriodInst_ns { 0.0 } |
| Instantaneous producer period estimate from metadata timestamps. | |
| double | m_avgProducerPeriod_ns { 0.0 } |
| Exponential moving-average producer period estimate from metadata. | |
| bool | m_firstProducerSample { true } |
| Tracks first-sample initialization for producer-period estimation. | |
| uint64_t | m_localFrameSeq { 0 } |
| Monotonic local acquisition sequence incremented on each published frame. | |
| uint64_t | m_syncFramesReceived { 0 } |
| Count of synchronized frames received from semaphore wakes. | |
| uint64_t | m_syncFramesWritten { 0 } |
| Count of synchronized frames published to the output stream. | |
| uint64_t | m_syncFramesDropped { 0 } |
| Count of missing producer frame IDs inferred from positive counter gaps. | |
| uint64_t | m_syncFrameIdGapCount { 0 } |
| Number of producer-frame gap events where ID delta exceeded one. | |
| uint64_t | m_syncProducerFrameId { 0 } |
Latest producer frame ID (cnt0) observed on the synchronization stream. | |
| uint64_t | m_syncProducerFrameDelta { 0 } |
| Latest producer-frame ID delta between consecutive synchronized wakes. | |
| uint64_t | m_lastSyncProducerFrameId { 0 } |
| Previous producer frame ID used to detect synchronized frame-ID gaps. | |
| bool | m_syncProducerFrameValid { false } |
| Tracks whether producer frame-ID gap tracking has a valid prior sample. | |
| bool | m_firstSemaphore { true } |
| Tracks first-arrival initialization for semaphore period estimation. | |
| double | m_avgReadLatency_ns { 0.0 } |
| Exponential moving-average estimate of semaphore-to-read latency in nanoseconds. | |
| bool | m_firstReadLatency { true } |
| Tracks first-arrival initialization for semaphore-to-read latency estimation. | |
| double | m_wfs_fps { 0.0 } |
| WFS frame rate estimate used for timing prediction; initialized from configured fps before callbacks. | |
| double | m_delayModel_ns { 0.0 } |
| Current modulo-wrapped delay predicted by the synchronized phase model. | |
| double | m_delayApplied_ns { 0.0 } |
| Delay applied to the most recent synchronized ADC read. | |
| double | m_delayBudget_ns { 0.0 } |
| Maximum delay allowed this cycle after cadence budgeting. | |
| double | m_nonDelayService_ns { 0.0 } |
| Measured wake-to-return service time minus applied delay for the latest cycle. | |
| double | m_avgNonDelayService_ns { 0.0 } |
| Exponential moving-average of non-delay synchronized service time. | |
| bool | m_firstNonDelayService { true } |
| Tracks first-sample initialization for non-delay service-time averaging. | |
| double | m_delayPhaseError_ns { 0.0 } |
| Wrapped phase error between applied and modeled synchronized delay. | |
| double | m_delayLock { 0.0 } |
| Delay-lock state exported to diagnostics as 1.0 (locked) or 0.0 (unlocked). | |
| double | m_delayCapped { 0.0 } |
| Delay-cap state exported as 1.0 when cadence budgeting limits the applied delay. | |
| timespec | m_triggerTime {} |
| Computed trigger timestamp aligned to the estimated WFS integration midpoint. | |
| double | m_triggerInterval_ns { 0.0 } |
| Measured interval between consecutive trigger events in nanoseconds. | |
| double | m_channelReadoutTime_ns { 0.0 } |
| Measured duration of reading all configured channels in nanoseconds. | |
| timespec | m_lastTriggerTime {} |
| Previous trigger timestamp used to compute the synchronized trigger interval. | |
| bool | m_firstTriggerTime { true } |
| Tracks first-trigger initialization for synchronized trigger-interval measurement. | |
| bool | m_firstTimerTrigger { true } |
| Tracks first-trigger initialization for timer-mode trigger-interval measurement. | |
| int | numChannels () |
| Report the configured channel count metadata to the framegrabber. | |
| INDI_NEWCALLBACK_DECL (mcp3208Ctrl, m_indiP_numChannels) | |
| INDI_SETCALLBACK_DECL (mcp3208Ctrl, m_indiP_numChannelsSource) | |
| INDI_NEWCALLBACK_DECL (mcp3208Ctrl, m_indiP_fps) | |
| Handle updates to the local fps target property. | |
| INDI_SETCALLBACK_DECL (mcp3208Ctrl, m_indiP_fpsSource) | |
| Handle updates from the configured external fps source. | |
| INDI_NEWCALLBACK_DECL (mcp3208Ctrl, m_indiP_alpha) | |
| Handle updates to the global EMA alpha property. | |
| INDI_NEWCALLBACK_DECL (mcp3208Ctrl, m_indiP_synchroDelay) | |
| Handle updates to the synchronized-mode signed phase offset property. | |
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. | |
INDI Interface | |
For reference: "Get" and "New" refer to properties we own. "Set" refers to properties owned by others. So we respond to GetProperties by listing our own properties, and NewProperty is a request to change a property we own. Whereas SetProperty is a notification that someone else has changed a property. | |
| std::unordered_map< std::string, indiCallBack > | m_indiNewCallBacks |
| Map to hold the NewProperty indiCallBacks for this App, with fast lookup by property name. | |
| 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. | |
| 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. | |
| 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 | 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. | |
| typedef std::pair< std::string, indiCallBack > | callBackValueType |
| Value type of the indiCallBack map. | |
| typedef std::unordered_map< std::string, indiCallBack >::iterator | callBackIterator |
| Iterator type of the indiCallBack map. | |
| typedef std::pair< callBackIterator, bool > | callBackInsertResult |
| Return type of insert on the indiCallBack map. | |
| static constexpr bool | m_useINDI |
| Flag controlling whether INDI is used. If false, then no INDI code executes. | |
| 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. | |
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. | |
| 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. | |
| int | powerState () |
| Returns the current power state. | |
| int | powerStateTarget () |
| Returns the target power state. | |
| INDI_SETCALLBACK_DECL (MagAOXApp, m_indiP_powerChannel) | |
Framegrabber Thread | |
This thread actually manages the framegrabbing hardware | |
| bool | m_fgThreadInit |
| Synchronizer for thread startup, to allow priority setting to finish. | |
| pid_t | m_fgThreadID |
| The ID of the framegrabber thread. | |
| pcf::IndiProperty | m_fgThreadProp |
| The property to hold the f.g. thread details. | |
| std::thread | m_fgThread |
| A separate thread for the actual framegrabbings. | |
| void | fgThreadExec () |
| Execute framegrabbing. | |
| static void | fgThreadStart (frameGrabber *o) |
| Thread starter, called by MagAOXApp::threadStart on thread construction. Calls fgThreadExec. | |
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_timing |
| int | updateINDI () |
| Update the INDI properties for this device controller. | |
Synchronization Helpers | |
| int | openSynchroStream () |
| Open the synchronization stream when semaphore-driven acquisition is enabled. | |
| int | claimSynchroSemaphore () |
| Claim a semaphore slot from the synchronization stream. | |
| bool | synchroStreamStale () |
| Check whether the synchronization stream has disappeared or been recreated. | |
| void | closeSynchroStream () |
| Release the synchronization semaphore claim and close the synchronization stream. | |
| int | acquireTimerAndCheckValid () |
| Acquire one frame using the internal timer loop. | |
| int | acquireSynchroAndCheckValid () |
| Acquire one frame using the synchronization semaphore. | |
| int | getRealtime (timespec &ts) |
| Read the current realtime clock value. | |
| int | waitOnSemaphore (sem_t *sem, timespec &ts) |
| Wait on the claimed synchronization semaphore until the supplied timeout. | |
| int | readChannelValue (int channel, uint16_t &value) |
| Read one MCP3208 channel value. | |
| void | delayBeforeRead () |
| Apply the current controlled delay between semaphore wake and ADC read. | |
| void | updateSynchroDelayController (double desiredDelay_ns) |
| Update the synchronized delay command with anti-windup and physical bounds. | |
| void | updateTriggerTiming (const timespec &atime) |
| Update synchronized trigger timing from the current semaphore arrival. | |
| void | updateTimingDiagnosticsIndi () |
| Publish acquisition timing diagnostics to the INDI read-only property. | |
| static double | timespecToNs (const timespec &t) |
| Convert a timespec timestamp to nanoseconds. | |
| static timespec | nsToTimespec (double ns) |
| Convert nanoseconds to a normalized timespec value. | |
Logging | |
| static void | configLog (const std::string &name, const int &code, const std::string &value, const std::string &source) |
| Callback for config system logging. | |
| void | logMessage (bufferPtrT &b) |
| Handle a log message from the logging system. | |
| static logManagerT | m_log |
| 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. | |
MagAO-X application to read MCP3208 channels on a Raspberry Pi.
The controller can either acquire on its internal timer loop or synchronize reads to an ImageStreamIO semaphore.
Definition at line 39 of file mcp3208Ctrl.hpp.
|
inherited |
Return type of insert on the indiCallBack map.
Definition at line 694 of file MagAOXApp.hpp.
|
inherited |
Iterator type of the indiCallBack map.
Definition at line 691 of file MagAOXApp.hpp.
|
inherited |
Value type of the indiCallBack map.
Definition at line 688 of file MagAOXApp.hpp.
|
inherited |
Definition at line 116 of file frameGrabber.hpp.
Definition at line 47 of file mcp3208Ctrl.hpp.
|
inherited |
The log manager type.
Definition at line 79 of file telemeter.hpp.
|
inherited |
The log manager type.
Definition at line 178 of file MagAOXApp.hpp.
Definition at line 48 of file mcp3208Ctrl.hpp.
|
inherited |
Definition at line 76 of file telemeter.hpp.
|
inherited |
Definition at line 175 of file MagAOXApp.hpp.
|
inherited |
Definition at line 108 of file frameGrabber.hpp.
| MagAOX::app::mcp3208Ctrl::mcp3208Ctrl | ( | ) |
Construct the application with the current repository version metadata.
Definition at line 442 of file mcp3208Ctrl.hpp.
|
inlinenoexcept |
Destroy the application.
Definition at line 335 of file mcp3208Ctrl.hpp.
|
staticprivateinherited |
The handler called when SIGTERM, SIGQUIT, or SIGINT is received. Just a wrapper for handlerSigTerm.
| [in] | signum | specifies the signal. |
| [in] | siginf | ignored by MagAOXApp |
| [in] | ucont | ignored by MagAOXApp |
Definition at line 397 of file MagAOXApp.hpp.
| int MagAOX::app::mcp3208Ctrl::acquireAndCheckValid | ( | ) |
Acquire one sample and indicate whether it should be published.
Definition at line 1201 of file mcp3208Ctrl.hpp.
References acquireSynchroAndCheckValid(), acquireTimerAndCheckValid(), and m_synchroShmimName.
|
protected |
Acquire one frame using the synchronization semaphore.
Definition at line 1424 of file mcp3208Ctrl.hpp.
References delayBeforeRead(), getRealtime(), MagAOX::app::MagAOXApp< true >::log(), flatlogs::logPrio::LOG_NOTICE, m_alpha, m_atime, m_avgNonDelayService_ns, m_avgProducerPeriod_ns, m_avgReadLatency_ns, m_cadenceGuard_ns, m_channelReadoutTime_ns, MagAOX::app::dev::frameGrabber< mcp3208Ctrl >::m_currImageTimestamp, m_delayApplied_ns, m_delayBudget_ns, m_delayCapped, m_firstNonDelayService, m_firstProducerSample, m_firstReadLatency, m_lastProducerAtime, m_lastProducerCnt0, m_lastSyncProducerFrameId, m_nonDelayService_ns, m_numChannels, m_producerPeriodInst_ns, MagAOX::app::dev::frameGrabber< mcp3208Ctrl >::m_reconfig, m_syncFrameIdGapCount, m_syncFramesDropped, m_syncFramesReceived, m_synchroDelay, m_synchroDelayTarget, m_synchroSemaphore, m_synchroStream, m_syncProducerFrameDelta, m_syncProducerFrameId, m_syncProducerFrameValid, m_values, m_wfsPeriodMeasured_ns, readChannelValue(), synchroStreamStale(), timespecToNs(), updateSynchroDelayController(), updateTriggerTiming(), and waitOnSemaphore().
Referenced by acquireAndCheckValid().
|
protected |
Acquire one frame using the internal timer loop.
Definition at line 1376 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log(), m_channelReadoutTime_ns, m_firstTimerTrigger, m_gain, m_numChannels, MagAOX::app::dev::frameGrabber< mcp3208Ctrl >::m_reconfig, MagAOX::app::MagAOXApp< true >::m_shutdown, m_time_start, m_trigger, m_triggerInterval_ns, m_values, nano_sec_target, and readChannelValue().
Referenced by acquireAndCheckValid().
|
virtual |
Execute one iteration of the application FSM.
Implements MagAOX::app::MagAOXApp< true >.
Definition at line 1060 of file mcp3208Ctrl.hpp.
References FRAMEGRABBER_APP_LOGIC, FRAMEGRABBER_UPDATE_INDI, MagAOX::app::MagAOXApp< true >::log(), m_alpha, m_fps, m_indiP_alpha, m_indiP_fps, m_indiP_numChannels, m_indiP_synchroDelay, m_numChannels, m_synchroPostDelay, TELEMETER_APP_LOGIC, and updateTimingDiagnosticsIndi().
|
virtual |
Shutdown the application and release synchronization resources.
Implements MagAOX::app::MagAOXApp< true >.
Definition at line 1081 of file mcp3208Ctrl.hpp.
References closeSynchroStream(), FRAMEGRABBER_APP_SHUTDOWN, and TELEMETER_APP_SHUTDOWN.
|
virtual |
Start the application and initialize its INDI and hardware state.
Implements MagAOX::app::MagAOXApp< true >.
Definition at line 848 of file mcp3208Ctrl.hpp.
References MCP3208Lib::MCP3208::connect(), CREATE_REG_INDI_NEW_NUMBERF, CREATE_REG_INDI_RO_NUMBER, FRAMEGRABBER_APP_STARTUP, MagAOX::app::MagAOXApp< true >::log(), m_adc, m_alpha, m_fps, m_fpsDevice, m_fpsProperty, m_indiP_alpha, m_indiP_fps, m_indiP_fpsSource, m_indiP_numChannels, m_indiP_numChannelsSource, m_indiP_synchroDelay, m_indiP_timingDiag, m_numChannels, m_numChannelsDevice, m_numChannelsProperty, m_synchroPostDelay, MagAOX::app::stateCodes::OPERATING, REG_INDI_SETPROP, MagAOX::app::MagAOXApp< true >::state(), TELEMETER_APP_STARTUP, and updateTimingDiagnosticsIndi().
|
inherited |
|
inherited |
Get the calibration directory.
Definition at line 1266 of file MagAOXApp.hpp.
|
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 271 of file MagAOXApp.hpp.
| int MagAOX::app::mcp3208Ctrl::checkRecordTimes | ( | ) |
Check whether framegrabber timing telemetry should be recorded this cycle.
Definition at line 1699 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log().
|
inherited |
Check the time of the last record for each telemetry type and make an entry if needed.
This must be called from derivedT::checkRecordTimes(), with one template parameter for ach telemetry log type being recorded.
| [in] | tel | [unused] object of the telemetry type to record |
| [in] | tels | [unused] objects of the additional telemetry types to record |
Definition at line 156 of file telemeter.hpp.
|
inherited |
Empty function called at the end of the template list.
| [in] | ts | [unused] the timestamp that records are compared to |
Definition at line 177 of file telemeter.hpp.
|
inherited |
Worker function to actually perform the record time checking logic.
Recursively calls itself until the variadic template list is exhausted.
| [in] | ts | [unused] the timestamp that records are compared to |
| [in] | tel | [unused] objects of the telemetry type to record |
| [in] | tels | [unused] objects of the additional telemetry types to record |
Definition at line 167 of file telemeter.hpp.
|
protected |
Claim a semaphore slot from the synchronization stream.
Definition at line 1263 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log(), m_synchroSemaphore, m_synchroSemaphoreNumber, m_synchroShmimName, m_synchroStream, and m_synchroStreamOpen.
Referenced by configureAcquisition(), and startAcquisition().
|
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 635 of file MagAOXApp.hpp.
|
protected |
Release the synchronization semaphore claim and close the synchronization stream.
Definition at line 1321 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log(), m_atime, m_avgNonDelayService_ns, m_avgProducerPeriod_ns, m_avgReadLatency_ns, m_avgSemaphorePeriod_ns, m_channelReadoutTime_ns, m_delayApplied_ns, m_delayBudget_ns, m_delayCapped, m_delayLock, m_delayModel_ns, m_delayPhaseError_ns, m_firstNonDelayService, m_firstProducerSample, m_firstReadLatency, m_firstSemaphore, m_firstTimerTrigger, m_firstTriggerTime, m_lastAtime, m_lastProducerAtime, m_lastProducerCnt0, m_lastSyncProducerFrameId, m_lastTriggerTime, m_localFrameSeq, m_nonDelayService_ns, m_producerPeriodInst_ns, m_syncFrameIdGapCount, m_syncFramesDropped, m_syncFramesReceived, m_syncFramesWritten, m_synchroSemaphore, m_synchroSemaphoreNumber, m_synchroStream, m_synchroStreamInode, m_synchroStreamOpen, m_syncProducerFrameDelta, m_syncProducerFrameId, m_syncProducerFrameValid, m_triggerInterval_ns, m_triggerTime, and m_wfsPeriodMeasured_ns.
Referenced by appShutdown(), configureAcquisition(), and reconfig().
|
inherited |
Get the config base file.
Definition at line 1261 of file MagAOXApp.hpp.
|
inherited |
Definition at line 253 of file frameGrabber.hpp.
|
inherited |
Get the config directory.
Definition at line 1256 of file MagAOXApp.hpp.
|
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.
| [in] | name | The name of the config value |
| [in] | code | numeric code specifying the type |
| [in] | value | the value read by the config system |
| [in] | source | the source of the value. |
Definition at line 377 of file MagAOXApp.hpp.
|
inherited |
Get the config name.
Definition at line 1250 of file MagAOXApp.hpp.
| int MagAOX::app::mcp3208Ctrl::configureAcquisition | ( | ) |
Configure the output image geometry and acquisition mode.
Definition at line 1091 of file mcp3208Ctrl.hpp.
References claimSynchroSemaphore(), closeSynchroStream(), MagAOX::app::MagAOXApp< true >::log(), flatlogs::logPrio::LOG_INFO, MagAOX::app::dev::frameGrabber< mcp3208Ctrl >::m_dataType, MagAOX::app::dev::frameGrabber< mcp3208Ctrl >::m_height, m_numChannels, m_synchroPostDelay, m_synchroShmimName, m_values, MagAOX::app::dev::frameGrabber< mcp3208Ctrl >::m_width, and openSynchroStream().
|
inherited |
Get the cpuset path.
Definition at line 1281 of file MagAOXApp.hpp.
|
protectedinherited |
Create the INDI FIFOs.
Changes permissions to max available and creates the FIFOs at the configured path.
Definition at line 953 of file MagAOXApp.hpp.
|
inherited |
Create a ReadOnly INDI Number property.
| [out] | prop | the property to create and setup |
| [in] | propName | the name of the property |
| [in] | propLabel | [optional] the GUI label suggestion for this property |
| [in] | propGroup | [optional] the group for this property |
Definition at line 776 of file MagAOXApp.hpp.
|
inherited |
Create a standard ReadOnly INDI Text property, with at least one element.
| [out] | prop | the property to create and setup |
| [in] | propName | the name of the property |
| [in] | elName | the name of the element |
| [in] | propLabel | [optional] the GUI label suggestion for this property |
| [in] | propGroup | [optional] the group for this property |
| [in] | elLabel | [optional] the GUI label suggestion for the element |
Definition at line 741 of file MagAOXApp.hpp.
|
inherited |
Create a standard R/W INDI Number property with target and current elements.
| [out] | prop | the property to create and setup |
| [in] | name | the name of the property |
| [in] | min | the minimum value for the elements, applied to both target and current |
| [in] | max | the minimum value for the elements, applied to both target and current |
| [in] | step | the step size for the elements, applied to both target and current |
| [in] | format | the _ value for the elements, applied to both target and current. Set to "" to use the MagAO-X standard for type. |
| [in] | label | [optional] the GUI label suggestion for this property |
| [in] | group | [optional] the group for this property |
Definition at line 755 of file MagAOXApp.hpp.
|
inherited |
Create a standard R/W INDI switch with a single request element.
This switch is intended to function like a momentary switch.
| [out] | prop | the property to create and setup |
| [in] | name | the name of the property |
| [in] | label | [optional] the GUI label suggestion for this property |
| [in] | group | [optional] the group for this property |
Definition at line 802 of file MagAOXApp.hpp.
|
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.
| [out] | prop | the property to create and setup |
| [in] | name | the name of the property, |
| [in] | elements | the element names to give to the switches |
| [in] | label | [optional] the GUI label suggestion for this property |
| [in] | group | [optional] the group for this property |
Definition at line 833 of file MagAOXApp.hpp.
|
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.
| [out] | prop | the property to create and setup |
| [in] | name | the name of the property, |
| [in] | elements | the element names to give to the switches |
| [in] | elementLabels | the element labels to give to the switches |
| [in] | label | [optional] the GUI label suggestion for this property |
| [in] | group | [optional] the group for this property |
Definition at line 815 of file MagAOXApp.hpp.
|
inherited |
Create a standard R/W INDI Text property with target and current elements.
| [out] | prop | the property to create and setup |
| [in] | propName | the name of the property |
| [in] | label | [optional] the GUI label suggestion for this property |
| [in] | group | [optional] the group for this property |
Definition at line 728 of file MagAOXApp.hpp.
|
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.
| [out] | prop | the property to create and setup |
| [in] | name | the name of the property |
| [in] | label | [optional] the GUI label suggestion for this property |
| [in] | group | [optional] the group for this property |
Definition at line 789 of file MagAOXApp.hpp.
|
protected |
Apply the current controlled delay between semaphore wake and ADC read.
Definition at line 1660 of file mcp3208Ctrl.hpp.
References m_delayApplied_ns.
Referenced by acquireSynchroAndCheckValid().
|
inlineprivateinherited |
Definition at line 328 of file frameGrabber.hpp.
|
inherited |
Get the INDI control FIFO file name.
Definition at line 1310 of file MagAOXApp.hpp.
|
inherited |
Get the INDI input FIFO file name.
Definition at line 1298 of file MagAOXApp.hpp.
|
inherited |
Get the INDI output FIFO file name.
Definition at line 1304 of file MagAOXApp.hpp.
|
virtualinherited |
The execute method implementing the standard main loop. Should not normally be overridden.
Performs final startup steps. That is:
Errors in the above steps will cause a process exit.
Then commences the main event loop. Conditions on entry to the main loop:
In the event loop, the power state is checked (if being managed). If power is off, then onPowerOff is called. If power is on, or power is not managed, appLogic is called. These methods are implemented in derived classes, and are called every m_loopPause interval.
If an error is returned by either onPowerOff or appLogic, or a signal is handled, then the shutdown is managed. This includes shutting down INDI, calling appShutdown, and unlocking the PID. The log thread will shutdown.
Definition at line 301 of file MagAOXApp.hpp.
|
protectedinherited |
Execute framegrabbing.
Definition at line 273 of file frameGrabber.hpp.
|
staticprotectedinherited |
Thread starter, called by MagAOXApp::threadStart on thread construction. Calls fgThreadExec.
| [in] | o | a pointer to a frameGrabber instance (normally this) |
Definition at line 270 of file frameGrabber.hpp.
| float MagAOX::app::mcp3208Ctrl::fps | ( | ) |
Report the current acquisition rate metadata to the framegrabber.
Definition at line 1129 of file mcp3208Ctrl.hpp.
References m_fps.
|
protected |
Read the current realtime clock value.
| [out] | ts | the current realtime clock value |
Definition at line 1644 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log().
Referenced by acquireSynchroAndCheckValid().
|
inherited |
Get the value of the git alert flag.
Definition at line 606 of file MagAOXApp.hpp.
|
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.
| [in] | ipRecv | The property being sent. |
Definition at line 969 of file MagAOXApp.hpp.
|
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.
| [in] | ipRecv | The property being requested. |
Definition at line 975 of file MagAOXApp.hpp.
|
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.
| [in] | ipRecv | The property being changed. |
Definition at line 985 of file MagAOXApp.hpp.
|
privateinherited |
Handles SIGTERM, SIGQUIT, and SIGINT. Sets m_shutdown to 1 and logs the signal.
| [in] | signum | specifies the signal. |
| [in] | siginf | ignored by MagAOXApp |
| [in] | ucont | ignored by MagAOXApp |
Definition at line 403 of file MagAOXApp.hpp.
|
inherited |
Handler for the set INDI property request.
This is called by m_indiDriver's indiDriver::handleSetProperties.
| [in] | ipRecv | The property being changed. |
Definition at line 994 of file MagAOXApp.hpp.
|
protected |
Handle updates to the global EMA alpha property.
|
protected |
Handle updates to the local fps target property.
|
protected |
|
protected |
Handle updates to the synchronized-mode signed phase offset property.
|
inherited |
|
protected |
Handle updates from the configured external fps source.
|
protected |
|
inlineinherited |
Determine whether an unresolved Set-property subscription should be requested now.
| [in] | callBack | the subscription retry state to evaluate |
| [in] | all | if true, force an immediate refresh regardless of retry timing |
| [in] | now | the current monotonic time for scheduling |
Definition at line 937 of file MagAOXApp.hpp.
|
protectedinherited |
Get the target element value from an new property.
| [out] | localProperty | The local property to update |
| [out] | localTarget | The local value to update |
| [in] | remoteProperty | the new property received |
| [in] | setBusy | [optional] set property to busy if true |
Definition at line 1091 of file MagAOXApp.hpp.
|
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 265 of file MagAOXApp.hpp.
|
virtual |
Load the configured application state.
Definition at line 843 of file mcp3208Ctrl.hpp.
References loadConfigImpl().
|
inherited |
Load the device section from an application configurator.
| [in] | config | an application configuration from which to load values |
Definition at line 120 of file telemeter.hpp.
|
inherited |
load the configuration system results
This should be called in derivedT::loadConfig as
with appropriate error checking.
| [in] | config | the derived classes configurator |
Definition at line 202 of file frameGrabber.hpp.
| int MagAOX::app::mcp3208Ctrl::loadConfigImpl | ( | mx::app::appConfigurator & | _config | ) |
Load configuration values into the application state.
This helper is separated from loadConfig() to support unit testing.
| [in] | _config | the populated application configurator |
Definition at line 738 of file mcp3208Ctrl.hpp.
References FRAMEGRABBER_LOAD_CONFIG, MagAOX::app::MagAOXApp< true >::log(), m_alpha, m_avgNonDelayService_ns, m_avgProducerPeriod_ns, m_cadenceGuard_ns, m_channelReadoutTime_ns, m_delayApplied_ns, m_delayBudget_ns, m_delayCapped, m_delayLock, m_delayLockAbsThreshold_ns, m_delayLockFracThreshold, m_delayModel_ns, m_delayPhaseError_ns, MagAOX::app::dev::frameGrabber< mcp3208Ctrl >::m_fgCpuset, m_firstNonDelayService, m_firstProducerSample, m_fps, m_fpsDevice, m_fpsElement, m_fpsProperty, m_fpsTol, m_lastProducerAtime, m_lastProducerCnt0, m_lastSyncProducerFrameId, m_localFrameSeq, m_nonDelayService_ns, m_numChannels, m_numChannelsDevice, m_numChannelsElement, m_numChannelsProperty, m_numChannelsTol, m_producerPeriodInst_ns, m_syncFrameIdGapCount, m_syncFramesDropped, m_syncFramesReceived, m_syncFramesWritten, m_synchroDelay, m_synchroDelayTarget, m_synchroDtF_ns, m_synchroDtTransfer_ns, m_synchroPostDelay, m_synchroShmimName, m_synchroWfsProcess_ns, m_synchroWfsRead_ns, m_syncProducerFrameDelta, m_syncProducerFrameId, m_syncProducerFrameValid, m_wfs_fps, m_wfsPeriodMeasured_ns, and TELEMETER_LOAD_CONFIG.
Referenced by loadConfig().
Copy the current MCP3208 values into the output image buffer.
| [out] | dest | the destination image buffer |
Definition at line 1211 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log(), m_localFrameSeq, m_syncFramesWritten, m_synchroShmimName, and m_values.
|
protectedinherited |
Definition at line 277 of file frameGrabber.hpp.
|
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
Definition at line 515 of file MagAOXApp.hpp.
|
staticinherited |
Make a log entry.
Wrapper for logManager::log
| logT | the log entry type |
| retval | the value returned by this method. |
| [in] | msg | the message to log |
| [in] | level | [optional] the log level. The default is used if not specified. |
Definition at line 348 of file MagAOXApp.hpp.
|
staticinherited |
Make a log entry.
Wrapper for logManager::log
| logT | the log entry type |
| retval | the value returned by this method. |
| [in] | level | [optional] the log level. The default is used if not specified. |
Definition at line 361 of file MagAOXApp.hpp.
|
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 370 of file MagAOXApp.hpp.
|
inherited |
Get the loop pause time.
Definition at line 1286 of file MagAOXApp.hpp.
|
protectedinherited |
The callback called by the static version, to actually process the FSM Alert Clear request.
| [in] | ipRecv | the INDI property sent with the new property request. |
Definition at line 1148 of file MagAOXApp.hpp.
|
inlineinherited |
Update retry tracking after sending a GetProperties request for a monitored Set-property.
| callBack | [in/out] the subscription retry state to update | |
| [in] | now | the current monotonic time for scheduling |
Definition at line 944 of file MagAOXApp.hpp.
|
inlinestaticprotected |
Convert nanoseconds to a normalized timespec value.
| [in] | ns | the nanosecond value to convert |
Definition at line 452 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log().
Referenced by libXWCTest::mcp3208CtrlTest::TEST_CASE(), and updateTriggerTiming().
|
protected |
Report the configured channel count metadata to the framegrabber.
Definition at line 1124 of file mcp3208Ctrl.hpp.
References m_numChannels.
|
inherited |
On power off, sets m_reconfig to true.
This should be called in derivedT::onPowerOff as
with appropriate error checking.
Definition at line 239 of file frameGrabber.hpp.
|
protectedvirtualinherited |
This method is called when the change to poweroff is detected.
Reimplemented in MagAOX::app::alpaoCtrl, MagAOX::app::bmcCtrl, MagAOX::app::irisaoCtrl, MagAOX::app::zaberLowLevel, and MagAOX::app::zaberLowLevelBinary.
Definition at line 1193 of file MagAOXApp.hpp.
|
protectedinherited |
Definition at line 279 of file frameGrabber.hpp.
|
protected |
Open the synchronization stream when semaphore-driven acquisition is enabled.
Definition at line 1228 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log(), m_synchroShmimName, m_synchroStream, m_synchroStreamInode, and m_synchroStreamOpen.
Referenced by configureAcquisition().
|
staticprivateinherited |
Call an optional derived-class hook after the main stream publication completes.
| [in] | hookOwner | derived object that may expose the hook |
| [in] | imageStream | published image stream |
| [in] | callPriorityTag | overload selector preferring the hook |
Definition at line 317 of file frameGrabber.hpp.
|
staticprivateinherited |
Return success when the derived class does not expose a post-publication hook.
| [in] | hookOwner | derived object lacking the optional hook |
| [in] | imageStream | published image stream |
| [in] | callPriorityTag | fallback overload selector |
Definition at line 323 of file frameGrabber.hpp.
|
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.
Definition at line 1209 of file MagAOXApp.hpp.
|
inherited |
Returns the current power state.
If power management is not enabled, this always returns 1=On.
Definition at line 1219 of file MagAOXApp.hpp.
|
inherited |
Returns the target power state.
If power management is not enabled, this always returns 1=On.
Definition at line 1228 of file MagAOXApp.hpp.
Read one MCP3208 channel value.
| [in] | channel | the MCP3208 channel index to read |
| [out] | value | the sampled channel value |
Definition at line 1654 of file mcp3208Ctrl.hpp.
References m_adc, and MCP3208Lib::MCP3208::read().
Referenced by acquireSynchroAndCheckValid(), and acquireTimerAndCheckValid().
| int MagAOX::app::mcp3208Ctrl::reconfig | ( | ) |
Reset synchronization resources before the next acquisition configuration.
Definition at line 1222 of file mcp3208Ctrl.hpp.
References closeSynchroStream().
|
inherited |
Definition at line 310 of file frameGrabber.hpp.
| int MagAOX::app::mcp3208Ctrl::recordTelem | ( | const telem_fgtimings * | telem | ) |
Record framegrabber timing telemetry.
| [in] | telem | the telemeter tag requested by the interface |
Definition at line 1704 of file mcp3208Ctrl.hpp.
References MagAOX::app::dev::frameGrabber< mcp3208Ctrl >::recordFGTimings().
|
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.
| [out] | prop | the property to register |
| [in] | propName | the name of the property |
| [in] | propType | the type of the property |
| [in] | propPerm | the permissions of the property |
| [in] | propState | the state of the property |
| [in] | propRule | the switch rule type |
|
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.
| [out] | prop | the property to register |
| [in] | propName | the name of the property |
| [in] | propType | the type of the property |
| [in] | propPerm | the permissions of the property |
| [in] | propState | the state of the property |
|
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.
| [in] | prop | the property to register, must be fully set up |
|
inherited |
Register an INDI property which is read only.
This version requires the property be fully set up.
| [in] | prop | the property to register, must be completely setup |
Definition at line 849 of file MagAOXApp.hpp.
|
inherited |
Register an INDI property which is read only.
This verison sets up the INDI property according to the arguments.
| [out] | prop | the property to register, will be configured |
| [in] | propName | the name of the property |
| [in] | propType | the type of the property |
| [in] | propPerm | the permissions of the property |
| [in] | propState | the state of the property |
Definition at line 859 of file MagAOXApp.hpp.
|
inherited |
Register an INDI property which is monitored for updates from others.
| [out] | prop | the property to register |
| [in] | devName | the device which owns this property |
| [in] | propName | the name of the property |
Definition at line 926 of file MagAOXApp.hpp.
|
inlineinherited |
Reset retry tracking for a monitored INDI Set-property subscription.
| callBack | [in/out] the subscription retry state to reset |
Definition at line 934 of file MagAOXApp.hpp.
|
inherited |
Get the secrets path.
Definition at line 1276 of file MagAOXApp.hpp.
|
inherited |
Definition at line 963 of file MagAOXApp.hpp.
|
protectedinherited |
Send a newProperty command to another device (using the INDI Client interface)
| [in] | ipSend | The property to send a "new" INDI command for |
Definition at line 1114 of file MagAOXApp.hpp.
|
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.
| [in] | ipSend | The property to send a "new" INDI command for |
| [in] | el | The element of the property to change |
| [in] | newVal | The value to request for the element. |
Definition at line 1104 of file MagAOXApp.hpp.
|
protectedinherited |
Send a new property commmand for a standard toggle switch.
| [in] | device | The device name |
| [in] | property | The property name |
| [in] | onoff | Switch state to send: true = on, false = off |
Definition at line 1121 of file MagAOXApp.hpp.
|
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.
| [in] | argc | standard command line result specifying number of arguments in argv |
| [in] | argv | standard command line result containing the arguments. |
Definition at line 243 of file MagAOXApp.hpp.
|
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
Definition at line 474 of file MagAOXApp.hpp.
|
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
Definition at line 483 of file MagAOXApp.hpp.
|
privateinherited |
Sets the handler for SIGTERM, SIGQUIT, and SIGINT.
Definition at line 394 of file MagAOXApp.hpp.
|
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 255 of file MagAOXApp.hpp.
|
virtual |
Register configuration entries for the application and helper devices.
Definition at line 542 of file mcp3208Ctrl.hpp.
References FRAMEGRABBER_SETUP_CONFIG, and TELEMETER_SETUP_CONFIG.
|
inherited |
Setup an application configurator for the device section.
| [in] | config | an application configuration to setup |
Definition at line 112 of file telemeter.hpp.
|
inherited |
Setup the configuration system.
This should be called in derivedT::setupConfig as
with appropriate error checking.
| [out] | config | the derived classes configurator |
Definition at line 192 of file frameGrabber.hpp.
|
inherited |
Get the value of the shutdown flag.
Definition at line 1292 of file MagAOXApp.hpp.
|
staticprotectedinherited |
The static callback function to be registered for requesting to clear the FSM alert.
| [in] | app | a pointer to this, will be static_cast-ed to MagAOXApp. |
| [in] | ipRecv | the INDI property sent with the new property request. |
Definition at line 1137 of file MagAOXApp.hpp.
| int MagAOX::app::mcp3208Ctrl::startAcquisition | ( | ) |
Prepare the selected acquisition mode to begin producing samples.
Definition at line 1134 of file mcp3208Ctrl.hpp.
References claimSynchroSemaphore(), MagAOX::app::MagAOXApp< true >::log(), m_atime, m_avgNonDelayService_ns, m_avgProducerPeriod_ns, m_avgReadLatency_ns, m_avgSemaphorePeriod_ns, m_channelReadoutTime_ns, m_delayApplied_ns, m_delayBudget_ns, m_delayCapped, m_delayLock, m_delayModel_ns, m_delayPhaseError_ns, m_firstNonDelayService, m_firstProducerSample, m_firstReadLatency, m_firstSemaphore, m_firstTimerTrigger, m_firstTriggerTime, m_lastAtime, m_lastProducerAtime, m_lastProducerCnt0, m_lastSyncProducerFrameId, m_lastTriggerTime, m_localFrameSeq, m_nonDelayService_ns, m_producerPeriodInst_ns, m_syncFrameIdGapCount, m_syncFramesDropped, m_syncFramesReceived, m_syncFramesWritten, m_synchroDelay, m_synchroDelayTarget, m_synchroSemaphore, m_synchroSemaphoreNumber, m_synchroShmimName, m_synchroStream, m_synchroStreamOpen, m_syncProducerFrameDelta, m_syncProducerFrameId, m_syncProducerFrameValid, m_time_start, m_triggerInterval_ns, m_triggerTime, and m_wfsPeriodMeasured_ns.
|
protectedinherited |
Start INDI Communications.
Definition at line 960 of file MagAOXApp.hpp.
|
inherited |
|
inherited |
Set the current state code.
| [in] | s | The new application state |
| [in] | stateAlert | [optional] flag to set the alert state of the FSM property. |
Definition at line 592 of file MagAOXApp.hpp.
|
inherited |
Get the value of the state alert flag.
Definition at line 600 of file MagAOXApp.hpp.
|
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:
In this example, the log entry is made the first time the state changes. If there are no changes to a different state in the mean time, then when the event loop gets here again and decides it is not connected, the log entry will not be made.
Definition at line 625 of file MagAOXApp.hpp.
|
protected |
Check whether the synchronization stream has disappeared or been recreated.
Definition at line 1292 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log(), m_synchroShmimName, m_synchroStream, m_synchroStreamInode, and m_synchroStreamOpen.
Referenced by acquireSynchroAndCheckValid().
|
inherited |
|
inherited |
Make a telemetry recording.
Wrapper for logManager::log, which updates telT::lastRecord.
| logT | the log entry type |
| retval | the value returned by this method. |
| [in] | msg | the data to log |
Definition at line 95 of file telemeter.hpp.
|
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:
where impl is the derived class, and mThreadStart and myThreadExec are members of impl.
| [out] | thrd | The thread object to start executing |
| thrdInit | [in/out] The thread initilization synchronizer. | |
| tpid | [in/out] The thread pid to be filled in by thrdStart immediately upon call | |
| thProp | [in/out] The INDI property to publish the thread details | |
| [in] | thrdPrio | The r/t priority to set for this thread |
| [in] | cpuset | the cpuset to place this thread on. Ignored if "". |
| [in] | thrdName | The name of the thread (just for logging) |
| [in] | thrdThis | The this pointer to pass to the thread starter function |
| [in] | thrdStart | The thread starting function, a static function taking a this pointer as argument. |
Definition at line 549 of file MagAOXApp.hpp.
Convert a timespec timestamp to nanoseconds.
| [in] | t | the timespec value to convert |
Definition at line 447 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log().
Referenced by acquireSynchroAndCheckValid(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), libXWCTest::mcp3208CtrlTest::TEST_CASE(), updateTimingDiagnosticsIndi(), and updateTriggerTiming().
|
protectedinherited |
Remove the PID file.
Definition at line 518 of file MagAOXApp.hpp.
|
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.
| p | [in/out] The property containing the element to possibly update | |
| [in] | el | The element name |
| [in] | newVal | the new value |
Definition at line 1024 of file MagAOXApp.hpp.
|
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.
| p | [in/out] The property containing the element to possibly update | |
| [in] | el | Beginning of each element name |
| [in] | newVals | the new values |
| [in] | ipState | [optional] the new state |
Definition at line 1053 of file MagAOXApp.hpp.
|
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.
| p | [in/out] The property containing the element to possibly update | |
| [in] | el | The element name |
| [in] | newVal | the new value |
Definition at line 1007 of file MagAOXApp.hpp.
|
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.
| p | [in/out] The property containing the element to possibly update | |
| [in] | els | String vector of element names |
| [in] | newVals | the new values |
| [in] | newState | [optional] The state of the property |
Definition at line 1070 of file MagAOXApp.hpp.
|
inherited |
Update the INDI properties for this device controller.
You should call this once per main loop. It is not called automatically.
Definition at line 302 of file frameGrabber.hpp.
|
protectedinherited |
| p | [in/out] The property containing the element to possibly update | |
| [in] | els | String vector of element names |
| [in] | newVals | the new values |
| [in] | newState | [optional] The state of the property |
Definition at line 1078 of file MagAOXApp.hpp.
|
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.
| p | [in/out] The property containing the element to possibly update | |
| [in] | el | The element name |
| [in] | newVal | the new value |
Definition at line 1035 of file MagAOXApp.hpp.
Update the synchronized delay command with anti-windup and physical bounds.
| [in] | desiredDelay_ns | the unconstrained synchronized-delay command |
Definition at line 1669 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log(), m_avgReadLatency_ns, m_delayApplied_ns, m_delayBudget_ns, m_gain, m_synchroDelay, m_synchroDelayTarget, and m_wfsPeriodMeasured_ns.
Referenced by acquireSynchroAndCheckValid().
|
protected |
Publish acquisition timing diagnostics to the INDI read-only property.
The exported trigger_interval_us value reports measured current-to-previous trigger interval.
The exported trigger_time_us value is relative to the latest semaphore arrival (m_atime).
Definition at line 921 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log(), m_atime, m_avgNonDelayService_ns, m_avgReadLatency_ns, m_avgSemaphorePeriod_ns, m_channelReadoutTime_ns, m_delayApplied_ns, m_delayBudget_ns, m_delayCapped, m_delayLock, m_delayLockAbsThreshold_ns, m_delayLockFracThreshold, m_delayModel_ns, m_delayPhaseError_ns, m_indiP_timingDiag, m_localFrameSeq, m_syncFrameIdGapCount, m_syncFramesDropped, m_syncFramesReceived, m_syncFramesWritten, m_synchroDelay, m_synchroDelayTarget, m_synchroShmimName, m_syncProducerFrameDelta, m_syncProducerFrameId, m_syncProducerFrameValid, m_triggerInterval_ns, m_triggerTime, m_wfsPeriodMeasured_ns, and timespecToNs().
Referenced by appLogic(), and appStartup().
Update synchronized trigger timing from the current semaphore arrival.
| [in] | atime | the semaphore-arrival timestamp |
Definition at line 474 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log(), m_alpha, m_avgSemaphorePeriod_ns, m_delayModel_ns, m_firstSemaphore, m_firstTriggerTime, m_lastAtime, m_lastTriggerTime, m_synchroDelayTarget, m_synchroDtF_ns, m_synchroDtTransfer_ns, m_synchroPostDelay, m_synchroWfsProcess_ns, m_synchroWfsRead_ns, m_triggerInterval_ns, m_triggerTime, m_wfsPeriodMeasured_ns, nsToTimespec(), and timespecToNs().
Referenced by acquireSynchroAndCheckValid().
Wait on the claimed synchronization semaphore until the supplied timeout.
| [in] | sem | the semaphore to wait on |
| [in] | ts | the absolute timeout for the wait |
Definition at line 1649 of file mcp3208Ctrl.hpp.
References MagAOX::app::MagAOXApp< true >::log().
Referenced by acquireSynchroAndCheckValid().
|
protectedvirtualinherited |
This method is called while the power is off, once per FSM loop.
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.
|
friend |
Definition at line 43 of file mcp3208Ctrl.hpp.
|
friend |
Definition at line 43 of file mcp3208Ctrl.hpp.
Definition at line 43 of file mcp3208Ctrl.hpp.
|
protected |
Secondary MCP3208 handle retained with the legacy class state.
Definition at line 146 of file mcp3208Ctrl.hpp.
app:dev config indicating these images can not be flipped
Definition at line 53 of file mcp3208Ctrl.hpp.
|
private |
The active MCP3208 device interface used for hardware access.
Definition at line 51 of file mcp3208Ctrl.hpp.
Referenced by appStartup(), and readChannelValue().
|
protectedinherited |
Flag indicating that all registered Set properties have been updated since last Get.
Definition at line 709 of file MagAOXApp.hpp.
Global exponential moving-average coefficient applied to timing smoothers.
Definition at line 92 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), appLogic(), appStartup(), loadConfigImpl(), and updateTriggerTiming().
|
protected |
The most recent semaphore-arrival timestamp on the local realtime clock.
Definition at line 160 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protectedinherited |
Definition at line 159 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 162 of file frameGrabber.hpp.
|
protected |
Exponential moving-average of non-delay synchronized service time.
Definition at line 212 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protected |
Exponential moving-average producer period estimate from metadata.
Definition at line 174 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), and startAcquisition().
|
protected |
Exponential moving-average estimate of semaphore-to-read latency in nanoseconds.
Definition at line 198 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), startAcquisition(), updateSynchroDelayController(), and updateTimingDiagnosticsIndi().
|
protected |
Exponential moving-average estimate of semaphore period in nanoseconds.
Definition at line 164 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), startAcquisition(), updateTimingDiagnosticsIndi(), and updateTriggerTiming().
|
protectedinherited |
The base path of the MagAO-X system.
Definition at line 181 of file MagAOXApp.hpp.
|
protected |
Reserved per-frame margin protecting synchronized cadence from overruns.
Definition at line 90 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), and loadConfigImpl().
|
protectedinherited |
The path to calibration files for MagAOX.
Definition at line 189 of file MagAOXApp.hpp.
|
protectedinherited |
The FPS used to configure the circular buffers.
Definition at line 157 of file frameGrabber.hpp.
|
protected |
Measured duration of reading all configured channels in nanoseconds.
Definition at line 226 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), acquireTimerAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protectedinherited |
Length of the circular buffer, in frames.
Definition at line 128 of file frameGrabber.hpp.
|
protectedinherited |
The name of a base config class for this app (minus .conf).
Definition at line 187 of file MagAOXApp.hpp.
|
protectedinherited |
The path to configuration files for MagAOX.
Definition at line 185 of file MagAOXApp.hpp.
|
protectedinherited |
The name of the configuration file (minus .conf).
Definition at line 183 of file MagAOXApp.hpp.
|
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 200 of file MagAOXApp.hpp.
|
protectedinherited |
The timestamp of the current image.
Definition at line 147 of file frameGrabber.hpp.
|
protectedinherited |
The ImageStreamIO type code.
Definition at line 141 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 134 of file frameGrabber.hpp.
|
protected |
Delay applied to the most recent synchronized ADC read.
Definition at line 206 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), delayBeforeRead(), loadConfigImpl(), startAcquisition(), updateSynchroDelayController(), and updateTimingDiagnosticsIndi().
|
protected |
Maximum delay allowed this cycle after cadence budgeting.
Definition at line 208 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), updateSynchroDelayController(), and updateTimingDiagnosticsIndi().
|
protected |
Delay-cap state exported as 1.0 when cadence budgeting limits the applied delay.
Definition at line 220 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protected |
Delay-lock state exported to diagnostics as 1.0 (locked) or 0.0 (unlocked).
Definition at line 218 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protected |
Absolute phase-error threshold for declaring delay lock.
Definition at line 86 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl(), and updateTimingDiagnosticsIndi().
|
protected |
Fractional period phase-error threshold for declaring delay lock.
Definition at line 88 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl(), and updateTimingDiagnosticsIndi().
|
protected |
Current modulo-wrapped delay predicted by the synchronized phase model.
Definition at line 204 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), loadConfigImpl(), startAcquisition(), updateTimingDiagnosticsIndi(), and updateTriggerTiming().
|
protected |
Wrapped phase error between applied and modeled synchronized delay.
Definition at line 216 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protectedinherited |
Full path name of the INDI driver control FIFO.
This is currently only used to signal restarts.
Definition at line 720 of file MagAOXApp.hpp.
|
protectedinherited |
Full path name of the INDI driver input FIFO.
Definition at line 712 of file MagAOXApp.hpp.
|
protectedinherited |
Full path name of the INDI driver output FIFO.
Definition at line 715 of file MagAOXApp.hpp.
|
protectedinherited |
Definition at line 168 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 167 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 166 of file frameGrabber.hpp.
|
privateinherited |
The user id of the process as called (i.e. the higher privileged id of the owner, root if setuid).
Definition at line 415 of file MagAOXApp.hpp.
|
privateinherited |
The real user id of the proces (i.e. the lower privileged id of the user)
Definition at line 414 of file MagAOXApp.hpp.
|
protectedinherited |
The cpuset to assign the framegrabber thread to. Not used if empty, the default.
Definition at line 126 of file frameGrabber.hpp.
|
protectedinherited |
A separate thread for the actual framegrabbings.
Definition at line 267 of file frameGrabber.hpp.
|
protectedinherited |
The ID of the framegrabber thread.
Definition at line 263 of file frameGrabber.hpp.
|
protectedinherited |
Synchronizer for thread startup, to allow priority setting to finish.
Definition at line 261 of file frameGrabber.hpp.
|
protectedinherited |
Priority of the framegrabber thread, should normally be > 00.
Definition at line 125 of file frameGrabber.hpp.
|
protectedinherited |
The property to hold the f.g. thread details.
Definition at line 265 of file frameGrabber.hpp.
Tracks first-sample initialization for non-delay service-time averaging.
Definition at line 214 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), and startAcquisition().
Tracks first-sample initialization for producer-period estimation.
Definition at line 176 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), and startAcquisition().
Tracks first-arrival initialization for semaphore-to-read latency estimation.
Definition at line 200 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), and startAcquisition().
Tracks first-arrival initialization for semaphore period estimation.
Definition at line 196 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), startAcquisition(), and updateTriggerTiming().
Tracks first-trigger initialization for timer-mode trigger-interval measurement.
Definition at line 232 of file mcp3208Ctrl.hpp.
Referenced by acquireTimerAndCheckValid(), closeSynchroStream(), and startAcquisition().
Tracks first-trigger initialization for synchronized trigger-interval measurement.
Definition at line 230 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), startAcquisition(), and updateTriggerTiming().
|
protected |
The target acquisition rate in frames per second.
Definition at line 116 of file mcp3208Ctrl.hpp.
Referenced by appLogic(), appStartup(), fps(), and loadConfigImpl().
|
protected |
Device name providing external fps metadata for framegrabber sizing.
Definition at line 63 of file mcp3208Ctrl.hpp.
Referenced by appStartup(), and loadConfigImpl().
|
protected |
Property element containing the fps value.
Definition at line 65 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl().
|
protected |
Property name providing external fps metadata.
Definition at line 64 of file mcp3208Ctrl.hpp.
Referenced by appStartup(), and loadConfigImpl().
|
protected |
The tolerance used when monitoring fps metadata changes.
Definition at line 67 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl().
|
protected |
The simple integrator gain used for timer and synchro delay control.
Definition at line 140 of file mcp3208Ctrl.hpp.
Referenced by acquireTimerAndCheckValid(), and updateSynchroDelayController().
|
privateinherited |
Definition at line 575 of file MagAOXApp.hpp.
|
protectedinherited |
The height of the image, once deinterlaced etc.
Definition at line 139 of file frameGrabber.hpp.
|
protectedinherited |
The ImageStreamIO shared memory buffer.
Definition at line 151 of file frameGrabber.hpp.
|
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 662 of file MagAOXApp.hpp.
|
inherited |
The INDI driver wrapper. Constructed and initialized by execute, which starts and stops communications.
Definition at line 652 of file MagAOXApp.hpp.
|
inherited |
Mutex for locking INDI communications.
Definition at line 655 of file MagAOXApp.hpp.
|
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 700 of file MagAOXApp.hpp.
|
protected |
INDI property exposing the global EMA alpha used by timing smoothers.
Definition at line 125 of file mcp3208Ctrl.hpp.
Referenced by appLogic(), and appStartup().
|
protectedinherited |
indi Property to clear an FSM alert.
Definition at line 1130 of file MagAOXApp.hpp.
|
protected |
INDI property exposing the local fps target.
Definition at line 111 of file mcp3208Ctrl.hpp.
Referenced by appLogic(), and appStartup().
|
protected |
INDI property subscription used to follow an external fps source.
Definition at line 119 of file mcp3208Ctrl.hpp.
Referenced by appStartup().
|
protectedinherited |
Property used to report the current frame size.
Definition at line 290 of file frameGrabber.hpp.
|
protected |
Definition at line 104 of file mcp3208Ctrl.hpp.
Referenced by appLogic(), and appStartup().
|
protected |
Definition at line 107 of file mcp3208Ctrl.hpp.
Referenced by appStartup().
|
protectedinherited |
INDI property used to communicate power state.
Definition at line 1186 of file MagAOXApp.hpp.
|
protectedinherited |
Property used to report the shmim buffer name.
Definition at line 288 of file frameGrabber.hpp.
|
protectedinherited |
indi Property to report the application state.
Definition at line 1127 of file MagAOXApp.hpp.
|
protected |
INDI property exposing the synchronized-mode signed phase offset in microseconds.
Definition at line 131 of file mcp3208Ctrl.hpp.
Referenced by appLogic(), and appStartup().
|
protectedinherited |
Definition at line 292 of file frameGrabber.hpp.
|
protected |
INDI property exposing runtime timing diagnostics for acquisition health checks.
Definition at line 137 of file mcp3208Ctrl.hpp.
Referenced by appStartup(), and updateTimingDiagnosticsIndi().
|
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 705 of file MagAOXApp.hpp.
|
protectedinherited |
The inode of the image stream file.
Definition at line 155 of file frameGrabber.hpp.
|
protected |
The previous semaphore-arrival timestamp used for period estimation.
Definition at line 162 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), startAcquisition(), and updateTriggerTiming().
|
protected |
Previous producer atime from the synchronization stream metadata.
Definition at line 168 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), and startAcquisition().
|
protected |
Previous producer frame counter from the synchronization stream metadata.
Definition at line 170 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), and startAcquisition().
|
protected |
Previous producer frame ID used to detect synchronized frame-ID gaps.
Definition at line 192 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), and startAcquisition().
|
protected |
Previous trigger timestamp used to compute the synchronized trigger interval.
Definition at line 228 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), startAcquisition(), and updateTriggerTiming().
|
protectedinherited |
Maximum length of the latency measurement circular buffers.
Definition at line 130 of file frameGrabber.hpp.
|
protectedinherited |
Maximum time of the latency meaurement circular buffers.
Definition at line 132 of file frameGrabber.hpp.
|
protected |
Monotonic local acquisition sequence incremented on each published frame.
Definition at line 178 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), loadConfigImpl(), loadImageIntoStream(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
staticinherited |
Definition at line 338 of file MagAOXApp.hpp.
|
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 202 of file MagAOXApp.hpp.
|
protectedinherited |
Definition at line 173 of file frameGrabber.hpp.
|
inherited |
The maximum interval, in seconds, between telemetry records. Default is 10.0 seconds.
Definition at line 83 of file telemeter.hpp.
|
protectedinherited |
Definition at line 178 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 172 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 177 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 170 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 175 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 180 of file frameGrabber.hpp.
|
protected |
Measured wake-to-return service time minus applied delay for the latest cycle.
Definition at line 210 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), and startAcquisition().
|
protected |
The number of MCP3208 channels read into each output frame.
Definition at line 61 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), acquireTimerAndCheckValid(), appLogic(), appStartup(), configureAcquisition(), loadConfigImpl(), and numChannels().
|
protected |
Device name for getting numChannels to set circular buffer length.
Definition at line 69 of file mcp3208Ctrl.hpp.
Referenced by appStartup(), and loadConfigImpl().
|
protected |
Element name for getting numChannels to set circular buffer length.
Definition at line 71 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl().
|
protected |
Property name for getting numChannels to set circular buffer length.
Definition at line 70 of file mcp3208Ctrl.hpp.
Referenced by appStartup(), and loadConfigImpl().
|
protected |
The tolerance for detecting a change in numChannels.
Definition at line 73 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl().
|
protectedinherited |
Flag controlling if the shmim is owned. If true it will be destroyed as needed.
Definition at line 153 of file frameGrabber.hpp.
|
protectedinherited |
This process's PID.
Definition at line 499 of file MagAOXApp.hpp.
|
protectedinherited |
The INDI property name of the channel controlling this device's power.
Definition at line 1172 of file MagAOXApp.hpp.
|
protectedinherited |
The INDI device name of the power controller.
Definition at line 1171 of file MagAOXApp.hpp.
|
protectedinherited |
The INDI element name to monitor for this device's power state.
Definition at line 1173 of file MagAOXApp.hpp.
|
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 1166 of file MagAOXApp.hpp.
|
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 1179 of file MagAOXApp.hpp.
|
protectedinherited |
Default time in sec to wait for device to boot after power on.
Definition at line 1176 of file MagAOXApp.hpp.
|
protectedinherited |
Current power state, 1=On, 0=Off, -1=Unk.
Definition at line 1183 of file MagAOXApp.hpp.
|
protectedinherited |
The INDI element name to monitor for this device's power state.
Definition at line 1174 of file MagAOXApp.hpp.
|
protectedinherited |
Current target power state, 1=On, 0=Off, -1=Unk.
Definition at line 1184 of file MagAOXApp.hpp.
|
protected |
Instantaneous producer period estimate from metadata timestamps.
Definition at line 172 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), and startAcquisition().
|
protectedinherited |
Flag to set if a camera reconfiguration requires a framegrabber reset.
Definition at line 149 of file frameGrabber.hpp.
|
protectedinherited |
Path to the secrets directory, where passwords, etc, are stored.
Definition at line 193 of file MagAOXApp.hpp.
|
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 390 of file MagAOXApp.hpp.
|
protectedinherited |
The name of the shared memory image, is used in /tmp/<shmimName>.im.shm. Derived classes should set a default.
Definition at line 122 of file frameGrabber.hpp.
|
protectedinherited |
Flag to signal it's time to shutdown. When not 0, the main loop exits.
Definition at line 207 of file MagAOXApp.hpp.
|
privateinherited |
The application's state. Never ever set this directly, use state(const stateCodeT & s).
Definition at line 569 of file MagAOXApp.hpp.
|
privateinherited |
Definition at line 572 of file MagAOXApp.hpp.
|
privateinherited |
Counter and flag for use to log errors just once. Never ever access directly, use stateLogged().
Definition at line 577 of file MagAOXApp.hpp.
|
privateinherited |
The save-set user id of the process.
Definition at line 417 of file MagAOXApp.hpp.
|
protected |
Number of producer-frame gap events where ID delta exceeded one.
Definition at line 186 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protected |
Count of missing producer frame IDs inferred from positive counter gaps.
Definition at line 184 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protected |
Count of synchronized frames received from semaphore wakes.
Definition at line 180 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protected |
Count of synchronized frames published to the output stream.
Definition at line 182 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), loadConfigImpl(), loadImageIntoStream(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protected |
The commanded pre-read delay in synchronized mode, in nanoseconds.
Definition at line 142 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), loadConfigImpl(), startAcquisition(), updateSynchroDelayController(), and updateTimingDiagnosticsIndi().
|
protected |
The synchronized-mode effective delay target in nanoseconds after applying signed offset and wrap.
Definition at line 143 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), loadConfigImpl(), startAcquisition(), updateSynchroDelayController(), updateTimingDiagnosticsIndi(), and updateTriggerTiming().
|
protected |
Filter/transport-latency term in the synchronized delay model.
Definition at line 82 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl(), and updateTriggerTiming().
Transfer-latency term in the synchronized delay model.
Definition at line 78 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl(), and updateTriggerTiming().
|
protected |
Signed microsecond phase offset added to synchronized delay-model predictions.
Definition at line 76 of file mcp3208Ctrl.hpp.
Referenced by appLogic(), appStartup(), configureAcquisition(), loadConfigImpl(), and updateTriggerTiming().
Cached pointer to the claimed synchronization semaphore.
Definition at line 158 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), claimSynchroSemaphore(), closeSynchroStream(), and startAcquisition().
|
protected |
The claimed semaphore slot for synchronization waits.
Definition at line 157 of file mcp3208Ctrl.hpp.
Referenced by claimSynchroSemaphore(), closeSynchroStream(), and startAcquisition().
|
protected |
The synchronization ImageStreamIO stream name; empty selects timer mode.
Definition at line 75 of file mcp3208Ctrl.hpp.
Referenced by acquireAndCheckValid(), claimSynchroSemaphore(), configureAcquisition(), loadConfigImpl(), loadImageIntoStream(), openSynchroStream(), startAcquisition(), synchroStreamStale(), and updateTimingDiagnosticsIndi().
|
protected |
The opened synchronization stream used for semaphore-triggered reads.
Definition at line 154 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), claimSynchroSemaphore(), closeSynchroStream(), openSynchroStream(), startAcquisition(), and synchroStreamStale().
|
protected |
Cached inode used to detect synchronization stream recreation.
Definition at line 156 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), openSynchroStream(), and synchroStreamStale().
Tracks whether the synchronization stream is currently open.
Definition at line 155 of file mcp3208Ctrl.hpp.
Referenced by claimSynchroSemaphore(), closeSynchroStream(), openSynchroStream(), startAcquisition(), and synchroStreamStale().
WFS processing-latency term in the synchronized delay model.
Definition at line 80 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl(), and updateTriggerTiming().
WFS read-latency term in the synchronized delay model.
Definition at line 84 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl(), and updateTriggerTiming().
|
protected |
Latest producer-frame ID delta between consecutive synchronized wakes.
Definition at line 190 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protected |
Latest producer frame ID (cnt0) observed on the synchronization stream.
Definition at line 188 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
Tracks whether producer frame-ID gap tracking has a valid prior sample.
Definition at line 194 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), and updateTimingDiagnosticsIndi().
|
protectedinherited |
The path to the system directory, for PID file, etc.
Definition at line 191 of file MagAOXApp.hpp.
|
inherited |
Definition at line 81 of file telemeter.hpp.
|
protected |
The timer-mode reference point for the next internal acquisition cycle.
Definition at line 149 of file mcp3208Ctrl.hpp.
Referenced by acquireTimerAndCheckValid(), and startAcquisition().
The timer-mode read interval in nanoseconds.
Definition at line 139 of file mcp3208Ctrl.hpp.
Referenced by acquireTimerAndCheckValid().
|
protected |
Measured interval between consecutive trigger events in nanoseconds.
Definition at line 224 of file mcp3208Ctrl.hpp.
Referenced by acquireTimerAndCheckValid(), closeSynchroStream(), startAcquisition(), updateTimingDiagnosticsIndi(), and updateTriggerTiming().
|
protected |
Computed trigger timestamp aligned to the estimated WFS integration midpoint.
Definition at line 222 of file mcp3208Ctrl.hpp.
Referenced by closeSynchroStream(), startAcquisition(), updateTimingDiagnosticsIndi(), and updateTriggerTiming().
|
protectedinherited |
The size of the type, in bytes. Result of sizeof.
Definition at line 142 of file frameGrabber.hpp.
|
staticconstexprprotectedinherited |
Flag controlling whether INDI is used. If false, then no INDI code executes.
Definition at line 647 of file MagAOXApp.hpp.
|
protected |
The most recently read MCP3208 channel values published to the output stream.
Definition at line 152 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), acquireTimerAndCheckValid(), configureAcquisition(), and loadImageIntoStream().
|
protectedinherited |
Definition at line 171 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 176 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 181 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 164 of file frameGrabber.hpp.
|
protected |
WFS frame rate estimate used for timing prediction; initialized from configured fps before callbacks.
Definition at line 202 of file mcp3208Ctrl.hpp.
Referenced by loadConfigImpl().
|
protected |
Measured semaphore period used as the synchronized delay-model WFS period.
Definition at line 166 of file mcp3208Ctrl.hpp.
Referenced by acquireSynchroAndCheckValid(), closeSynchroStream(), loadConfigImpl(), startAcquisition(), updateSynchroDelayController(), updateTimingDiagnosticsIndi(), and updateTriggerTiming().
|
protectedinherited |
The width of the image, once deinterlaced etc.
Definition at line 138 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 160 of file frameGrabber.hpp.
|
protectedinherited |
Definition at line 163 of file frameGrabber.hpp.
|
protectedinherited |
The x-binning according to the framegrabber.
Definition at line 144 of file frameGrabber.hpp.
|
protectedinherited |
The y-binning according to the framegrabber.
Definition at line 145 of file frameGrabber.hpp.
The timer-mode target interval in nanoseconds.
Definition at line 141 of file mcp3208Ctrl.hpp.
Referenced by acquireTimerAndCheckValid().
|
protectedinherited |
The name of the PID file.
Definition at line 497 of file MagAOXApp.hpp.