TwiceAsNice  2019-02-18
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Imager Class Reference

#include <agent_imager.h>

Inheritance diagram for Imager:
Inheritance graph
Collaboration diagram for Imager:
Collaboration graph

Public Member Functions

 Imager ()
 
virtual ~Imager ()=default
 
virtual bool initProperties ()
 Initilize properties initial state and value. More...
 
virtual bool updateProperties ()
 updateProperties is called whenever there is a change in the CONNECTION status of the driver. More...
 
virtual void ISGetProperties (const char *dev)
 define the driver's properties to the client. More...
 
virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process the client newNumber command. More...
 
virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process the client newSwitch 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. More...
 
virtual void newDevice (INDI::BaseDevice *dp)
 Emmited when a new device is created from INDI server. More...
 
virtual void newProperty (INDI::Property *property)
 Emmited when a new property is created for an INDI driver. More...
 
virtual void removeProperty (INDI::Property *property)
 Emmited when a property is deleted for an INDI driver. More...
 
virtual void removeDevice (INDI::BaseDevice *dp)
 Emmited when a device is deleted from INDI server. More...
 
virtual void newBLOB (IBLOB *bp)
 Emmited when a new BLOB value arrives from INDI server. More...
 
virtual void newSwitch (ISwitchVectorProperty *svp)
 Emmited when a new switch value arrives from INDI server. More...
 
virtual void newNumber (INumberVectorProperty *nvp)
 Emmited when a new number value arrives from INDI server. More...
 
virtual void newText (ITextVectorProperty *tvp)
 Emmited when a new text value arrives from INDI server. More...
 
virtual void newLight (ILightVectorProperty *lvp)
 Emmited when a new light value arrives from INDI server. More...
 
virtual void newMessage (INDI::BaseDevice *dp, int messageID)
 Emmited when a new message arrives from INDI server. More...
 
virtual void serverConnected ()
 Emmited when the server is connected. More...
 
virtual void serverDisconnected (int exit_code)
 Emmited when the server gets disconnected. More...
 
- Public Member Functions inherited from INDI::DefaultDevice
 DefaultDevice ()
 
virtual ~DefaultDevice ()
 
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. More...
 
void defineText (ITextVectorProperty *tvp)
 Define text vector to client & register it. More...
 
void defineSwitch (ISwitchVectorProperty *svp)
 Define switch vector to client & register it. More...
 
void defineLight (ILightVectorProperty *lvp)
 Define light vector to client & register it. More...
 
void defineBLOB (IBLOBVectorProperty *bvp)
 Define BLOB vector to client & register it. More...
 
virtual bool deleteProperty (const char *propertyName)
 Delete a property and unregister it. 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 ()
 
uint16_t getMinorVersion ()
 
virtual uint16_t getDriverInterface ()
 
void setDriverInterface (uint16_t value)
 setInterface Set driver interface. More...
 
 DefaultDevice ()
 
virtual ~DefaultDevice ()
 
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. More...
 
void defineText (ITextVectorProperty *tvp)
 Define text vector to client & register it. More...
 
void defineSwitch (ISwitchVectorProperty *svp)
 Define switch vector to client & register it. More...
 
void defineLight (ILightVectorProperty *lvp)
 Define light vector to client & register it. More...
 
void defineBLOB (IBLOBVectorProperty *bvp)
 Define BLOB vector to client & register it. More...
 
virtual bool deleteProperty (const char *propertyName)
 Delete a property and unregister it. 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 ()
 
uint16_t getMinorVersion ()
 
virtual uint16_t getDriverInterface ()
 
void setDriverInterface (uint16_t value)
 setInterface Set driver interface. More...
 
- Public Member Functions inherited from INDI::BaseDevice
 BaseDevice ()
 
virtual ~BaseDevice ()
 
INumberVectorPropertygetNumber (const char *name)
 
ITextVectorPropertygetText (const char *name)
 
ISwitchVectorPropertygetSwitch (const char *name)
 
ILightVectorPropertygetLight (const char *name)
 
IBLOBVectorPropertygetBLOB (const char *name)
 
IPState getPropertyState (const char *name)
 
IPerm getPropertyPermission (const char *name)
 
