Stellarium 0.14.3
List of all members | Public Slots | Signals | Public Member Functions
TelescopeControl Class Reference

This class manages the controlling of one or more telescopes by one instance of the stellarium program. More...

#include <TelescopeControl.hpp>

Public Slots

void setFlagTelescopeReticles (bool b)
 Set display flag for telescope reticles. More...
 
bool getFlagTelescopeReticles () const
 Get display flag for telescope reticles. More...
 
void setFlagTelescopeLabels (bool b)
 Set display flag for telescope name labels. More...
 
bool getFlagTelescopeLabels () const
 Get display flag for telescope name labels. More...
 
void setFlagTelescopeCircles (bool b)
 Set display flag for telescope field of view circles. More...
 
bool getFlagTelescopeCircles () const
 Get display flag for telescope field of view circles. More...
 
void setReticleColor (const Vec3f &c)
 Set the telescope reticle color. More...
 
const Vec3f & getReticleColor () const
 Get the telescope reticle color. More...
 
const Vec3f & getLabelColor () const
 Get the telescope labels color. More...
 
void setLabelColor (const Vec3f &c)
 Set the telescope labels color. More...
 
void setCircleColor (const Vec3f &c)
 Set the field of view circles color. More...
 
const Vec3f & getCircleColor () const
 Get the field of view circles color. More...
 
void setFontSize (int fontSize)
 Define font size to use for telescope names display. More...
 
void slewTelescopeToSelectedObject ()
 slews a telescope to the selected object. More...
 
void slewTelescopeToViewDirection ()
 slews a telescope to the point of the celestial sphere currently in the center of the screen. More...
 
void setFlagUseTelescopeServerLogs (bool b)
 Used in the GUI. More...
 

Signals

void clientConnected (int slot, QString name)
 
void clientDisconnected (int slot)
 

Public Member Functions

virtual void init ()
 
virtual void deinit ()
 
virtual void update (double deltaTime)
 
virtual void draw (StelCore *core)
 
virtual double getCallOrder (StelModuleActionName actionName) const
 
virtual QList< StelObjectPsearchAround (const Vec3d &v, double limitFov, const StelCore *core) const
 
virtual StelObjectP searchByNameI18n (const QString &nameI18n) const
 
virtual StelObjectP searchByName (const QString &name) const
 
