Instrument Neutral Distributed Interface INDI  1.9.2
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
INDI::SensorInterface Class Reference

The SensorDevice class provides functionality of a Sensor Device within a Sensor. More...

#include <indisensorinterface.h>

Inheritance diagram for INDI::SensorInterface:
INDI::DefaultDevice INDI::BaseDevice INDI::Correlator INDI::Detector INDI::Receiver INDI::Spectrograph RadioSim RTLSDR SimpleReceiver

Public Types

enum  {
  SENSOR_CAN_ABORT = 1<<0, SENSOR_HAS_STREAMING = 1<<1, SENSOR_HAS_SHUTTER = 1<<2, SENSOR_HAS_COOLER = 1<<3,
  SENSOR_HAS_DSP = 1<<4, SENSOR_MAX_CAPABILITY = 1<<5
}
 
enum  { CONNECTION_NONE = 1 << 0, CONNECTION_SERIAL = 1 << 1, CONNECTION_TCP = 1 << 2 }
 
- Public Types inherited from INDI::BaseDevice
enum  INDI_ERROR { INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4 }
 
enum  { INDI_ENABLED, INDI_DISABLED }
 
enum  DRIVER_INTERFACE {
  GENERAL_INTERFACE = 0, TELESCOPE_INTERFACE = (1 << 0), CCD_INTERFACE = (1 << 1), GUIDER_INTERFACE = (1 << 2),
  FOCUSER_INTERFACE = (1 << 3), FILTER_INTERFACE = (1 << 4), DOME_INTERFACE = (1 << 5), GPS_INTERFACE = (1 << 6),
  WEATHER_INTERFACE = (1 << 7), AO_INTERFACE = (1 << 8), DUSTCAP_INTERFACE = (1 << 9), LIGHTBOX_INTERFACE = (1 << 10),
  DETECTOR_INTERFACE = (1 << 11), ROTATOR_INTERFACE = (1 << 12), SPECTROGRAPH_INTERFACE = (1 << 13), CORRELATOR_INTERFACE = (1 << 14),
  AUX_INTERFACE = (1 << 15), SENSOR_INTERFACE = SPECTROGRAPH_INTERFACE | DETECTOR_INTERFACE | CORRELATOR_INTERFACE
}
 The DRIVER_INTERFACE enum defines the class of devices the driver implements. A driver may implement one or more interfaces. More...
 
typedef INDI::Properties Properties
 

Public Member Functions

 SensorInterface ()
 
 ~SensorInterface ()
 
bool initProperties ()
 Initilize properties initial state and value. The child class must implement this function. More...
 
bool updateProperties ()
 updateProperties is called whenever there is a change in the CONNECTION status of the driver. This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver may only define a set of properties after a device is connected, but not before. More...
 
bool processNumber (const char *dev, const char *name, double values[], char *names[], int n)
 
void processProperties (const char *dev)
 
bool processText (const char *dev, const char *name, char *texts[], char *names[], int n)
 
bool processSwitch (const char *dev, const char *name, ISState states[], char *names[], int n)
 
bool processBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
 
bool processSnoopDevice (XMLEle *root)
 
int getBufferSize () const
 getContinuumBufferSize Get allocated continuum buffer size to hold the Sensor integrationd stream. More...
 
double getIntegrationLeft () const
 getIntegrationLeft Get Integration time left in seconds. More...
 
double getIntegrationTime () const
 getIntegrationTime Get requested Integration duration for the Sensor device in seconds. More...
 
const char * getIntegrationStartTime ()
 getIntegrationStartTime More...
 
uint8_t * getBuffer ()
 getBuffer Get raw buffer of the stream of the Sensor device. More...
 
void setBuffer (uint8_t *buffer)
 setBuffer Set raw frame buffer pointer. More...
 
int getBPS () const
 getBPS Get Sensor depth (bits per sample). 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 setBufferSize (int nbuf, bool allocMem=true)
 setBufferSize Set desired buffer size. The function will allocate memory accordingly. The frame size depends on the desired integration time, sampling frequency, and sample depth of the Sensor device (bps). You must set the frame size any time any of the prior parameters gets updated. More...
 
void setBPS (int bps)
 setBPP Set depth of Sensor device. More...
 
void setIntegrationTime (double duration)
 setIntegrationTime Set desired Sensor frame Integration duration for next Integration. You must call this function immediately before starting the actual Integration as it is used to calculate the timestamp used for the FITS header. More...
 
void setIntegrationLeft (double duration)
 setIntegrationLeft Update Integration time left. Inform the client of the new Integration time left value. More...
 
void setIntegrationFailed ()
 setIntegrationFailed Alert the client that the Integration failed. More...
 
int getNAxis () const
 
void setNAxis (int value)
 setNAxis Set FITS number of axis More...
 
void setIntegrationFileExtension (const char *ext)
 setIntegrationExtension Set integration exntension More...
 
char * getIntegrationFileExtension ()
 
bool isCapturing () const
 
virtual int SetTemperature (double temperature)
 Set Sensor temperature. More...
 
virtual bool StartStreaming ()
 StartStreaming Start live video streaming. More...
 
virtual bool StopStreaming ()
 StopStreaming Stop live video streaming. More...
 
