22 #include "StelObjectModule.hpp" 23 #include "StelObject.hpp" 24 #include "StelFader.hpp" 28 #include <QVariantMap> 31 #include <QSharedPointer> 33 class QNetworkAccessManager;
66 typedef QSharedPointer<Pulsar> PulsarP;
76 Q_PROPERTY(
bool pulsarsVisible
79 NOTIFY flagPulsarsVisibilityChanged
126 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false,
bool inEnglish=
false)
const;
128 virtual QString getName()
const {
return "Pulsars"; }
131 PulsarP
getByID(
const QString&
id);
156 void setEnableAtStartup(
bool b) { enableAtStartup=b; }
157 bool getEnableAtStartup(
void) {
return enableAtStartup; }
164 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
179 void flagPulsarsVisibilityChanged(
bool b);
184 bool getFlagShowPulsarsButton(
void) {
return flagShowPulsarsButton; }
233 void restoreDefaultConfigIni(
void);
236 void upgradeConfigIni(
void);
239 void restoreDefaultJsonFile(
void);
242 void readJsonFile(
void);
247 bool backupJsonFile(
bool deleteOriginal=
false);
251 int getJsonFileFormatVersion(
void);
255 bool checkJsonFileFormat(
void);
258 QVariantMap loadPSRMap(QString path=QString());
261 void setPSRMap(
const QVariantMap& map);
263 QString jsonCatalogPath;
272 QNetworkAccessManager* downloadMgr;
275 QTimer* messageTimer;
276 QList<int> messageIDs;
278 QDateTime lastUpdate;
279 int updateFrequencyDays;
280 bool enableAtStartup;
286 bool flagShowPulsars;
287 bool flagShowPulsarsButton;
299 void checkForUpdate(
void);
300 void updateDownloadComplete(QNetworkReply* reply);
302 void reloadCatalog(
void);
305 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
306 void messageTimeout(
void);
312 #include "StelPluginInterface.hpp" 318 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
Define the interface to implement when creating a plugin.
virtual StelObjectP searchByName(const QString &name) const
Return the matching satellite if exists or NULL.
bool getGlitchFlag(void)
Get status for usage of separate color for pulsars with glitches.
void setFlagShowPulsarsButton(bool b)
Define whether the button toggling pulsars should be visible.
void jsonUpdateComplete(void)
emitted after a JSON update has run.
Error during download phase.
Define the StelTextureSP type.
void updateStateChanged(Pulsars::UpdateState state)
void restoreDefaults(void)
Set up the plugin with default values.
void setUpdatesEnabled(bool b)
set whether or not the plugin will try to update catalog data from the internet
Main class of the Pulsars plugin.
Main class for Stellarium core processing.
virtual QStringList listAllObjects(bool inEnglish) const
List all StelObjects.
virtual void init()
Initialize itself.
virtual bool configureGui(bool show=true)
Implement this to tell the main Stellarium GUI that there is a GUI element to configure this plugin...
PulsarP getByID(const QString &id)
get a Pulsar object by identifier
virtual void update(double)
Update the module with respect to the time.
Vec3f getMarkerColor(bool mtype=true)
Get color for pulsars markers.
void saveSettingsToConfig(void)
Save the settings to the main configuration file.
Specialization of StelModule which manages a collection of StelObject.
UpdateState
Used for keeping for track of the download/update status.
void setDisplayMode(bool b)
Enable/disable display of distribution of pulsars.
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 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 updateJSON(void)
Download JSON from web recources described in the module section of the module.ini file and update th...
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.
bool getDisplayMode(void)
Get status to display of distribution of pulsars.
int getCountPulsars(void)
Get count of pulsars from catalog.
Provides functions for performing openGL drawing operations.
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
bool getUpdatesEnabled(void)
get whether or not the plugin will try to update catalog data from the internet
Update completed, there were updates.
int getSecondsToUpdate(void)
get the number of seconds till the next update
virtual StelObjectP searchByNameI18n(const QString &nameI18n) const
Return the matching satellite object's pointer if exists or NULL.
bool getFlagShowPulsars(void)
Get status to display of markers of pulsars.
void readSettingsFromConfig(void)
Read (or re-read) settings from the main config file.
int getUpdateFrequencyDays(void)
get the update frequency in days
StelModuleActionName
Define the possible action for which an order is defined.
void setFlagShowPulsars(bool b)
Enable/disable display of markers of pulsars.
Update completed, there we no updates.
Maintain the state of a progress bar.
void setMarkerColor(const Vec3f &c, bool mtype=true)
Set color for pulsars markers.
QDateTime getLastUpdate(void)
get the date and time the pulsars were updated
virtual void deinit()
Called before the module will be delete, and before the openGL context is suppressed.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
UpdateState getUpdateState(void)
Get the current updateState.
void setGlitchFlag(bool b)
Enable/disable the use of a separate color for pulsars with glitches.
This is the common base class for all the main components of stellarium.
Contains information about a Stellarium plugin.