Instrument Neutral Distributed Interface INDI  1.5.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
INDI::FilterInterface Class Referenceabstract

Provides interface to implement Filter Wheel functionality. More...

#include <indifilterinterface.h>

Inheritance diagram for INDI::FilterInterface:
CCDSim INDI::FilterWheel FilterIFW FilterSim QFW TruTech XAGYLWheel

Public Member Functions

virtual int QueryFilter ()=0
 Return current filter position. More...
 
virtual bool SelectFilter (int position)=0
 Select a new filter position. More...
 
virtual bool SetFilterNames ()=0
 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)=0
 Obtains a list of filter names from the hardware and initializes the FilterNameTP property. The function should check for the number of filters available in the filter wheel and build the FilterNameTP property accordingly. More...
 
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

 FilterInterface ()
 
 ~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...
 

Protected Attributes

INumberVectorProperty FilterSlotNP
 
INumber FilterSlotN [1]
 
ITextVectorPropertyFilterNameTP
 
ITextFilterNameT
 
int CurrentFilter
 
int TargetFilter
 

Detailed Description

Provides interface to implement Filter Wheel functionality.

A filter wheel can be an independent device, or an embedded filter wheel within another device (e.g. CCD camera). Child class must implement all the pure virtual functions and call SelectFilterDone(int) when selection of a new filter position is complete in the hardware.

IMPORTANT: initFilterProperties() must be called before any other function to initilize the filter properties.

IMPORTANT: processFilterSlot() must be called in your driver's ISNewNumber() function. processFilterSlot() will call the driver's SelectFilter() accordingly.

Note
Filter position starts from 1 and not 0
Author
Gerry Rozema, Jasem Mutlaq

Definition at line 40 of file indifilterinterface.h.

Constructor & Destructor Documentation

INDI::FilterInterface::FilterInterface ( )
protected

Definition at line 25 of file indifilterinterface.cpp.

INDI::FilterInterface::~FilterInterface ( )
protected

Definition at line 38 of file indifilterinterface.cpp.

Member Function Documentation

virtual bool INDI::FilterInterface::GetFilterNames ( const char *  groupName)
pure virtual

Obtains a list of filter names from the hardware and initializes 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.

Implemented in FilterIFW, INDI::FilterWheel, XAGYLWheel, TruTech, QFW, and FilterSim.

void INDI::FilterInterface::initFilterProperties ( const char *  deviceName,
const char *  groupName 
)
protected

Initilize filter wheel properties. It is recommended to call this function within initProperties() of your primary device.

Parameters
deviceNameName of the primary device
groupNameGroup or tab name to be used to define filter wheel properties.

Definition at line 31 of file indifilterinterface.cpp.

void INDI::FilterInterface::processFilterName ( const char *  deviceName,
char *  texts[],
char *  names[],
int  n 
)
protected

Process client request to change filter name(s). Call this function in the filter wheel implementation class ISNewText() function.

Parameters
deviceNameName of the primary device
textsvalues from ISNewText().
namesnames from ISNewText();
nn from ISNewtext();

Definition at line 90 of file indifilterinterface.cpp.

void INDI::FilterInterface::processFilterSlot ( const char *  deviceName,
double  values[],
char *  names[] 
)
protected

Process client request to change filter position. Call this function in the filter wheel implementation class ISNewNumber function.

Parameters
deviceNameName of the primary device
valuesvalues from ISNewNumber().
namesnames from ISNewNumber();

Definition at line 54 of file indifilterinterface.cpp.

virtual int INDI::FilterInterface::QueryFilter ( )
pure virtual

Return current filter position.

Implemented in INDI::FilterWheel, and QFW.

virtual bool INDI::FilterInterface::SelectFilter ( int  position)
pure virtual

Select a new filter position.

Returns
True if operation is successful, false otherwise

Implemented in FilterIFW, INDI::FilterWheel, XAGYLWheel, QFW, TruTech, and FilterSim.

void INDI::FilterInterface::SelectFilterDone ( int  newpos)

The child class calls this function when the hardware successfully finished selecting a new filter wheel position.

Parameters
newposNew position of the filter wheel

Definition at line 43 of file indifilterinterface.cpp.

virtual bool INDI::FilterInterface::SetFilterNames ( )
pure virtual

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

Implemented in FilterIFW, INDI::FilterWheel, XAGYLWheel, TruTech, QFW, and FilterSim.

Member Data Documentation

int INDI::FilterInterface::CurrentFilter
protected

Definition at line 115 of file indifilterinterface.h.

IText* INDI::FilterInterface::FilterNameT
protected

Definition at line 113 of file indifilterinterface.h.

ITextVectorProperty* INDI::FilterInterface::FilterNameTP
protected

Definition at line 112 of file indifilterinterface.h.

INumber INDI::FilterInterface::FilterSlotN[1]
protected

Definition at line 110 of file indifilterinterface.h.

INumberVectorProperty INDI::FilterInterface::FilterSlotNP
protected

Definition at line 109 of file indifilterinterface.h.

int INDI::FilterInterface::TargetFilter
protected

Definition at line 116 of file indifilterinterface.h.


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