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

Class to provide general functionality of a focuser device. More...

#include <indifocuser.h>

Inheritance diagram for INDI::Focuser:
INDI::DefaultDevice INDI::FocuserInterface INDI::BaseDevice

Public Member Functions

virtual bool initProperties ()
 Initilize properties initial state and value. The child class must implement this function. 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 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 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 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...
 
- 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::FocuserInterface
void setFocuserFeatures (bool CanAbsMove, bool CanRelMove, bool CanAbort, bool VariableSpeed)
 setFocuserFeatures Sets Focuser features More...
 

Protected Member Functions

virtual bool saveConfigItems (FILE *fp)
 saveConfigItems Saves the Device Port and Focuser Presets in the configuration file 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::FocuserInterface
void initFocuserProperties (const char *deviceName, const char *groupName)
 Initilize focuser properties. It is recommended to call this function within initProperties() of your primary device. More...
 
bool processFocuserNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process focus number properties.
 
bool processFocuserSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process focus switch properties.
 
virtual bool SetSpeed (int speed)
 SetSpeed Set Focuser speed. More...
 
virtual int Move (FocusDirection dir, int speed, int duration)
 Move the focuser in a particular direction with a specific speed for a finite duration. More...
 
virtual int MoveAbs (int ticks)
 Move the focuser to an absolute position. More...
 
virtual int MoveRel (FocusDirection dir, unsigned int ticks)
 Move the focuser to an relative position. More...
 
virtual bool Abort ()
 Abort all focus motion. 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 focuser device.

Both relative and absolute focuser supported. Furthermore, if no position feedback is available from the focuser, an open-loop control is possible using timers, speed presets, and direction of motion. Developers need to subclass INDI::Focuser to implement any driver for focusers within INDI.

Author
Jasem Mutlaq
Gerry Rozema

Definition at line 36 of file indifocuser.h.

Member Function Documentation

bool INDI::Focuser::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 32 of file indifocuser.cpp.

void INDI::Focuser::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 59 of file indifocuser.cpp.

bool INDI::Focuser::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 116 of file indifocuser.cpp.

bool INDI::Focuser::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 141 of file indifocuser.cpp.

bool INDI::Focuser::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 173 of file indifocuser.cpp.

bool INDI::Focuser::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 189 of file indifocuser.cpp.

bool INDI::Focuser::saveConfigItems ( FILE *  fp)
protectedvirtual

saveConfigItems Saves the Device Port and Focuser Presets in the configuration file

Parameters
fppointer to configuration file
Returns
true if successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Definition at line 194 of file indifocuser.cpp.

bool INDI::Focuser::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 69 of file indifocuser.cpp.


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