Instrument Neutral Distributed Interface INDI  2.0.2
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
INDI::CCD Class Reference

Class to provide general functionality of CCD cameras with a single CCD sensor, or a primary CCD sensor in addition to a secondary CCD guide head. More...

#include <indiccd.h>

Inheritance diagram for INDI::CCD:
INDI::DefaultDevice INDI::GuiderInterface INDI::ParentDevice INDI::BaseDevice CCDSim GuideSim SimpleCCD V4L2_Driver MockCCDSimDriver

Classes

struct  CaptureFormat
 

Public Types

enum  {
  CCD_CAN_BIN = 1 << 0 , CCD_CAN_SUBFRAME = 1 << 1 , CCD_CAN_ABORT = 1 << 2 , CCD_HAS_GUIDE_HEAD = 1 << 3 ,
  CCD_HAS_ST4_PORT = 1 << 4 , CCD_HAS_SHUTTER = 1 << 5 , CCD_HAS_COOLER = 1 << 6 , CCD_HAS_BAYER = 1 << 7 ,
  CCD_HAS_STREAMING = 1 << 8 , CCD_HAS_WEB_SOCKET = 1 << 9 , CCD_HAS_DSP = 1 << 10
}
 
enum  CCD_UPLOAD_MODE { UPLOAD_CLIENT , UPLOAD_LOCAL , UPLOAD_BOTH }
 
typedef struct INDI::CCD::CaptureFormat CaptureFormat
 
- Public Types inherited from INDI::ParentDevice
enum  Type { Valid , Invalid }
 
- 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  WATCH { WATCH_NEW = 0 , WATCH_UPDATE , WATCH_NEW_OR_UPDATE }
 
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

 CCD ()
 
virtual ~CCD ()
 
virtual bool initProperties () override
 Initilize properties initial state and value. The child class must implement this function. More...
 
virtual bool updateProperties () override
 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...
 
virtual void ISGetProperties (const char *dev) override
 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 ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n) override
 Process the client newNumber command. More...
 
virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) override
 Process the client newSwitch command. More...
 
virtual bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) override
 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) override
 Process the client newBLOB command. More...
 
virtual bool ISSnoopDevice (XMLEle *root) override
 Process a snoop event from INDI server. This function is called when a snooped property is updated in a snooped driver. More...
 
- 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)
 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)
 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)
 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)
 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)
 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...
 
bool deleteProperty (INDI::Property &property)
 deleteProperty 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
 
uint16_t getDriverInterface () const
 
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...
 
void watchDevice (const char *deviceName, const std::function< void(INDI::BaseDevice)> &callback)
 Add a device to the watch list. More...
 
- Public Member Functions inherited from INDI::ParentDevice
 ParentDevice (Type type)
 
 ~ParentDevice ()
 
 ParentDevice (ParentDevice &&other)=default
 
ParentDeviceoperator= (ParentDevice &&other)=default
 
- Public Member Functions inherited from INDI::BaseDevice
 BaseDevice ()
 
virtual ~BaseDevice ()
 
void registerProperty (const INDI::Property &property)
 Register the property to be able to observe and update. More...
 
void registerProperty (const INDI::Property &property, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void watchProperty (const char *name, const std::function< void(INDI::Property)> &callback, WATCH watch=WATCH_NEW)
 Call the callback function if property is available. 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
 
INDI::PropertyNumber getNumber (const char *name) const
 
INDI::PropertyText getText (const char *name) const
 
INDI::PropertySwitch getSwitch (const char *name) const
 
INDI::PropertyLight getLight (const char *name) const
 
INDI::PropertyBlob getBLOB (const char *name) const
 
IPState getPropertyState (const char *name) const
 
IPerm getPropertyPermission (const char *name) const
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN) const
 Return a property and its type given its name. More...
 
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 isValid () const
 
bool isConnected () const
 
void attach ()
 indicates that the device is ready More...
 
void detach ()
 indicates that the device is being removed More...
 
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
 
uint16_t getDriverInterface () const
 getDriverInterface returns ORed values of DRIVER_INTERFACE. It presents the device classes supported by the driver. More...
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
int buildProp (const INDI::LilXmlElement &root, char *errmsg, bool isDynamic=false)
 Build a property given the supplied XML element (defXXX) More...
 
int setValue (const INDI::LilXmlElement &root, char *errmsg)
 handle SetXXX commands from client More...
 
 operator BaseDevice * ()
 
BaseDeviceoperator-> ()
 
bool operator!= (std::nullptr_t) const
 
bool operator== (std::nullptr_t) const
 
 operator bool () const
 
 operator bool ()
 

Static Public Member Functions

static void wsThreadHelper (void *context)
 
- Static Public Member Functions inherited from INDI::BaseDevice
static std::string getSharedFilePath (std::string fileName)
 

Public Attributes

enum INDI::CCD:: { ... }  CCDCapability
 

Static Public Attributes

static constexpr const char * GUIDE_CONTROL_TAB = "Guider Control"
 Group Names. More...
 
static constexpr const char * WCS_TAB = "WCS"
 

Protected Types

enum  {
  ACTIVE_TELESCOPE , ACTIVE_ROTATOR , ACTIVE_FOCUSER , ACTIVE_FILTER ,
  ACTIVE_SKYQUALITY
}
 
enum  { RAMP_SLOPE , RAMP_THRESHOLD }
 
enum  { FORMAT_FITS , FORMAT_NATIVE , FORMAT_XISF }
 
enum  { UPLOAD_DIR , UPLOAD_PREFIX }
 
enum  { FocalLength , Aperture }
 
enum  { WEBSOCKET_ENABLED , WEBSOCKET_DISABLED }
 
enum  { WS_SETTINGS_PORT }
 
enum  { KEYWORD_NAME , KEYWORD_VALUE , KEYWORD_COMMENT }
 

Protected Member Functions

uint32_t GetCCDCapability () const
 GetCCDCapability returns the CCD capabilities. More...
 
void SetCCDCapability (uint32_t cap)
 SetCCDCapability Set the CCD capabilities. Al fields must be initialized. More...
 
bool CanAbort ()
 
bool CanBin ()
 
bool CanSubFrame ()
 
bool HasGuideHead ()
 
bool HasShutter ()
 
bool HasST4Port ()
 
bool HasCooler ()
 
