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 return qSharedPointerCast<StelObject>(
getByID(
id));
118 virtual QString
getName()
const {
return "Historical Supernovae"; }
122 SupernovaP
getByID(
const QString&
id)
const;
152 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
184 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
185 void messageTimeout(
void);
187 void reloadCatalog(
void);
194 void restoreDefaultConfigIni(
void);
197 void restoreDefaultJsonFile(
void);
200 void readJsonFile(
void);
205 bool backupJsonFile(
bool deleteOriginal=
false);
209 int getJsonFileVersion(
void)
const;
213 bool checkJsonFileFormat(
void)
const;
216 QVariantMap loadSNeMap(QString path=QString());
219 void setSNeMap(
const QVariantMap& map);
226 QList<SupernovaP> snstar;
227 QHash<QString, double> snlist;
231 QNetworkAccessManager* downloadMgr;
235 QTimer* messageTimer;
236 QList<int> messageIDs;
238 QDateTime lastUpdate;
239 int updateFrequencyDays;
250 void checkForUpdate(
void);
251 void updateDownloadComplete(QNetworkReply* reply);
258 #include "StelPluginInterface.hpp" 264 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.
virtual QString getName() const
Gets a user-displayable name of the object category.
Define the StelTextureSP type.
void setUpdatesEnabled(bool b)
Set whether or not the plugin will try to update catalog data from the internet.
Update completed, there were updates.
virtual QString getStelObjectType() const
Returns the name that will be returned by StelObject::getType() for the objects this module manages...
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 Q_NULLPTR.
virtual void init()
Initialize itself.
virtual StelObjectP searchByID(const QString &id) const
Return the StelObject with the given ID if exists or the empty StelObject if not found.
Error during download phase.
Provides functions for performing openGL drawing operations.
Main class of the Historical Supernovae plugin.
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 Q_NULLPTR.
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.
QString getSupernovaeList() const
Get list of supernovae.
StelModuleActionName
Define the possible action for which an order is defined.
SupernovaP getByID(const QString &id) const
get a supernova object by identifier
float getLowerLimitBrightness() const
Get lower limit of brightness for displayed supernovae.
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...
virtual QObjectList getExtensionList() const
A mechanism to provide abitrary QObjects to the StelModuleMgr.
QDateTime getLastUpdate(void)
Get the date and time the supernovae were updated.
virtual void update(double)
Update the module with respect to the time.
int getCountSupernovae(void) const
Get count of supernovae from catalog.
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.
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.