virtual QStringList listMatchingObjectsI18n (const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const
 Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name. More...
 
virtual QStringList listMatchingObjects (const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const
 Find and return the list of at most maxNbItem objects auto-completing the passed object English name. More...
 
virtual QStringList listAllObjects (bool inEnglish) const
 
virtual QStringList listAllObjectsByType (const QString &objType, bool inEnglish) const
 
virtual QString getName () const
 
virtual bool configureGui (bool show=true)
 
void telescopeGoto (int telescopeNr, const Vec3d &j2000Pos)
 Send a J2000-goto-command to the specified telescope. More...
 
void deleteAllTelescopes ()
 Remove all currently registered telescopes. More...
 
const QHash< QString,
DeviceModel > & 
getDeviceModels ()
 Safe access to the loaded list of telescope models. More...
 
void loadConfiguration ()
 Loads the module's configuration from the configuration file. More...
 
void saveConfiguration ()
 Saves the module's configuration to the configuration file. More...
 
void saveTelescopes ()
 Saves to telescopes.json a list of the parameters of the active telescope clients. More...
 
void loadTelescopes ()
 Loads from telescopes.json the parameters of telescope clients and initializes them. If there are already any initialized telescope clients, they are removed. More...
 
bool addTelescopeAtSlot (int slot, ConnectionType connectionType, QString name, QString equinox, QString host=QString("localhost"), int portTCP=DEFAULT_TCP_PORT, int delay=DEFAULT_DELAY, bool connectAtStartup=false, QList< double > circles=QList< double >(), QString serverName=QString(), QString portSerial=QString())
 Adds a telescope description containing the given properties. More...
 
bool getTelescopeAtSlot (int slot, ConnectionType &connectionType, QString &name, QString &equinox, QString &host, int &portTCP, int &delay, bool &connectAtStartup, QList< double > &circles, QString &serverName, QString &portSerial)
 Retrieves a telescope description. Returns false if the slot is empty. Returns empty serverName and portSerial if the description contains no server. More...
 
bool removeTelescopeAtSlot (int slot)
 Removes info from the tree. Should it include stopTelescopeAtSlot()? More...
 
bool startTelescopeAtSlot (int slot)
 Starts a telescope at the given slot, getting its description with getTelescopeAtSlot(). Creates a TelescopeClient object and starts a server process if necessary. More...
 
bool stopTelescopeAtSlot (int slot)
 Stops the telescope at the given slot. Destroys the TelescopeClient object and terminates the server process if necessary. More...
 
bool stopAllTelescopes ()
 Stops all telescopes, but without removing them like deleteAllTelescopes(). More...
 
bool isExistingClientAtSlot (int slot)
 Checks if there's a TelescopeClient object at a given slot, i.e. if there's an active telescope at that slot. More...
 
bool isConnectedClientAtSlot (int slot)
 Checks if the TelescopeClient object at a given slot is connected to a server. More...
 
QHash< int, QString > getConnectedClientsNames ()
 Returns a list of the currently connected clients. More...
 
bool getFlagUseServerExecutables ()
 
void setFlagUseServerExecutables (bool b)
 Forces a call of loadDeviceModels(). Stops all active telescopes. More...
 
const QString & getServerExecutablesDirectoryPath ()
 
bool setServerExecutablesDirectoryPath (const QString &newPath)
 Forces a call of loadDeviceModels(). Stops all active telescopes. More...
 
bool getFlagUseTelescopeServerLogs ()
 

Detailed Description

This class manages the controlling of one or more telescopes by one instance of the stellarium program.

"Controlling a telescope" means receiving position information from the telescope and sending GOTO commands to the telescope. No esoteric features like motor focus, electric heating and such. The actual controlling of a telescope is left to the implementation of the abstract base class TelescopeClient.

Definition at line 70 of file TelescopeControl.hpp.

Member Function Documentation

bool TelescopeControl::addTelescopeAtSlot ( int  slot,
ConnectionType  connectionType,
QString  name,
QString  equinox,
QString  host = QString("localhost"),
int  portTCP = DEFAULT_TCP_PORT,
int  delay = DEFAULT_DELAY,
bool  connectAtStartup = false,
QList< double >  circles = QList< double >(),
QString  serverName = QString(),
QString  portSerial = QString() 
)

Adds a telescope description containing the given properties.

DOES NOT VALIDATE its parameters. If serverName is specified, portSerial should be specified too. Call saveTelescopes() to write the modified configuration to disc. Call startTelescopeAtSlot() to start this telescope.

Parameters
portSerialmust be a valid serial port name for the particular platform, e.g. "COM1" for Microsoft Windows of "/dev/ttyS0" for Linux
void TelescopeControl::deleteAllTelescopes ( )

Remove all currently registered telescopes.

const Vec3f& TelescopeControl::getCircleColor ( ) const
inlineslot

Get the field of view circles color.

Definition at line 194 of file TelescopeControl.hpp.

QHash<int, QString> TelescopeControl::getConnectedClientsNames ( )

Returns a list of the currently connected clients.

const QHash<QString, DeviceModel>& TelescopeControl::getDeviceModels ( )

Safe access to the loaded list of telescope models.

bool TelescopeControl::getFlagTelescopeCircles ( ) const
inlineslot

Get display flag for telescope field of view circles.

Definition at line 179 of file TelescopeControl.hpp.

bool TelescopeControl::getFlagTelescopeLabels ( ) const
inlineslot

Get display flag for telescope name labels.

Definition at line 174 of file TelescopeControl.hpp.

bool TelescopeControl::getFlagTelescopeReticles ( ) const
inlineslot

Get display flag for telescope reticles.

Definition at line 169 of file TelescopeControl.hpp.

const Vec3f& TelescopeControl::getLabelColor ( ) const
inlineslot

Get the telescope labels color.

Definition at line 187 of file TelescopeControl.hpp.

const Vec3f& TelescopeControl::getReticleColor ( ) const
inlineslot

Get the telescope reticle color.

Definition at line 184 of file TelescopeControl.hpp.

bool TelescopeControl::getTelescopeAtSlot ( int  slot,
ConnectionType &  connectionType,
QString &  name,
QString &  equinox,
QString &  host,
int &  portTCP,
int &  delay,
bool &  connectAtStartup,
QList< double > &  circles,
QString &  serverName,
QString &  portSerial 
)

Retrieves a telescope description. Returns false if the slot is empty. Returns empty serverName and portSerial if the description contains no server.

bool TelescopeControl::isConnectedClientAtSlot ( int  slot)

Checks if the TelescopeClient object at a given slot is connected to a server.

bool TelescopeControl::isExistingClientAtSlot ( int  slot)

Checks if there's a TelescopeClient object at a given slot, i.e. if there's an active telescope at that slot.

virtual QStringList TelescopeControl::listMatchingObjects ( const QString &  objPrefix,
int  maxNbItem = 5,
bool  useStartOfWords = false 
) const
virtual

Find and return the list of at most maxNbItem objects auto-completing the passed object English name.

Parameters
objPrefixthe case insensitive first letters of the searched object
maxNbItemthe maximum number of returned object names
useStartOfWordsthe autofill mode for returned objects names
Returns
a list of matching object name by order of relevance, or an empty list if nothing match

Implements StelObjectModule.

virtual QStringList TelescopeControl::listMatchingObjectsI18n ( const QString &  objPrefix,
int  maxNbItem = 5,
bool  useStartOfWords = false 
) const
virtual

Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name.

Parameters
objPrefixthe case insensitive first letters of the searched object
maxNbItemthe maximum number of returned object names
useStartOfWordsthe autofill mode for returned objects names
Returns
a list of matching object name by order of relevance, or an empty list if nothing match

Implements StelObjectModule.

void TelescopeControl::loadConfiguration ( )

Loads the module's configuration from the configuration file.

void TelescopeControl::loadTelescopes ( )

Loads from telescopes.json the parameters of telescope clients and initializes them. If there are already any initialized telescope clients, they are removed.

bool TelescopeControl::removeTelescopeAtSlot ( int  slot)

Removes info from the tree. Should it include stopTelescopeAtSlot()?

void TelescopeControl::saveConfiguration ( )

Saves the module's configuration to the configuration file.

void TelescopeControl::saveTelescopes ( )

Saves to telescopes.json a list of the parameters of the active telescope clients.

void TelescopeControl::setCircleColor ( const Vec3f &  c)
inlineslot

Set the field of view circles color.

Definition at line 192 of file TelescopeControl.hpp.

void TelescopeControl::setFlagTelescopeCircles ( bool  b)
inlineslot

Set display flag for telescope field of view circles.

Definition at line 177 of file TelescopeControl.hpp.

void TelescopeControl::setFlagTelescopeLabels ( bool  b)
inlineslot

Set display flag for telescope name labels.

Definition at line 172 of file TelescopeControl.hpp.

void TelescopeControl::setFlagTelescopeReticles ( bool  b)
inlineslot

Set display flag for telescope reticles.

Definition at line 167 of file TelescopeControl.hpp.

void TelescopeControl::setFlagUseServerExecutables ( bool  b)

Forces a call of loadDeviceModels(). Stops all active telescopes.

void TelescopeControl::setFlagUseTelescopeServerLogs ( bool  b)
inlineslot

Used in the GUI.

Definition at line 211 of file TelescopeControl.hpp.

void TelescopeControl::setFontSize ( int  fontSize)
slot

Define font size to use for telescope names display.

void TelescopeControl::setLabelColor ( const Vec3f &  c)
inlineslot

Set the telescope labels color.

Definition at line 189 of file TelescopeControl.hpp.

void TelescopeControl::setReticleColor ( const Vec3f &  c)
inlineslot

Set the telescope reticle color.

Definition at line 182 of file TelescopeControl.hpp.

bool TelescopeControl::setServerExecutablesDirectoryPath ( const QString &  newPath)

Forces a call of loadDeviceModels(). Stops all active telescopes.

void TelescopeControl::slewTelescopeToSelectedObject ( )
slot

slews a telescope to the selected object.

For use from the GUI. The telescope number will be deduced from the name of the StelAction which triggered the slot.

void TelescopeControl::slewTelescopeToViewDirection ( )
slot

slews a telescope to the point of the celestial sphere currently in the center of the screen.

For use from the GUI. The telescope number will be deduced from the name of the StelAction which triggered the slot.

bool TelescopeControl::startTelescopeAtSlot ( int  slot)

Starts a telescope at the given slot, getting its description with getTelescopeAtSlot(). Creates a TelescopeClient object and starts a server process if necessary.

bool TelescopeControl::stopAllTelescopes ( )

Stops all telescopes, but without removing them like deleteAllTelescopes().

bool TelescopeControl::stopTelescopeAtSlot ( int  slot)

Stops the telescope at the given slot. Destroys the TelescopeClient object and terminates the server process if necessary.

void TelescopeControl::telescopeGoto ( int  telescopeNr,
const Vec3d &  j2000Pos 
)

Send a J2000-goto-command to the specified telescope.

Parameters
telescopeNrthe number of the telescope
j2000Posthe direction in equatorial J2000 frame

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