bool HasBayer ()
 
bool HasStreaming ()
 
bool HasWebSocket ()
 
bool HasDSP ()
 
virtual int SetTemperature (double temperature)
 Set CCD temperature. More...
 
virtual bool StartExposure (float duration)
 Start exposing primary CCD chip. More...
 
virtual bool ExposureComplete (CCDChip *targetChip)
 Uploads target Chip exposed buffer as FITS to the client. Dervied classes should class this function when an exposure is complete. More...
 
virtual bool AbortExposure ()
 Abort ongoing exposure. More...
 
virtual bool StartGuideExposure (float duration)
 Start exposing guide CCD chip. More...
 
virtual bool AbortGuideExposure ()
 Abort ongoing exposure. More...
 
virtual bool UpdateCCDFrame (int x, int y, int w, int h)
 CCD calls this function when CCD Frame dimension needs to be updated in the hardware. Derived classes should implement this function. More...
 
virtual bool UpdateGuiderFrame (int x, int y, int w, int h)
 CCD calls this function when Guide head frame dimension is updated by the client. Derived classes should implement this function. More...
 
virtual bool UpdateCCDBin (int hor, int ver)
 CCD calls this function when CCD Binning needs to be updated in the hardware. Derived classes should implement this function. More...
 
virtual bool UpdateGuiderBin (int hor, int ver)
 CCD calls this function when Guide head binning is updated by the client. Derived classes should implement this function. More...
 
virtual bool UpdateCCDFrameType (CCDChip::CCD_FRAME fType)
 CCD calls this function when CCD frame type needs to be updated in the hardware. More...
 
virtual bool UpdateCCDUploadMode (CCD_UPLOAD_MODE mode)
 CCD calls this function when client upload mode switch is updated. More...
 
virtual bool UpdateGuiderFrameType (CCDChip::CCD_FRAME fType)
 CCD calls this function when Guide frame type is updated by the client. More...
 
virtual void SetCCDParams (int x, int y, int bpp, float xf, float yf)
 Setup CCD paramters for primary CCD. Child classes call this function to update CCD parameters. More...
 
virtual void SetGuiderParams (int x, int y, int bpp, float xf, float yf)
 Setup CCD paramters for guide head CCD. Child classes call this function to update CCD parameters. More...
 
virtual IPState GuideNorth (uint32_t ms) override
 Guide northward for ms milliseconds. More...
 
virtual IPState GuideSouth (uint32_t ms) override
 Guide southward for ms milliseconds. More...
 
virtual IPState GuideEast (uint32_t ms) override
 Guide easward for ms milliseconds. More...
 
virtual IPState GuideWest (uint32_t ms) override
 Guide westward for ms milliseconds. More...
 
virtual bool StartStreaming ()
 StartStreaming Start live video streaming. More...
 
virtual bool StopStreaming ()
 StopStreaming Stop live video streaming. More...
 
virtual bool SetCaptureFormat (uint8_t index)
 SetCaptureFormat Set Active Capture format. More...
 
virtual void addFITSKeywords (CCDChip *targetChip, std::vector< FITSRecord > &fitsKeywords)
 Generate FITS keywords that will be added to FIST/XISF file. More...
 
void fits_update_key_s (fitsfile *fptr, int type, std::string name, void *p, std::string explanation, int *status)
 
virtual void activeDevicesUpdated ()
 activeDevicesUpdated Inform children that ActiveDevices property was updated so they can snoop on the updated devices if desired. More...
 
virtual bool saveConfigItems (FILE *fp) override
 saveConfigItems Save configuration items in XML file. More...
 
virtual void GuideComplete (INDI_EQ_AXIS axis) override
 GuideComplete Signal guide pulse completion. More...
 
virtual void UploadComplete (CCDChip *)
 UploadComplete Signal that capture is completed and image was uploaded and/or saved successfully. More...
 
virtual void checkTemperatureTarget ()
 checkTemperatureTarget Checks the current temperature against target temperature and calculates the next required temperature if there is a ramp. If the current temperature is within threshold of target temperature, it sets the state as OK. More...
 
virtual bool processFastExposure (CCDChip *targetChip)
 processFastExposure After an exposure is complete, check if fast exposure was enabled. If it is, then immediately start the next exposure if possible and decrement the counter. More...
 
virtual void addCaptureFormat (const CaptureFormat &format)
 addCaptureFormat Add a supported camera native capture format (e.g. Mono, Bayer8..etc) 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...
 
bool loadConfig (INDI::Property &property)
 Load property config from the configuration file. If the property configuration is successfully parsed, the corresponding ISNewXXX is called with the values parsed from the config file. More...
 
virtual bool saveConfig (bool silent=false, const char *property=nullptr)
 Save the current properties in a configuration file. More...
 
bool saveConfig (INDI::Property &property)
 Save a property in the 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...
 
bool isInitializationComplete () const
 isInitializationComplete Check if driver initialization is complete. More...
 
void syncDriverInfo ()
 syncDriverInfo sends the current driver information to the client. More...
 
virtual const char * getDefaultName ()=0
 
 DefaultDevice (const std::shared_ptr< DefaultDevicePrivate > &dd)
 
- Protected Member Functions inherited from INDI::ParentDevice
 ParentDevice (const std::shared_ptr< ParentDevicePrivate > &dd)
 
- Protected Member Functions inherited from INDI::BaseDevice
 BaseDevice (BaseDevicePrivate &dd)
 
 BaseDevice (const std::shared_ptr< BaseDevicePrivate > &dd)
 

Protected Attributes

double RA
 
double Dec
 
int pierSide
 
double J2000RA
 
double J2000DE
 
bool J2000Valid
 
char exposureStartTime [MAXINDINAME]
 
double exposureDuration
 
double snoopedFocalLength
 
double snoopedAperture
 
bool InExposure
 
bool InGuideExposure
 
bool AutoLoop
 
bool GuiderAutoLoop
 
bool SendImage
 
bool GuiderSendImage
 
bool ShowMarker
 
bool GuiderShowMarker
 
double ExposureTime
 
double GuiderExposureTime
 
double MPSAS
 
double RotatorAngle
 
long FocuserPos
 
double FocuserTemp
 
double Airmass
 
double Latitude
 
double Longitude
 
double Azimuth
 
