TwiceAsNice  2019-02-18
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
DetectorDevice Class Reference

The DetectorDevice class provides functionality of a Detector Device within a Detector. More...

#include <indidetector.h>

Collaboration diagram for DetectorDevice:
Collaboration graph

Public Types

enum  DETECTOR_INFO_INDEX {
  DETECTOR_SAMPLERATE, DETECTOR_FREQUENCY, DETECTOR_BITSPERSAMPLE, DETECTOR_SAMPLERATE,
  DETECTOR_FREQUENCY, DETECTOR_BITSPERSAMPLE
}
 
enum  DETECTOR_BLOB_INDEX { DETECTOR_BLOB_CONTINUUM, DETECTOR_BLOB_SPECTRUM, DETECTOR_BLOB_CONTINUUM, DETECTOR_BLOB_SPECTRUM }
 
enum  DETECTOR_INFO_INDEX {
  DETECTOR_SAMPLERATE, DETECTOR_FREQUENCY, DETECTOR_BITSPERSAMPLE, DETECTOR_SAMPLERATE,
  DETECTOR_FREQUENCY, DETECTOR_BITSPERSAMPLE
}
 
enum  DETECTOR_BLOB_INDEX { DETECTOR_BLOB_CONTINUUM, DETECTOR_BLOB_SPECTRUM, DETECTOR_BLOB_CONTINUUM, DETECTOR_BLOB_SPECTRUM }
 

Public Member Functions

 DetectorDevice ()
 
 ~DetectorDevice ()
 
int getBPS ()
 getBPS Get Detector depth (bits per sample). More...
 
int getContinuumBufferSize ()
 getContinuumBufferSize Get allocated continuum buffer size to hold the Detector captured stream. More...
 
int getSpectrumBufferSize ()
 getSpectrumBufferSize Get allocated spectrum buffer size to hold the Detector spectrum. More...
 
double getCaptureLeft ()
 getCaptureLeft Get Capture time left in seconds. More...
 
double getSampleRate ()
 getSampleRate Get requested SampleRate for the Detector device in Hz. More...
 
double getFrequency ()
 getSamplingFrequency Get requested Capture frequency for the Detector device in Hz. More...
 
double getCaptureDuration ()
 getCaptureDuration Get requested Capture duration for the Detector device in seconds. More...
 
const char * getCaptureStartTime ()
 getCaptureStartTime More...
 
uint8_tgetContinuumBuffer ()
 getContinuumBuffer Get raw buffer of the continuum stream of the Detector device. More...
 
double * getSpectrumBuffer ()
 getSpectrumBuffer Get raw buffer of the spectrum of the Detector device. More...
 
void setContinuumBuffer (uint8_t *buffer)
 setContinuumBuffer Set raw frame buffer pointer. More...
 
void setSpectrumBuffer (double *buffer)
 setSpectrumBuffer Set raw frame buffer pointer. More...
 
INumberVectorPropertygetDetectorSettings ()
 Return Detector Info Property. More...
 
void setMinMaxStep (const char *property, const char *element, double min, double max, double step, bool sendToClient=true)
 setMinMaxStep for a number property element More...
 
void setContinuumBufferSize (int nbuf, bool allocMem=true)
 setContinuumBufferSize Set desired continuum buffer size. More...
 
void setSpectrumBufferSize (int nbuf, bool allocMem=true)
 setSpectrumBufferSize Set desired spectrum buffer size. More...
 
void setSampleRate (float sr)
 setSampleRate Set depth of Detector device. More...
 
void setFrequency (float freq)
 setFrequency Set the frequency observed. More...
 
void setBPS (int bps)
 setBPP Set depth of Detector device. More...
 
void setCaptureDuration (double duration)
 setCaptureDuration Set desired Detector frame Capture duration for next Capture. More...
 
void setCaptureLeft (double duration)
 setCaptureLeft Update Capture time left. More...
 
void setCaptureFailed ()
 setCaptureFailed Alert the client that the Capture failed. More...
 
int getNAxis () const
 
void setNAxis (int value)
 setNAxis Set FITS number of axis More...
 
void setCaptureExtension (const char *ext)
 setCaptureExtension Set capture exntension More...
 
char * getCaptureExtension ()
 
