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

#include <indifilterinterface.h>

Inheritance diagram for INDI::FilterInterface:
CCDSim INDI::FilterWheel MockCCDSimDriver FilterIFW FilterSim ManualFilter PegasusINDIGO QFW QHYCFW1 QHYCFW2 QHYCFW3 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 ()
 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. The default implementation saves them in the configuration file. More...
 
virtual bool GetFilterNames ()
 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. The default implementation loads the filter names from configuration file. 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 (DefaultDevice *defaultDevice)
 FilterInterface Initiailize Filter Interface. More...
 
 ~FilterInterface ()
 
void initProperties (const char *groupName)
 Initilize filter wheel properties. It is recommended to call this function within initProperties() of your primary device. More...
 
bool updateProperties ()
 updateProperties Defines or Delete proprties based on default device connection status More...
 
bool processNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process number properties. More...
 
bool processText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Process text properties. More...
 
void generateSampleFilters ()
 generateSampleFilters Generate sample 8-filter wheel and fill it sample filters More...
 
bool saveConfigItems (FILE *fp)
 saveConfigItems save Filter Names in config file More...
 

Protected Attributes

INumberVectorProperty FilterSlotNP
 
INumber FilterSlotN [1]
 
ITextVectorPropertyFilterNameTP { nullptr }
 
ITextFilterNameT
 
int CurrentFilter = 1
 
int TargetFilter = 1
 
bool loadingFromConfig = false
 
DefaultDevicem_defaultDevice { nullptr }
 

Detailed Description

Definition at line 45 of file indifilterinterface.h.

Constructor & Destructor Documentation

◆ FilterInterface()

FilterInterface::FilterInterface ( DefaultDevice defaultDevice)
explicitprotected

FilterInterface Initiailize Filter Interface.

Parameters
defaultDevicedefault device that owns the interface

Definition at line 28 of file indifilterinterface.cpp.

◆ ~FilterInterface()

FilterInterface::~FilterInterface ( )
protected

Definition at line 34 of file indifilterinterface.cpp.

Member Function Documentation

◆ generateSampleFilters()

void FilterInterface::generateSampleFilters ( )
protected

generateSampleFilters Generate sample 8-filter wheel and fill it sample filters

Definition at line 191 of file indifilterinterface.cpp.

◆ GetFilterNames()

bool FilterInterface::GetFilterNames ( )
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. The default implementation loads the filter names from configuration file.

Returns
True if successful, false if unsupported or failed operation

Reimplemented in FilterIFW.

Definition at line 220 of file indifilterinterface.cpp.

◆ initProperties()

void FilterInterface::initProperties ( const char *  groupName)
protected

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

Parameters
groupNameGroup or tab name to be used to define filter wheel properties.

Definition at line 39 of file indifilterinterface.cpp.

◆ processNumber()

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

Process number properties.

Definition at line 72 of file indifilterinterface.cpp.

◆ processText()

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

Process text properties.

Definition at line 115 of file indifilterinterface.cpp.

◆ QueryFilter()

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

Return current filter position.

Implemented in INDI::FilterWheel, TruTech, CCDSim, and QFW.

◆ saveConfigItems()

bool FilterInterface::saveConfigItems ( FILE *  fp)
protected

saveConfigItems save Filter Names in config file

Parameters
fppointer to config file
Returns
Always return true

Definition at line 171 of file indifilterinterface.cpp.

◆ SelectFilter()

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

Select a new filter position.

Returns
True if operation is successful, false otherwise

Implemented in INDI::FilterWheel, XAGYLWheel, TruTech, QHYCFW3, QHYCFW2, QHYCFW1, PegasusINDIGO, ManualFilter, FilterIFW, CCDSim, QFW, and FilterSim.

◆ SelectFilterDone()

void 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 180 of file indifilterinterface.cpp.

◆ SetFilterNames()

bool FilterInterface::SetFilterNames ( )
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. The default implementation saves them in the configuration file.

Returns
True if successful, false if supported or failed operation

Reimplemented in FilterIFW.

Definition at line 240 of file indifilterinterface.cpp.

◆ updateProperties()

bool FilterInterface::updateProperties ( )
protected

updateProperties Defines or Delete proprties based on default device connection status

Returns
True if all is OK, false otherwise.

Definition at line 49 of file indifilterinterface.cpp.

Member Data Documentation

◆ CurrentFilter

int INDI::FilterInterface::CurrentFilter = 1
protected

Definition at line 128 of file indifilterinterface.h.

◆ FilterNameT

IText* INDI::FilterInterface::FilterNameT
protected

Definition at line 126 of file indifilterinterface.h.

◆ FilterNameTP

ITextVectorProperty* INDI::FilterInterface::FilterNameTP { nullptr }
protected

Definition at line 125 of file indifilterinterface.h.

◆ FilterSlotN

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

Definition at line 122 of file indifilterinterface.h.

◆ FilterSlotNP

INumberVectorProperty INDI::FilterInterface::FilterSlotNP
protected

Definition at line 121 of file indifilterinterface.h.

◆ loadingFromConfig

bool INDI::FilterInterface::loadingFromConfig = false
protected

Definition at line 130 of file indifilterinterface.h.

◆ m_defaultDevice

DefaultDevice* INDI::FilterInterface::m_defaultDevice { nullptr }
protected

Definition at line 132 of file indifilterinterface.h.

◆ TargetFilter

int INDI::FilterInterface::TargetFilter = 1
protected

Definition at line 129 of file indifilterinterface.h.


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