double Altitude
 
double m_TargetTemperature {0}
 
INDI::Timer m_TemperatureCheckTimer
 
INDI::ElapsedTimer m_TemperatureElapsedTimer
 
std::mutex ccdBufferLock
 
std::vector< std::string > FilterNames
 
int CurrentFilterSlot {-1}
 
std::vector< CaptureFormatm_CaptureFormats
 
std::unique_ptr< StreamManagerStreamer
 
std::unique_ptr< DSP::ManagerDSP
 
CCDChip PrimaryCCD
 
CCDChip GuideCCD
 
INumberVectorProperty EqNP
 Properties. More...
 
INumber EqN [2]
 
INumberVectorProperty J2000EqNP
 J200EqNP Snoop property to read the equatorial J2000 coordinates of the mount. ActiveDeviceTP defines snoop devices and the driver listens to this property emitted by the mount driver if specified. It is important to generate a proper FITS header. More...
 
INumber J2000EqN [2]
 
ITextVectorProperty ActiveDeviceTP
 ActiveDeviceTP defines 4 devices the camera driver can listen to (snoop) for properties of interest so that it can generate a proper FITS header. More...
 
IText ActiveDeviceT [5] {}
 
INumberVectorProperty TemperatureNP
 TemperatureNP Camera Temperature in Celcius. More...
 
INumber TemperatureN [1]
 
INDI::PropertyNumber TemperatureRampNP {2}
 Temperature Ramp in C/Min with configurable threshold. More...
 
ITextVectorProperty BayerTP
 BayerTP Bayer pattern offset and type. More...
 
IText BayerT [3] {}
 
ITextVectorProperty FileNameTP
 FileNameTP File name of locally-saved images. By default, images are uploaded to the client but when upload option is set to either Both or Local, then they are saved on the local disk with this name. More...
 
IText FileNameT [1] {}
 
INDI::PropertySwitch CaptureFormatSP {0}
 Specifies Camera NATIVE capture format (e.g. Mono, RGB, RAW8..etc). More...
 
INDI::PropertySwitch EncodeFormatSP {3}
 Specifies Driver image encoding format (FITS, Native, JPG, ..etc) More...
 
ISwitch UploadS [3]
 
ISwitchVectorProperty UploadSP
 
IText UploadSettingsT [2] {}
 
ITextVectorProperty UploadSettingsTP
 
INDI::PropertyNumber ScopeInfoNP {2}
 
ISwitch WebSocketS [2]
 
ISwitchVectorProperty WebSocketSP
 
INumber WebSocketSettingsN [1]
 
INumberVectorProperty WebSocketSettingsNP
 
ISwitch WorldCoordS [2]
 
ISwitchVectorProperty WorldCoordSP
 
INumber CCDRotationN [1]
 
INumberVectorProperty CCDRotationNP
 
ISwitch FastExposureToggleS [2]
 
ISwitchVectorProperty FastExposureToggleSP
 
INumber FastExposureCountN [1]
 
INumberVectorProperty FastExposureCountNP
 
double m_UploadTime = { 0 }
 
std::chrono::system_clock::time_point FastExposureToggleStartup
 
INDI::PropertyText FITSHeaderTP {3}
 
- Protected Attributes inherited from INDI::BaseDevice
std::shared_ptr< BaseDevicePrivated_ptr
 

Friends

class StreamManager
 Misc. More...
 
class StreamManagerPrivate
 

Detailed Description

Class to provide general functionality of CCD cameras with a single CCD sensor, or a primary CCD sensor in addition to a secondary CCD guide head.

The CCD capabilities must be set to select which features are exposed to the clients. SetCCDCapability() is typically set in the constructor or initProperties(), but can also be called after connection is established with the CCD, but must be called /em before returning true in Connect().

It also implements the interface to perform guiding. The class enable the ability to snoop on telescope equatorial coordinates and record them in the FITS file before upload. It also snoops Sky-Quality-Meter devices to record sky quality in units of Magnitudes-Per-Arcsecond-Squared (MPASS) in the FITS header.

Support for streaming and recording is available and is handled by the StreamManager class.

Developers need to subclass INDI::CCD to implement any driver for CCD cameras within INDI.

Data binary transfers are supported using two methods:

INDI BLOBs: This is the and recommended default configuration.

Websockets: This requires INDI to be built with websocket support. There is marginal

improvement in throughput with Websockets when compared with INDI base64 BLOB encoding. It requires the client to explicitly support websockets. It is not recommended to use this approach unless for the most demanding and FPS sensitive tasks.

INDI::CCD and INDI::StreamManager both upload frames asynchrounously in a worker thread. The CCD Buffer data is protected by the ccdBufferLock mutex. When reading the camera data and writing to the buffer, it must be first locked by the mutex. After the write is complete release the lock. For example:

std::unique_lock<std::mutex> guard(ccdBufferLock);
get_ccd_frame(PrimaryCCD.getFrameBuffer);
guard.unlock();
uint8_t * getFrameBuffer()
getFrameBuffer Get raw frame buffer of the CCD chip.
Definition: indiccdchip.h:209
CCDChip PrimaryCCD
Definition: indiccd.h:629
virtual bool ExposureComplete(CCDChip *targetChip)
Uploads target Chip exposed buffer as FITS to the client. Dervied classes should class this function ...
Definition: indiccd.cpp:2228
std::mutex ccdBufferLock
Definition: indiccd.h:620

Similiary, before calling Streamer->newFrame, the buffer needs to be protected in a similiar fashion using the same ccdBufferLock mutex.

Examples
simpleccd.h.

Definition at line 115 of file indiccd.h.

Member Typedef Documentation

◆ CaptureFormat

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
CCD_CAN_BIN 

Does the CCD support binning?

CCD_CAN_SUBFRAME 

Does the CCD support setting ROI?

CCD_CAN_ABORT 

Can the CCD exposure be aborted?

CCD_HAS_GUIDE_HEAD 

Does the CCD have a guide head?

CCD_HAS_ST4_PORT 

Does the CCD have an ST4 port?

CCD_HAS_SHUTTER 

Does the CCD have a mechanical shutter?

CCD_HAS_COOLER 

Does the CCD have a cooler and temperature control?

CCD_HAS_BAYER 

Does the CCD send color data in bayer format?

CCD_HAS_STREAMING 

