Instrument Neutral Distributed Interface INDI  1.5.0
Public Types | Protected Member Functions | Protected Attributes | List of all members
INDI::LightBoxInterface Class Reference

Provides interface to implement controllable light box/switch device. More...

#include <indilightboxinterface.h>

Inheritance diagram for INDI::LightBoxInterface:
FlipFlat

Public Types

Protected Member Functions

 LightBoxInterface (INDI::DefaultDevice *device, bool isDimmable)
 
virtual ~LightBoxInterface ()
 
void initLightBoxProperties (const char *deviceName, const char *groupNam)
 Initilize light box properties. It is recommended to call this function within initProperties() of your primary device. More...
 
void isGetLightBoxProperties (const char *deviceName)
 isGetLightBoxProperties Get light box properties More...
 
bool processLightBoxSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process light box switch properties. More...
 
bool processLightBoxNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process light box number properties. More...
 
bool processLightBoxText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Process light box text properties. More...
 
bool updateLightBoxProperties ()
 
bool saveLightBoxConfigItems (FILE *fp)
 
bool snoopLightBox (XMLEle *root)
 
virtual bool SetLightBoxBrightness (uint16_t value)
 setBrightness Set light level. Must be impelemented in the child class, if supported. More...
 
virtual bool EnableLightBox (bool enable)
 EnableLightBox Turn on/off on a light box. Must be impelemented in the child class. More...
 

Protected Attributes

ISwitchVectorProperty LightSP
 
ISwitch LightS [2]
 
INumberVectorProperty LightIntensityNP
 
INumber LightIntensityN [1]
 
ITextVectorProperty ActiveDeviceTP
 
IText ActiveDeviceT [1]
 
INumberVectorProperty FilterIntensityNP
 
INumberFilterIntensityN
 

Detailed Description

Provides interface to implement controllable light box/switch device.

Filter durations preset can be defined if the active filter name is set. Once the filter names are retrieved, the duration in seconds can be set for each filter. When the filter wheel changes to a new filter, the duration is set accordingly.

The child class is expected to call the following functions from the INDI frameworks standard functions:

IMPORTANT: initLightBoxProperties() must be called before any other function to initilize the Light device properties. IMPORTANT: isGetLightBoxProperties() must be called in your driver ISGetProperties function IMPORTANT: processLightBoxSwitch() must be called in your driver ISNewSwitch function. IMPORTANT: processLightBoxNumber() must be called in your driver ISNewNumber function. IMPORTANT: processLightBoxText() must be called in your driver ISNewText function.

Author
Jasem Mutlaq

Definition at line 43 of file indilightboxinterface.h.

Member Enumeration Documentation

anonymous enum
Enumerator
FLAT_LIGHT_ON 
FLAT_LIGHT_OFF 

Definition at line 46 of file indilightboxinterface.h.

Constructor & Destructor Documentation

INDI::LightBoxInterface::LightBoxInterface ( INDI::DefaultDevice device,
bool  isDimmable 
)
protected

Definition at line 27 of file indilightboxinterface.cpp.

INDI::LightBoxInterface::~LightBoxInterface ( )
protectedvirtual

Definition at line 35 of file indilightboxinterface.cpp.

Member Function Documentation

bool INDI::LightBoxInterface::EnableLightBox ( bool  enable)
protectedvirtual

EnableLightBox Turn on/off on a light box. Must be impelemented in the child class.

Parameters
enableIf true, turn on the light, otherwise turn off the light.
Returns
True if successful, false otherwise.

Reimplemented in FlipFlat.

Definition at line 188 of file indilightboxinterface.cpp.

void INDI::LightBoxInterface::initLightBoxProperties ( const char *  deviceName,
const char *  groupNam 
)
protected

Initilize light box 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 light box properties.

Definition at line 39 of file indilightboxinterface.cpp.

void INDI::LightBoxInterface::isGetLightBoxProperties ( const char *  deviceName)
protected

isGetLightBoxProperties Get light box properties

Parameters
deviceNameparent device name

Definition at line 65 of file indilightboxinterface.cpp.

bool INDI::LightBoxInterface::processLightBoxNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)
protected

Process light box number properties.

Definition at line 119 of file indilightboxinterface.cpp.

bool INDI::LightBoxInterface::processLightBoxSwitch ( const char *  dev,
const char *  name,
ISState states,
char *  names[],
int  n 
)
protected

Process light box switch properties.

Definition at line 90 of file indilightboxinterface.cpp.

bool INDI::LightBoxInterface::processLightBoxText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)
protected

Process light box text properties.

Definition at line 167 of file indilightboxinterface.cpp.

bool INDI::LightBoxInterface::saveLightBoxConfigItems ( FILE *  fp)
protected

Definition at line 289 of file indilightboxinterface.cpp.

bool INDI::LightBoxInterface::SetLightBoxBrightness ( uint16_t  value)
protectedvirtual

setBrightness Set light level. Must be impelemented in the child class, if supported.

Parameters
valuelevel of light box
Returns
True if successful, false otherwise.

Reimplemented in FlipFlat.

Definition at line 195 of file indilightboxinterface.cpp.

bool INDI::LightBoxInterface::snoopLightBox ( XMLEle root)
protected

Definition at line 202 of file indilightboxinterface.cpp.

bool INDI::LightBoxInterface::updateLightBoxProperties ( )
protected

Definition at line 74 of file indilightboxinterface.cpp.

Member Data Documentation

IText INDI::LightBoxInterface::ActiveDeviceT[1]
protected

Definition at line 105 of file indilightboxinterface.h.

ITextVectorProperty INDI::LightBoxInterface::ActiveDeviceTP
protected

Definition at line 104 of file indilightboxinterface.h.

INumber* INDI::LightBoxInterface::FilterIntensityN
protected

Definition at line 108 of file indilightboxinterface.h.

INumberVectorProperty INDI::LightBoxInterface::FilterIntensityNP
protected

Definition at line 107 of file indilightboxinterface.h.

INumber INDI::LightBoxInterface::LightIntensityN[1]
protected

Definition at line 101 of file indilightboxinterface.h.

INumberVectorProperty INDI::LightBoxInterface::LightIntensityNP
protected

Definition at line 100 of file indilightboxinterface.h.

ISwitch INDI::LightBoxInterface::LightS[2]
protected

Definition at line 97 of file indilightboxinterface.h.

ISwitchVectorProperty INDI::LightBoxInterface::LightSP
protected

Definition at line 96 of file indilightboxinterface.h.


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