void registerProperty (void *p, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
INDI::PropertygetProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
std::vector< INDI::Property * > * getProperties ()
 Return a list of all properties in the device. More...
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
bool isConnected ()
 
void setDeviceName (const char *dev)
 Set the device name. More...
 
const char * getDeviceName ()
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue. More...
 
void checkMessage (XMLEle *root)
 
void doMessage (XMLEle *msg)
 
std::string messageQueue (int index) const
 
std::string lastMessage ()
 
void setMediator (INDI::BaseMediator *med)
 Set the driver's mediator to receive notification of news devices and updated property values. More...
 
INDI::BaseMediatorgetMediator ()
 
const char * getDriverName ()
 
const char * getDriverExec ()
 
const char * getDriverVersion ()
 
 BaseDevice ()
 
virtual ~BaseDevice ()
 
INumberVectorPropertygetNumber (const char *name)
 
ITextVectorPropertygetText (const char *name)
 
ISwitchVectorPropertygetSwitch (const char *name)
 
ILightVectorPropertygetLight (const char *name)
 
IBLOBVectorPropertygetBLOB (const char *name)
 
IPState getPropertyState (const char *name)
 
IPerm getPropertyPermission (const char *name)
 
void registerProperty (void *p, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
INDI::PropertygetProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
std::vector< INDI::Property * > * getProperties ()
 Return a list of all properties in the device. More...
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
bool isConnected ()
 
void setDeviceName (const char *dev)
 Set the device name. More...
 
const char * getDeviceName ()
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue. More...
 
void checkMessage (XMLEle *root)
 
void doMessage (XMLEle *msg)
 
std::string messageQueue (int index) const
 
std::string lastMessage ()
 
void setMediator (INDI::BaseMediator *med)
 Set the driver's mediator to receive notification of news devices and updated property values. More...
 
INDI::BaseMediatorgetMediator ()
 
const char * getDriverName ()
 
const char * getDriverExec ()
 
const char * getDriverVersion ()
 
- Public Member Functions inherited from INDI::BaseClient
 BaseClient ()
 
virtual ~BaseClient ()
 
void setServer (const char *hostname, unsigned int port)
 Set the server host name and port. More...
 
void watchDevice (const char *deviceName)
 Add a device to the watch list. More...
 
bool connectServer ()
 Connect to INDI server. More...
 
bool disconnectServer ()
 Disconnect from INDI server. More...
 
bool isServerConnected () const
 
void connectDevice (const char *deviceName)
 Connect to INDI driver. More...
 
void disconnectDevice (const char *deviceName)
 Disconnect INDI driver. More...
 
INDI::BaseDevicegetDevice (const char *deviceName)
 
const std::vector< INDI::BaseDevice * > & getDevices () const
 
bool getDevices (std::vector< INDI::BaseDevice *> &deviceList, uint16_t driverInterface)
 
getDevices Returns list of devices that belong to a particular DRIVER_INTERFACE class. More...
 
void setBLOBMode (BLOBHandling blobH, const char *dev, const char *prop=NULL)
 Set Binary Large Object policy mode. More...
 
BLOBHandling getBLOBMode (const char *dev, const char *prop=NULL)
 getBLOBMode Get Binary Large Object policy mode IF set previously by setBLOBMode More...
 
const char * getHost ()
 
int getPort ()
 
void sendNewText (ITextVectorProperty *pp)
 Send new Text command to server. More...
 
void sendNewText (const char *deviceName, const char *propertyName, const char *elementName, const char *text)
 Send new Text command to server. More...
 
void sendNewNumber (INumberVectorProperty *pp)
 Send new Number command to server. More...
 
void sendNewNumber (const char *deviceName, const char *propertyName, const char *elementName, double value)
 Send new Number command to server. More...
 
void sendNewSwitch (ISwitchVectorProperty *pp)
 Send new Switch command to server. More...
 
void sendNewSwitch (const char *deviceName, const char *propertyName, const char *elementName)
 Send new Switch command to server. More...
 
void startBlob (const char *devName, const char *propName, const char *timestamp)
 Send opening tag for BLOB command to server. More...
 
void sendOneBlob (IBLOB *bp)
 Send ONE blob content to server. More...
 
void sendOneBlob (const char *blobName, unsigned int blobSize, const char *blobFormat, void *blobBuffer)
 Send ONE blob content to server. More...
 
void finishBlob ()
 Send closing tag for BLOB command to server. More...
 
void setVerbose (bool enable)
 setVerbose Set verbose mode More...
 
bool isVerbose () const
 isVerbose Is client in verbose mode? More...
 
void setConnectionTimeout (uint32_t seconds, uint32_t microseconds)
 setConnectionTimeout Set connection timeout. More...
 
 BaseClient ()
 
virtual ~BaseClient ()
 
void setServer (const char *hostname, unsigned int port)
 Set the server host name and port. More...
 
void watchDevice (const char *deviceName)
 Add a device to the watch list. More...
 
bool connectServer ()
 Connect to INDI server. More...
 
bool disconnectServer ()
 Disconnect from INDI server. More...
 
bool isServerConnected () const
 
void connectDevice (const char *deviceName)
 Connect to INDI driver. More...
 
void disconnectDevice (const char *deviceName)
 Disconnect INDI driver. More...
 
INDI::BaseDevicegetDevice (const char *deviceName)
 
const std::vector< INDI::BaseDevice * > & getDevices () const
 
bool getDevices (std::vector< INDI::BaseDevice *> &deviceList, uint16_t driverInterface)
 
getDevices Returns list of devices that belong to a particular DRIVER_INTERFACE class. More...
 
void setBLOBMode (BLOBHandling blobH, const char *dev, const char *prop=NULL)
 Set Binary Large Object policy mode. More...
 
BLOBHandling getBLOBMode (const char *dev, const char *prop=NULL)
 getBLOBMode Get Binary Large Object policy mode IF set previously by setBLOBMode More...
 
const char * getHost ()
 
int getPort ()
 
void sendNewText (ITextVectorProperty *pp)
 Send new Text command to server. More...
 
void sendNewText (const char *deviceName, const char *propertyName, const char *elementName, const char *text)
 Send new Text command to server. More...
 
void sendNewNumber (INumberVectorProperty *pp)
 Send new Number command to server. More...
 
void sendNewNumber (const char *deviceName, const char *propertyName, const char *elementName, double value)
 Send new Number command to server. More...
 
void sendNewSwitch (ISwitchVectorProperty *pp)
 Send new Switch command to server. More...
 
void sendNewSwitch (const char *deviceName, const char *propertyName, const char *elementName)
 Send new Switch command to server. More...
 
void startBlob (const char *devName, const char *propName, const char *timestamp)
 Send opening tag for BLOB command to server. More...
 
void sendOneBlob (IBLOB *bp)
 Send ONE blob content to server. More...
 
void sendOneBlob (const char *blobName, unsigned int blobSize, const char *blobFormat, void *blobBuffer)
 Send ONE blob content to server. More...
 
void finishBlob ()
 Send closing tag for BLOB command to server. More...
 
void setVerbose (bool enable)
 setVerbose Set verbose mode More...
 
bool isVerbose () const
 isVerbose Is client in verbose mode? More...
 
void setConnectionTimeout (uint32_t seconds, uint32_t microseconds)
 setConnectionTimeout Set connection timeout. More...
 
- Public Member Functions inherited from INDI::BaseMediator
virtual ~BaseMediator ()
 
virtual ~BaseMediator ()
 

Static Public Attributes

static const std::string DEVICE_NAME = "Imager Agent"
 

Protected Member Functions

virtual const char * getDefaultName ()
 
virtual bool Connect ()
 Connect to the device. More...
 
virtual bool Disconnect ()
 Disconnect from device. More...
 
- Protected Member Functions inherited from INDI::DefaultDevice
void setDynamicPropertiesBehavior (bool defineEnabled, bool deleteEnabled)
 setDynamicPropertiesBehavior controls handling of dynamic properties. 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 saveConfigItems (FILE *fp)
 saveConfigItems Save specific properties in the provide config file handler. 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. More...
 
virtual void simulationTriggered (bool enable)
 Inform driver that the simulation option was triggered. More...
 
bool isDebug ()
 
bool isSimulation ()
 
void registerConnection (Connection::Interface *newConnection)
 registerConnection Add new connection plugin to the existing connection pool. More...
 
bool unRegisterConnection (Connection::Interface *existingConnection)
 unRegisterConnection Remove connection from existing pool More...
 
Connection::InterfacegetActiveConnection ()
 
void setDefaultPollingPeriod (uint32_t period)
 
uint32_t getPollingPeriod ()
 
void setDynamicPropertiesBehavior (bool defineEnabled, bool deleteEnabled)
 setDynamicPropertiesBehavior controls handling of dynamic properties. 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 saveConfigItems (FILE *fp)
 saveConfigItems Save specific properties in the provide config file handler. 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. More...
 
virtual void simulationTriggered (bool enable)
 Inform driver that the simulation option was triggered. More...
 
bool isDebug ()
 
bool isSimulation ()
 
void registerConnection (Connection::Interface *newConnection)
 registerConnection Add new connection plugin to the existing connection pool. More...
 
bool unRegisterConnection (Connection::Interface *existingConnection)
 unRegisterConnection Remove connection from existing pool More...
 
Connection::InterfacegetActiveConnection ()
 
void setDefaultPollingPeriod (uint32_t period)
 
uint32_t getPollingPeriod ()
 
- Protected Member Functions inherited from INDI::BaseDevice
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...
 
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...
 
- Protected Member Functions inherited from INDI::BaseClient
int dispatchCommand (XMLEle *root, char *errmsg)
 Dispatch command received from INDI server to respective devices handled by the client. More...
 
int deleteDevice (const char *devName, char *errmsg)
 Remove device. More...
 
int delPropertyCmd (XMLEle *root, char *errmsg)
 Delete property command. More...
 
INDI::BaseDevicefindDev (const char *devName, char *errmsg)
 Find and return a particular device. More...
 
INDI::BaseDeviceaddDevice (XMLEle *dep, char *errmsg)
 Add a new device. More...
 
INDI::BaseDevicefindDev (XMLEle *root, int create, char *errmsg)
 Find a device, and if it doesn't exist, create it if create is set to 1. More...
 
int messageCmd (XMLEle *root, char *errmsg)
 Process messages. More...
 
virtual void newUniversalMessage (std::string message)
 newUniversalMessage Universal messages are sent from INDI server without a specific device. More...
 
int dispatchCommand (XMLEle *root, char *errmsg)
 Dispatch command received from INDI server to respective devices handled by the client. More...
 
int deleteDevice (const char *devName, char *errmsg)
 Remove device. More...
 
int delPropertyCmd (XMLEle *root, char *errmsg)
 Delete property command. More...
 
INDI::BaseDevicefindDev (const char *devName, char *errmsg)
 Find and return a particular device. More...
 
INDI::BaseDeviceaddDevice (XMLEle *dep, char *errmsg)
 Add a new device. More...
 
INDI::BaseDevicefindDev (XMLEle *root, int create, char *errmsg)
 Find a device, and if it doesn't exist, create it if create is set to 1. More...
 
int messageCmd (XMLEle *root, char *errmsg)
 Process messages. More...
 
virtual void newUniversalMessage (std::string message)
 newUniversalMessage Universal messages are sent from INDI server without a specific device. More...
 

Private Member Functions

bool isRunning ()
 
bool isCCDConnected ()
 
bool isFilterConnected ()
 
void defineProperties ()
 
void deleteProperties ()
 
void initiateNextFilter ()
 
void initiateNextCapture ()
 
void startBatch ()
 
void abortBatch ()
 
void batchDone ()
 
void initiateDownload ()
 
std::shared_ptr< GroupcurrentGroup () const
 
std::shared_ptr< GroupnextGroup () const
 
std::shared_ptr< GroupgetGroup (int index) const
 

Private Attributes

char format [16]
 
int group { 0 }
 
int maxGroup { 0 }
 
int image { 0 }
 
int maxImage { 0 }
 
char * controlledCCD { nullptr }
 
char * controlledFilterWheel { nullptr }
 
ITextVectorProperty ControlledDeviceTP
 
IText ControlledDeviceT [2]
 
INumberVectorProperty GroupCountNP
 
INumber GroupCountN [1]
 
INumberVectorProperty ProgressNP
 
INumber ProgressN [3]
 
ISwitchVectorProperty BatchSP
 
ISwitch BatchS [2]
 
ILightVectorProperty StatusLP
 
ILight StatusL [2]
 
ITextVectorProperty ImageNameTP
 
IText ImageNameT [2]
 
INumberVectorProperty DownloadNP
 
INumber DownloadN [2]
 
IBLOBVectorProperty FitsBP
 
IBLOB FitsB [1]
 
INumberVectorProperty CCDImageExposureNP
 
INumber CCDImageExposureN [1]
 
INumberVectorProperty CCDImageBinNP
 
INumber CCDImageBinN [2]
 
ISwitch CCDUploadS [3]
 
ISwitchVectorProperty CCDUploadSP
 
IText CCDUploadSettingsT [2]
 
ITextVectorProperty CCDUploadSettingsTP
 
INumberVectorProperty FilterSlotNP
 
INumber FilterSlotN [1]
 
std::vector< std::shared_ptr< Group > > groups
 

Additional Inherited Members

- 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,
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4
}
 
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), AUX_INTERFACE = (1 << 15),
  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), AUX_INTERFACE = (1 << 15)
}
 The DRIVER_INTERFACE enum defines the class of devices the driver implements. More...
 