bool isCapturing ()
 
 DetectorDevice ()
 
 ~DetectorDevice ()
 
int getBPS ()
 getBPS Get Detector depth (bits per sample). More...
 
int getContinuumBufferSize ()
 getContinuumBufferSize Get allocated continuum buffer size to hold the Detector captured stream. More...
 
int getSpectrumBufferSize ()
 getSpectrumBufferSize Get allocated spectrum buffer size to hold the Detector spectrum. More...
 
double getCaptureLeft ()
 getCaptureLeft Get Capture time left in seconds. More...
 
double getSampleRate ()
 getSampleRate Get requested SampleRate for the Detector device in Hz. More...
 
double getFrequency ()
 getSamplingFrequency Get requested Capture frequency for the Detector device in Hz. More...
 
double getCaptureDuration ()
 getCaptureDuration Get requested Capture duration for the Detector device in seconds. More...
 
const char * getCaptureStartTime ()
 getCaptureStartTime More...
 
uint8_tgetContinuumBuffer ()
 getContinuumBuffer Get raw buffer of the continuum stream of the Detector device. More...
 
double * getSpectrumBuffer ()
 getSpectrumBuffer Get raw buffer of the spectrum of the Detector device. More...
 
void setContinuumBuffer (uint8_t *buffer)
 setContinuumBuffer Set raw frame buffer pointer. More...
 
void setSpectrumBuffer (double *buffer)
 setSpectrumBuffer Set raw frame buffer pointer. More...
 
INumberVectorPropertygetDetectorSettings ()
 Return Detector Info Property. More...
 
void setMinMaxStep (const char *property, const char *element, double min, double max, double step, bool sendToClient=true)
 setMinMaxStep for a number property element More...
 
void setContinuumBufferSize (int nbuf, bool allocMem=true)
 setContinuumBufferSize Set desired continuum buffer size. More...
 
void setSpectrumBufferSize (int nbuf, bool allocMem=true)
 setSpectrumBufferSize Set desired spectrum buffer size. More...
 
void setSampleRate (float sr)
 setSampleRate Set depth of Detector device. More...
 
void setFrequency (float freq)
 setFrequency Set the frequency observed. More...
 
void setBPS (int bps)
 setBPP Set depth of Detector device. More...
 
void setCaptureDuration (double duration)
 setCaptureDuration Set desired Detector frame Capture duration for next Capture. More...
 
void setCaptureLeft (double duration)
 setCaptureLeft Update Capture time left. More...
 
void setCaptureFailed ()
 setCaptureFailed Alert the client that the Capture failed. More...
 
int getNAxis () const
 
void setNAxis (int value)
 setNAxis Set FITS number of axis More...
 
void setCaptureExtension (const char *ext)
 setCaptureExtension Set capture exntension More...
 
char * getCaptureExtension ()
 
bool isCapturing ()
 

Private Attributes

int NAxis
 

of Axis

More...
 
int BPS
 Bytes per Sample. More...
 
double samplerate
 
double Frequency
 
uint8_tContinuumBuffer
 
int ContinuumBufferSize
 
double * SpectrumBuffer
 
int SpectrumBufferSize
 
double captureDuration
 
timeval startCaptureTime
 
char captureExtention [MAXINDIBLOBFMT]
 
INumberVectorProperty FramedCaptureNP
 
INumber FramedCaptureN [1]
 
INumberVectorProperty DetectorSettingsNP
 
INumber DetectorSettingsN [4]
 
ISwitchVectorProperty AbortCaptureSP
 
ISwitch AbortCaptureS [1]
 
IBLOB FitsB [2]
 
IBLOBVectorProperty FitsBP
 

Friends

class INDI::Detector
 

Detailed Description

The DetectorDevice class provides functionality of a Detector Device within a Detector.

Member Enumeration Documentation

◆ DETECTOR_BLOB_INDEX [1/2]

Enumerator
DETECTOR_BLOB_CONTINUUM 
DETECTOR_BLOB_SPECTRUM 
DETECTOR_BLOB_CONTINUUM 
DETECTOR_BLOB_SPECTRUM 

◆ DETECTOR_BLOB_INDEX [2/2]