virtual bool StartIntegration (double duration)
 Start integration from the Sensor device. More...
 
virtual bool IntegrationComplete ()
 Uploads target Device exposed buffer as FITS to the client. Dervied classes should class this function when an Integration is complete. More...
 
virtual bool Handshake ()
 perform handshake with device to check communication More...
 
void setSensorConnection (const uint8_t &value)
 setSensorConnection Set Sensor connection mode. Child class should call this in the constructor before Sensor registers any connection interfaces More...
 
uint8_t getSensorConnection ()
 
virtual void addFITSKeywords (fitsfile *fptr, uint8_t *buf, int len)
 Add FITS keywords to a fits file. More...
 
void fits_update_key_s (fitsfile *fptr, int type, std::string name, void *p, std::string explanation, int *status)
 
- Public Member Functions inherited from INDI::DefaultDevice
 DefaultDevice ()
 
virtual ~DefaultDevice () override=default
 
void addAuxControls ()
 Add Debug, Simulation, and Configuration options to the driver. More...
 
void addDebugControl ()
 Add Debug control to the driver. More...
 
void addSimulationControl ()
 Add Simulation control to the driver. More...
 
void addConfigurationControl ()
 Add Configuration control to the driver. More...
 
void addPollPeriodControl ()
 Add Polling period control to the driver. More...
 
void resetProperties ()
 Set all properties to IDLE state. More...
 
void defineNumber (INumberVectorProperty *nvp) __attribute__((deprecated))
 Define number vector to client & register it. Alternatively, IDDefNumber can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineProperty (INumberVectorProperty *property)
 
void defineText (ITextVectorProperty *tvp) __attribute__((deprecated))
 Define text vector to client & register it. Alternatively, IDDefText can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineProperty (ITextVectorProperty *property)
 
void defineSwitch (ISwitchVectorProperty *svp) __attribute__((deprecated))
 Define switch vector to client & register it. Alternatively, IDDefswitch can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineProperty (ISwitchVectorProperty *property)
 
void defineLight (ILightVectorProperty *lvp) __attribute__((deprecated))
 Define light vector to client & register it. Alternatively, IDDeflight can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineProperty (ILightVectorProperty *property)
 
void defineBLOB (IBLOBVectorProperty *bvp) __attribute__((deprecated))
 Define BLOB vector to client & register it. Alternatively, IDDefBLOB can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineProperty (IBLOBVectorProperty *property)
 
void defineProperty (INDI::Property &property)
 
virtual bool deleteProperty (const char *propertyName)
 Delete a property and unregister it. It will also be deleted from all clients. More...
 
virtual void setConnected (bool status, IPState state=IPS_OK, const char *msg=nullptr)
 Set connection switch status in the client. More...
 
int SetTimer (uint32_t ms)
 Set a timer to call the function TimerHit after ms milliseconds. More...
 
void RemoveTimer (int id)
 Remove timer added with SetTimer. More...
 
virtual void TimerHit ()
 Callback function to be called once SetTimer duration elapses. More...
 
virtual const char * getDriverExec ()
 
virtual const char * getDriverName ()
 
void setVersion (uint16_t vMajor, uint16_t vMinor)
 Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor. More...
 
uint16_t getMajorVersion () const
 
uint16_t getMinorVersion () const
 
virtual void ISGetProperties (const char *dev)
 define the driver's properties to the client. Usually, only a minimum set of properties are defined to the client in this function if the device is in disconnected state. Those properties should be enough to enable the client to establish a connection to the device. In addition to CONNECT/DISCONNECT, such properties may include port name, IP address, etc. You should check if the device is already connected, and if this is true, then you must define the remainder of the the properties to the client in this function. Otherwise, the remainder of the driver's properties are defined to the client in updateProperties() function which is called when a client connects/disconnects from a device. More...
 
virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process the client newNumber command. More...
 
virtual bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
 Process the client newBLOB command. More...
 
virtual bool ISSnoopDevice (XMLEle *root)
 Process a snoop event from INDI server. This function is called when a snooped property is updated in a snooped driver. More...
 
virtual uint16_t getDriverInterface () override
 
void setDriverInterface (uint16_t value)
 setInterface Set driver interface. By default the driver interface is set to GENERAL_DEVICE. You may send an ORed list of DeviceInterface values. More...
 
- Public Member Functions inherited from INDI::BaseDevice
 BaseDevice ()
 
virtual ~BaseDevice ()
 
INDI::PropertyView< INumber > * getNumber (const char *name) const
 
INDI::PropertyView< IText > * getText (const char *name) const
 
INDI::PropertyView< ISwitch > * getSwitch (const char *name) const
 
INDI::PropertyView< ILight > * getLight (const char *name) const
 
INDI::PropertyView< IBLOB > * getBLOB (const char *name) const
 
IPState getPropertyState (const char *name) const
 
IPerm getPropertyPermission (const char *name) const
 
void registerProperty (void *p, INDI_PROPERTY_TYPE type)
 
void registerProperty (ITextVectorProperty *property)
 
void registerProperty (INumberVectorProperty *property)
 
void registerProperty (ISwitchVectorProperty *property)
 
void registerProperty (ILightVectorProperty *property)
 