Does the CCD support live video streaming?

CCD_HAS_WEB_SOCKET 

Does the CCD support web socket transfers?

CCD_HAS_DSP 

Does the CCD support image processing?

Definition at line 121 of file indiccd.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
ACTIVE_TELESCOPE 
ACTIVE_ROTATOR 
ACTIVE_FOCUSER 
ACTIVE_FILTER 
ACTIVE_SKYQUALITY 

Definition at line 665 of file indiccd.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
RAMP_SLOPE 
RAMP_THRESHOLD 

Definition at line 684 of file indiccd.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
FORMAT_FITS 

Save Image as FITS format

FORMAT_NATIVE 

Save Image as the native format of the camera itself.

FORMAT_XISF 

Save Image as XISF format

Definition at line 709 of file indiccd.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
UPLOAD_DIR 
UPLOAD_PREFIX 

Definition at line 721 of file indiccd.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
FocalLength 
Aperture 

Definition at line 729 of file indiccd.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
WEBSOCKET_ENABLED 
WEBSOCKET_DISABLED 

Definition at line 738 of file indiccd.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
WS_SETTINGS_PORT 

Definition at line 748 of file indiccd.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
KEYWORD_NAME 
KEYWORD_VALUE 
KEYWORD_COMMENT 

Definition at line 772 of file indiccd.h.

◆ CCD_UPLOAD_MODE

Enumerator
UPLOAD_CLIENT 
UPLOAD_LOCAL 
UPLOAD_BOTH 

Definition at line 136 of file indiccd.h.

Constructor & Destructor Documentation

◆ CCD()

INDI::CCD::CCD ( )

Definition at line 81 of file indiccd.cpp.

◆ ~CCD()

INDI::CCD::~CCD ( )
virtual

Definition at line 131 of file indiccd.cpp.

Member Function Documentation

◆ AbortExposure()

bool INDI::CCD::AbortExposure ( )
protectedvirtual

Abort ongoing exposure.

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

Reimplemented in SimpleCCD, V4L2_Driver, GuideSim, and CCDSim.

Definition at line 1879 of file indiccd.cpp.

◆ AbortGuideExposure()

bool INDI::CCD::AbortGuideExposure ( )
protectedvirtual

Abort ongoing exposure.

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

Reimplemented in CCDSim.

Definition at line 1885 of file indiccd.cpp.

◆ activeDevicesUpdated()

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

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

Reimplemented in GuideSim, and CCDSim.

Definition at line 519 of file indiccd.h.

◆ addCaptureFormat()

void INDI::CCD::addCaptureFormat ( const CaptureFormat format)
protectedvirtual

addCaptureFormat Add a supported camera native capture format (e.g. Mono, Bayer8..etc)

Parameters
nameName of format (e.g. FORMAT_MONO)
labelLabel of format (e.g. Mono)
isDefaultIf true, it would be set as the default format if there is config file does not specify one. Config file override default format.

Definition at line 3033 of file indiccd.cpp.

◆ addFITSKeywords()

void INDI::CCD::addFITSKeywords ( CCDChip targetChip,
std::vector< FITSRecord > &  fitsKeywords 
)
protectedvirtual

Generate FITS keywords that will be added to FIST/XISF file.

Parameters
targetChipThe target chip to extract the keywords from.
Note
In additional to the standard FITS keywords, this function write the following keywords the FITS file:
  • EXPTIME: Total Exposure Time (s)
  • DARKTIME (if applicable): Total Exposure Time (s)
  • PIXSIZE1: Pixel Size 1 (microns)
  • PIXSIZE2: Pixel Size 2 (microns)
  • BINNING: Binning HOR x VER
  • FRAME: Frame Type
  • DATAMIN: Minimum value
  • DATAMAX: Maximum value
  • INSTRUME: CCD Name
  • DATE-OBS: UTC start date of observation

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

Reimplemented in GuideSim, and CCDSim.

Definition at line 1940 of file indiccd.cpp.

◆ CanAbort()

bool INDI::CCD::CanAbort ( )
inlineprotected
Returns
True if CCD can abort exposure. False otherwise.

Definition at line 184 of file indiccd.h.

◆ CanBin()

bool INDI::CCD::CanBin ( )
inlineprotected
Returns
True if CCD supports binning. False otherwise.

Definition at line 192 of file indiccd.h.

◆ CanSubFrame()

bool INDI::CCD::CanSubFrame ( )
inlineprotected
Returns
True if CCD supports subframing. False otherwise.

Definition at line 200 of file indiccd.h.

◆ checkTemperatureTarget()

void INDI::CCD::checkTemperatureTarget ( )
protectedvirtual

checkTemperatureTarget Checks the current temperature against target temperature and calculates the next required temperature if there is a ramp. If the current temperature is within threshold of target temperature, it sets the state as OK.

Definition at line 3002 of file indiccd.cpp.

◆ ExposureComplete()

bool INDI::CCD::ExposureComplete ( CCDChip targetChip)
protectedvirtual

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

Parameters
targetChipchip that contains upload image data
Note
This function is not implemented in CCD, it must be implemented in the child class
Examples
simpleccd.cpp.

Definition at line 2228 of file indiccd.cpp.

◆ fits_update_key_s()

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

A function to just remove GCC warnings about deprecated conversion

Definition at line 2221 of file indiccd.cpp.

◆ GetCCDCapability()

uint32_t INDI::CCD::GetCCDCapability ( ) const
inlineprotected

GetCCDCapability returns the CCD capabilities.

Definition at line 170 of file indiccd.h.

◆ GuideComplete()

void INDI::CCD::GuideComplete ( INDI_EQ_AXIS  axis)
overrideprotectedvirtual

GuideComplete Signal guide pulse completion.

Parameters
axiswhich axis the guide pulse was acting on

Reimplemented from INDI::GuiderInterface.

Definition at line 2970 of file indiccd.cpp.

◆ GuideEast()

IPState INDI::CCD::GuideEast ( uint32_t  ms)
overrideprotectedvirtual

Guide easward for ms milliseconds.

Parameters
msDuration in milliseconds.
Note
This function is not implemented in CCD, it must be implemented in the child class
Returns
0 if successful, -1 otherwise.

Implements INDI::GuiderInterface.

Reimplemented in GuideSim, and CCDSim.