Enumerator
DETECTOR_BLOB_CONTINUUM 
DETECTOR_BLOB_SPECTRUM 
DETECTOR_BLOB_CONTINUUM 
DETECTOR_BLOB_SPECTRUM 

◆ DETECTOR_INFO_INDEX [1/2]

Enumerator
DETECTOR_SAMPLERATE 
DETECTOR_FREQUENCY 
DETECTOR_BITSPERSAMPLE 
DETECTOR_SAMPLERATE 
DETECTOR_FREQUENCY 
DETECTOR_BITSPERSAMPLE 

◆ DETECTOR_INFO_INDEX [2/2]

Enumerator
DETECTOR_SAMPLERATE 
DETECTOR_FREQUENCY 
DETECTOR_BITSPERSAMPLE 
DETECTOR_SAMPLERATE 
DETECTOR_FREQUENCY 
DETECTOR_BITSPERSAMPLE 

Constructor & Destructor Documentation

◆ DetectorDevice() [1/2]

DetectorDevice::DetectorDevice ( )

◆ ~DetectorDevice() [1/2]

DetectorDevice::~DetectorDevice ( )

◆ DetectorDevice() [2/2]

DetectorDevice::DetectorDevice ( )

◆ ~DetectorDevice() [2/2]

DetectorDevice::~DetectorDevice ( )

Member Function Documentation

◆ getBPS() [1/2]

int DetectorDevice::getBPS ( )
inline

getBPS Get Detector depth (bits per sample).

Returns
bits per sample.

◆ getBPS() [2/2]

int DetectorDevice::getBPS ( )
inline

getBPS Get Detector depth (bits per sample).

Returns
bits per sample.

◆ getCaptureDuration() [1/2]

double DetectorDevice::getCaptureDuration ( )
inline

getCaptureDuration Get requested Capture duration for the Detector device in seconds.

Returns
requested Capture duration for the Detector device in seconds.

◆ getCaptureDuration() [2/2]

double DetectorDevice::getCaptureDuration ( )
inline

getCaptureDuration Get requested Capture duration for the Detector device in seconds.

Returns
requested Capture duration for the Detector device in seconds.

◆ getCaptureExtension() [1/2]

char* DetectorDevice::getCaptureExtension ( )
inline
Returns
Return capture extension (fits, jpeg, raw..etc)

◆ getCaptureExtension() [2/2]

char* DetectorDevice::getCaptureExtension ( )
inline
Returns
Return capture extension (fits, jpeg, raw..etc)

◆ getCaptureLeft() [1/2]

double DetectorDevice::getCaptureLeft ( )
inline

getCaptureLeft Get Capture time left in seconds.

Returns
Capture time left in seconds.

◆ getCaptureLeft() [2/2]

double DetectorDevice::getCaptureLeft ( )
inline

getCaptureLeft Get Capture time left in seconds.

Returns
Capture time left in seconds.

◆ getCaptureStartTime() [1/2]

const char * DetectorDevice::getCaptureStartTime ( )

getCaptureStartTime

Returns
Capture start time in ISO 8601 format.

◆ getCaptureStartTime() [2/2]

const char* DetectorDevice::getCaptureStartTime ( )

getCaptureStartTime

Returns
Capture start time in ISO 8601 format.

◆ getContinuumBuffer() [1/2]

uint8_t* DetectorDevice::getContinuumBuffer ( )
inline

getContinuumBuffer Get raw buffer of the continuum stream of the Detector device.

Returns
raw continuum buffer of the Detector device.

◆ getContinuumBuffer() [2/2]

uint8_t* DetectorDevice::getContinuumBuffer ( )
inline

getContinuumBuffer Get raw buffer of the continuum stream of the Detector device.

Returns
raw continuum buffer of the Detector device.

◆ getContinuumBufferSize() [1/2]

int DetectorDevice::getContinuumBufferSize ( )
inline

getContinuumBufferSize Get allocated continuum buffer size to hold the Detector captured stream.

Returns
allocated continuum buffer size to hold the Detector capture stream.

◆ getContinuumBufferSize() [2/2]

int DetectorDevice::getContinuumBufferSize ( )
inline

getContinuumBufferSize Get allocated continuum buffer size to hold the Detector captured stream.