void registerProperty (IBLOBVectorProperty *property)
 
void registerProperty (INDI::PropertyView< IText > *property)
 
void registerProperty (INDI::PropertyView< INumber > *property)
 
void registerProperty (INDI::PropertyView< ISwitch > *property)
 
void registerProperty (INDI::PropertyView< ILight > *property)
 
void registerProperty (INDI::PropertyView< IBLOB > *property)
 
void registerProperty (INDI::Property &property)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN) const
 Return a property and its type given its name. More...
 
Property getProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN) const
 Return a property and its type given its name. More...
 
Properties getProperties ()
 Return a list of all properties in the device. More...
 
const Properties getProperties () const
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue. More...
 
void checkMessage (XMLEle *root)
 
void doMessage (XMLEle *msg)
 
const std::string & messageQueue (size_t index) const
 
const std::string & lastMessage () const
 
bool isConnected () const
 
void setMediator (INDI::BaseMediator *mediator)
 Set the driver's mediator to receive notification of news devices and updated property values. More...
 
INDI::BaseMediatorgetMediator () const
 
void setDeviceName (const char *dev)
 Set the device name. More...
 
const char * getDeviceName () const
 
bool isDeviceNameMatch (const char *otherName) const
 Check that the device name matches the argument. More...
 
bool isDeviceNameMatch (const std::string &otherName) const
 Check that the device name matches the argument. More...
 
const char * getDriverName () const
 
const char * getDriverExec () const
 
const char * getDriverVersion () const
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
int buildProp (XMLEle *root, char *errmsg)
 Build a property given the supplied XML element (defXXX) More...
 
int setValue (XMLEle *root, char *errmsg)
 handle SetXXX commands from client More...
 
int setBLOB (IBLOBVectorProperty *pp, XMLEle *root, char *errmsg)
 Parse and store BLOB in the respective vector. More...
 

Public Attributes

enum INDI::SensorInterface:: { ... }  SensorCapability
 
enum INDI::SensorInterface:: { ... }  SensorConnection
 

Protected Types

enum  { TELESCOPE_PRIMARY }
 
enum  { UPLOAD_DIR, UPLOAD_PREFIX }
 
enum  { FITS_OBSERVER, FITS_OBJECT }
 

Protected Member Functions

bool HasShutter () const
 
bool HasCooler () const
 
bool CanAbort () const
 
bool HasDSP ()
 
bool HasStreaming ()
 
uint32_t GetCapability () const
 GetCapability returns the Sensor capabilities. More...
 
void SetCapability (uint32_t cap)
 SetCapability Set the Sensor capabilities. Al fields must be initilized. More...
 
virtual bool AbortIntegration ()
 Abort ongoing Integration. More...
 
virtual bool saveConfigItems (FILE *fp)
 saveConfigItems Save configuration items in XML file. More...
 
virtual void activeDevicesUpdated ()
 activeDevicesUpdated Inform children that ActiveDevices property was updated so they can snoop on the updated devices if desired. More...
 
- Protected Member Functions inherited from INDI::DefaultDevice
void setDynamicPropertiesBehavior (bool defineEnabled, bool deleteEnabled)
 setDynamicPropertiesBehavior controls handling of dynamic properties. Dyanmic properties are those generated from an external skeleton XML file. By default all properties, including dynamic properties, are defined to the client in ISGetProperties(). Furthermore, when ┼▒deleteProperty(properyName) is called, the dynamic property is deleted by default, and can only be restored by calling buildSkeleton(filename) again. However, it is sometimes desirable to skip the definition of the dynamic properties on startup and delegate this task to the child class. To control this behavior, set enabled to false. More...
 
virtual bool loadConfig (bool silent=false, const char *property=nullptr)
 Load the last saved configuration file. More...
 
virtual bool saveConfig (bool silent=false, const char *property=nullptr)
 Save the current properties in a configuration file. More...
 
virtual bool purgeConfig ()
 purgeConfig Remove config file from disk. More...
 
virtual bool saveAllConfigItems (FILE *fp)
 saveAllConfigItems Save all the drivers' properties in the configuration file More...
 
virtual bool loadDefaultConfig ()
 Load the default configuration file. More...
 
void setDebug (bool enable)
 Toggle driver debug status A driver can be more verbose if Debug option is enabled by the client. More...
 
void setSimulation (bool enable)
 Toggle driver simulation status A driver can run in simulation mode if Simulation option is enabled by the client. More...
 
virtual void debugTriggered (bool enable)
 Inform driver that the debug option was triggered. This function is called after setDebug is triggered by the client. Reimplement this function if your driver needs to take specific action after debug is enabled/disabled. Otherwise, you can use isDebug() to check if simulation is enabled or disabled. More...
 
virtual void simulationTriggered (bool enable)
 Inform driver that the simulation option was triggered. This function is called after setSimulation is triggered by the client. Reimplement this function if your driver needs to take specific action after simulation is enabled/disabled. Otherwise, you can use isSimulation() to check if simulation is enabled or disabled. More...
 
bool isDebug () const
 
bool isSimulation () const
 
virtual bool Connect ()
 Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interface (Serial or TCP) governed by connectionMode. If connection is successful, it proceed to call Handshake() function to ensure communication with device is successful. For other communication interface, override the method in the child class implementation. More...
 
