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;
97 virtual QStringList listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false,
bool inEnglish=
false)
const;
100 virtual QString
getName()
const {
return "Telescope Control"; }
101 virtual QString getStelObjectType()
const;
102 virtual bool configureGui(
bool show =
true);
110 void telescopeGoto(
int telescopeNr,
const Vec3d &j2000Pos,
StelObjectP selectObject = Q_NULLPTR);
113 void deleteAllTelescopes();
116 const QHash<QString, DeviceModel>& getDeviceModels();
119 void loadConfiguration();
121 void saveConfiguration();
124 void saveTelescopes();
126 void loadTelescopes();
131 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(), QString rts2Url = QString(), QString rts2Username = QString(), QString rts2Password = QString(),
int rts2Refresh = -1);
133 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, QString& rts2Url, QString& rts2Username, QString& rts2Password,
int& rts2Refresh);
135 bool removeTelescopeAtSlot(
int slot);
138 bool startTelescopeAtSlot(
int slot);
140 bool stopTelescopeAtSlot(
int slot);
142 bool stopAllTelescopes();
145 bool isExistingClientAtSlot(
int slot);
147 bool isConnectedClientAtSlot(
int slot);
150 QHash<int, QString> getConnectedClientsNames();
152 bool getFlagUseServerExecutables() {
return useServerExecutables;}
154 void setFlagUseServerExecutables(
bool b);
155 const QString& getServerExecutablesDirectoryPath();
157 bool setServerExecutablesDirectoryPath(
const QString& newPath);
159 bool getFlagUseTelescopeServerLogs () {
return useTelescopeServerLogs;}
255 void setFontSize(
int fontSize);
264 void slewTelescopeToSelectedObject(
const int idx);
274 void slewTelescopeToViewDirection(
const int idx);
280 void clientConnected(
int slot, QString name);
281 void clientDisconnected(
int slot);
285 void translateActionDescriptions();
292 void communicate(
void);
316 QMap<int, TelescopeClientP> telescopeClients;
318 QHash<int, QProcess*> telescopeServerProcess;
319 QStringList telescopeServers;
320 QVariantMap telescopeDescriptions;
321 QHash<QString, DeviceModel> deviceModels;
323 QHash<ConnectionType, QString> connectionTypeNames;
325 bool useTelescopeServerLogs;
326 QHash<int, QFile*> telescopeServerLogFiles;
327 QHash<int, QTextStream*> telescopeServerLogStreams;
329 bool useServerExecutables;
330 QString serverExecutablesDirectoryPath;
337 bool isValidSlotNumber(
int slot);
338 bool isValidPort(uint port);
339 bool isValidDelay(
int delay);
345 bool startServerAtSlot(
int slot, QString serverName,
int tcpPort, QString serialPort);
347 bool stopServerAtSlot(
int slot);
350 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(), QString rts2Url = QString(), QString rts2Username = QString(), QString rts2Password = QString(),
int rts2Refresh = -1);
353 bool stopClientAtSlot(
int slot);
356 void loadTelescopeServerExecutables();
359 void loadDeviceModels();
363 bool restoreDeviceModelsListTo(QString deviceModelsListPath);
365 void addLogAtSlot(
int slot);
366 void logAtSlot(
int slot);
367 void removeLogAtSlot(
int slot);
369 static void translations();
371 QString actionGroupId;
372 QString moveToSelectedActionId;
373 QString moveToCenterActionId;
379 #include "StelPluginInterface.hpp" 385 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.
virtual QObjectList getExtensionList() const
A mechanism to provide abitrary QObjects to the StelModuleMgr.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual StelObjectP searchByID(const QString &id) const
Return the StelObject with the given ID if exists or the empty StelObject if not found.
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.
virtual QString getName() const
Gets a user-displayable name of the object category.