enum  INDI_ERROR {
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4,
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4
}
 
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), AUX_INTERFACE = (1 << 15),
  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), AUX_INTERFACE = (1 << 15)
}
 The DRIVER_INTERFACE enum defines the class of devices the driver implements. More...
 
- Static Public Member Functions inherited from INDI::BaseClient
static void * listenHelper (void *context)
 
static void * listenHelper (void *context)
 
- Protected Attributes inherited from INDI::DefaultDevice
uint32_t POLLMS = 1000
 Period in milliseconds to call TimerHit(). Default 1000 ms. More...
 

Constructor & Destructor Documentation

◆ Imager()

Imager::Imager ( )

◆ ~Imager()

virtual Imager::~Imager ( )
virtualdefault

Member Function Documentation

◆ abortBatch()

void Imager::abortBatch ( )
private

◆ batchDone()

void Imager::batchDone ( )
private

◆ Connect()

bool Imager::Connect ( )
protectedvirtual

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

Returns
True if connection is successful, false otherwise

Reimplemented from INDI::DefaultDevice.

◆ currentGroup()

std::shared_ptr< Group > Imager::currentGroup ( ) const
private

◆ defineProperties()

void Imager::defineProperties ( )
private

◆ deleteProperties()

void Imager::deleteProperties ( )
private