virtual bool Disconnect ()
 Disconnect from device. More...
 
void registerConnection (Connection::Interface *newConnection)
 registerConnection Add new connection plugin to the existing connection pool. The connection type shall be defined to the client in ISGetProperties() More...
 
bool unRegisterConnection (Connection::Interface *existingConnection)
 unRegisterConnection Remove connection from existing pool More...
 
Connection::InterfacegetActiveConnection ()
 
void setActiveConnection (Connection::Interface *existingConnection)
 setActiveConnection Switch the active connection to the passed connection plugin More...
 
void setDefaultPollingPeriod (uint32_t msec)
 setDefaultPollingPeriod Change the default polling period to call TimerHit() function in the driver. More...
 
void setPollingPeriodRange (uint32_t minimum, uint32_t maximum)
 setPollingPeriodRange Set the range permitted by the polling range in milliseconds More...
 
uint32_t getPollingPeriod () const
 getPollingPeriod Return the polling period. More...
 
void setCurrentPollingPeriod (uint32_t msec)
 setCurrentPollingPeriod Change the current polling period to call TimerHit() function in the driver. More...
 
uint32_t getCurrentPollingPeriod () const
 getCurrentPollingPeriod Return the current polling period. More...
 
uint32_t & refCurrentPollingPeriod () __attribute__((deprecated))
 
uint32_t refCurrentPollingPeriod () const __attribute__((deprecated))
 
bool isConfigLoading () const
 isConfigLoading Check if driver configuration is currently in the process of getting loaded. More...
 
void syncDriverInfo ()
 syncDriverInfo sends the current driver information to the client. More...
 
virtual const char * getDefaultName ()=0
 
 DefaultDevice (DefaultDevicePrivate &dd)
 
- Protected Member Functions inherited from INDI::BaseDevice
 BaseDevice (BaseDevicePrivate &dd)
 

Protected Attributes

uint32_t capability
 
INumberVectorProperty FramedIntegrationNP
 
INumber FramedIntegrationN [1]
 
ISwitchVectorProperty AbortIntegrationSP
 
ISwitch AbortIntegrationS [1]
 
IBLOB FitsB
 
IBLOBVectorProperty FitsBP
 
ITextVectorProperty ActiveDeviceTP
 
IText ActiveDeviceT [4] {}
 
IText FileNameT [1] {}
 
ITextVectorProperty FileNameTP
 
ISwitch DatasetS [1]
 
ISwitchVectorProperty DatasetSP
 
ISwitch UploadS [3]
 
ISwitchVectorProperty UploadSP
 
IText UploadSettingsT [2] {}
 
ITextVectorProperty UploadSettingsTP
 
ISwitch TelescopeTypeS [2]
 
ISwitchVectorProperty TelescopeTypeSP
 
IText FITSHeaderT [2] {}
 
ITextVectorProperty FITSHeaderTP
 
bool InIntegration
 
INumberVectorProperty EqNP
 
INumber EqN [2]
 
double RA
 
double Dec
 
INumberVectorProperty LocationNP
 
INumber LocationN [3]
 
double Latitude
 
double Longitude
 
double Elevation
 
INumberVectorProperty ScopeParametersNP
 
INumber ScopeParametersN [4]
 
double primaryAperture
 
double primaryFocalLength
 
bool AutoLoop
 
bool SendIntegration
 
bool ShowMarker
 
double IntegrationTime
 
double MPSAS
 
INumber TemperatureN [1]
 
INumberVectorProperty TemperatureNP
 
std::mutex detectorBufferLock
 
std::unique_ptr< StreamManagerStreamer
 
std::unique_ptr< DSP::ManagerDSP
 
Connection::SerialserialConnection = NULL
 
Connection::TCPtcpConnection = NULL
 
int PortFD = -1
 For Serial & TCP connections. More...
 
- Protected Attributes inherited from INDI::BaseDevice
std::shared_ptr< BaseDevicePrivated_ptr
 

Friends

class StreamManager
 Misc. More...
 

Detailed Description

The SensorDevice class provides functionality of a Sensor Device within a Sensor.

Definition at line 70 of file indisensorinterface.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SENSOR_CAN_ABORT 

Can the Sensor Integration be aborted?

SENSOR_HAS_STREAMING 

Does the Sensor supports streaming?

SENSOR_HAS_SHUTTER 

Does the Sensor have a mechanical shutter?

SENSOR_HAS_COOLER 

Does the Sensor have a cooler and temperature control?

SENSOR_HAS_DSP 
SENSOR_MAX_CAPABILITY 

Does the Sensor have a cooler and temperature control?

Definition at line 74 of file indisensorinterface.h.

◆ anonymous enum

anonymous enum
Enumerator
CONNECTION_NONE 
CONNECTION_SERIAL 

Do not use any connection plugin

CONNECTION_TCP 

For regular serial and bluetooth connections

Definition at line 92 of file indisensorinterface.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
TELESCOPE_PRIMARY 

Definition at line 434 of file indisensorinterface.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
UPLOAD_DIR 
UPLOAD_PREFIX 

Definition at line 448 of file indisensorinterface.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
FITS_OBSERVER 
FITS_OBJECT 