Definition at line 2820 of file indiccd.cpp.

◆ GuideNorth()

IPState INDI::CCD::GuideNorth ( uint32_t  ms)
overrideprotectedvirtual

Guide northward for ms milliseconds.

Parameters
msDuration in milliseconds.
Note
This function is not implemented in CCD, it must be implemented in the child class
Returns
True if successful, false otherwise.

Implements INDI::GuiderInterface.

Reimplemented in GuideSim, and CCDSim.

Definition at line 2806 of file indiccd.cpp.

◆ GuideSouth()

IPState INDI::CCD::GuideSouth ( uint32_t  ms)
overrideprotectedvirtual

Guide southward for ms milliseconds.

Parameters
msDuration in milliseconds.
Note
This function is not implemented in CCD, it must be implemented in the child class
Returns
0 if successful, -1 otherwise.

Implements INDI::GuiderInterface.

Reimplemented in GuideSim, and CCDSim.

Definition at line 2813 of file indiccd.cpp.

◆ GuideWest()

IPState INDI::CCD::GuideWest ( uint32_t  ms)
overrideprotectedvirtual

Guide westward for ms milliseconds.

Parameters
msDuration in milliseconds.
Note
This function is not implemented in CCD, it must be implemented in the child class
Returns
0 if successful, -1 otherwise.

Implements INDI::GuiderInterface.

Reimplemented in GuideSim, and CCDSim.

Definition at line 2827 of file indiccd.cpp.

◆ HasBayer()

bool INDI::CCD::HasBayer ( )
inlineprotected
Returns
True if CCD sends image data in bayer format. False otherwise.

Definition at line 240 of file indiccd.h.

◆ HasCooler()

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

Definition at line 232 of file indiccd.h.

◆ HasDSP()

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

Definition at line 273 of file indiccd.h.

◆ HasGuideHead()

bool INDI::CCD::HasGuideHead ( )
inlineprotected
Returns
True if CCD has guide head. False otherwise.

Definition at line 208 of file indiccd.h.

◆ HasShutter()

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

Definition at line 216 of file indiccd.h.

◆ HasST4Port()

bool INDI::CCD::HasST4Port ( )
inlineprotected
Returns
True if CCD has ST4 port for guiding. False otherwise.

Definition at line 224 of file indiccd.h.

◆ HasStreaming()

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

Definition at line 248 of file indiccd.h.

◆ HasWebSocket()

bool INDI::CCD::HasWebSocket ( )
inlineprotected
Returns
True if the CCD supports native Web Socket transfers. False otherwise.

Definition at line 265 of file indiccd.h.

◆ initProperties()

bool INDI::CCD::initProperties ( )
overridevirtual

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 SimpleCCD, V4L2_Driver, GuideSim, and CCDSim.

Examples
simpleccd.cpp.

Definition at line 152 of file indiccd.cpp.

◆ ISGetProperties()

void INDI::CCD::ISGetProperties ( const char *  dev)
overridevirtual

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.

Parameters
devname of the device
Note
This function is called by the INDI framework, do not call it directly. See LX200 Generic driver for an example implementation

Reimplemented from INDI::DefaultDevice.

Reimplemented in V4L2_Driver, GuideSim, and CCDSim.

Definition at line 516 of file indiccd.cpp.

◆ ISNewBLOB()

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

Process the client newBLOB command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Definition at line 1850 of file indiccd.cpp.

◆ ISNewNumber()

bool INDI::CCD::ISNewNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)
overridevirtual

Process the client newNumber command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in V4L2_Driver, GuideSim, and CCDSim.

Definition at line 1070 of file indiccd.cpp.

◆ ISNewSwitch()

bool INDI::CCD::ISNewSwitch ( const char *  dev,
const char *  name,
ISState states,
char *  names[],
int  n 
)
overridevirtual

Process the client newSwitch command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in V4L2_Driver, GuideSim, and CCDSim.

Definition at line 1451 of file indiccd.cpp.

◆ ISNewText()

bool INDI::CCD::ISNewText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)
overridevirtual

Process the client newSwitch command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in V4L2_Driver, and CCDSim.

Definition at line 884 of file indiccd.cpp.

◆ ISSnoopDevice()

bool INDI::CCD::ISSnoopDevice ( XMLEle root)
overridevirtual

Process a snoop event from INDI server. This function is called when a snooped property is updated in a snooped driver.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in GuideSim, and CCDSim.

Definition at line 728 of file indiccd.cpp.

◆ processFastExposure()

bool INDI::CCD::processFastExposure ( CCDChip targetChip)
protectedvirtual

processFastExposure After an exposure is complete, check if fast exposure was enabled. If it is, then immediately start the next exposure if possible and decrement the counter.

Parameters
targetChipActive fast exposure chip.
Returns
True if next fast exposure is started, false otherwise.

Definition at line 2675 of file indiccd.cpp.

◆ saveConfigItems()

bool INDI::CCD::saveConfigItems ( FILE *  fp)
overrideprotectedvirtual

saveConfigItems Save configuration items in XML file.

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

Reimplemented from INDI::DefaultDevice.

Reimplemented in V4L2_Driver, GuideSim, and CCDSim.

Definition at line 2762 of file indiccd.cpp.

◆ SetCaptureFormat()

bool INDI::CCD::SetCaptureFormat ( uint8_t  index)
protectedvirtual

SetCaptureFormat Set Active Capture format.

Parameters
indexIndex of capture format from CaptureFormatSP property.
Returns
True if change is successful, false otherwise.

Reimplemented in V4L2_Driver, and CCDSim.

Definition at line 3052 of file indiccd.cpp.

◆ SetCCDCapability()

void INDI::CCD::SetCCDCapability ( uint32_t  cap)
protected

SetCCDCapability Set the CCD capabilities. Al fields must be initialized.

Parameters
cappointer to CCDCapability struct.
Examples
simpleccd.cpp.

Definition at line 138 of file indiccd.cpp.

◆ SetCCDParams()

void INDI::CCD::SetCCDParams ( int  x,
int  y,
int  bpp,
float  xf,
float  yf 
)
protectedvirtual

Setup CCD paramters for primary CCD. Child classes call this function to update CCD parameters.