◆ Disconnect()

bool Imager::Disconnect ( )
protectedvirtual

Disconnect from device.

Returns
True if successful, false otherwise

Reimplemented from INDI::DefaultDevice.

◆ getDefaultName()

const char * Imager::getDefaultName ( )
protectedvirtual
Returns
Default name of the device.

Implements INDI::DefaultDevice.

◆ getGroup()

std::shared_ptr< Group > Imager::getGroup ( int  index) const
private

◆ initiateDownload()

void Imager::initiateDownload ( )
private

◆ initiateNextCapture()

void Imager::initiateNextCapture ( )
private

◆ initiateNextFilter()

void Imager::initiateNextFilter ( )
private

◆ initProperties()

bool Imager::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.

◆ isCCDConnected()

bool Imager::isCCDConnected ( )
private

◆ isFilterConnected()

bool Imager::isFilterConnected ( )
private

◆ ISGetProperties()

void Imager::ISGetProperties ( const char *  dev)
virtual

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.

◆ ISNewBLOB()

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

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.

◆ ISNewNumber()

bool Imager::ISNewNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)
virtual

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.

◆ ISNewSwitch()

bool Imager::ISNewSwitch ( const char *  dev,
const char *  name,
ISState states,
char *  names[],
int  n 
)
virtual

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.