Definition at line 460 of file indisensorinterface.h.

Constructor & Destructor Documentation

◆ SensorInterface()

INDI::SensorInterface::SensorInterface ( )

Definition at line 66 of file indisensorinterface.cpp.

◆ ~SensorInterface()

INDI::SensorInterface::~SensorInterface ( )

Definition at line 96 of file indisensorinterface.cpp.

Member Function Documentation

◆ AbortIntegration()

bool INDI::SensorInterface::AbortIntegration ( )
protectedvirtual

Abort ongoing Integration.

Returns
true is abort is successful, false otherwise.
Note
This function is not implemented in Sensor, it must be implemented in the child class

Reimplemented in RTLSDR, RadioSim, and SimpleReceiver.

Definition at line 630 of file indisensorinterface.cpp.

◆ activeDevicesUpdated()

virtual void INDI::SensorInterface::activeDevicesUpdated ( )
inlineprotectedvirtual

activeDevicesUpdated Inform children that ActiveDevices property was updated so they can snoop on the updated devices if desired.

Definition at line 500 of file indisensorinterface.h.

◆ addFITSKeywords()

void INDI::SensorInterface::addFITSKeywords ( fitsfile *  fptr,
uint8_t *  buf,
int  len 
)
virtual

Add FITS keywords to a fits file.

Parameters
fptrpointer to a valid FITS file.
bufThe buffer of the fits contents.
lenThe lenght of the buffer.
Note
In additional to the standard FITS keywords, this function write the following keywords the FITS file:
  • EXPTIME: Total Integration Time (s)
  • DATAMIN: Minimum value
  • DATAMAX: Maximum value
  • INSTRUME: Sensor Name
  • DATE-OBS: UTC start date of observation

To add additional information, override this function in the child class and ensure to call SensorInterface::addFITSKeywords.

Reimplemented in INDI::Receiver, INDI::Spectrograph, and INDI::Detector.

Definition at line 636 of file indisensorinterface.cpp.

◆ CanAbort()

bool INDI::SensorInterface::CanAbort ( ) const
inlineprotected
Returns
True if Sensor can abort Integration. False otherwise.

Definition at line 359 of file indisensorinterface.h.

◆ fits_update_key_s()

void INDI::SensorInterface::fits_update_key_s ( fitsfile *  fptr,
int  type,
std::string  name,
void *  p,
std::string  explanation,
int *  status 
)

A function to just remove GCC warnings about deprecated conversion

Definition at line 760 of file indisensorinterface.cpp.

◆ getBPS()

int INDI::SensorInterface::getBPS ( ) const
inline

getBPS Get Sensor depth (bits per sample).

Returns
bits per sample.

Definition at line 168 of file indisensorinterface.h.

◆ getBuffer()

uint8_t* INDI::SensorInterface::getBuffer ( )
inline

getBuffer Get raw buffer of the stream of the Sensor device.

Returns
raw buffer of the Sensor device.

Definition at line 146 of file indisensorinterface.h.

◆ getBufferSize()

int INDI::SensorInterface::getBufferSize ( ) const
inline

getContinuumBufferSize Get allocated continuum buffer size to hold the Sensor integrationd stream.

Returns
allocated continuum buffer size to hold the Sensor integration stream.

Definition at line 113 of file indisensorinterface.h.

◆ GetCapability()

uint32_t INDI::SensorInterface::GetCapability ( ) const
inlineprotected

GetCapability returns the Sensor capabilities.

Definition at line 400 of file indisensorinterface.h.

◆ getIntegrationFileExtension()

char* INDI::SensorInterface::getIntegrationFileExtension ( )
inline
Returns
Return integration extension (fits, jpeg, raw..etc)

Definition at line 242 of file indisensorinterface.h.

◆ getIntegrationLeft()

double INDI::SensorInterface::getIntegrationLeft ( ) const
inline

getIntegrationLeft Get Integration time left in seconds.

Returns
Integration time left in seconds.

Definition at line 122 of file indisensorinterface.h.

◆ getIntegrationStartTime()

const char * INDI::SensorInterface::getIntegrationStartTime ( )

getIntegrationStartTime

Returns
Integration start time in ISO 8601 format.

Definition at line 595 of file indisensorinterface.cpp.

◆ getIntegrationTime()

double INDI::SensorInterface::getIntegrationTime ( ) const
inline

getIntegrationTime Get requested Integration duration for the Sensor device in seconds.

Returns
requested Integration duration for the Sensor device in seconds.

Definition at line 131 of file indisensorinterface.h.

◆ getNAxis()

int INDI::SensorInterface::getNAxis ( ) const
Returns
Get number of FITS axis in integration. By default 2

Definition at line 614 of file indisensorinterface.cpp.

◆ getSensorConnection()

uint8_t INDI::SensorInterface::getSensorConnection ( )
inline
Returns
Get current Sensor connection mode

Definition at line 313 of file indisensorinterface.h.

◆ Handshake()

bool INDI::SensorInterface::Handshake ( )
virtual

perform handshake with device to check communication

Reimplemented in RTLSDR.

Definition at line 1256 of file indisensorinterface.cpp.

◆ HasCooler()

bool INDI::SensorInterface::HasCooler ( ) const
inlineprotected
Returns
True if Sensor has cooler and temperature can be controlled. False otherwise.

