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 READ getFlagShowExoplanets WRITE setFlagShowExoplanets)
91 virtual void deinit();
92 virtual void update(
double deltaTime);
95 virtual double getCallOrder(StelModuleActionName actionName)
const;
104 virtual QList<StelObjectP>
searchAround(
const Vec3d& v,
double limitFov,
const StelCore* core)
const;
119 virtual QStringList
listMatchingObjectsI18n(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false)
const;
126 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false)
const;
128 virtual QStringList listAllObjects(
bool inEnglish)
const;
129 virtual QStringList listAllObjectsByType(
const QString& objType,
bool inEnglish)
const { Q_UNUSED(objType) Q_UNUSED(inEnglish) return QStringList(); }
131 virtual QString getName()
const {
return "Exoplanets"; }
134 ExoplanetP
getByID(
const QString&
id);
159 bool getDisplayMode(
void);
160 void setDisplayMode(
bool b);
162 bool getTimelineMode(
void);
163 void setTimelineMode(
bool b);
165 bool getHabitableMode(
void);
166 void setHabitableMode(
bool b);
168 QString getMarkerColor(
bool habitable);
169 void setMarkerColor(QString c,
bool h);
171 void setEnableAtStartup(
bool b) { enableAtStartup=b; }
172 bool getEnableAtStartup(
void) {
return enableAtStartup; }
179 void setUpdateFrequencyHours(
int hours) {updateFrequencyHours = hours;}
217 void setFlagShowExoplanets(
bool b) { flagShowExoplanets=b; }
218 bool getFlagShowExoplanets(
void) {
return flagShowExoplanets; }
222 bool getFlagShowExoplanetsButton(
void) {
return flagShowExoplanetsButton; }
225 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
226 void messageTimeout(
void);
233 void resetConfiguration(
void);
236 void upgradeConfigIni(
void);
239 void restoreDefaultJsonFile(
void);
242 void readJsonFile(
void);
247 bool backupJsonFile(
bool deleteOriginal=
false);
251 int getJsonFileFormatVersion(
void);
255 bool checkJsonFileFormat(
void);
258 QVariantMap loadEPMap(QString path=QString());
261 void setEPMap(
const QVariantMap& map);
267 static void translations();
269 QString jsonCatalogPath;
276 QList<ExoplanetP> ep;
280 QNetworkAccessManager* downloadMgr;
283 QTimer* messageTimer;
284 QList<int> messageIDs;
286 QDateTime lastUpdate;
287 int updateFrequencyHours;
288 bool enableAtStartup;
294 bool flagShowExoplanets;
295 bool flagShowExoplanetsButton;
303 void checkForUpdate(
void);
304 void updateDownloadComplete(QNetworkReply* reply);
311 #include "StelPluginInterface.hpp"
317 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 getUpdatesEnabled(void)
get whether or not the plugin will try to update TLE data from the internet
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 displayMessage(const QString &message, const QString hexColor="#999999")
Display a message. This is used for plugin-specific warnings and such.
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)
void updateJSON(void)
Download JSON from web recources described in the module section of the module.ini file and update th...
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.
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 QStringList listMatchingObjectsI18n(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const
Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name...
virtual StelObjectP searchByName(const QString &name) const
Return the matching satellite if exists or NULL.
Update completed, there were updates.
Main window of the Exoplanets plugin.
int getSecondsToUpdate(void)
get the number of seconds till the next update
virtual QStringList listMatchingObjects(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const
Find and return the list of at most maxNbItem objects auto-completing the passed object English name...
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.
QSharedPointer< StelTexture > StelTextureSP
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
ExoplanetP getByID(const QString &id)
get a exoplanet object by identifier
int getCountPlanetarySystems(void) const
Get count of planetary systems from catalog.