◆ ISNewText()

bool Imager::ISNewText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)
virtual

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.

◆ isRunning()

bool Imager::isRunning ( )
private

◆ ISSnoopDevice()

bool Imager::ISSnoopDevice ( XMLEle root)
virtual

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.

◆ newBLOB()

void Imager::newBLOB ( IBLOB bp)
virtual

Emmited when a new BLOB value arrives from INDI server.

Parameters
bpPointer to filled and process BLOB.

Implements INDI::BaseMediator.

◆ newDevice()

void Imager::newDevice ( INDI::BaseDevice dp)
virtual

Emmited when a new device is created from INDI server.

Parameters
dpPointer to the base device instance

Implements INDI::BaseMediator.

◆ newLight()

void Imager::newLight ( ILightVectorProperty lvp)
virtual

Emmited when a new light value arrives from INDI server.

Parameters
lvpPointer to a light vector property.

Implements INDI::BaseMediator.

◆ newMessage()

void Imager::newMessage ( INDI::BaseDevice dp,
int  messageID 
)
virtual

Emmited when a new message arrives from INDI server.

Parameters
dppointer to the INDI device the message is sent to.
messageIDID of the message that can be used to retrieve the message from the device's messageQueue() function.

Implements INDI::BaseMediator.

◆ newNumber()

void Imager::newNumber ( INumberVectorProperty nvp)
virtual

Emmited when a new number value arrives from INDI server.

Parameters
nvpPointer to a number vector property.

Implements INDI::BaseMediator.

◆ newProperty()

void Imager::newProperty ( INDI::Property property)
virtual

Emmited when a new property is created for an INDI driver.