Definition at line 351 of file indisensorinterface.h.

◆ HasDSP()

bool INDI::SensorInterface::HasDSP ( )
inlineprotected
Returns
True if the Sensor wants DSP processing. False otherwise.

Definition at line 367 of file indisensorinterface.h.

◆ HasShutter()

bool INDI::SensorInterface::HasShutter ( ) const
inlineprotected
Returns
True if Sensor has mechanical or electronic shutter. False otherwise.

Definition at line 343 of file indisensorinterface.h.

◆ HasStreaming()

bool INDI::SensorInterface::HasStreaming ( )
inlineprotected
Returns
True if the Sensor supports live video streaming. False otherwise.

Definition at line 383 of file indisensorinterface.h.

◆ initProperties()

bool INDI::SensorInterface::initProperties ( )
virtual

Initilize properties initial state and value. The child class must implement this function.

Returns
True if initilization is successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in INDI::Spectrograph.

Definition at line 398 of file indisensorinterface.cpp.

◆ IntegrationComplete()

bool INDI::SensorInterface::IntegrationComplete ( )
virtual

Uploads target Device exposed buffer as FITS to the client. Dervied classes should class this function when an Integration is complete.

Parameters
targetDevicedevice that contains upload integration data
Note
This function is not implemented in Sensor, it must be implemented in the child class

Definition at line 885 of file indisensorinterface.cpp.

◆ isCapturing()

bool INDI::SensorInterface::isCapturing ( ) const
inline
Returns
True if Sensor is currently exposing, false otherwise.

Definition at line 250 of file indisensorinterface.h.

◆ processBLOB()

bool INDI::SensorInterface::processBLOB ( const char *  dev,
const char *  name,
int  sizes[],
int  blobsizes[],
char *  blobs[],
char *  formats[],
char *  names[],
int  n 
)

Definition at line 389 of file indisensorinterface.cpp.

◆ processNumber()

bool INDI::SensorInterface::processNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)

Definition at line 250 of file indisensorinterface.cpp.

◆ processProperties()

void INDI::SensorInterface::processProperties ( const char *  dev)

Definition at line 155 of file indisensorinterface.cpp.

◆ processSnoopDevice()

bool INDI::SensorInterface::processSnoopDevice ( XMLEle root)

Definition at line 169 of file indisensorinterface.cpp.

◆ processSwitch()

bool INDI::SensorInterface::processSwitch ( const char *  dev,
const char *  name,
ISState  states[],
char *  names[],
int  n 
)

Definition at line 318 of file indisensorinterface.cpp.

◆ processText()

bool INDI::SensorInterface::processText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)

Definition at line 194 of file indisensorinterface.cpp.

◆ saveConfigItems()

bool INDI::SensorInterface::saveConfigItems ( FILE *  fp)
protectedvirtual

saveConfigItems Save configuration items in XML file.

Parameters
fppointer to file to write to
Returns
True if successful, false otherwise

Reimplemented from INDI::DefaultDevice.

Definition at line 1047 of file indisensorinterface.cpp.

◆ setBPS()

void INDI::SensorInterface::setBPS ( int  bps)

setBPP Set depth of Sensor device.

Parameters
bppbits per pixel

Definition at line 1242 of file indisensorinterface.cpp.

◆ setBuffer()

void INDI::SensorInterface::setBuffer ( uint8_t *  buffer)
inline

setBuffer Set raw frame buffer pointer.

Parameters
bufferpointer to continuum buffer /note Sensor Device allocates the frame buffer internally once SetBufferSize 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.

Definition at line 159 of file indisensorinterface.h.

◆ setBufferSize()

void INDI::SensorInterface::setBufferSize ( int  nbuf,
bool  allocMem = true 
)

setBufferSize Set desired buffer size. The function will allocate memory accordingly. The frame size depends on the desired integration time, sampling frequency, and sample depth of the Sensor 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.

Definition at line 551 of file indisensorinterface.cpp.

◆ SetCapability()

void INDI::SensorInterface::SetCapability ( uint32_t  cap)
protected

SetCapability Set the Sensor capabilities. Al fields must be initilized.

Parameters
cappointer to SensorCapability struct.

Definition at line 519 of file indisensorinterface.cpp.

◆ setIntegrationFailed()

void INDI::SensorInterface::setIntegrationFailed ( )

setIntegrationFailed Alert the client that the Integration failed.

Definition at line 608 of file indisensorinterface.cpp.

◆ setIntegrationFileExtension()

void INDI::SensorInterface::setIntegrationFileExtension ( const char *  ext)

setIntegrationExtension Set integration exntension

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

Definition at line 624 of file indisensorinterface.cpp.

◆ setIntegrationLeft()

void INDI::SensorInterface::setIntegrationLeft ( double  duration)

setIntegrationLeft Update Integration time left. Inform the client of the new Integration time left value.

Parameters
durationIntegration duration left in seconds.

Definition at line 579 of file indisensorinterface.cpp.

◆ setIntegrationTime()

void INDI::SensorInterface::setIntegrationTime ( double  duration)

setIntegrationTime Set desired Sensor frame Integration duration for next Integration. You must call this function immediately before starting the actual Integration as it is used to calculate the timestamp used for the FITS header.

