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;
113 virtual QString getName()
const {
return "Historical Supernovae"; }
116 SupernovaP
getByID(
const QString&
id);
146 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
178 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
179 void messageTimeout(
void);
181 void reloadCatalog(
void);
188 void restoreDefaultConfigIni(
void);
191 void restoreDefaultJsonFile(
void);
194 void readJsonFile(
void);
199 bool backupJsonFile(
bool deleteOriginal=
false);
203 int getJsonFileVersion(
void);
207 bool checkJsonFileFormat(
void);
210 QVariantMap loadSNeMap(QString path=QString());
213 void setSNeMap(
const QVariantMap& map);
220 QList<SupernovaP> snstar;
221 QHash<QString, double> snlist;
225 QNetworkAccessManager* downloadMgr;
229 QTimer* messageTimer;
230 QList<int> messageIDs;
232 QDateTime lastUpdate;
233 int updateFrequencyDays;
244 void checkForUpdate(
void);
245 void updateDownloadComplete(QNetworkReply* reply);
252 #include "StelPluginInterface.hpp" 258 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
Update completed, there we no updates.
Define the interface to implement when creating a plugin.
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 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.
Define the StelTextureSP type.
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.
Main class for Stellarium core processing.
Specialization of StelModule which manages a collection of StelObject.
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.
virtual void init()
Initialize itself.
Error during download phase.
float getLowerLimitBrightness()
Get lower limit of brightness for displayed supernovae.
Provides functions for performing openGL drawing operations.
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.
StelModuleActionName
Define the possible action for which an order is defined.
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 void draw(StelCore *core)
Execute all the drawing functions for this module.
Maintain the state of a progress bar.
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.
virtual void update(double)
Update the module with respect to the time.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
void updateStateChanged(Supernovae::UpdateState state)
virtual void deinit()
Called before the module will be delete, and before the openGL context is suppressed.
void saveSettingsToConfig(void)
Save the settings to the main configuration file.
int getSecondsToUpdate(void)
Get the number of seconds till the next update.
This is the common base class for all the main components of stellarium.
void restoreDefaults(void)
Set up the plugin with default values.
Contains information about a Stellarium plugin.
QString getSupernovaeList()
Get list of supernovae.
UpdateState getUpdateState(void)
Get the current updateState.
virtual QStringList listAllObjects(bool inEnglish) const
List all StelObjects.
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.