Instrument Neutral Distributed Interface INDI  1.2.0
Public Types | Public Member Functions | Protected Member Functions | List of all members
INDI::FocuserInterface Class Reference

Provides interface to implement focuser functionality. More...

#include <indifocuserinterface.h>

Inheritance diagram for INDI::FocuserInterface:
INDI::Focuser

Public Types

Public Member Functions

uint32_t GetFocuserCapability () const
 GetFocuserCapability returns the capability of the focuser.
 
void SetFocuserCapability (uint32_t cap)
 SetFocuserCapability sets the focuser capabilities. All capabilities must be initialized. More...
 
bool CanAbsMove ()
 
bool CanRelMove ()
 
bool CanAbort ()
 
bool HasVariableSpeed ()
 

Protected Member Functions

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 SetFocuserSpeed (int speed)
 SetFocuserSpeed Set Focuser speed. More...
 
virtual IPState MoveFocuser (FocusDirection dir, int speed, uint16_t duration)
 MoveFocuser the focuser in a particular direction with a specific speed for a finite duration. More...
 
virtual IPState MoveAbsFocuser (uint32_t ticks)
 MoveFocuser the focuser to an absolute position. More...
 
virtual IPState MoveRelFocuser (FocusDirection dir, uint32_t ticks)
 MoveFocuser the focuser to an relative position. More...
 
virtual bool AbortFocuser ()
 AbortFocuser all focus motion. More...
 

Detailed Description

Provides interface to implement focuser functionality.

A focuser can be an independent device, or an embedded focuser within another device (e.g. Camera).

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

IMPORTANT: processFocuserNumber() and processFocuserSwitch() must be called in your driver's ISNewNumber() and ISNewSwitch functions recepectively.

Author
Jasem Mutlaq

Definition at line 38 of file indifocuserinterface.h.

Member Enumeration Documentation

anonymous enum
Enumerator
FOCUSER_CAN_ABS_MOVE 

Can the focuser move by absolute position?

FOCUSER_CAN_REL_MOVE 

Can the focuser move by relative position?

FOCUSER_CAN_ABORT 

Is it possible to abort focuser motion?

FOCUSER_HAS_VARIABLE_SPEED 

Can the focuser move in different configurable speeds?

Definition at line 44 of file indifocuserinterface.h.

Member Function Documentation

bool INDI::FocuserInterface::AbortFocuser ( )
protectedvirtual

AbortFocuser all focus motion.

Returns
True if abort is successful, false otherwise.

Definition at line 276 of file indifocuserinterface.cpp.

bool INDI::FocuserInterface::CanAbort ( )
inline
Returns
True if the focuser motion can be aborted.

Definition at line 76 of file indifocuserinterface.h.

bool INDI::FocuserInterface::CanAbsMove ( )
inline
Returns
True if the focuser has absolute position encoders.

Definition at line 66 of file indifocuserinterface.h.

bool INDI::FocuserInterface::CanRelMove ( )
inline
Returns
True if the focuser has relative position encoders.

Definition at line 71 of file indifocuserinterface.h.

bool INDI::FocuserInterface::HasVariableSpeed ( )
inline
Returns
True if the focuser has multiple speeds.

Definition at line 81 of file indifocuserinterface.h.

void INDI::FocuserInterface::initFocuserProperties ( const char *  deviceName,
const char *  groupName 
)
protected

Initilize focuser 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 focuser properties.

Definition at line 35 of file indifocuserinterface.cpp.

IPState INDI::FocuserInterface::MoveAbsFocuser ( uint32_t  ticks)
protectedvirtual

MoveFocuser the focuser to an absolute position.

Parameters
ticksThe new position of the focuser.
Returns
Return IPS_OK if motion is completed and focuser reached requested position. Return IPS_BUSY if focuser started motion to requested position and is in progress. Return IPS_ALERT if there is an error.

Definition at line 269 of file indifocuserinterface.cpp.

IPState INDI::FocuserInterface::MoveFocuser ( FocusDirection  dir,
int  speed,
uint16_t  duration 
)
protectedvirtual

MoveFocuser the focuser in a particular direction with a specific speed for a finite duration.

Parameters
dirDirection of focuser, either FOCUS_INWARD or FOCUS_OUTWARD.
speedSpeed of focuser if supported by the focuser.
durationThe timeout in milliseconds before the focus motion halts.
Returns
Return IPS_OK if motion is completed and focuser reached requested position. Return IPS_BUSY if focuser started motion to requested position and is in progress. Return IPS_ALERT if there is an error.

Definition at line 257 of file indifocuserinterface.cpp.

IPState INDI::FocuserInterface::MoveRelFocuser ( FocusDirection  dir,
uint32_t  ticks 
)
protectedvirtual

MoveFocuser the focuser to an relative position.

Parameters
dirDirection of focuser, either FOCUS_INWARD or FOCUS_OUTWARD.
ticksThe relative ticks to move.
Returns
Return IPS_OK if motion is completed and focuser reached requested position. Return IPS_BUSY if focuser started motion to requested position and is in progress. Return IPS_ALERT if there is an error.

Definition at line 263 of file indifocuserinterface.cpp.

void INDI::FocuserInterface::SetFocuserCapability ( uint32_t  cap)

SetFocuserCapability sets the focuser capabilities. All capabilities must be initialized.

Parameters
cappointer to focuser capability struct.

Definition at line 294 of file indifocuserinterface.cpp.

bool INDI::FocuserInterface::SetFocuserSpeed ( int  speed)
protectedvirtual

SetFocuserSpeed Set Focuser speed.

Parameters
speedfocuser speed
Returns
true if successful, false otherwise

Definition at line 284 of file indifocuserinterface.cpp.


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