22 #include "StelObjectModule.hpp" 23 #include "StelObject.hpp" 27 #include <QVariantMap> 30 #include <QSharedPointer> 34 class QNetworkAccessManager;
62 typedef QSharedPointer<Quasar> QuasarP;
72 Q_PROPERTY(
bool quasarsVisible
75 NOTIFY flagQuasarsVisibilityChanged
119 return qSharedPointerCast<StelObject>(
getByID(
id));
127 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false,
bool inEnglish=
false)
const;
131 virtual QString
getName()
const {
return "Quasars"; }
136 QuasarP
getByID(
const QString&
id)
const;
161 void setEnableAtStartup(
bool b) { enableAtStartup=b; }
162 bool getEnableAtStartup(
void) {
return enableAtStartup; }
169 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
184 void flagQuasarsVisibilityChanged(
bool b);
200 bool getFlagShowQuasarsButton(
void) {
return flagShowQuasarsButton; }
229 void restoreDefaultConfigIni(
void);
232 void upgradeConfigIni(
void);
235 void restoreDefaultJsonFile(
void);
238 void readJsonFile(
void);
243 bool backupJsonFile(
bool deleteOriginal=
false);
247 int getJsonFileFormatVersion(
void);
251 bool checkJsonFileFormat(
void);
254 QVariantMap loadQSOMap(QString path=QString());
257 void setQSOMap(
const QVariantMap& map);
259 QString catalogJsonPath;
268 QNetworkAccessManager* downloadMgr;
271 QTimer* messageTimer;
272 QList<int> messageIDs;
274 QDateTime lastUpdate;
275 int updateFrequencyDays;
276 bool enableAtStartup;
282 bool flagShowQuasars;
283 bool flagShowQuasarsButton;
294 void checkForUpdate(
void);
295 void updateDownloadComplete(QNetworkReply* reply);
298 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
299 void messageTimeout(
void);
301 void reloadCatalog(
void);
307 #include "StelPluginInterface.hpp" 313 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
void readSettingsFromConfig(void)
Read (or re-read) settings from the main config file.
Vec3f getMarkerColor(void)
Get color for quasars markers.
QuasarP getByID(const QString &id) const
get a Quasar object by identifier
UpdateState
Used for keeping for track of the download/update status.
void setFlagShowQuasarsButton(bool b)
Define whether the button toggling quasars should be visible.
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
int getCountQuasars(void)
Get count of quasars from catalog.
Define the interface to implement when creating a plugin.
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 bool configureGui(bool show=true)
Implement this to tell the main Stellarium GUI that there is a GUI element to configure this plugin...
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 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...
void setUpdatesEnabled(bool b)
set 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.
Update completed, there we no updates.
Define the StelTextureSP type.
int getSecondsToUpdate(void)
get the number of seconds till the next update
virtual StelObjectP searchByID(const QString &id) const
Return the StelObject with the given ID if exists or the empty StelObject if not found.
Main class for Stellarium core processing.
void saveSettingsToConfig(void)
Save the settings to the main configuration file.
Specialization of StelModule which manages a collection of StelObject.
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.
void restoreDefaults(void)
Set up the plugin with default values.
bool getDisplayMode(void)
Get status to display of distribution of pulsars.
Update completed, there were updates.
virtual QStringList listAllObjects(bool inEnglish) const
List all StelObjects.
bool getFlagShowQuasars(void)
Get status to display of markers of quasars.
virtual QString getName() const
Gets a user-displayable name of the object category.
Provides functions for performing openGL drawing operations.
void updateStateChanged(Quasars::UpdateState state)
Main class of the Quasars plugin.
virtual void update(double)
Update the module with respect to the time.
bool getUpdatesEnabled(void)
get whether or not the plugin will try to update catalog data from the internet
UpdateState getUpdateState(void)
Get the current updateState.
virtual void init()
Initialize itself.
void setFlagShowQuasars(bool b)
Enable/disable display of markers of quasars.
StelModuleActionName
Define the possible action for which an order is defined.
Maintain the state of a progress bar.
virtual void deinit()
Called before the module will be delete, and before the openGL context is suppressed.
void updateJSON(void)
Download JSON from web recources described in the module section of the module.ini file and update th...
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
Error during download phase.
void setDisplayMode(bool b)
Enable/disable display of distribution of pulsars.
virtual QString getStelObjectType() const
Returns the name that will be returned by StelObject::getType() for the objects this module manages...
This is the common base class for all the main components of stellarium.
QDateTime getLastUpdate(void)
get the date and time the TLE elements were updated
void setMarkerColor(const Vec3f &c)
Set color for quasars markers.
int getUpdateFrequencyDays(void)
get the update frequency in days
Contains information about a Stellarium plugin.