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);
125 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false,
bool inEnglish=
true)
const;
129 virtual QString
getName()
const {
return "Exoplanets"; }
133 ExoplanetP
getByID(
const QString&
id);
158 void setEnableAtStartup(
bool b) { enableAtStartup=b; }
159 bool getEnableAtStartup(
void)
const {
return enableAtStartup; }
166 void setUpdateFrequencyHours(
int hours) {updateFrequencyHours = hours;}
174 QList<double> getExoplanetsData(
int mode)
const 179 return EPSemiAxisAll;
191 return EPAngleDistanceAll;
194 return EPEffectiveTempHostStarAll;
197 return EPYearDiscoveryAll;
200 return EPMetallicityHostStarAll;
203 return EPVMagHostStarAll;
206 return EPRAHostStarAll;
209 return EPDecHostStarAll;
212 return EPDistanceHostStarAll;
215 return EPMassHostStarAll;
218 return EPRadiusHostStarAll;
221 return EPEccentricityAll;
232 void flagExoplanetsVisibilityChanged(
bool b);
255 bool getFlagShowExoplanetsButton(
void) {
return flagShowExoplanetsButton; }
317 void resetConfiguration(
void);
320 void upgradeConfigIni(
void);
323 void restoreDefaultJsonFile(
void);
326 void readJsonFile(
void);
331 bool backupJsonFile(
bool deleteOriginal=
false)
const;
335 int getJsonFileFormatVersion(
void)
const;
339 bool checkJsonFileFormat(
void)
const;
342 QVariantMap loadEPMap(QString path=QString());
345 void setEPMap(
const QVariantMap& map);
351 static void translations();
353 QString jsonCatalogPath;
359 QList<double> EPEccentricityAll, EPSemiAxisAll, EPMassAll, EPRadiusAll, EPPeriodAll, EPAngleDistanceAll,
360 EPEffectiveTempHostStarAll, EPYearDiscoveryAll, EPMetallicityHostStarAll, EPVMagHostStarAll,
361 EPRAHostStarAll, EPDecHostStarAll, EPDistanceHostStarAll, EPMassHostStarAll, EPRadiusHostStarAll;
364 QList<ExoplanetP> ep;
368 QNetworkAccessManager* downloadMgr;
371 QTimer* messageTimer;
372 QList<int> messageIDs;
374 QDateTime lastUpdate;
375 int updateFrequencyHours;
376 bool enableAtStartup;
382 bool flagShowExoplanets;
383 bool flagShowExoplanetsButton;
391 void checkForUpdate(
void);
392 void updateDownloadComplete(QNetworkReply* reply);
395 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
396 void messageTimeout(
void);
398 void reloadCatalog(
void);
404 #include "StelPluginInterface.hpp" 410 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
void jsonUpdateComplete(void)
emitted after a JSON update has run.
virtual QObjectList getExtensionList() const
A mechanism to provide abitrary QObjects to the StelModuleMgr.
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.
void setFlagShowExoplanetsDesignations(bool b)
Enable/disable display of designations of exoplanetary systems.
virtual void deinit()
Called before the module will be delete, and before the openGL context is suppressed.
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.
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.
bool getDisplayMode(void) const
Get status to display of distribution of exoplanetary systems.
Define the StelTextureSP type.
Error during download phase.
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...
virtual QString getName() const
Gets a user-displayable name of the object category.
Specialization of StelModule which manages a collection of StelObject.
int getUpdateFrequencyHours(void) const
get the update frequency in hours
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 Q_NULLPTR.
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.
Vec3f getMarkerColor(bool habitable) const
Get 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.
virtual StelObjectP searchByID(const QString &id) const
Return the StelObject with the given ID if exists or the empty StelObject if not found.
bool getHabitableMode(void) const
Get status to display of exoplanetary systems with the potentially habitable exoplanets.
Main window of the Exoplanets plugin.
UpdateState getUpdateState(void) const
Get the current updateState.
int getSecondsToUpdate(void)
get the number of seconds till the next update
StelModuleActionName
Define the possible action for which an order is defined.
QDateTime getLastUpdate(void) const
get the date and time the TLE elements were updated
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 Q_NULLPTR.
bool getFlagShowExoplanetsDesignations(void) const
Get status to display of designations of exoplanetary systems.
virtual QString getStelObjectType() const
Returns the name that will be returned by StelObject::getType() for the objects this module manages...
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
bool getUpdatesEnabled(void) const
get whether or not the plugin will try to update TLE data from the internet
bool getTimelineMode(void) const
Get status to display of systems with exoplanets after their discovery.
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.
bool getFlagShowExoplanets(void) const
Get status to display of markers of exoplanetary systems.
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.