Returns
allocated continuum buffer size to hold the Detector capture stream.

◆ getDetectorSettings() [1/2]

INumberVectorProperty* DetectorDevice::getDetectorSettings ( )
inline

Return Detector Info Property.

◆ getDetectorSettings() [2/2]

INumberVectorProperty* DetectorDevice::getDetectorSettings ( )
inline

Return Detector Info Property.

◆ getFrequency() [1/2]

double DetectorDevice::getFrequency ( )
inline

getSamplingFrequency Get requested Capture frequency for the Detector device in Hz.

Returns
requested Capture frequency for the Detector device in Hz.

◆ getFrequency() [2/2]

double DetectorDevice::getFrequency ( )
inline

getSamplingFrequency Get requested Capture frequency for the Detector device in Hz.

Returns
requested Capture frequency for the Detector device in Hz.

◆ getNAxis() [1/2]

int DetectorDevice::getNAxis ( ) const
Returns
Get number of FITS axis in capture. By default 2

◆ getNAxis() [2/2]

int DetectorDevice::getNAxis ( ) const
Returns
Get number of FITS axis in capture. By default 2

◆ getSampleRate() [1/2]

double DetectorDevice::getSampleRate ( )
inline

getSampleRate Get requested SampleRate for the Detector device in Hz.

Returns
requested SampleRate for the Detector device in Hz.

◆ getSampleRate() [2/2]

double DetectorDevice::getSampleRate ( )
inline

getSampleRate Get requested SampleRate for the Detector device in Hz.

Returns
requested SampleRate for the Detector device in Hz.

◆ getSpectrumBuffer() [1/2]

double* DetectorDevice::getSpectrumBuffer ( )
inline

getSpectrumBuffer Get raw buffer of the spectrum of the Detector device.

Returns
raw continuum buffer of the Detector device.

◆ getSpectrumBuffer() [2/2]

double* DetectorDevice::getSpectrumBuffer ( )
inline

getSpectrumBuffer Get raw buffer of the spectrum of the Detector device.

Returns
raw continuum buffer of the Detector device.

◆ getSpectrumBufferSize() [1/2]

int DetectorDevice::getSpectrumBufferSize ( )
inline

getSpectrumBufferSize Get allocated spectrum buffer size to hold the Detector spectrum.

Returns
allocated spectrum buffer size (in doubles) to hold the Detector spectrum.

◆ getSpectrumBufferSize() [2/2]

int DetectorDevice::getSpectrumBufferSize ( )
inline

getSpectrumBufferSize Get allocated spectrum buffer size to hold the Detector spectrum.

Returns
allocated spectrum buffer size (in doubles) to hold the Detector spectrum.

◆ isCapturing() [1/2]

bool DetectorDevice::isCapturing ( )
inline
Returns
True if Detector is currently exposing, false otherwise.

◆ isCapturing() [2/2]

bool DetectorDevice::isCapturing ( )
inline
Returns
True if Detector is currently exposing, false otherwise.

◆ setBPS() [1/2]

void DetectorDevice::setBPS ( int  bps)

setBPP Set depth of Detector device.

Parameters
bppbits per pixel

◆ setBPS() [2/2]

void DetectorDevice::setBPS ( int  bps)

setBPP Set depth of Detector device.

Parameters
bppbits per pixel

◆ setCaptureDuration() [1/2]

void DetectorDevice::setCaptureDuration ( double  duration)

setCaptureDuration Set desired Detector frame Capture duration for next Capture.

You must call this function immediately before starting the actual Capture as it is used to calculate the timestamp used for the FITS header.

Parameters
durationCapture duration in seconds.

◆ setCaptureDuration() [2/2]

void DetectorDevice::setCaptureDuration ( double  duration)

setCaptureDuration Set desired Detector frame Capture duration for next Capture.

You must call this function immediately before starting the actual Capture as it is used to calculate the timestamp used for the FITS header.

Parameters
durationCapture duration in seconds.

◆ setCaptureExtension() [1/2]

void DetectorDevice::setCaptureExtension ( const char *  ext)

setCaptureExtension Set capture exntension

Parameters
extextension (fits, jpeg, raw..etc)

◆ setCaptureExtension() [2/2]

