Instrument Neutral Distributed Interface INDI  0.9.9
Public Member Functions | Protected Member Functions | List of all members
INDI::FilterWheel Class Reference

Class to provide general functionality of a filter wheel device. More...

#include <indifilterwheel.h>

Inheritance diagram for INDI::FilterWheel:
INDI::DefaultDevice INDI::FilterInterface INDI::BaseDevice

Public Member Functions

virtual bool initProperties ()
 Initilize properties initial state and value. The child class must implement this function. More...
 
virtual bool updateProperties ()
 updateProperties is called whenever there is a change in the CONNECTION status of the driver. This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver may only define a set of properties after a device is connected, but not before. More...
 
virtual void ISGetProperties (const char *dev)
 define the driver's properties to the client. Usually, only a minumum 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. Otherweise, 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 ISSnoopDevice (XMLEle *root)
 Process a snoop event from INDI server. This function is called when a snooped property is updated in a snooped driver. More...
 
virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process the client newNumber command. More...
 
virtual bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Process the client newSwitch command. More...
 
- Public Member Functions inherited from INDI::DefaultDevice
void addAuxControls ()
 Add Debug, Simulation, and Configuration options to the driver.
 
void addDebugControl ()
 Add Debug control to the driver.
 
void addSimulationControl ()
 Add Simulation control to the driver.
 
void addConfigurationControl ()
 Add Configuration control to the driver.
 
void resetProperties ()
 Set all properties to IDLE state.
 
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 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 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 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 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...
 
virtual bool deleteProperty (const char *propertyName)
 Delete a property and unregister it. It will also be deleted from all clients. More...
 
virtual void setConnected (bool status, IPState state=IPS_OK, const char *msg=NULL)
 Set connection switch status in the client. More...
 
int SetTimer (int 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.
 
virtual const char * getDriverName ()
 
void setVersion (unsigned int vMajor, unsigned int vMinor)
 Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor. More...
 
unsigned int getMajorVersion ()
 
unsigned int getMinorVersion ()
 
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...
 
- Public Member Functions inherited from INDI::BaseDevice
INumberVectorPropertygetNumber (const char *name)
 
ITextVectorPropertygetText (const char *name)
 
ISwitchVectorPropertygetSwitch (const char *name)
 
ILightVectorPropertygetLight (const char *name)
 
IBLOBVectorPropertygetBLOB (const char *name)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void * getRawProperty (const char *name, INDI_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
INDI::Property * getProperty (const char *name, INDI_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.
 
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 char *msg)
 Add message to the driver's message queue. More...
 
const char * messageQueue (int index)
 
const char * lastMessage ()
 
void setMediator (INDI::BaseMediator *med)
 Set the driver's mediator to receive notification of news devices and updated property values.
 
INDI::BaseMediatorgetMediator ()
 
const char * getDriverName ()
 
const char * getDriverExec ()
 
- Public Member Functions inherited from INDI::FilterInterface
void SelectFilterDone (int newpos)
 The child class calls this function when the hardware successfully finished selecting a new filter wheel position. More...
 

Protected Member Functions

virtual int QueryFilter ()
 Return current filter position.
 
virtual bool SelectFilter (int)
 Select a new filter position. More...
 
virtual bool SetFilterNames ()
 Set filter names as defined by the client for each filter position. The desired filter names are stored in FilterNameTP property. Filter names should be saved in hardware if possible. More...
 
virtual bool GetFilterNames (const char *groupName)
 Obtains a list of filter names from the hardware and initilizes the FilterNameTP property. The function should check for the number of filters available in the filter wheel and build the FilterNameTP property accordingly. More...
 
- Protected Member Functions inherited from INDI::DefaultDevice
virtual bool loadConfig (bool silent=false)
 Load the last saved configuration file. More...
 
virtual bool saveConfig ()
 Save the current properties in a configuration file. More...
 
virtual bool loadDefaultConfig ()
 Load the default configuration file. More...
 
void setDebug (bool enable)
 Toggle driver debug status. More...
 
void setSimulation (bool enable)
 Toggle driver simulation status. 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 ()
 
virtual bool Connect ()=0
 Connect to a device. Child classes must implement this function and perform the connection routine in the function. More...
 
virtual bool Disconnect ()=0
 Disconnect from a device. Child classes must implement this function and perform the disconnection routine in the function. More...
 
virtual const char * getDefaultName ()=0
 
- 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
 
int setBLOB (IBLOBVectorProperty *pp, XMLEle *root, char *errmsg)
 Parse and store BLOB in the respective vector.
 
- Protected Member Functions inherited from INDI::FilterInterface
void initFilterProperties (const char *deviceName, const char *groupName)
 Initilize filter wheel properties. It is recommended to call this function within initProperties() of your primary device. More...
 
void processFilterSlot (const char *deviceName, double values[], char *names[])
 Process client request to change filter position. Call this function in the filter wheel implementation class ISNewNumber function. More...
 
void processFilterName (const char *deviceName, char *texts[], char *names[], int n)
 Process client request to change filter name(s). Call this function in the filter wheel implementation class ISNewText() function. More...
 

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 }
 

Detailed Description

Class to provide general functionality of a filter wheel device.

Developers need to subclass INDI::FilterWheel to implement any driver for filter wheels within INDI.

Author
Gerry Rozema, Jasem Mutlaq
See Also
INDI::FilterInterface

Definition at line 35 of file indifilterwheel.h.

Member Function Documentation

bool INDI::FilterWheel::GetFilterNames ( const char *  groupName)
protectedvirtual

Obtains a list of filter names from the hardware and initilizes the FilterNameTP property. The function should check for the number of filters available in the filter wheel and build the FilterNameTP property accordingly.

Parameters
groupNamegroup name for FilterNameTP property to be created.
Returns
True if successful, false if unsupported or failed operation
See Also
QSI CCD implementation of the FilterInterface. QSI CCD is available as a 3rd party INDI driver.

Implements INDI::FilterInterface.

Definition at line 163 of file indifilterwheel.cpp.

bool INDI::FilterWheel::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.

Definition at line 37 of file indifilterwheel.cpp.

void INDI::FilterWheel::ISGetProperties ( const char *  dev)
virtual

define the driver's properties to the client. Usually, only a minumum 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. Otherweise, 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.

Definition at line 51 of file indifilterwheel.cpp.

bool INDI::FilterWheel::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.

Definition at line 95 of file indifilterwheel.cpp.

bool INDI::FilterWheel::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.

Definition at line 89 of file indifilterwheel.cpp.

bool INDI::FilterWheel::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.

Definition at line 115 of file indifilterwheel.cpp.

bool INDI::FilterWheel::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.

Definition at line 169 of file indifilterwheel.cpp.

bool INDI::FilterWheel::SelectFilter ( int  position)
protectedvirtual

Select a new filter position.

Returns
True if operation is successful, false otherwise

Implements INDI::FilterInterface.

Definition at line 152 of file indifilterwheel.cpp.

bool INDI::FilterWheel::SetFilterNames ( )
protectedvirtual

Set filter names as defined by the client for each filter position. The desired filter names are stored in FilterNameTP property. Filter names should be saved in hardware if possible.

Returns
True if successful, false if supported or failed operation

Implements INDI::FilterInterface.

Definition at line 157 of file indifilterwheel.cpp.

bool INDI::FilterWheel::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.

Definition at line 68 of file indifilterwheel.cpp.


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