19 #ifndef _EXOPLANETS_HPP_ 20 #define _EXOPLANETS_HPP_ 22 #include "StelObjectModule.hpp" 23 #include "StelObject.hpp" 24 #include "StelFader.hpp" 26 #include "Exoplanet.hpp" 28 #include <QVariantMap> 31 #include <QSharedPointer> 33 class QNetworkAccessManager;
63 typedef QSharedPointer<Exoplanet> ExoplanetP;
73 Q_PROPERTY(
bool showExoplanets
76 NOTIFY flagExoplanetsVisibilityChanged
96 virtual void update(
double deltaTime);
123 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false,
bool inEnglish=
true)
const;
127 virtual QString getName()
const {
return "Exoplanets"; }
130 ExoplanetP
getByID(
const QString&
id);
155 void setEnableAtStartup(
bool b) { enableAtStartup=b; }
156 bool getEnableAtStartup(
void) {
return enableAtStartup; }
163 void setUpdateFrequencyHours(
int hours) {updateFrequencyHours = hours;}
171 QList<double> getExoplanetsData(
int mode)
176 return EPSemiAxisAll;
188 return EPAngleDistanceAll;
191 return EPEccentricityAll;
202 void flagExoplanetsVisibilityChanged(
bool b);
225 bool getFlagShowExoplanetsButton(
void) {
return flagShowExoplanetsButton; }
287 void resetConfiguration(
void);
290 void upgradeConfigIni(
void);
293 void restoreDefaultJsonFile(
void);
296 void readJsonFile(
void);
301 bool backupJsonFile(
bool deleteOriginal=
false);
305 int getJsonFileFormatVersion(
void);
309 bool checkJsonFileFormat(
void);
312 QVariantMap loadEPMap(QString path=QString());
315 void setEPMap(
const QVariantMap& map);
321 static void translations();
323 QString jsonCatalogPath;
329 QList<double> EPEccentricityAll, EPSemiAxisAll, EPMassAll, EPRadiusAll, EPPeriodAll, EPAngleDistanceAll;
332 QList<ExoplanetP> ep;
336 QNetworkAccessManager* downloadMgr;
339 QTimer* messageTimer;
340 QList<int> messageIDs;
342 QDateTime lastUpdate;
343 int updateFrequencyHours;
344 bool enableAtStartup;
350 bool flagShowExoplanets;
351 bool flagShowExoplanetsButton;
359 void checkForUpdate(
void);
360 void updateDownloadComplete(QNetworkReply* reply);
363 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
364 void messageTimeout(
void);
366 void reloadCatalog(
void);
372 #include "StelPluginInterface.hpp" 378 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
void jsonUpdateComplete(void)
emitted after a JSON update has run.
virtual QList< StelObjectP > searchAround(const Vec3d &v, double limitFov, const StelCore *core) const
Used to get a list of objects which are near to some position.
bool getFlagShowExoplanetsDesignations(void)
Get status to display of designations of exoplanetary systems.
void setFlagShowExoplanetsDesignations(bool b)
Enable/disable display of designations of exoplanetary systems.
bool getUpdatesEnabled(void)
get whether or not the plugin will try to update TLE data from the internet
virtual void deinit()
Called before the module will be delete, and before the openGL context is suppressed.
bool getDisplayMode(void)
Get status to display of distribution of exoplanetary systems.
void setHabitableMode(bool b)
Enable/disable display of exoplanetary systems with the potentially habitable exoplanets only...
Define the interface to implement when creating a plugin.
void setFlagShowExoplanetsButton(bool b)
Define whether the button toggling exoplanets should be visible.
QDateTime getLastUpdate(void)
get the date and time the TLE elements were updated
This class is used by Qt to manage a plug-in interface.
UpdateState
Used for keeping for track of the download/update status.
void setFlagShowExoplanets(bool b)
Enable/disable display of markers of exoplanetary systems.
Define the StelTextureSP type.
bool getHabitableMode(void)
Get status to display of exoplanetary systems with the potentially habitable exoplanets.
Error during download phase.
UpdateState getUpdateState(void)
Get the current updateState.
void saveConfiguration(void)
Save the settings to the main configuration file.
void updateStateChanged(Exoplanets::UpdateState state)
Main class for Stellarium core processing.
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.
void updateJSON(void)
Download JSON from web recources described in the module section of the module.ini file and update th...
Vec3f getMarkerColor(bool habitable)
Get color for markers of exoplanetary systems.
Specialization of StelModule which manages a collection of StelObject.
bool getFlagShowExoplanets(void)
Get status to display of markers of exoplanetary systems.
int getCountAllExoplanets(void) const
Get count of exoplanets from catalog.
void setUpdatesEnabled(bool b)
set whether or not the plugin will try to update TLE data from the internet
Main class of the Exoplanets plugin.
Provides functions for performing openGL drawing operations.
virtual bool configureGui(bool show=true)
Implement this to tell the main Stellarium GUI that there is a GUI element to configure this plugin...
void loadConfiguration(void)
Read (or re-read) settings from the main config file.
virtual StelObjectP searchByName(const QString &name) const
Return the matching satellite if exists or NULL.
virtual void update(double deltaTime)
Update the module with respect to the time.
void setMarkerColor(const Vec3f &c, bool h)
Set color for markers of exoplanetary systems.
Update completed, there were updates.
void setTimelineMode(bool b)
Enable/disable display of systems with exoplanets after their discovery only.
virtual QStringList listAllObjects(bool inEnglish) const
List all StelObjects.
Main window of the Exoplanets plugin.
int getSecondsToUpdate(void)
get the number of seconds till the next update
StelModuleActionName
Define the possible action for which an order is defined.
Maintain the state of a progress bar.
void restoreDefaults(void)
Set up the plugin with default values.
virtual StelObjectP searchByNameI18n(const QString &nameI18n) const
Return the matching satellite object's pointer if exists or NULL.
bool getTimelineMode(void)
Get status to display of systems with exoplanets after their discovery.
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
virtual void init()
Initialize itself.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual QStringList listMatchingObjects(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false, bool inEnglish=true) const
Find and return the list of at most maxNbItem objects auto-completing the passed object name...
int getCountHabitableExoplanets(void) const
Get count of potentially habitable exoplanets from catalog.
Update completed, there we no updates.
int getUpdateFrequencyHours(void)
get the update frequency in hours
This is the common base class for all the main components of stellarium.
Contains information about a Stellarium plugin.
void setDisplayMode(bool b)
Enable/disable display of distribution of exoplanetary systems.
ExoplanetP getByID(const QString &id)
get a exoplanet object by identifier
int getCountPlanetarySystems(void) const
Get count of planetary systems from catalog.