#include <frameGrabber.hpp>
Public Types | |
enum | fgFlip { fgFlipNone , fgFlipUD , fgFlipLR , fgFlipUDLR } |
Public Member Functions | |
int | setupConfig (mx::app::appConfigurator &config) |
Setup the configuration system. More... | |
int | loadConfig (mx::app::appConfigurator &config) |
load the configuration system results More... | |
int | appStartup () |
Startup function. More... | |
int | appLogic () |
Checks the framegrabber thread. More... | |
int | onPowerOff () |
On power off, sets m_reconfig to true. More... | |
int | appShutdown () |
Shuts down the framegrabber thread. More... | |
Telemeter Interface | |
int | recordFGTimings (bool force=false) |
Protected Types | |
typedef uint16_t | cbIndexT |
Protected Member Functions | |
void * | loadImageIntoStreamCopy (void *dest, void *src, size_t width, size_t height, size_t szof) |
Protected Attributes | |
int | m_currentFlip {fgFlipNone} |
uint32_t | m_width {0} |
The width of the image, once deinterlaced etc. More... | |
uint32_t | m_height {0} |
The height of the image, once deinterlaced etc. More... | |
uint8_t | m_dataType {0} |
The ImageStreamIO type code. More... | |
size_t | m_typeSize {0} |
The size of the type, in bytes. Result of sizeof. More... | |
int | m_xbinning {0} |
The x-binning according to the framegrabber. More... | |
int | m_ybinning {0} |
The y-binning according to the framegrabber. More... | |
timespec | m_currImageTimestamp {0,0} |
The timestamp of the current image. More... | |
bool | m_reconfig {false} |
Flag to set if a camera reconfiguration requires a framegrabber reset. More... | |
IMAGE * | m_imageStream {nullptr} |
The ImageStreamIO shared memory buffer. More... | |
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 {0,0} |
uint64_t | m_dummy_cnt {0} |
char | m_dummy_c {0} |
double | m_mna |
double | m_vara |
double | m_mnw |
double | m_varw |
double | m_mnwa |
double | m_varwa |
Configurable Parameters | |
std::string | m_shmimName {""} |
The name of the shared memory image, is used in /tmp/<shmimName>.im.shm . Derived classes should set a default. More... | |
int | m_fgThreadPrio {2} |
Priority of the framegrabber thread, should normally be > 00. More... | |
std::string | m_fgCpuset |
The cpuset to assign the framegrabber thread to. Not used if empty, the default. More... | |
uint32_t | m_circBuffLength {1} |
Length of the circular buffer, in frames. More... | |
uint16_t | m_latencyCircBuffMaxLength {3600} |
Maximum length of the latency measurement circular buffers. More... | |
float | m_latencyCircBuffMaxTime {5} |
Maximum time of the latency meaurement circular buffers. More... | |
int | m_defaultFlip {fgFlipNone} |
Private Member Functions | |
derivedT & | derived () |
Framegrabber Thread | |
bool | m_fgThreadInit {true} |
Synchronizer for thread startup, to allow priority setting to finish. More... | |
pid_t | m_fgThreadID {0} |
The ID of the framegrabber thread. More... | |
pcf::IndiProperty | m_fgThreadProp |
The property to hold the f.g. thread details. More... | |
std::thread | m_fgThread |
A separate thread for the actual framegrabbings. More... | |
static void | fgThreadStart (frameGrabber *o) |
Thread starter, called by MagAOXApp::threadStart on thread construction. Calls fgThreadExec. More... | |
void | fgThreadExec () |
Execute framegrabbing. More... | |
INDI | |
pcf::IndiProperty | m_indiP_shmimName |
Property used to report the shmim buffer name. More... | |
pcf::IndiProperty | m_indiP_frameSize |
Property used to report the current frame size. More... | |
pcf::IndiProperty | m_indiP_timing |
int | updateINDI () |
Update the INDI properties for this device controller. More... | |
MagAO-X generic frame grabber
The derived class derivedT
has the following requirements:
acquireAndCheckValid
>0 will indicate no data but not an error. In most cases, an appropriate state code, such as NOTCONNECTED, should be set as well.A static configuration variable must be defined in derivedT as
which determines whether or not the images can be flipped programatically.
Calls to this class's setupConfig
, loadConfig
, appStartup
, appLogic
, updateINDI
, and appShutdown
functions must be placed in the derived class's functions of the same name. For convenience the following macros are defined to provide error checking:
Definition at line 101 of file frameGrabber.hpp.
|
protected |
Definition at line 143 of file frameGrabber.hpp.
enum MagAOX::app::dev::frameGrabber::fgFlip |
Enumerator | |
---|---|
fgFlipNone | |
fgFlipUD | |
fgFlipLR | |
fgFlipUDLR |
Definition at line 104 of file frameGrabber.hpp.
int MagAOX::app::dev::frameGrabber< derivedT >::appLogic |
Checks the framegrabber thread.
This should be called in derivedT::appLogic
as
with appropriate error checking.
Definition at line 461 of file frameGrabber.hpp.
int MagAOX::app::dev::frameGrabber< derivedT >::appShutdown |
Shuts down the framegrabber thread.
This should be called in derivedT::appShutdown
as
with appropriate error checking.
Definition at line 552 of file frameGrabber.hpp.
Referenced by MagAOX::app::andorCtrl::appShutdown(), MagAOX::app::ocam2KCtrl::appShutdown(), MagAOX::app::picamCtrl::appShutdown(), MagAOX::app::qhyCtrl::appShutdown(), and MagAOX::app::zylaCtrl::appShutdown().
int MagAOX::app::dev::frameGrabber< derivedT >::appStartup |
Startup function.
Starts the framegrabber thread This should be called in derivedT::appStartup
as
with appropriate error checking.
Definition at line 394 of file frameGrabber.hpp.
|
inlineprivate |
Definition at line 306 of file frameGrabber.hpp.
|
protected |
Execute framegrabbing.
Definition at line 580 of file frameGrabber.hpp.
Referenced by MagAOX::app::dev::frameGrabber< derivedT >::fgThreadStart().
|
staticprotected |
Thread starter, called by MagAOXApp::threadStart on thread construction. Calls fgThreadExec.
[in] | o | a pointer to a frameGrabber instance (normally this) |
Definition at line 573 of file frameGrabber.hpp.
int MagAOX::app::dev::frameGrabber< derivedT >::loadConfig | ( | mx::app::appConfigurator & | config | ) |
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 337 of file frameGrabber.hpp.
Referenced by MagAOX::app::andorCtrl::loadConfig(), MagAOX::app::ocam2KCtrl::loadConfig(), MagAOX::app::picamCtrl::loadConfig(), MagAOX::app::qhyCtrl::loadConfig(), MagAOX::app::zylaCtrl::loadConfig(), and MagAOX::app::pvcamCtrl::loadConfigImpl().
|
protected |
Definition at line 761 of file frameGrabber.hpp.
int MagAOX::app::dev::frameGrabber< derivedT >::onPowerOff |
On power off, sets m_reconfig to true.
This should be called in derivedT::onPowerOff
as
with appropriate error checking.
Definition at line 530 of file frameGrabber.hpp.
int MagAOX::app::dev::frameGrabber< derivedT >::recordFGTimings | ( | bool | force = false | ) |
Definition at line 813 of file frameGrabber.hpp.
int MagAOX::app::dev::frameGrabber< derivedT >::setupConfig | ( | mx::app::appConfigurator & | config | ) |
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 313 of file frameGrabber.hpp.
Referenced by MagAOX::app::andorCtrl::setupConfig(), MagAOX::app::ocam2KCtrl::setupConfig(), MagAOX::app::picamCtrl::setupConfig(), MagAOX::app::pvcamCtrl::setupConfig(), MagAOX::app::qhyCtrl::setupConfig(), and MagAOX::app::zylaCtrl::setupConfig().
int MagAOX::app::dev::frameGrabber< derivedT >::updateINDI |
Update the INDI properties for this device controller.
You should call this once per main loop. It is not called automatically.
Definition at line 793 of file frameGrabber.hpp.
|
protected |
Definition at line 145 of file frameGrabber.hpp.
|
protected |
Definition at line 148 of file frameGrabber.hpp.
|
protected |
Length of the circular buffer, in frames.
Definition at line 116 of file frameGrabber.hpp.
|
protected |
Definition at line 125 of file frameGrabber.hpp.
|
protected |
The timestamp of the current image.
Definition at line 137 of file frameGrabber.hpp.
|
protected |
The ImageStreamIO type code.
Definition at line 130 of file frameGrabber.hpp.
|
protected |
Definition at line 121 of file frameGrabber.hpp.
|
protected |
Definition at line 154 of file frameGrabber.hpp.
|
protected |
Definition at line 153 of file frameGrabber.hpp.
|
protected |
Definition at line 152 of file frameGrabber.hpp.
|
protected |
The cpuset to assign the framegrabber thread to. Not used if empty, the default.
Definition at line 114 of file frameGrabber.hpp.
|
protected |
A separate thread for the actual framegrabbings.
Definition at line 253 of file frameGrabber.hpp.
|
protected |
The ID of the framegrabber thread.
Definition at line 249 of file frameGrabber.hpp.
|
protected |
Synchronizer for thread startup, to allow priority setting to finish.
Definition at line 247 of file frameGrabber.hpp.
|
protected |
Priority of the framegrabber thread, should normally be > 00.
Definition at line 113 of file frameGrabber.hpp.
|
protected |
The property to hold the f.g. thread details.
Definition at line 251 of file frameGrabber.hpp.
|
protected |
The height of the image, once deinterlaced etc.
Definition at line 128 of file frameGrabber.hpp.
|
protected |
The ImageStreamIO shared memory buffer.
Definition at line 141 of file frameGrabber.hpp.
|
protected |
Property used to report the current frame size.
Definition at line 281 of file frameGrabber.hpp.
|
protected |
Property used to report the shmim buffer name.
Definition at line 279 of file frameGrabber.hpp.
|
protected |
Definition at line 283 of file frameGrabber.hpp.
|
protected |
Maximum length of the latency measurement circular buffers.
Definition at line 118 of file frameGrabber.hpp.
|
protected |
Maximum time of the latency meaurement circular buffers.
Definition at line 119 of file frameGrabber.hpp.
|
protected |
Definition at line 156 of file frameGrabber.hpp.
|
protected |
Definition at line 159 of file frameGrabber.hpp.
|
protected |
Definition at line 162 of file frameGrabber.hpp.
|
protected |
Flag to set if a camera reconfiguration requires a framegrabber reset.
Definition at line 139 of file frameGrabber.hpp.
|
protected |
The name of the shared memory image, is used in /tmp/<shmimName>.im.shm
. Derived classes should set a default.
Definition at line 111 of file frameGrabber.hpp.
|
protected |
The size of the type, in bytes. Result of sizeof.
Definition at line 131 of file frameGrabber.hpp.
|
protected |
Definition at line 157 of file frameGrabber.hpp.
|
protected |
Definition at line 160 of file frameGrabber.hpp.
|
protected |
Definition at line 163 of file frameGrabber.hpp.
|
protected |
Definition at line 150 of file frameGrabber.hpp.
|
protected |
The width of the image, once deinterlaced etc.
Definition at line 127 of file frameGrabber.hpp.
|
protected |
Definition at line 146 of file frameGrabber.hpp.
|
protected |
Definition at line 149 of file frameGrabber.hpp.
|
protected |
The x-binning according to the framegrabber.
Definition at line 133 of file frameGrabber.hpp.
|
protected |
The y-binning according to the framegrabber.
Definition at line 134 of file frameGrabber.hpp.