19 #ifndef _SUPERNOVAE_HPP_
20 #define _SUPERNOVAE_HPP_
22 #include "StelObjectModule.hpp"
23 #include "StelObject.hpp"
24 #include "StelFader.hpp"
26 #include "Supernova.hpp"
28 #include <QVariantMap>
31 #include <QSharedPointer>
34 class QNetworkAccessManager;
61 typedef QSharedPointer<Supernova> SupernovaP;
88 virtual void deinit();
89 virtual void update(
double) {;}
92 virtual double getCallOrder(StelModuleActionName actionName)
const;
101 virtual QList<StelObjectP>
searchAround(
const Vec3d& v,
double limitFov,
const StelCore* core)
const;
116 virtual QStringList
listMatchingObjectsI18n(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false)
const;
122 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false)
const;
123 virtual QStringList listAllObjects(
bool inEnglish)
const;
124 virtual QStringList listAllObjectsByType(
const QString& objType,
bool inEnglish)
const { Q_UNUSED(objType) Q_UNUSED(inEnglish) return QStringList(); }
125 virtual QString getName()
const {
return "Historical Supernovae"; }
128 SupernovaP
getByID(
const QString&
id);
158 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
190 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
191 void messageTimeout(
void);
198 void restoreDefaultConfigIni(
void);
201 void restoreDefaultJsonFile(
void);
204 void readJsonFile(
void);
209 bool backupJsonFile(
bool deleteOriginal=
false);
213 int getJsonFileVersion(
void);
217 bool checkJsonFileFormat(
void);
220 QVariantMap loadSNeMap(QString path=QString());
223 void setSNeMap(
const QVariantMap& map);
230 QList<SupernovaP> snstar;
231 QHash<QString, double> snlist;
235 QNetworkAccessManager* downloadMgr;
239 QTimer* messageTimer;
240 QList<int> messageIDs;
242 QDateTime lastUpdate;
243 int updateFrequencyDays;
254 void checkForUpdate(
void);
255 void updateDownloadComplete(QNetworkReply* reply);
262 #include "StelPluginInterface.hpp"
268 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
Update completed, there we no updates.
void displayMessage(const QString &message, const QString hexColor="#999999")
Display a message. This is used for plugin-specific warnings and such.
int getUpdateFrequencyDays(void)
Get the update frequency in days.
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...
void setUpdatesEnabled(bool b)
Set whether or not the plugin will try to update catalog data from the internet.
SupernovaP getByID(const QString &id)
get a supernova object by identifier
Update completed, there were updates.
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 jsonUpdateComplete(void)
Emitted after a JSON update has run.
virtual StelObjectP searchByNameI18n(const QString &nameI18n) const
Return the matching satellite object's pointer if exists or NULL.
Error during download phase.
float getLowerLimitBrightness()
Get lower limit of brightness for displayed supernovae.
Main class of the Historical Supernovae plugin.
int getCountSupernovae(void)
Get count of supernovae from catalog.
bool getUpdatesEnabled(void)
Get whether or not the plugin will try to update catalog data from the internet.
virtual StelObjectP searchByName(const QString &name) const
Return the matching satellite if exists or NULL.
This class is used by Qt to manage a plug-in interface.
void readSettingsFromConfig(void)
Read (or re-read) settings from the main config file.
void updateJSON(void)
Download JSON from web recources described in the module section of the module.ini file and update th...
UpdateState
Used for keeping for track of the download/update status.
virtual bool configureGui(bool show=true)
Implement this to tell the main Stellarium GUI that there is a GUI element to configure this plugin...
QDateTime getLastUpdate(void)
Get the date and time the supernovae were updated.
QSharedPointer< StelTexture > StelTextureSP
void updateStateChanged(Supernovae::UpdateState state)
void saveSettingsToConfig(void)
Save the settings to the main configuration file.
int getSecondsToUpdate(void)
Get the number of seconds till the next update.
void restoreDefaults(void)
Set up the plugin with default values.
QString getSupernovaeList()
Get list of supernovae.
UpdateState getUpdateState(void)
Get the current updateState.
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.