20 #ifndef METEORSHOWERSMGR_HPP_
21 #define METEORSHOWERSMGR_HPP_
23 #include <QNetworkReply>
25 #include "StelGuiItems.hpp"
26 #include "StelObjectModule.hpp"
28 #define MS_CATALOG_VERSION 1
29 #define MS_CONFIG_PREFIX QString("MeteorShowers")
55 Q_PROPERTY(
bool enablePlugin READ getEnablePlugin WRITE actionEnablePlugin)
94 bool getEnablePlugin() {
return m_enablePlugin; }
109 Vec3f getColorARG() {
return m_colorARG; }
113 Vec3f getColorARC() {
return m_colorARC; }
117 Vec3f getColorIR() {
return m_colorIR; }
141 void setUrl(
const QString& url);
142 QString getUrl() {
return m_url; }
146 QDateTime getLastUpdate() {
return m_lastUpdate; }
150 DownloadStatus getStatusOfLastUpdate() {
return m_statusOfLastUpdate; }
162 virtual void deinit();
163 virtual void update(
double deltaTime);
165 virtual double getCallOrder(StelModuleActionName actionName)
const;
166 virtual bool configureGui(
bool show=
true);
171 virtual QList<StelObjectP> searchAround(
const Vec3d&,
double,
const StelCore*)
const {
return QList<StelObjectP>(); }
174 virtual QStringList listMatchingObjectsI18n(
const QString&,
int,
bool)
const {
return QStringList(); }
175 virtual QStringList listMatchingObjects(
const QString&,
int,
bool)
const {
return QStringList(); }
176 virtual QStringList listAllObjects(
bool)
const {
return QStringList(); }
177 virtual QStringList listAllObjectsByType(
const QString&,
bool)
const {
return QStringList(); }
178 virtual QString getName()
const {
return QString(); }
181 void downloadStatusChanged(DownloadStatus);
218 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
219 void messageTimeout();
222 void checkForUpdates();
223 void updateFinished(QNetworkReply* reply);
233 QString m_catalogPath;
237 bool m_activeRadiantOnly;
238 bool m_enableAtStartup;
241 bool m_showEnableButton;
242 bool m_showSearchButton;
248 QTimer* m_messageTimer;
249 QList<int> m_messageIDs;
256 bool m_enableAutoUpdates;
257 int m_updateFrequencyHours;
259 QDateTime m_lastUpdate;
260 DownloadStatus m_statusOfLastUpdate;
261 QNetworkAccessManager* m_downloadMgr;
264 void createActions();
267 bool loadCatalog(
const QString& jsonPath);
271 void actionEnablePlugin(
const bool& b) { m_enablePlugin = b; }
275 #include "StelPluginInterface.hpp"
281 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.
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.
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.
void restoreDefaultSettings()
Restore default settings.
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.
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.
Main class of the Meteor Showers plugin, inherits from StelObjectModule.
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.
virtual StelPluginInfo getPluginInfo() const =0
StelTextureSP getRadiantTexture()
Gets the radiant texture.
void setShowSearchButton(const bool &show)
Show/hide the button that opens the search dialog.
MeteorShowersMgr()
Constructor.
virtual class StelModule * getStelModule() const =0
void setStatusOfLastUpdate(const int &downloadStatus)
Set the status of the last update.
void setUpdateFrequencyHours(const int &hours)
Set the update frequency in hours.
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
virtual ~MeteorShowersMgr()
Destructor.
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.
bool getEnableMarker()
Enable/disable radiant marker.
int getFontSize()
Set the font size (used on radiant labels).
void setColorIR(const Vec3f &rgb)
Set the color of the inactive radiant.