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
123 return qSharedPointerCast<StelObject>(
getByID(
id));
131 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false,
bool inEnglish=
false)
const;
133 virtual QString
getName()
const {
return "Pulsars"; }
137 PulsarP
getByID(
const QString&
id)
const;
162 void setEnableAtStartup(
bool b) { enableAtStartup=b; }
163 bool getEnableAtStartup(
void) {
return enableAtStartup; }
170 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
185 void flagPulsarsVisibilityChanged(
bool b);
190 bool getFlagShowPulsarsButton(
void) {
return flagShowPulsarsButton; }
239 void restoreDefaultConfigIni(
void);
242 void upgradeConfigIni(
void);
245 void restoreDefaultJsonFile(
void);
248 void readJsonFile(
void);
253 bool backupJsonFile(
bool deleteOriginal=
false);
257 int getJsonFileFormatVersion(
void);
261 bool checkJsonFileFormat(
void);
264 QVariantMap loadPSRMap(QString path=QString());
267 void setPSRMap(
const QVariantMap& map);
269 QString jsonCatalogPath;
278 QNetworkAccessManager* downloadMgr;
281 QTimer* messageTimer;
282 QList<int> messageIDs;
284 QDateTime lastUpdate;
285 int updateFrequencyDays;
286 bool enableAtStartup;
292 bool flagShowPulsars;
293 bool flagShowPulsarsButton;
305 void checkForUpdate(
void);
306 void updateDownloadComplete(QNetworkReply* reply);
308 void reloadCatalog(
void);
311 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
312 void messageTimeout(
void);
318 #include "StelPluginInterface.hpp" 324 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 Q_NULLPTR.
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...
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.
virtual QString getStelObjectType() const
Returns the name that will be returned by StelObject::getType() for the objects this module manages...
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 Q_NULLPTR.
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.
virtual QString getName() const
Gets a user-displayable name of the object category.
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
PulsarP getByID(const QString &id) const
get a Pulsar object by identifier
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.
virtual StelObjectP searchByID(const QString &id) const
Return the StelObject with the given ID if exists or the empty StelObject if not found.