Parameters
xFrame X coordinates in pixels.
yFrame Y coordinates in pixels.
bppBits Per Pixels.
xfX pixel size in microns.
yfY pixel size in microns.
Examples
simpleccd.cpp.

Definition at line 2742 of file indiccd.cpp.

◆ SetGuiderParams()

void INDI::CCD::SetGuiderParams ( int  x,
int  y,
int  bpp,
float  xf,
float  yf 
)
protectedvirtual

Setup CCD paramters for guide head CCD. Child classes call this function to update CCD parameters.

Parameters
xFrame X coordinates in pixels.
yFrame Y coordinates in pixels.
bppBits Per Pixels.
xfX pixel size in microns.
yfY pixel size in microns.

Definition at line 2752 of file indiccd.cpp.

◆ SetTemperature()

int INDI::CCD::SetTemperature ( double  temperature)
protectedvirtual

Set CCD temperature.

Parameters
temperatureCCD temperature in degrees celcius.
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 CCD, it must be implemented in the child class

Reimplemented in SimpleCCD, GuideSim, and CCDSim.

Definition at line 1860 of file indiccd.cpp.

◆ StartExposure()

bool INDI::CCD::StartExposure ( float  duration)
protectedvirtual

Start exposing primary CCD chip.

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

Reimplemented in SimpleCCD, V4L2_Driver, GuideSim, and CCDSim.

Definition at line 1867 of file indiccd.cpp.

◆ StartGuideExposure()

bool INDI::CCD::StartGuideExposure ( float  duration)
protectedvirtual

Start exposing guide CCD chip.

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

Reimplemented in CCDSim.

Definition at line 1873 of file indiccd.cpp.

◆ StartStreaming()

bool INDI::CCD::StartStreaming ( )
protectedvirtual

StartStreaming Start live video streaming.

Returns
True if successful, false otherwise.

Reimplemented in V4L2_Driver, GuideSim, and CCDSim.

Definition at line 2975 of file indiccd.cpp.

◆ StopStreaming()

bool INDI::CCD::StopStreaming ( )
protectedvirtual

StopStreaming Stop live video streaming.

Returns
True if successful, false otherwise.

Reimplemented in V4L2_Driver, GuideSim, and CCDSim.

Definition at line 2981 of file indiccd.cpp.

◆ UpdateCCDBin()

bool INDI::CCD::UpdateCCDBin ( int  hor,
int  ver 
)
protectedvirtual

CCD calls this function when CCD Binning needs to be updated in the hardware. Derived classes should implement this function.

Parameters
horHorizontal binning.
verVertical binning.
Returns
true is CCD chip update is successful, false otherwise.
Note
This function is not implemented in CCD, it must be implemented in the child class

Reimplemented in V4L2_Driver, GuideSim, and CCDSim.

Definition at line 1904 of file indiccd.cpp.

◆ UpdateCCDFrame()

bool INDI::CCD::UpdateCCDFrame ( int  x,
int  y,
int  w,
int  h 
)
protectedvirtual

CCD calls this function when CCD Frame dimension needs to be updated in the hardware. Derived classes should implement this function.

Parameters
xSubframe X coordinate in pixels.
ySubframe Y coordinate in pixels.
wSubframe width in pixels.
hSubframe height in pixels.
Note
(0,0) is defined as most left, top pixel in the subframe.
Returns
true is CCD chip update is successful, false otherwise.
Note
This function is not implemented in CCD, it must be implemented in the child class

Reimplemented in V4L2_Driver, GuideSim, and CCDSim.

Definition at line 1891 of file indiccd.cpp.

◆ UpdateCCDFrameType()

bool INDI::CCD::UpdateCCDFrameType ( CCDChip::CCD_FRAME  fType)
protectedvirtual

CCD calls this function when CCD frame type needs to be updated in the hardware.

Parameters
fTypeFrame type
Returns
true is CCD chip update is successful, false otherwise.
Note
It is not mandatory to implement this function in the child class. The CCD hardware layer may either set the frame type when this function is called, or (optionally) before an exposure is started.

Definition at line 1926 of file indiccd.cpp.

◆ UpdateCCDUploadMode()

virtual bool INDI::CCD::UpdateCCDUploadMode ( CCD_UPLOAD_MODE  mode)
inlineprotectedvirtual

CCD calls this function when client upload mode switch is updated.

Parameters
modeupload mode. UPLOAD_CLIENT only sends the upload the client application. UPLOAD_BOTH saves the frame and uploads it to the client. UPLOAD_LOCAL only saves the frame locally.
Returns
true if mode is changed successfully, false otherwise.
Note
By default this function is implemented in the base class and returns true. Override if necessary.

Definition at line 400 of file indiccd.h.

◆ UpdateGuiderBin()

bool INDI::CCD::UpdateGuiderBin ( int  hor,
int  ver 
)
protectedvirtual

CCD calls this function when Guide head binning is updated by the client. Derived classes should implement this function.

Parameters
horHorizontal binning.
verVertical binning.
Returns
true is CCD chip update is successful, false otherwise.
Note
This function is not implemented in CCD, it must be implemented in the child class

Reimplemented in CCDSim.

Definition at line 1919 of file indiccd.cpp.

◆ UpdateGuiderFrame()

bool INDI::CCD::UpdateGuiderFrame ( int  x,
int  y,
int  w,
int  h 
)
protectedvirtual

CCD calls this function when Guide head frame dimension is updated by the client. Derived classes should implement this function.

Parameters
xSubframe X coordinate in pixels.
ySubframe Y coordinate in pixels.
wSubframe width in pixels.
hSubframe height in pixels.
Note
(0,0) is defined as most left, top pixel in the subframe.
Returns
true is CCD chip update is successful, false otherwise.
Note
This function is not implemented in CCD, it must be implemented in the child class

Definition at line 1898 of file indiccd.cpp.

◆ UpdateGuiderFrameType()

bool INDI::CCD::UpdateGuiderFrameType ( CCDChip::CCD_FRAME  fType)
protectedvirtual

CCD calls this function when Guide frame type is updated by the client.

Parameters
fTypeFrame type
Returns
true is CCD chip update is successful, false otherwise.
Note
It is not mandatory to implement this function in the child class. The CCD hardware layer may either set the frame type when this function is called, or (optionally) before an exposure is started.

Definition at line 1933 of file indiccd.cpp.

