28 #ifndef _TELESCOPE_CONTROL_HPP_ 29 #define _TELESCOPE_CONTROL_HPP_ 31 #include "StelFader.hpp" 32 #include "StelGui.hpp" 33 #include "StelJsonParser.hpp" 34 #include "StelObjectModule.hpp" 37 #include "TelescopeControlGlobals.hpp" 38 #include "VecMath.hpp" 47 #include <QStringList> 48 #include <QTextStream> 61 typedef QSharedPointer<TelescopeClient> TelescopeClientP;
81 virtual void deinit();
82 virtual void update(
double deltaTime);
88 virtual QList<StelObjectP> searchAround(
const Vec3d& v,
double limitFov,
const StelCore* core)
const;
89 virtual StelObjectP searchByNameI18n(
const QString& nameI18n)
const;
90 virtual StelObjectP searchByName(
const QString& name)
const;
93 virtual QString getName()
const {
return "Telescope Control"; }
94 virtual bool configureGui(
bool show =
true);
101 void telescopeGoto(
int telescopeNr,
const Vec3d &j2000Pos);
104 void deleteAllTelescopes();
107 const QHash<QString, DeviceModel>& getDeviceModels();
110 void loadConfiguration();
112 void saveConfiguration();
115 void saveTelescopes();
117 void loadTelescopes();
122 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());
124 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);
126 bool removeTelescopeAtSlot(
int slot);
129 bool startTelescopeAtSlot(
int slot);
131 bool stopTelescopeAtSlot(
int slot);
133 bool stopAllTelescopes();
136 bool isExistingClientAtSlot(
int slot);
138 bool isConnectedClientAtSlot(
int slot);
141 QHash<int, QString> getConnectedClientsNames();
143 bool getFlagUseServerExecutables() {
return useServerExecutables;}
145 void setFlagUseServerExecutables(
bool b);
146 const QString& getServerExecutablesDirectoryPath();
148 bool setServerExecutablesDirectoryPath(
const QString& newPath);
150 bool getFlagUseTelescopeServerLogs () {
return useTelescopeServerLogs;}
246 void setFontSize(
int fontSize);
255 void slewTelescopeToSelectedObject(
const int idx);
265 void slewTelescopeToViewDirection(
const int idx);
271 void clientConnected(
int slot, QString name);
272 void clientDisconnected(
int slot);
276 void translateActionDescriptions();
283 void communicate(
void);
307 QMap<int, TelescopeClientP> telescopeClients;
309 QHash<int, QProcess*> telescopeServerProcess;
310 QStringList telescopeServers;
311 QVariantMap telescopeDescriptions;
312 QHash<QString, DeviceModel> deviceModels;
314 QHash<ConnectionType, QString> connectionTypeNames;
316 bool useTelescopeServerLogs;
317 QHash<int, QFile*> telescopeServerLogFiles;
318 QHash<int, QTextStream*> telescopeServerLogStreams;
320 bool useServerExecutables;
321 QString serverExecutablesDirectoryPath;
328 bool isValidSlotNumber(
int slot);
329 bool isValidPort(uint port);
330 bool isValidDelay(
int delay);
336 bool startServerAtSlot(
int slot, QString serverName,
int tcpPort, QString serialPort);
338 bool stopServerAtSlot(
int slot);
341 bool startClientAtSlot(
int slot, ConnectionType connectionType, QString name, QString equinox, QString host,
int portTCP,
int delay, QList<double> circles, QString serverName = QString(), QString portSerial = QString());
344 bool stopClientAtSlot(
int slot);
347 void loadTelescopeServerExecutables();
350 void loadDeviceModels();
354 bool restoreDeviceModelsListTo(QString deviceModelsListPath);
356 void addLogAtSlot(
int slot);
357 void logAtSlot(
int slot);
358 void removeLogAtSlot(
int slot);
360 QString actionGroupId;
361 QString moveToSelectedActionId;
362 QString moveToCenterActionId;
368 #include "StelPluginInterface.hpp" 374 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
const Vec3f & getLabelColor() const
Get the telescope labels color.
virtual QStringList listAllObjects(bool) const
List all StelObjects.
void setLabelColor(const Vec3f &c)
Set the telescope labels color.
Define the interface to implement when creating a plugin.
Implementation of StelFader which implements a linear transition.
The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
void setFlagTelescopeReticles(bool b)
Set display flag for telescope reticles.
void setFlagTelescopeCircles(bool b)
Set display flag for telescope field of view circles.
Define the StelTextureSP type.
bool getFlagTelescopeCircles() const
Get display flag for telescope field of view circles.
An abstract base class that should never be used directly, only inherited.
Main class for Stellarium core processing.
This class manages the controlling of one or more telescopes by one instance of the stellarium progra...
bool getFlagTelescopeReticles() const
Get display flag for telescope reticles.
Specialization of StelModule which manages a collection of StelObject.
This class is used by Qt to manage a plug-in interface.
void setCircleColor(const Vec3f &c)
Set the field of view circles color.
QSharedPointer< StelProjector > StelProjectorP
Shared pointer on a StelProjector instance (implement reference counting)
bool getFlagTelescopeLabels() const
Get display flag for telescope name labels.
void setFlagTelescopeLabels(bool b)
Set display flag for telescope name labels.
const Vec3f & getReticleColor() const
Get the telescope reticle color.
Provides functions for performing openGL drawing operations.
Provide the main interface to all operations of projecting coordinates from sky to screen...
StelModuleActionName
Define the possible action for which an order is defined.
void setFlagUseTelescopeServerLogs(bool b)
Used in the GUI.
void setReticleColor(const Vec3f &c)
Set the telescope reticle color.
Define the StelProjectorP type.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
This is the common base class for all the main components of stellarium.
const Vec3f & getCircleColor() const
Get the field of view circles color.
Contains information about a Stellarium plugin.