![]() |
Stellarium 0.12.3
|
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 () |
Initialize itself. More... | |
virtual void | deinit () |
Called before the module will be deleted, and before the renderer is destroyed. More... | |
virtual void | update (double deltaTime) |
Update the module with respect to the time. More... | |
virtual void | draw (StelCore *core, class StelRenderer *renderer) |
Execute all the drawing functions for this module. More... | |
virtual double | getCallOrder (StelModuleActionName actionName) const |
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations. More... | |
virtual QList< StelObjectP > | searchAround (const Vec3d &v, double limitFov, const StelCore *core) const |
Search for StelObject in an area around a specifid point. More... | |
virtual StelObjectP | searchByNameI18n (const QString &nameI18n) const |
Find a StelObject by name. More... | |
virtual StelObjectP | searchByName (const QString &name) const |
Return the matching StelObject if exists or the empty StelObject if not found. More... | |
virtual QStringList | listMatchingObjectsI18n (const QString &objPrefix, int maxNbItem=5) const |
Find and return the list of at most maxNbItem objects auto-completing passed object I18 name. More... | |
virtual QStringList | listMatchingObjects (const QString &objPrefix, int maxNbItem=5) const |
Find and return the list of at most maxNbItem objects auto-completing passed object English name. More... | |
virtual QStringList | listAllObjects (bool inEnglish) const |
virtual QString | getName () const |
virtual bool | configureGui (bool show=true) |
Detect or show the configuration GUI elements for the module. More... | |
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 () |
Additional Inherited Members | |
![]() | |
enum | StelModuleSelectAction { AddToSelection, ReplaceSelection, RemoveFromSelection } |
Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list. More... | |
enum | StelModuleActionName { ActionDraw, ActionUpdate, ActionHandleMouseClicks, ActionHandleMouseMoves, ActionHandleKeys } |
Define the possible action for which an order is defined. More... | |
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 67 of file TelescopeControl.hpp.
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.
portSerial | must be a valid serial port name for the particular platform, e.g. "COM1" for Microsoft Windows of "/dev/ttyS0" for Linux |
|
virtual |
Detect or show the configuration GUI elements for the module.
This is to be used with plugins to display a configuration dialog from the plugin list window.
show | if true, make the configuration GUI visible. If false, hide the config GUI if there is one. |
Reimplemented from StelModule.
|
virtual |
Called before the module will be deleted, and before the renderer is destroyed.
Deinitialize all textures in this method.
Reimplemented from StelModule.
void TelescopeControl::deleteAllTelescopes | ( | ) |
Remove all currently registered telescopes.
|
virtual |
Execute all the drawing functions for this module.
core | the core to use for the drawing |
renderer | Renderer to draw with. |
Reimplemented from StelModule.
|
virtual |
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.
actionName | the name of the action for which we want the call order |
Reimplemented from StelModule.
|
inlineslot |
Get the field of view circles color.
Definition at line 180 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.
|
inlineslot |
Get display flag for telescope field of view circles.
Definition at line 165 of file TelescopeControl.hpp.
|
inlineslot |
Get display flag for telescope name labels.
Definition at line 160 of file TelescopeControl.hpp.
|
inlineslot |
Get display flag for telescope reticles.
Definition at line 155 of file TelescopeControl.hpp.
|
inlineslot |
Get the telescope labels color.
Definition at line 173 of file TelescopeControl.hpp.
|
inlineslot |
Get the telescope reticle color.
Definition at line 170 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.
|
virtual |
Initialize itself.
If the initialization takes significant time, the progress should be displayed on the loading bar.
Implements StelModule.
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 |
Find and return the list of at most maxNbItem objects auto-completing passed object English name.
objPrefix | the first letters of the searched object |
maxNbItem | the maximum number of returned object names |
Implements StelObjectModule.
|
virtual |
Find and return the list of at most maxNbItem objects auto-completing passed object I18 name.
objPrefix | the first letters of the searched object |
maxNbItem | the maximum number of returned object names |
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.
|
virtual |
Search for StelObject in an area around a specifid point.
The function searches in a disk of diameter limitFov centered on v. Only visible objects (i.e curretly displayed on screen) should be returned.
v | equatorial position at epoch J2000. |
limitFov | angular diameter of the searching zone in degree. |
core | the core instance to use. |
Implements StelObjectModule.
|
virtual |
Return the matching StelObject if exists or the empty StelObject if not found.
name | the english object name |
Implements StelObjectModule.
|
virtual |
Find a StelObject by name.
nameI18n | The translated name for the current sky locale. |
Implements StelObjectModule.
|
inlineslot |
Set the field of view circles color.
Definition at line 178 of file TelescopeControl.hpp.
|
inlineslot |
Set display flag for telescope field of view circles.
Definition at line 163 of file TelescopeControl.hpp.
|
inlineslot |
Set display flag for telescope name labels.
Definition at line 158 of file TelescopeControl.hpp.
|
inlineslot |
Set display flag for telescope reticles.
Definition at line 153 of file TelescopeControl.hpp.
void TelescopeControl::setFlagUseServerExecutables | ( | bool | b | ) |
Forces a call of loadDeviceModels(). Stops all active telescopes.
|
inlineslot |
Used in the GUI.
Definition at line 197 of file TelescopeControl.hpp.
|
slot |
Define font size to use for telescope names display.
|
inlineslot |
Set the telescope labels color.
Definition at line 175 of file TelescopeControl.hpp.
|
inlineslot |
Set the telescope reticle color.
Definition at line 168 of file TelescopeControl.hpp.
bool TelescopeControl::setServerExecutablesDirectoryPath | ( | const QString & | newPath | ) |
Forces a call of loadDeviceModels(). Stops all active telescopes.
|
slot |
slews a telescope to the selected object.
For use from the GUI. The telescope number will be deduced from the name of the QAction which triggered the slot.
|
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 QAction 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.
telescopeNr | the number of the telescope |
j2000Pos | the direction in equatorial J2000 frame |
|
virtual |
Update the module with respect to the time.
deltaTime | the time increment in second since last call. |
Implements StelModule.