20 #ifndef METEORSHOWERSMGR_HPP_ 21 #define METEORSHOWERSMGR_HPP_ 23 #include <QNetworkReply> 25 #include "StelGuiItems.hpp" 26 #include "StelTextureMgr.hpp" 27 #include "StelObjectModule.hpp" 29 #define MS_CATALOG_VERSION 1 30 #define MS_CONFIG_PREFIX QString("MeteorShowers") 56 Q_PROPERTY(
bool enablePlugin READ getEnablePlugin WRITE actionEnablePlugin NOTIFY enablePluginChanged)
95 bool getEnablePlugin() {
return m_enablePlugin; }
101 void setUrl(
const QString& url);
102 QString getUrl() {
return m_url; }
106 QDateTime getLastUpdate() {
return m_lastUpdate; }
110 DownloadStatus getStatusOfLastUpdate() {
return m_statusOfLastUpdate; }
123 virtual void update(
double deltaTime);
136 virtual QString getName()
const {
return QString(); }
139 void downloadStatusChanged(DownloadStatus);
140 void enablePluginChanged(
bool b);
141 void enableLabelsChanged(
bool b);
285 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
286 void messageTimeout();
289 void checkForUpdates();
290 void updateFinished(QNetworkReply* reply);
300 QString m_catalogPath;
304 bool m_activeRadiantOnly;
305 bool m_enableAtStartup;
308 bool m_showEnableButton;
309 bool m_showSearchButton;
315 QTimer* m_messageTimer;
316 QList<int> m_messageIDs;
323 bool m_enableAutoUpdates;
324 int m_updateFrequencyHours;
326 QDateTime m_lastUpdate;
327 DownloadStatus m_statusOfLastUpdate;
328 QNetworkAccessManager* m_downloadMgr;
331 void createActions();
334 bool loadCatalog(
const QString& jsonPath);
338 void actionEnablePlugin(
const bool& b) {
if (m_enablePlugin != b) { m_enablePlugin = b; emit enablePluginChanged(b);} }
342 #include "StelPluginInterface.hpp" 348 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
void setColorARG(const Vec3f &rgb)
Set the color of the active radiant based on generic data.
StelTextureSP getBolideTexture()
Gets the bolide texture.
virtual StelObjectP searchByNameI18n(const QString &) const
Find a StelObject by name.
QFont getFont()
Get the font.
void setShowEnableButton(const bool &show)
Show/hide the button that enable/disable the meteor showers plugin.
bool getEnableAutoUpdates()
Enable/disable catalog updates from the internet.
bool getActiveRadiantOnly()
True if user wants to see the active radiants only.
Store the informations for a location on a planet.
void setEnableAutoUpdates(const bool &b)
Enable/disable automatic catalog updates from the internet.
void setLastUpdate(const QDateTime &datetime)
Set the date and time of last update.
void setColorARC(const Vec3f &rgb)
Set the color of the active radiant based on confirmed data.
void displayMessage(const QString &message, const QString hexColor="#999999")
Display a message. This is used for plugin-specific warnings and such.
Define the interface to implement when creating a plugin.
virtual QStringList listAllObjects(bool) const
List all StelObjects.
void restoreDefaultSettings()
Restore default settings.
virtual StelObjectP searchByName(const QString &) const
Return the matching StelObject if exists or the empty StelObject if not found.
StelTextureSP getPointerTexture()
Gets the pointer texture.
void setFontSize(int pixelSize)
Set the font size (used on radiant labels).
void setUrl(const QString &url)
Set the URL for downloading the meteor showers catalog.
This class manages a collection of MeteorShower objects.
Main class for Stellarium core processing.
void setEnableMarker(const bool &b)
Enable/disable radiant marker.
bool getShowEnableButton()
Get the status of the enable button on the toolbar.
bool getShowSearchButton()
Get the status of the search button on the toolbar.
void setEnableLabels(const bool &b)
Enable/disable radiant labels.
virtual bool configureGui(bool show=true)
Detect or show the configuration GUI elements for the module.
Main class of the Meteor Showers plugin, inherits from StelObjectModule.
Specialization of StelModule which manages a collection of StelObject.
QSharedPointerNoDelete< StelObject > StelObjectP
Intrusive pointer used to manage StelObject with smart pointers.
bool getEnableLabels()
Enable/disable radiant labels.
void setActiveRadiantOnly(const bool &b)
True if user wants to see the active radiants only.
void setEnablePlugin(const bool &b)
Enable/disable the meteor showers plugin.
bool restoreDefaultCatalog(const QString &destination)
Restore default catalog.
StelTextureSP getRadiantTexture()
Gets the radiant texture.
void setShowSearchButton(const bool &show)
Show/hide the button that opens the search dialog.
virtual void init()
Initialize itself.
virtual void deinit()
Called before the module will be delete, and before the openGL context is suppressed.
virtual QStringList listMatchingObjects(const QString &, int, bool, bool) const
Find and return the list of at most maxNbItem objects auto-completing passed object name...
virtual QList< StelObjectP > searchAround(const Vec3d &, double, const StelCore *) const
Search for StelObject in an area around a specifid point.
MeteorShowersMgr()
Constructor.
void setStatusOfLastUpdate(const int &downloadStatus)
Set the status of the last update.
void setUpdateFrequencyHours(const int &hours)
Set the update frequency in hours.
StelModuleActionName
Define the possible action for which an order is defined.
Maintain the state of a progress bar.
MeteorShowers * getMeteorShowers()
Gets the MeteorShowers instance.
void repaint()
It's useful to force the update() and draw().
void updateCatalog()
Download the Meteor Showers catalog from the Internet.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual ~MeteorShowersMgr()
Destructor.
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 void draw(StelCore *core)
Execute all the drawing functions for this module.
void setEnableAtStartup(const bool &b)
Enable the meteor showers plugin at Stellarium startup.
bool getEnableAtStartup()
True if the plugin is enabled at Stellarium startup.
int getUpdateFrequencyHours()
Gets the update frequency in hours.
QDateTime getNextUpdate()
Gets the date of the next update.
This is the common base class for all the main components of stellarium.
bool getEnableMarker()
Enable/disable radiant marker.
virtual void update(double deltaTime)
Update the module with respect to the time.
int getFontSize()
Set the font size (used on radiant labels).
Contains information about a Stellarium plugin.
void setColorIR(const Vec3f &rgb)
Set the color of the inactive radiant.