void DetectorDevice::setCaptureExtension ( const char *  ext)

setCaptureExtension Set capture exntension

Parameters
extextension (fits, jpeg, raw..etc)

◆ setCaptureFailed() [1/2]

void DetectorDevice::setCaptureFailed ( )

setCaptureFailed Alert the client that the Capture failed.

◆ setCaptureFailed() [2/2]

void DetectorDevice::setCaptureFailed ( )

setCaptureFailed Alert the client that the Capture failed.

◆ setCaptureLeft() [1/2]

void DetectorDevice::setCaptureLeft ( double  duration)

setCaptureLeft Update Capture time left.

Inform the client of the new Capture time left value.

Parameters
durationCapture duration left in seconds.

◆ setCaptureLeft() [2/2]

void DetectorDevice::setCaptureLeft ( double  duration)

setCaptureLeft Update Capture time left.

Inform the client of the new Capture time left value.

Parameters
durationCapture duration left in seconds.

◆ setContinuumBuffer() [1/2]

void DetectorDevice::setContinuumBuffer ( uint8_t buffer)
inline

setContinuumBuffer Set raw frame buffer pointer.

Parameters
bufferpointer to continuum buffer /note Detector Device allocates the frame buffer internally once SetContinuumBufferSize is called with allocMem set to true which is the default behavior. If you allocated the memory yourself (i.e. allocMem is false), then you must call this function to set the pointer to the raw frame buffer.

◆ setContinuumBuffer() [2/2]

void DetectorDevice::setContinuumBuffer ( uint8_t buffer)
inline

setContinuumBuffer Set raw frame buffer pointer.

Parameters
bufferpointer to continuum buffer /note Detector Device allocates the frame buffer internally once SetContinuumBufferSize is called with allocMem set to true which is the default behavior. If you allocated the memory yourself (i.e. allocMem is false), then you must call this function to set the pointer to the raw frame buffer.

◆ setContinuumBufferSize() [1/2]

void DetectorDevice::setContinuumBufferSize ( int  nbuf,
bool  allocMem = true 
)

setContinuumBufferSize Set desired continuum buffer size.

The function will allocate memory accordingly. The frame size depends on the desired capture time, sampling frequency, and sample depth of the Detector device (bps). You must set the frame size any time any of the prior parameters gets updated.

Parameters
nbufsize of buffer in bytes.
allocMemif True, it will allocate memory of nbut size bytes.

◆ setContinuumBufferSize() [2/2]

void DetectorDevice::setContinuumBufferSize ( int  nbuf,
bool  allocMem = true 
)

setContinuumBufferSize Set desired continuum buffer size.

The function will allocate memory accordingly. The frame size depends on the desired capture time, sampling frequency, and sample depth of the Detector device (bps). You must set the frame size any time any of the prior parameters gets updated.

Parameters
nbufsize of buffer in bytes.
allocMemif True, it will allocate memory of nbut size bytes.

◆ setFrequency() [1/2]

void DetectorDevice::setFrequency ( float  freq)

setFrequency Set the frequency observed.

Parameters
capfreqCapture frequency

◆ setFrequency() [2/2]

void DetectorDevice::setFrequency ( float  freq)

setFrequency Set the frequency observed.

Parameters
capfreqCapture frequency

◆ setMinMaxStep() [1/2]

void DetectorDevice::setMinMaxStep ( const char *  property,
const char *  element,
double  min,
double  max,
double  step,
bool  sendToClient = true 
)

setMinMaxStep for a number property element

Parameters
propertyProperty name
elementElement name
minMinimum element value
maxMaximum element value
stepElement step value
sendToClientIf true (default), the element limits are updated and is sent to the client. If false, the element limits are updated without getting sent to the client.

◆ setMinMaxStep() [2/2]

void DetectorDevice::setMinMaxStep ( const char *  property,
const char *  element,
double  min,
double  max,
double  step,
bool  sendToClient = true 
)

setMinMaxStep for a number property element

Parameters
propertyProperty name
elementElement name
minMinimum element value
maxMaximum element value
stepElement step value
sendToClientIf true (default), the element limits are updated and is sent to the client. If false, the element limits are updated without getting sent to the client.

◆ setNAxis() [1/2]

