API
MagAOX::app::dev::edtCamera< derivedT > Class Template Reference

MagAO-X EDT framegrabber interface. More...

#include <edtCamera.hpp>

Inheritance diagram for MagAOX::app::dev::edtCamera< derivedT >:
Inheritance graph
Collaboration diagram for MagAOX::app::dev::edtCamera< derivedT >:
Collaboration graph

Public Member Functions

 edtCamera ()
 C'tor, sets up stdCamera. More...
 
 ~edtCamera () noexcept
 Destructor, destroys the PdvDev structure. More...
 
int pdvSerialWriteRead (std::string &response, const std::string &command)
 Send a serial command over cameralink and retrieve the response. More...
 
int pdvConfig (std::string &cfgname)
 Configure the EDT framegrabber. More...
 
void setupConfig (mx::app::appConfigurator &config)
 Setup the configuration system. More...
 
void loadConfig (mx::app::appConfigurator &config)
 load the configuration system results More...
 
int appStartup ()
 Startup function. More...
 
int appLogic ()
 Application logic. More...
 
int onPowerOff ()
 Actions on power off. More...
 
int whilePowerOff ()
 Actions while powered off. More...
 
int appShutdown ()
 Application the shutdown. More...
 
int pdvStartAcquisition ()
 
int pdvAcquire (timespec &currImageTimestamp)
 
int pdvReconfig ()
 
INDI
int updateINDI ()
 The static callback function to be registered for the channel properties. More...
 

Public Attributes

unsigned m_readTimeout {1000}
 The read timeout [msec]. More...
 
unsigned m_writeTimeout {1000}
 The write timeout [msec]. More...
 

Protected Attributes

PdvDev * m_pdv {nullptr}
 The EDT PDV device handle. More...
 
u_char * m_image_p {nullptr}
 The image data grabbed. More...
 
int m_raw_height {0}
 The height of the frame, according to the framegrabber. More...
 
int m_raw_width {0}
 The width of the frame, according to the framegrabber. More...
 
int m_raw_depth {0}
 The bit-depth of the frame, according to the framegrabber. More...
 
std::string m_cameraType
 The camera type according to the framegrabber. More...
 
Configurable Parameters
int m_unit {0}
 EDT PDV board unit number. More...
 
int m_channel {0}
 EDT PDV board channel number. More...
 
int m_numBuffs {4}
 EDT PDV DMA buffer size, indicating number of images. More...
 

Private Member Functions

derivedT & derived ()
 

Detailed Description

template<class derivedT>
class MagAOX::app::dev::edtCamera< derivedT >

MagAO-X EDT framegrabber interface.

Implements an interface to the EDT PDV SDK

The derived class derivedT must be a MagAOXApp<true>, and must declare this class a friend like so:

friend class dev::dssShutter<derivedT>;

A static configuration variable must be defined in derivedT as

static constexpr bool c_edtCamera_relativeConfigPath = true; //or: false

which determines whether or not the EDT config path is relative to the MagAO-X config path (true) or absolute (false).

In addition, derivedT should be dev::frameGrabber or equivalent, with an m_reconfig member, and calls to this class's pdvStartAcquisition, pdvAcquire, and pdvReconfig in the relevant dev::frameGrabber implementation functions.

Calls to this class's setupConfig, loadConfig, appStartup, appLogic, appShutdown onPowerOff, and whilePowerOff, must be placed in the derived class's functions of the same name.

Definition at line 56 of file edtCamera.hpp.

Constructor & Destructor Documentation

◆ edtCamera()

template<class derivedT >
MagAOX::app::dev::edtCamera< derivedT >::edtCamera

C'tor, sets up stdCamera.

Definition at line 247 of file edtCamera.hpp.

◆ ~edtCamera()

template<class derivedT >
MagAOX::app::dev::edtCamera< derivedT >::~edtCamera
noexcept

Destructor, destroys the PdvDev structure.

Definition at line 253 of file edtCamera.hpp.

Member Function Documentation

◆ appLogic()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::appLogic

Application logic.

Checks the edtCamera thread

This should be called from the derived's appLogic() as in

with appropriate error checking.

Returns
0 on success
-1 on error, which is logged.

Definition at line 473 of file edtCamera.hpp.

◆ appShutdown()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::appShutdown

Application the shutdown.

Shuts down the edtCamera thread

with appropriate error checking.

Returns
0 on success
-1 on error, which is logged.

Definition at line 492 of file edtCamera.hpp.

Referenced by MagAOX::app::ocam2KCtrl::appShutdown().

◆ appStartup()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::appStartup

Startup function.

This should be called in derivedT::appStartup as

with appropriate error checking.

Returns
0 on success
-1 on error, which is logged.

Definition at line 460 of file edtCamera.hpp.

◆ derived()

template<class derivedT >
derivedT& MagAOX::app::dev::edtCamera< derivedT >::derived ( )
inlineprivate