Parameters
propertyPointer to the Property Container

Implements INDI::BaseMediator.

◆ newSwitch()

void Imager::newSwitch ( ISwitchVectorProperty svp)
virtual

Emmited when a new switch value arrives from INDI server.

Parameters
svpPointer to a switch vector property.

Implements INDI::BaseMediator.

◆ newText()

void Imager::newText ( ITextVectorProperty tvp)
virtual

Emmited when a new text value arrives from INDI server.

Parameters
tvpPointer to a text vector property.

Implements INDI::BaseMediator.

◆ nextGroup()

std::shared_ptr< Group > Imager::nextGroup ( ) const
private

◆ removeDevice()

void Imager::removeDevice ( INDI::BaseDevice dp)
virtual

Emmited when a device is deleted from INDI server.

Parameters
dpPointer to the base device instance.

Implements INDI::BaseMediator.

◆ removeProperty()

void Imager::removeProperty ( INDI::Property property)
virtual

Emmited when a property is deleted for an INDI driver.

Parameters
propertyPointer to the Property Container to remove.

Implements INDI::BaseMediator.

◆ serverConnected()

void Imager::serverConnected ( )
virtual

Emmited when the server is connected.

Implements INDI::BaseMediator.

◆ serverDisconnected()

void Imager::serverDisconnected ( int  exit_code)
virtual

Emmited when the server gets disconnected.

Parameters
exit_code0 if client was requested to disconnect from server. -1 if connection to server is terminated due to remote server disconnection.

Implements INDI::BaseMediator.

◆ startBatch()

void Imager::startBatch ( )
private

◆ updateProperties()

bool Imager::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.

Member Data Documentation

◆ BatchS

ISwitch Imager::BatchS[2]
private

◆ BatchSP

ISwitchVectorProperty Imager::BatchSP
private

◆ CCDImageBinN

INumber Imager::CCDImageBinN[2]
private

◆ CCDImageBinNP

INumberVectorProperty Imager::CCDImageBinNP
private

◆ CCDImageExposureN

INumber Imager::CCDImageExposureN[1]
private

◆ CCDImageExposureNP

INumberVectorProperty Imager::CCDImageExposureNP
private

◆ CCDUploadS

ISwitch Imager::CCDUploadS[3]
private

◆ CCDUploadSettingsT

IText Imager::CCDUploadSettingsT[2]
private

◆ CCDUploadSettingsTP

ITextVectorProperty Imager::CCDUploadSettingsTP
private

◆ CCDUploadSP

ISwitchVectorProperty Imager::CCDUploadSP
private

◆ controlledCCD

char* Imager::controlledCCD { nullptr }
private

◆ ControlledDeviceT

IText Imager::ControlledDeviceT[2]
private

◆ ControlledDeviceTP

ITextVectorProperty Imager::ControlledDeviceTP
private

◆ controlledFilterWheel

char* Imager::controlledFilterWheel { nullptr }
private

◆ DEVICE_NAME

const std::string Imager::DEVICE_NAME = "Imager Agent"
static

◆ DownloadN

INumber Imager::DownloadN[2]
private

◆ DownloadNP

INumberVectorProperty Imager::DownloadNP
private

◆ FilterSlotN

INumber Imager::FilterSlotN[1]
private

◆ FilterSlotNP

INumberVectorProperty Imager::FilterSlotNP
private

◆ FitsB

IBLOB Imager::FitsB[1]
private

◆ FitsBP

IBLOBVectorProperty Imager::FitsBP
private

◆ format

char Imager::format[16]
private

◆ group

int Imager::group { 0 }
private

◆ GroupCountN

INumber Imager::GroupCountN[1]
private

◆ GroupCountNP

INumberVectorProperty Imager::GroupCountNP
private

◆ groups

std::vector<std::shared_ptr<Group> > Imager::groups
private

◆ image

int Imager::image { 0 }
private

◆ ImageNameT

IText Imager::ImageNameT[2]
private

◆ ImageNameTP

ITextVectorProperty Imager::ImageNameTP
private

◆ maxGroup

int Imager::maxGroup { 0 }
private

◆ maxImage

int Imager::maxImage { 0 }
private

◆ ProgressN

INumber Imager::ProgressN[3]
private

◆ ProgressNP

INumberVectorProperty Imager::ProgressNP
private

◆ StatusL

ILight Imager::StatusL[2]
private

◆ StatusLP

ILightVectorProperty Imager::StatusLP
private

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