Instrument Neutral Distributed Interface INDI  1.5.0
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | 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 FocusLynxBase FocusSim Gemini HitecAstroDCFocuser Microtouch MoonLite NFocus NightCrawler NSTEP PerfectStar RoboFocus SmartFocus SteelDrive TCFS USBFocusV3

Public Types

Public Member Functions

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

Public Attributes

enum INDI::FocuserInterface:: { ... }  FocuserCapability
 

Protected Member Functions

 FocuserInterface ()
 
virtual ~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. More...
 
bool processFocuserSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process focus switch properties. More...
 
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 targetTicks)
 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...
 

Protected Attributes

INumberVectorProperty FocusSpeedNP
 
INumber FocusSpeedN [1]
 
ISwitchVectorProperty FocusMotionSP
 
ISwitch FocusMotionS [2]
 
INumberVectorProperty FocusTimerNP
 
INumber FocusTimerN [1]
 
INumberVectorProperty FocusAbsPosNP
 
INumber FocusAbsPosN [1]
 
INumberVectorProperty FocusRelPosNP
 
INumber FocusRelPosN [1]
 
ISwitchVectorProperty AbortSP
 
ISwitch AbortS [1]
 
uint32_t capability
 
char focuserName [MAXINDIDEVICE]
 
double lastTimerValue
 

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 initialize 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 47 of file indifocuserinterface.h.

Enumerator
FOCUS_INWARD 
FOCUS_OUTWARD 

Definition at line 41 of file indifocuserinterface.h.

Constructor & Destructor Documentation

INDI::FocuserInterface::FocuserInterface ( )
protected

Definition at line 27 of file indifocuserinterface.cpp.

INDI::FocuserInterface::~FocuserInterface ( )
protectedvirtual

Definition at line 31 of file indifocuserinterface.cpp.

Member Function Documentation

bool INDI::FocuserInterface::AbortFocuser ( )
protectedvirtual

AbortFocuser all focus motion.

Returns
True if abort is successful, false otherwise.

Reimplemented in USBFocusV3, Gemini, FocusLynxBase, SteelDrive, Microtouch, PerfectStar, NightCrawler, NSTEP, MoonLite, RoboFocus, and SmartFocus.

Definition at line 289 of file indifocuserinterface.cpp.

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

Definition at line 79 of file indifocuserinterface.h.

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

Definition at line 69 of file indifocuserinterface.h.

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

Definition at line 74 of file indifocuserinterface.h.

uint32_t INDI::FocuserInterface::GetFocuserCapability ( ) const
inline

GetFocuserCapability returns the capability of the focuser.

Definition at line 58 of file indifocuserinterface.h.

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

Definition at line 84 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  targetTicks)
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.

Reimplemented in USBFocusV3, Gemini, FocusLynxBase, TCFS, SteelDrive, Microtouch, PerfectStar, NSTEP, FocusSim, NightCrawler, NFocus, MoonLite, SmartFocus, and RoboFocus.

Definition at line 282 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.

Reimplemented in Gemini, FocusLynxBase, SteelDrive, Microtouch, HitecAstroDCFocuser, FocusSim, and MoonLite.

Definition at line 265 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.

Reimplemented in USBFocusV3, Gemini, FocusLynxBase, TCFS, Microtouch, HitecAstroDCFocuser, PerfectStar, FocusSim, NightCrawler, NFocus, MoonLite, SmartFocus, and RoboFocus.

Definition at line 274 of file indifocuserinterface.cpp.

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

Process focus number properties.

Definition at line 65 of file indifocuserinterface.cpp.

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

Process focus switch properties.

Definition at line 221 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 307 of file indifocuserinterface.cpp.

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

SetFocuserSpeed Set Focuser speed.

Parameters
speedfocuser speed
Returns
true if successful, false otherwise

Reimplemented in USBFocusV3, SteelDrive, Microtouch, NSTEP, FocusSim, and MoonLite.

Definition at line 297 of file indifocuserinterface.cpp.

Member Data Documentation

ISwitch INDI::FocuserInterface::AbortS[1]
protected

Definition at line 159 of file indifocuserinterface.h.

ISwitchVectorProperty INDI::FocuserInterface::AbortSP
protected

Definition at line 158 of file indifocuserinterface.h.

uint32_t INDI::FocuserInterface::capability
protected

Definition at line 161 of file indifocuserinterface.h.

INumber INDI::FocuserInterface::FocusAbsPosN[1]
protected

Definition at line 155 of file indifocuserinterface.h.

INumberVectorProperty INDI::FocuserInterface::FocusAbsPosNP
protected

Definition at line 154 of file indifocuserinterface.h.

enum { ... } INDI::FocuserInterface::FocuserCapability
char INDI::FocuserInterface::focuserName[MAXINDIDEVICE]
protected

Definition at line 163 of file indifocuserinterface.h.

ISwitch INDI::FocuserInterface::FocusMotionS[2]
protected

Definition at line 151 of file indifocuserinterface.h.

ISwitchVectorProperty INDI::FocuserInterface::FocusMotionSP
protected

Definition at line 150 of file indifocuserinterface.h.

INumber INDI::FocuserInterface::FocusRelPosN[1]
protected

Definition at line 157 of file indifocuserinterface.h.

INumberVectorProperty INDI::FocuserInterface::FocusRelPosNP
protected

Definition at line 156 of file indifocuserinterface.h.

INumber INDI::FocuserInterface::FocusSpeedN[1]
protected

Definition at line 149 of file indifocuserinterface.h.

INumberVectorProperty INDI::FocuserInterface::FocusSpeedNP
protected

Definition at line 148 of file indifocuserinterface.h.

INumber INDI::FocuserInterface::FocusTimerN[1]
protected

Definition at line 153 of file indifocuserinterface.h.

INumberVectorProperty INDI::FocuserInterface::FocusTimerNP
protected

Definition at line 152 of file indifocuserinterface.h.

double INDI::FocuserInterface::lastTimerValue
protected

Definition at line 164 of file indifocuserinterface.h.


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