void DetectorDevice::setNAxis ( int  value)

setNAxis Set FITS number of axis

Parameters
valuenumber of axis

◆ setNAxis() [2/2]

void DetectorDevice::setNAxis ( int  value)

setNAxis Set FITS number of axis

Parameters
valuenumber of axis

◆ setSampleRate() [1/2]

void DetectorDevice::setSampleRate ( float  sr)

setSampleRate Set depth of Detector device.

Parameters
bppbits per pixel

◆ setSampleRate() [2/2]

void DetectorDevice::setSampleRate ( float  sr)

setSampleRate Set depth of Detector device.

Parameters
bppbits per pixel

◆ setSpectrumBuffer() [1/2]

void DetectorDevice::setSpectrumBuffer ( double *  buffer)
inline

setSpectrumBuffer Set raw frame buffer pointer.

Parameters
bufferpointer to spectrum buffer /note Detector Device allocates the frame buffer internally once SetSpectrumBufferSize is called with allocMem set to true which is the default behavior. If you allocated the memory yourself (i.e. allocMem is false), then you must call this function to set the pointer to the raw frame buffer.

◆ setSpectrumBuffer() [2/2]

void DetectorDevice::setSpectrumBuffer ( double *  buffer)
inline

setSpectrumBuffer Set raw frame buffer pointer.

Parameters
bufferpointer to spectrum buffer /note Detector Device allocates the frame buffer internally once SetSpectrumBufferSize is called with allocMem set to true which is the default behavior. If you allocated the memory yourself (i.e. allocMem is false), then you must call this function to set the pointer to the raw frame buffer.

◆ setSpectrumBufferSize() [1/2]

void DetectorDevice::setSpectrumBufferSize ( int  nbuf,
bool  allocMem = true 
)

setSpectrumBufferSize Set desired spectrum buffer size.

The function will allocate memory accordingly. The frame size depends on the size of the spectrum. You must set the frame size any time the spectrum size changes.

Parameters
nbufsize of buffer in doubles.
allocMemif True, it will allocate memory of nbut size doubles.

◆ setSpectrumBufferSize() [2/2]

void DetectorDevice::setSpectrumBufferSize ( int  nbuf,
bool  allocMem = true 
)

setSpectrumBufferSize Set desired spectrum buffer size.

The function will allocate memory accordingly. The frame size depends on the size of the spectrum. You must set the frame size any time the spectrum size changes.

Parameters
nbufsize of buffer in doubles.
allocMemif True, it will allocate memory of nbut size doubles.

Friends And Related Function Documentation

◆ INDI::Detector

Member Data Documentation

◆ AbortCaptureS

ISwitch DetectorDevice::AbortCaptureS
private

◆ AbortCaptureSP

ISwitchVectorProperty DetectorDevice::AbortCaptureSP
private

◆ BPS

int DetectorDevice::BPS
private

Bytes per Sample.

◆ captureDuration

double DetectorDevice::captureDuration
private

◆ captureExtention

char DetectorDevice::captureExtention
private

◆ ContinuumBuffer

uint8_t * DetectorDevice::ContinuumBuffer
private

◆ ContinuumBufferSize

int DetectorDevice::ContinuumBufferSize
private

◆ DetectorSettingsN

INumber DetectorDevice::DetectorSettingsN
private

◆ DetectorSettingsNP

INumberVectorProperty DetectorDevice::DetectorSettingsNP
private

◆ FitsB

IBLOB DetectorDevice::FitsB
private

◆ FitsBP

IBLOBVectorProperty DetectorDevice::FitsBP
private

◆ FramedCaptureN

INumber DetectorDevice::FramedCaptureN
private

◆ FramedCaptureNP

INumberVectorProperty DetectorDevice::FramedCaptureNP
private

◆ Frequency

double DetectorDevice::Frequency
private

◆ NAxis

int DetectorDevice::NAxis
private

of Axis

◆ samplerate

double DetectorDevice::samplerate
private

◆ SpectrumBuffer

double * DetectorDevice::SpectrumBuffer
private

◆ SpectrumBufferSize

int DetectorDevice::SpectrumBufferSize
private

◆ startCaptureTime

timeval DetectorDevice::startCaptureTime
private

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