◆ updateProperties()

bool INDI::CCD::updateProperties ( )
overridevirtual

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 SimpleCCD, V4L2_Driver, GuideSim, and CCDSim.

Examples
simpleccd.cpp.

Definition at line 528 of file indiccd.cpp.

◆ UploadComplete()

virtual void INDI::CCD::UploadComplete ( CCDChip )
inlineprotectedvirtual

UploadComplete Signal that capture is completed and image was uploaded and/or saved successfully.

Parameters
targetChipActive exposure chip
Note
Child camera should override this function to receive notification on exposure upload completion.

Definition at line 539 of file indiccd.h.

◆ wsThreadHelper()

static void INDI::CCD::wsThreadHelper ( void *  context)
static

Friends And Related Function Documentation

◆ StreamManager

friend class StreamManager
friend

Misc.

Definition at line 807 of file indiccd.h.

◆ StreamManagerPrivate

friend class StreamManagerPrivate
friend

Definition at line 808 of file indiccd.h.

Member Data Documentation

◆ ActiveDeviceT

IText INDI::CCD::ActiveDeviceT[5] {}
protected

Definition at line 664 of file indiccd.h.

◆ ActiveDeviceTP

ITextVectorProperty INDI::CCD::ActiveDeviceTP
protected

ActiveDeviceTP defines 4 devices the camera driver can listen to (snoop) for properties of interest so that it can generate a proper FITS header.

  • Mount: Listens for equatorial coordinates in JNow epoch.
  • Rotator: Listens for Rotator Absolute Rotation Angle (E of N) in degrees.
  • Filter Wheel: Listens for FILTER_SLOT and FILTER_NAME properties.
  • SQM: Listens for sky quality meter magnitude.

Definition at line 661 of file indiccd.h.

◆ Airmass

double INDI::CCD::Airmass
protected

Definition at line 608 of file indiccd.h.

◆ Altitude

double INDI::CCD::Altitude
protected

Definition at line 612 of file indiccd.h.

◆ AutoLoop

bool INDI::CCD::AutoLoop
protected

Definition at line 587 of file indiccd.h.

◆ Azimuth

double INDI::CCD::Azimuth
protected

Definition at line 611 of file indiccd.h.

◆ BayerT

IText INDI::CCD::BayerT[3] {}
protected

Definition at line 694 of file indiccd.h.

◆ BayerTP

ITextVectorProperty INDI::CCD::BayerTP
protected

BayerTP Bayer pattern offset and type.

Definition at line 693 of file indiccd.h.

◆ CaptureFormatSP

INDI::PropertySwitch INDI::CCD::CaptureFormatSP {0}
protected

Specifies Camera NATIVE capture format (e.g. Mono, RGB, RAW8..etc).

Definition at line 705 of file indiccd.h.

◆ ccdBufferLock

std::mutex INDI::CCD::ccdBufferLock
protected

Definition at line 620 of file indiccd.h.

◆ 

enum { ... } INDI::CCD::CCDCapability

◆ CCDRotationN

INumber INDI::CCD::CCDRotationN[1]
protected

Definition at line 758 of file indiccd.h.

◆ CCDRotationNP

INumberVectorProperty INDI::CCD::CCDRotationNP
protected

Definition at line 759 of file indiccd.h.

◆ CurrentFilterSlot

int INDI::CCD::CurrentFilterSlot {-1}
protected

Definition at line 623 of file indiccd.h.

◆ Dec

double INDI::CCD::Dec
protected

Definition at line 567 of file indiccd.h.

◆ DSP

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

Definition at line 628 of file indiccd.h.

◆ EncodeFormatSP

INDI::PropertySwitch INDI::CCD::EncodeFormatSP {3}
protected

Specifies Driver image encoding format (FITS, Native, JPG, ..etc)

Definition at line 708 of file indiccd.h.

◆ EqN

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

Definition at line 643 of file indiccd.h.

◆ EqNP

INumberVectorProperty INDI::CCD::EqNP
protected

Properties.

EqNP Snoop property to read the equatorial coordinates of the mount. ActiveDeviceTP defines snoop devices and the driver listens to this property emitted by the mount driver if specified. It is important to generate a proper FITS header.

Definition at line 642 of file indiccd.h.

◆ exposureDuration

double INDI::CCD::exposureDuration
protected

Definition at line 579 of file indiccd.h.

◆ exposureStartTime

char INDI::CCD::exposureStartTime[MAXINDINAME]
protected

Definition at line 578 of file indiccd.h.

◆ ExposureTime

double INDI::CCD::ExposureTime
protected

Definition at line 594 of file indiccd.h.

◆ FastExposureCountN

INumber INDI::CCD::FastExposureCountN[1]
protected

Definition at line 766 of file indiccd.h.

◆ FastExposureCountNP

INumberVectorProperty INDI::CCD::FastExposureCountNP
protected

Definition at line 767 of file indiccd.h.

◆ FastExposureToggleS

ISwitch INDI::CCD::FastExposureToggleS[2]
protected

Definition at line 762 of file indiccd.h.

◆ FastExposureToggleSP

ISwitchVectorProperty INDI::CCD::FastExposureToggleSP
protected

Definition at line 763 of file indiccd.h.

◆ FastExposureToggleStartup

std::chrono::system_clock::time_point INDI::CCD::FastExposureToggleStartup
protected

Definition at line 769 of file indiccd.h.

◆ FileNameT

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

Definition at line 702 of file indiccd.h.

◆ FileNameTP

ITextVectorProperty INDI::CCD::FileNameTP
protected

FileNameTP File name of locally-saved images. By default, images are uploaded to the client but when upload option is set to either Both or Local, then they are saved on the local disk with this name.

Definition at line 701 of file indiccd.h.

◆ FilterNames

std::vector<std::string> INDI::CCD::FilterNames
protected

Definition at line 622 of file indiccd.h.

◆ FITSHeaderTP

INDI::PropertyText INDI::CCD::FITSHeaderTP {3}
protected

Definition at line 771 of file indiccd.h.

◆ FocuserPos

long INDI::CCD::FocuserPos
protected

Definition at line 604 of file indiccd.h.

◆ FocuserTemp

double INDI::CCD::FocuserTemp
protected

Definition at line 605 of file indiccd.h.

◆ GUIDE_CONTROL_TAB

