22 #include "StelObjectModule.hpp" 23 #include "StelObject.hpp" 24 #include "StelFader.hpp" 28 #include <QVariantMap> 31 #include <QSharedPointer> 34 class QNetworkAccessManager;
60 typedef QSharedPointer<Nova> NovaP;
114 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false,
bool inEnglish=
false)
const;
116 virtual QString getName()
const {
return "Bright Novae"; }
119 NovaP
getByID(
const QString&
id);
149 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
181 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
182 void messageTimeout(
void);
184 void reloadCatalog(
void);
191 void restoreDefaultConfigIni(
void);
194 void restoreDefaultJsonFile(
void);
197 void readJsonFile(
void);
202 bool backupJsonFile(
bool deleteOriginal=
false);
206 int getJsonFileVersion(
void);
210 bool checkJsonFileFormat(
void);
213 QVariantMap loadNovaeMap(QString path=QString());
216 void setNovaeMap(
const QVariantMap& map);
218 QString novaeJsonPath;
224 QHash<QString, double> novalist;
228 QNetworkAccessManager* downloadMgr;
232 QTimer* messageTimer;
233 QList<int> messageIDs;
235 QDateTime lastUpdate;
236 int updateFrequencyDays;
247 void checkForUpdate(
void);
248 void updateDownloadComplete(QNetworkReply* reply);
254 #include "StelPluginInterface.hpp" 260 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
void setUpdatesEnabled(bool b)
Set whether or not the plugin will try to update catalog data from the internet.
Define the interface to implement when creating a plugin.
Update completed, there were updates.
QString getNovaeList()
Get list of novae.
void restoreDefaults(void)
Set up the plugin with default values.
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 jsonUpdateComplete(void)
Emitted after a JSON update has run.
QDateTime getLastUpdate(void)
Get the date and time the novae were updated.
Define the StelTextureSP type.
Main class of the Bright Novae plugin.
void displayMessage(const QString &message, const QString hexColor="#999999")
Display a message. This is used for plugin-specific warnings and such.
UpdateState getUpdateState(void)
Get the current updateState.
float getLowerLimitBrightness()
Get lower limit of brightness for displayed novae.
NovaP getByID(const QString &id)
get a nova object by identifier
Main class for Stellarium core processing.
int getCountNovae(void)
Get count of novae from catalog.
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.
virtual StelObjectP searchByName(const QString &name) const
Return the matching satellite if exists or NULL.
void updateJSON(void)
Download JSON from web recources described in the module section of the module.ini file and update th...
void updateStateChanged(Novae::UpdateState state)
void saveSettingsToConfig(void)
Save the settings to the main configuration file.
virtual StelObjectP searchByNameI18n(const QString &nameI18n) const
Return the matching satellite object's pointer if exists or NULL.
Specialization of StelModule which manages a collection of StelObject.
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 QStringList listAllObjects(bool inEnglish) const
List all StelObjects.
int getSecondsToUpdate(void)
Get the number of seconds till the next update.
Error during download phase.
Provides functions for performing openGL drawing operations.
virtual void update(double)
Update the module with respect to the time.
void readSettingsFromConfig(void)
Read (or re-read) settings from the main config file.
This class is used by Qt to manage a plug-in interface.
StelModuleActionName
Define the possible action for which an order is defined.
bool getUpdatesEnabled(void)
Get whether or not the plugin will try to update catalog data from the internet.
Maintain the state of a progress bar.
int getUpdateFrequencyDays(void)
Get the update frequency in days.
UpdateState
Used for keeping for track of the download/update status.
Update completed, there we no updates.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual QStringList listMatchingObjects(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false, bool inEnglish=false) const
Find and return the list of at most maxNbItem objects auto-completing the passed object name...
This is the common base class for all the main components of stellarium.
virtual void init()
Initialize itself.
Contains information about a Stellarium plugin.