Parameters
durationIntegration duration in seconds.

Definition at line 586 of file indisensorinterface.cpp.

◆ setMinMaxStep()

void INDI::SensorInterface::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.

Definition at line 529 of file indisensorinterface.cpp.

◆ setNAxis()

void INDI::SensorInterface::setNAxis ( int  value)

setNAxis Set FITS number of axis

Parameters
valuenumber of axis

Definition at line 619 of file indisensorinterface.cpp.

◆ setSensorConnection()

void INDI::SensorInterface::setSensorConnection ( const uint8_t &  value)

setSensorConnection Set Sensor connection mode. Child class should call this in the constructor before Sensor registers any connection interfaces

Parameters
valueORed combination of SensorConnection values.

Definition at line 1274 of file indisensorinterface.cpp.

◆ SetTemperature()

int INDI::SensorInterface::SetTemperature ( double  temperature)
virtual

Set Sensor temperature.

Parameters
temperatureSensor temperature in degrees celsius.
Returns
0 or 1 if setting the temperature call to the hardware is successful. -1 if an error is encountered. Return 0 if setting the temperature to the requested value takes time. Return 1 if setting the temperature to the requested value is complete.
Note
Upon returning 0, the property becomes BUSY. Once the temperature reaches the requested value, change the state to OK.
This function is not implemented in Sensor, it must be implemented in the child class

Reimplemented in SimpleReceiver.

Definition at line 1040 of file indisensorinterface.cpp.

◆ StartIntegration()

bool INDI::SensorInterface::StartIntegration ( double  duration)
virtual

Start integration from the Sensor device.

Parameters
durationDuration in seconds
Returns
true if OK and Integration will take some time to complete, false on error.
Note
This function is not implemented in Sensor, it must be implemented in the child class

Reimplemented in INDI::Correlator, INDI::Receiver, INDI::Spectrograph, RTLSDR, RadioSim, SimpleReceiver, and INDI::Detector.

Definition at line 572 of file indisensorinterface.cpp.

◆ StartStreaming()

bool INDI::SensorInterface::StartStreaming ( )
virtual

StartStreaming Start live video streaming.

Returns
True if successful, false otherwise.

Reimplemented in RTLSDR, and RadioSim.

Definition at line 1028 of file indisensorinterface.cpp.

◆ StopStreaming()

bool INDI::SensorInterface::StopStreaming ( )
virtual

StopStreaming Stop live video streaming.

Returns
True if successful, false otherwise.

Reimplemented in RTLSDR, and RadioSim.

Definition at line 1034 of file indisensorinterface.cpp.

◆ updateProperties()

bool INDI::SensorInterface::updateProperties ( )
virtual

updateProperties is called whenever there is a change in the CONNECTION status of the driver. This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver may only define a set of properties after a device is connected, but not before.

Returns
True if update is successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in INDI::Spectrograph.

Definition at line 104 of file indisensorinterface.cpp.

Friends And Related Function Documentation

◆ StreamManager

friend class StreamManager
friend

Misc.

Definition at line 271 of file indisensorinterface.h.

Member Data Documentation

◆ AbortIntegrationS

ISwitch INDI::SensorInterface::AbortIntegrationS[1]
protected

Definition at line 424 of file indisensorinterface.h.

◆ AbortIntegrationSP

ISwitchVectorProperty INDI::SensorInterface::AbortIntegrationSP
protected

Definition at line 423 of file indisensorinterface.h.

◆ ActiveDeviceT

IText INDI::SensorInterface::ActiveDeviceT[4] {}
protected

Definition at line 430 of file indisensorinterface.h.

◆ ActiveDeviceTP

ITextVectorProperty INDI::SensorInterface::ActiveDeviceTP
protected

Definition at line 429 of file indisensorinterface.h.

◆ AutoLoop

bool INDI::SensorInterface::AutoLoop
protected

Definition at line 487 of file indisensorinterface.h.

◆ capability

uint32_t INDI::SensorInterface::capability
protected

Definition at line 418 of file indisensorinterface.h.

◆ DatasetS

ISwitch INDI::SensorInterface::DatasetS[1]
protected

Definition at line 439 of file indisensorinterface.h.

◆ DatasetSP

ISwitchVectorProperty INDI::SensorInterface::DatasetSP
protected

Definition at line 440 of file indisensorinterface.h.

◆ Dec

double INDI::SensorInterface::Dec
protected

Definition at line 477 of file indisensorinterface.h.

◆ detectorBufferLock

std::mutex INDI::SensorInterface::detectorBufferLock
protected

Definition at line 506 of file indisensorinterface.h.

◆ DSP

std::unique_ptr<DSP::Manager> INDI::SensorInterface::DSP
protected

Definition at line 509 of file indisensorinterface.h.

◆ Elevation

double INDI::SensorInterface::Elevation
protected

Definition at line 481 of file indisensorinterface.h.

◆ EqN

INumber INDI::SensorInterface::EqN[2]
protected

Definition at line 476 of file indisensorinterface.h.

◆ EqNP

INumberVectorProperty INDI::SensorInterface::EqNP
protected

Definition at line 475 of file indisensorinterface.h.