Definition at line 240 of file edtCamera.hpp.

◆ loadConfig()

template<class derivedT >
void MagAOX::app::dev::edtCamera< derivedT >::loadConfig ( mx::app::appConfigurator &  config)

load the configuration system results

This should be called in derivedT::loadConfig as

void loadConfig(mx::app::appConfigurator &config)
load the configuration system results
Definition: edtCamera.hpp:446

with appropriate error checking.

Parameters
[in]configthe derived classes configurator

Definition at line 446 of file edtCamera.hpp.

Referenced by MagAOX::app::andorCtrl::loadConfig(), and MagAOX::app::ocam2KCtrl::loadConfig().

◆ onPowerOff()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::onPowerOff

Actions on power off.

This should be called from the derived's onPowerOff() as in

with appropriate error checking.

Returns
0 on success
-1 on error, which is logged.

Definition at line 480 of file edtCamera.hpp.

◆ pdvAcquire()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::pdvAcquire ( timespec &  currImageTimestamp)

Definition at line 506 of file edtCamera.hpp.

◆ pdvConfig()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::pdvConfig ( std::string &  cfgname)

Configure the EDT framegrabber.

Parameters
[in]cfgnameThe configuration name for the mode to set

Definition at line 321 of file edtCamera.hpp.

◆ pdvReconfig()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::pdvReconfig

Definition at line 522 of file edtCamera.hpp.

◆ pdvSerialWriteRead()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::pdvSerialWriteRead ( std::string &  response,
const std::string &  command 
)

Send a serial command over cameralink and retrieve the response.

Parameters
[out]responsethe response to the command from the device
[in]commandthe command to send to the device

Definition at line 264 of file edtCamera.hpp.

◆ pdvStartAcquisition()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::pdvStartAcquisition

Definition at line 498 of file edtCamera.hpp.

◆ setupConfig()

template<class derivedT >
void MagAOX::app::dev::edtCamera< derivedT >::setupConfig ( mx::app::appConfigurator &  config)

Setup the configuration system.

This should be called in derivedT::setupConfig as

void setupConfig(mx::app::appConfigurator &config)
Setup the configuration system.
Definition: edtCamera.hpp:436

with appropriate error checking.

Parameters
[out]configthe derived classes configurator

Definition at line 436 of file edtCamera.hpp.

Referenced by MagAOX::app::andorCtrl::setupConfig(), and MagAOX::app::ocam2KCtrl::setupConfig().

◆ updateINDI()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::updateINDI

The static callback function to be registered for the channel properties.

Returns
0 on success.
-1 on error. The callback called by the static version, to actually process the new request.
0 on success.
-1 on error. Update the INDI properties for this device controller You should call this once per main loop. It is not called automatically.
0 on success.
-1 on error.

Definition at line 541 of file edtCamera.hpp.

◆ whilePowerOff()

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::whilePowerOff

Actions while powered off.

This should be called from the derived's whilePowerOff() as in

int whilePowerOff()
Actions while powered off.
Definition: edtCamera.hpp:486

with appropriate error checking.

Returns
0 on success
-1 on error, which is logged.

Definition at line 486 of file edtCamera.hpp.

Member Data Documentation

◆ m_cameraType

template<class derivedT >
std::string MagAOX::app::dev::edtCamera< derivedT >::m_cameraType
protected

The camera type according to the framegrabber.

Definition at line 89 of file edtCamera.hpp.

◆ m_channel

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::m_channel {0}
protected

EDT PDV board channel number.

Definition at line 69 of file edtCamera.hpp.

◆ m_image_p

template<class derivedT >
u_char* MagAOX::app::dev::edtCamera< derivedT >::m_image_p {nullptr}
protected

The image data grabbed.

Definition at line 80 of file edtCamera.hpp.

◆ m_numBuffs

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::m_numBuffs {4}
protected

EDT PDV DMA buffer size, indicating number of images.

Definition at line 70 of file edtCamera.hpp.

◆ m_pdv

template<class derivedT >
PdvDev* MagAOX::app::dev::edtCamera< derivedT >::m_pdv {nullptr}
protected

The EDT PDV device handle.

Definition at line 78 of file edtCamera.hpp.

◆ m_raw_depth

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::m_raw_depth {0}
protected

The bit-depth of the frame, according to the framegrabber.

Definition at line 88 of file edtCamera.hpp.

◆ m_raw_height

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::m_raw_height {0}
protected

The height of the frame, according to the framegrabber.

Definition at line 86 of file edtCamera.hpp.

◆ m_raw_width

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::m_raw_width {0}
protected

The width of the frame, according to the framegrabber.

Definition at line 87 of file edtCamera.hpp.

◆ m_readTimeout

◆ m_unit

template<class derivedT >
int MagAOX::app::dev::edtCamera< derivedT >::m_unit {0}
protected

EDT PDV board unit number.

Definition at line 68 of file edtCamera.hpp.

◆ m_writeTimeout


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