constexpr const char* INDI::CCD::GUIDE_CONTROL_TAB = "Guider Control"
staticconstexpr

Group Names.

Definition at line 162 of file indiccd.h.

◆ GuideCCD

CCDChip INDI::CCD::GuideCCD
protected

Definition at line 630 of file indiccd.h.

◆ GuiderAutoLoop

bool INDI::CCD::GuiderAutoLoop
protected

Definition at line 588 of file indiccd.h.

◆ GuiderExposureTime

double INDI::CCD::GuiderExposureTime
protected

Definition at line 595 of file indiccd.h.

◆ GuiderSendImage

bool INDI::CCD::GuiderSendImage
protected

Definition at line 590 of file indiccd.h.

◆ GuiderShowMarker

bool INDI::CCD::GuiderShowMarker
protected

Definition at line 592 of file indiccd.h.

◆ InExposure

bool INDI::CCD::InExposure
protected

Definition at line 582 of file indiccd.h.

◆ InGuideExposure

bool INDI::CCD::InGuideExposure
protected

Definition at line 583 of file indiccd.h.

◆ J2000DE

double INDI::CCD::J2000DE
protected

Definition at line 574 of file indiccd.h.

◆ J2000EqN

INumber INDI::CCD::J2000EqN[2]
protected

Definition at line 651 of file indiccd.h.

◆ J2000EqNP

INumberVectorProperty INDI::CCD::J2000EqNP
protected

J200EqNP Snoop property to read the equatorial J2000 coordinates of the mount. ActiveDeviceTP defines snoop devices and the driver listens to this property emitted by the mount driver if specified. It is important to generate a proper FITS header.

Definition at line 650 of file indiccd.h.

◆ J2000RA

double INDI::CCD::J2000RA
protected

Definition at line 573 of file indiccd.h.

◆ J2000Valid

bool INDI::CCD::J2000Valid
protected

Definition at line 575 of file indiccd.h.

◆ Latitude

double INDI::CCD::Latitude
protected

Definition at line 609 of file indiccd.h.

◆ Longitude

double INDI::CCD::Longitude
protected

Definition at line 610 of file indiccd.h.

◆ m_CaptureFormats

std::vector<CaptureFormat> INDI::CCD::m_CaptureFormats
protected

Definition at line 625 of file indiccd.h.

◆ m_TargetTemperature

double INDI::CCD::m_TargetTemperature {0}
protected

Definition at line 615 of file indiccd.h.

◆ m_TemperatureCheckTimer

INDI::Timer INDI::CCD::m_TemperatureCheckTimer
protected

Definition at line 616 of file indiccd.h.

◆ m_TemperatureElapsedTimer

INDI::ElapsedTimer INDI::CCD::m_TemperatureElapsedTimer
protected

Definition at line 617 of file indiccd.h.

◆ m_UploadTime

double INDI::CCD::m_UploadTime = { 0 }
protected

Definition at line 768 of file indiccd.h.

◆ MPSAS

double INDI::CCD::MPSAS
protected

Definition at line 598 of file indiccd.h.

◆ pierSide

int INDI::CCD::pierSide
protected

Definition at line 570 of file indiccd.h.

◆ PrimaryCCD

CCDChip INDI::CCD::PrimaryCCD
protected
Examples
simpleccd.cpp.

Definition at line 629 of file indiccd.h.

◆ RA

double INDI::CCD::RA
protected

Definition at line 567 of file indiccd.h.

◆ RotatorAngle

double INDI::CCD::RotatorAngle
protected

Definition at line 601 of file indiccd.h.

◆ ScopeInfoNP

INDI::PropertyNumber INDI::CCD::ScopeInfoNP {2}
protected

Definition at line 728 of file indiccd.h.

◆ SendImage

bool INDI::CCD::SendImage
protected

Definition at line 589 of file indiccd.h.

◆ ShowMarker

bool INDI::CCD::ShowMarker
protected

Definition at line 591 of file indiccd.h.

◆ snoopedAperture

double INDI::CCD::snoopedAperture
protected

Definition at line 581 of file indiccd.h.

◆ snoopedFocalLength

double INDI::CCD::snoopedFocalLength
protected

Definition at line 581 of file indiccd.h.

◆ Streamer

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

Definition at line 627 of file indiccd.h.

◆ TemperatureN

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

Definition at line 678 of file indiccd.h.

◆ TemperatureNP

INumberVectorProperty INDI::CCD::TemperatureNP
protected

TemperatureNP Camera Temperature in Celcius.

Examples
simpleccd.cpp.

Definition at line 677 of file indiccd.h.

◆ TemperatureRampNP

INDI::PropertyNumber INDI::CCD::TemperatureRampNP {2}
protected

Temperature Ramp in C/Min with configurable threshold.

Definition at line 683 of file indiccd.h.

◆ UploadS

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

Definition at line 716 of file indiccd.h.

◆ UploadSettingsT

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

Definition at line 719 of file indiccd.h.

◆ UploadSettingsTP

ITextVectorProperty INDI::CCD::UploadSettingsTP
protected

Definition at line 720 of file indiccd.h.

◆ UploadSP

ISwitchVectorProperty INDI::CCD::UploadSP
protected

Definition at line 717 of file indiccd.h.

◆ WCS_TAB

constexpr const char* INDI::CCD::WCS_TAB = "WCS"
staticconstexpr

Definition at line 163 of file indiccd.h.

◆ WebSocketS

ISwitch INDI::CCD::WebSocketS[2]
protected

Definition at line 736 of file indiccd.h.

◆ WebSocketSettingsN

INumber INDI::CCD::WebSocketSettingsN[1]
protected

Definition at line 746 of file indiccd.h.

◆ WebSocketSettingsNP

INumberVectorProperty INDI::CCD::WebSocketSettingsNP
protected

Definition at line 747 of file indiccd.h.

◆ WebSocketSP

ISwitchVectorProperty INDI::CCD::WebSocketSP
protected

Definition at line 737 of file indiccd.h.

◆ WorldCoordS

ISwitch INDI::CCD::WorldCoordS[2]
protected

Definition at line 754 of file indiccd.h.

◆ WorldCoordSP

ISwitchVectorProperty INDI::CCD::WorldCoordSP
protected

Definition at line 755 of file indiccd.h.


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