◆ FileNameT

IText INDI::SensorInterface::FileNameT[1] {}
protected

Definition at line 432 of file indisensorinterface.h.

◆ FileNameTP

ITextVectorProperty INDI::SensorInterface::FileNameTP
protected

Definition at line 433 of file indisensorinterface.h.

◆ FitsB

IBLOB INDI::SensorInterface::FitsB
protected

Definition at line 426 of file indisensorinterface.h.

◆ FitsBP

IBLOBVectorProperty INDI::SensorInterface::FitsBP
protected

Definition at line 427 of file indisensorinterface.h.

◆ FITSHeaderT

IText INDI::SensorInterface::FITSHeaderT[2] {}
protected

Definition at line 458 of file indisensorinterface.h.

◆ FITSHeaderTP

ITextVectorProperty INDI::SensorInterface::FITSHeaderTP
protected

Definition at line 459 of file indisensorinterface.h.

◆ FramedIntegrationN

INumber INDI::SensorInterface::FramedIntegrationN[1]
protected

Definition at line 421 of file indisensorinterface.h.

◆ FramedIntegrationNP

INumberVectorProperty INDI::SensorInterface::FramedIntegrationNP
protected

Definition at line 420 of file indisensorinterface.h.

◆ InIntegration

bool INDI::SensorInterface::InIntegration
protected

Definition at line 473 of file indisensorinterface.h.

◆ IntegrationTime

double INDI::SensorInterface::IntegrationTime
protected

Definition at line 491 of file indisensorinterface.h.

◆ Latitude

double INDI::SensorInterface::Latitude
protected

Definition at line 481 of file indisensorinterface.h.

◆ LocationN

INumber INDI::SensorInterface::LocationN[3]
protected

Definition at line 480 of file indisensorinterface.h.

◆ LocationNP

INumberVectorProperty INDI::SensorInterface::LocationNP
protected

Definition at line 479 of file indisensorinterface.h.

◆ Longitude

double INDI::SensorInterface::Longitude
protected

Definition at line 481 of file indisensorinterface.h.

◆ MPSAS

double INDI::SensorInterface::MPSAS
protected

Definition at line 494 of file indisensorinterface.h.

◆ PortFD

int INDI::SensorInterface::PortFD = -1
protected

For Serial & TCP connections.

Definition at line 517 of file indisensorinterface.h.

◆ primaryAperture

double INDI::SensorInterface::primaryAperture
protected

Definition at line 485 of file indisensorinterface.h.

◆ primaryFocalLength

double INDI::SensorInterface::primaryFocalLength
protected

Definition at line 485 of file indisensorinterface.h.

◆ RA

double INDI::SensorInterface::RA
protected

Definition at line 477 of file indisensorinterface.h.

◆ ScopeParametersN

INumber INDI::SensorInterface::ScopeParametersN[4]
protected

Definition at line 484 of file indisensorinterface.h.

◆ ScopeParametersNP

INumberVectorProperty INDI::SensorInterface::ScopeParametersNP
protected

Definition at line 483 of file indisensorinterface.h.

◆ SendIntegration

bool INDI::SensorInterface::SendIntegration
protected

Definition at line 488 of file indisensorinterface.h.

◆ SensorCapability

enum { ... } INDI::SensorInterface::SensorCapability

◆ SensorConnection

enum { ... } INDI::SensorInterface::SensorConnection

◆ serialConnection

Connection::Serial* INDI::SensorInterface::serialConnection = NULL
protected

Definition at line 513 of file indisensorinterface.h.

◆ ShowMarker

bool INDI::SensorInterface::ShowMarker
protected

Definition at line 489 of file indisensorinterface.h.

◆ Streamer

std::unique_ptr<StreamManager> INDI::SensorInterface::Streamer
protected

Definition at line 508 of file indisensorinterface.h.

◆ tcpConnection

Connection::TCP* INDI::SensorInterface::tcpConnection = NULL
protected

Definition at line 514 of file indisensorinterface.h.

◆ TelescopeTypeS

ISwitch INDI::SensorInterface::TelescopeTypeS[2]
protected

Definition at line 454 of file indisensorinterface.h.

◆ TelescopeTypeSP

ISwitchVectorProperty INDI::SensorInterface::TelescopeTypeSP
protected

Definition at line 455 of file indisensorinterface.h.

◆ TemperatureN

INumber INDI::SensorInterface::TemperatureN[1]
protected

Definition at line 502 of file indisensorinterface.h.

◆ TemperatureNP

INumberVectorProperty INDI::SensorInterface::TemperatureNP
protected

Definition at line 503 of file indisensorinterface.h.

◆ UploadS

ISwitch INDI::SensorInterface::UploadS[3]
protected

Definition at line 443 of file indisensorinterface.h.

◆ UploadSettingsT

IText INDI::SensorInterface::UploadSettingsT[2] {}
protected

Definition at line 446 of file indisensorinterface.h.

◆ UploadSettingsTP

ITextVectorProperty INDI::SensorInterface::UploadSettingsTP
protected

Definition at line 447 of file indisensorinterface.h.

◆ UploadSP

ISwitchVectorProperty INDI::SensorInterface::UploadSP
protected

Definition at line 444 of file indisensorinterface.h.


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