Instrument Neutral Distributed Interface INDI  0.9.9
Public Member Functions | Protected Member Functions | List of all members
INDI::Telescope Class Referenceabstract

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

#include <inditelescope.h>

Inheritance diagram for INDI::Telescope:
INDI::DefaultDevice INDI::BaseDevice

Public Member Functions

virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process the client newNumber 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 ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process the client newSwitch command. 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 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...
 
virtual bool initProperties ()
 Called to initialize basic properties required all the time.
 
virtual bool updateProperties ()
 Called when connected state changes, to add/remove properties.
 
virtual void TimerHit ()
 Called when setTimer() time is up.
 
virtual bool Connect ()
 Connect to the telescope. More...
 
virtual bool Disconnect ()
 Disconnect from telescope. More...
 
virtual bool Connect (const char *port)
 INDI::Telescope implementation of Connect() assumes 9600 baud, 8 bit word, even parity, and no stop bit. Override function if communication paramaters are different. 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 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 ()
 

Protected Member Functions

void NewRaDec (double ra, double dec)
 The child class calls this function when it has updates.
 
virtual bool ReadScopeStatus ()=0
 Read telescope status. This function checks the following: More...
 
virtual bool Goto (double ra, double dec)=0
 Move the scope to the supplied RA and DEC coordinates. More...
 
virtual bool canSync ()
 Does the mount support sync? More...
 
virtual bool Sync (double ra, double dec)
 Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates. More...
 
virtual bool MoveNS (TelescopeMotionNS dir, TelescopeMotionCommand command)
 Start or Stop the telescope motion in the direction dir. More...
 
virtual bool MoveWE (TelescopeMotionWE dir, TelescopeMotionCommand command)
 Move the telescope in the direction dir. More...
 
virtual bool canPark ()
 Does the mount support park? More...
 
virtual bool Park ()
 Park the telescope to its home position. More...
 
virtual bool Abort ()=0
 Abort telescope motion. More...
 
virtual bool updateTime (ln_date *utc, double utc_offset)
 Update telescope time, date, and UTC offset. More...
 
virtual bool updateLocation (double latitude, double longitude, double elevation)
 Update telescope location settings. 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 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.
 

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 telescope device.

Developers need to subclass INDI::Telescope to implement any driver for telescopes within INDI.

Implementing a basic telescope driver involves the child class performing the following steps:

Author
Gerry Rozema, Jasem Mutlaq
See Also
TelescopeSimulator and SynScan drivers for examples of implementations of INDI::Telescope.
Examples:
simplescope.h.

Definition at line 46 of file inditelescope.h.

Member Function Documentation

virtual bool INDI::Telescope::Abort ( )
protectedpure virtual

Abort telescope motion.

Returns
True if successful, false otherewise
Note
This function is not implemented in INDI::Telescope, it must be implemented in the child class
Examples:
simplescope.h.
bool INDI::Telescope::canPark ( )
protectedvirtual

Does the mount support park?

Returns
True if park is supported, false otherwise.
Note
This function defaults to return false unless subclassed by the child class.

Definition at line 662 of file inditelescope.cpp.

bool INDI::Telescope::canSync ( )
protectedvirtual

Does the mount support sync?

Returns
True if sync is supported, false otherwise.
Note
This function is not implemented in INDI::Telescope, it must be implemented in the child class

Definition at line 657 of file inditelescope.cpp.

bool INDI::Telescope::Connect ( )
virtual

Connect to the telescope.

Returns
True if connection is successful, false otherwise

Implements INDI::DefaultDevice.

Examples:
simplescope.h.

Definition at line 556 of file inditelescope.cpp.

bool INDI::Telescope::Connect ( const char *  port)
virtual

INDI::Telescope implementation of Connect() assumes 9600 baud, 8 bit word, even parity, and no stop bit. Override function if communication paramaters are different.

Parameters
portPort to connect to
Returns
True if connection is successful, false otherwise
Warning
Do not call this function directly, it is called by INDI::Telescope Connect() function.

Definition at line 580 of file inditelescope.cpp.

bool INDI::Telescope::Disconnect ( )
virtual

Disconnect from telescope.

Returns
True if successful, false otherwise

Implements INDI::DefaultDevice.

Examples:
simplescope.h.

Definition at line 618 of file inditelescope.cpp.

virtual bool INDI::Telescope::Goto ( double  ra,
double  dec 
)
protectedpure virtual

Move the scope to the supplied RA and DEC coordinates.

Returns
True if successful, false otherewise
Note
This function is not implemented in INDI::Telescope, it must be implemented in the child class
Examples:
simplescope.h.
void INDI::Telescope::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 92 of file inditelescope.cpp.

bool INDI::Telescope::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 292 of file inditelescope.cpp.

bool INDI::Telescope::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 407 of file inditelescope.cpp.

bool INDI::Telescope::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 234 of file inditelescope.cpp.

bool INDI::Telescope::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 151 of file inditelescope.cpp.

bool INDI::Telescope::MoveNS ( TelescopeMotionNS  dir,
TelescopeMotionCommand  command 
)
protectedvirtual

Start or Stop the telescope motion in the direction dir.

Parameters
dirdirection of motion
commandStart or Stop command
Returns
True if successful, false otherewise
Note
This function is not implemented in INDI::Telescope, it must be implemented in the child class

Definition at line 209 of file inditelescope.cpp.

bool INDI::Telescope::MoveWE ( TelescopeMotionWE  dir,
TelescopeMotionCommand  command 
)
protectedvirtual

Move the telescope in the direction dir.

Parameters
dirdirection of motion
commandStart or Stop command
Returns
True if successful, false otherewise
Note
This function is not implemented in INDI::Telescope, it must be implemented in the child class

Definition at line 220 of file inditelescope.cpp.

bool INDI::Telescope::Park ( )
protectedvirtual

Park the telescope to its home position.

Returns
True if successful, false otherewise
Note
This function defaults to return false unless subclassed by the child class.

Definition at line 649 of file inditelescope.cpp.

virtual bool INDI::Telescope::ReadScopeStatus ( )
protectedpure virtual

Read telescope status. This function checks the following:

  1. Check if the link to the telescope is alive.
  2. Update telescope status: Idle, Slewing, Parking..etc.
  3. Read coordinates
Returns
True if reading scope status is OK, false if an error is encounterd.
Note
This function is not implemented in INDI::Telescope, it must be implemented in the child class
Examples:
simplescope.h.
bool INDI::Telescope::Sync ( double  ra,
double  dec 
)
protectedvirtual

Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.

Returns
True if successful, false otherewise
Note
This function implemented INDI::Telescope always returns false. Override the function to return true.

Definition at line 202 of file inditelescope.cpp.

bool INDI::Telescope::updateLocation ( double  latitude,
double  longitude,
double  elevation 
)
protectedvirtual

Update telescope location settings.

Parameters
latitudeSite latitude in degrees.
longitudeSite latitude in degrees increasing eastward from Greenwich (0 to 360).
elevationSite elevation in meters.
Returns
True if successful, false otherewise
Note
This function performs no action unless subclassed by the child class if required.

Definition at line 675 of file inditelescope.cpp.

bool INDI::Telescope::updateTime ( ln_date *  utc,
double  utc_offset 
)
protectedvirtual

Update telescope time, date, and UTC offset.

Parameters
utcUTC time.
utc_offsetUTC offset in hours.
Returns
True if successful, false otherewise
Note
This function performs no action unless subclassed by the child class if required.

Definition at line 667 of file inditelescope.cpp.


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