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 READ getFlagShowPulsars WRITE setFlagShowPulsars)
94 virtual void deinit();
95 virtual void update(
double) {;}
98 virtual double getCallOrder(StelModuleActionName actionName)
const;
107 virtual QList<StelObjectP>
searchAround(
const Vec3d& v,
double limitFov,
const StelCore* core)
const;
122 virtual QStringList
listMatchingObjectsI18n(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false)
const;
128 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false)
const;
129 virtual QStringList listAllObjects(
bool inEnglish)
const;
130 virtual QStringList listAllObjectsByType(
const QString& objType,
bool inEnglish)
const { Q_UNUSED(objType) Q_UNUSED(inEnglish) return QStringList(); }
131 virtual QString getName()
const {
return "Pulsars"; }
134 PulsarP
getByID(
const QString&
id);
159 bool getDisplayMode(
void);
160 void setDisplayMode(
bool b);
162 bool getGlitchFlag(
void);
163 void setGlitchFlag(
bool b);
165 QString getMarkerColor(
bool mtype =
true);
166 void setMarkerColor(QString c,
bool mtype =
true);
168 void setEnableAtStartup(
bool b) { enableAtStartup=b; }
169 bool getEnableAtStartup(
void) {
return enableAtStartup; }
176 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
199 void setFlagShowPulsars(
bool b) { flagShowPulsars=b; }
200 bool getFlagShowPulsars(
void) {
return flagShowPulsars; }
203 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
204 void messageTimeout(
void);
208 bool getFlagShowPulsarsButton(
void) {
return flagShowPulsarsButton; }
216 void restoreDefaultConfigIni(
void);
219 void upgradeConfigIni(
void);
222 void restoreDefaultJsonFile(
void);
225 void readJsonFile(
void);
230 bool backupJsonFile(
bool deleteOriginal=
false);
234 int getJsonFileFormatVersion(
void);
238 bool checkJsonFileFormat(
void);
241 QVariantMap loadPSRMap(QString path=QString());
244 void setPSRMap(
const QVariantMap& map);
246 QString jsonCatalogPath;
255 QNetworkAccessManager* downloadMgr;
258 QTimer* messageTimer;
259 QList<int> messageIDs;
261 QDateTime lastUpdate;
262 int updateFrequencyDays;
263 bool enableAtStartup;
269 bool flagShowPulsars;
270 bool flagShowPulsarsButton;
282 void checkForUpdate(
void);
283 void updateDownloadComplete(QNetworkReply* reply);
290 #include "StelPluginInterface.hpp"
296 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
void displayMessage(const QString &message, const QString hexColor="#999999")
Display a message. This is used for plugin-specific warnings and such.
virtual StelObjectP searchByName(const QString &name) const
Return the matching satellite if exists or NULL.
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.
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.
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
void saveSettingsToConfig(void)
Save the settings to the main configuration file.
UpdateState
Used for keeping for track of the download/update status.
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 updateJSON(void)
Download JSON from web recources described in the module section of the module.ini file and update th...
int getCountPulsars(void)
Get count of pulsars from catalog.
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.
void readSettingsFromConfig(void)
Read (or re-read) settings from the main config file.
int getUpdateFrequencyDays(void)
get the update frequency in days
Update completed, there we no updates.
QDateTime getLastUpdate(void)
get the date and time the pulsars were updated
virtual QStringList listMatchingObjects(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const
Find and return the list of at most maxNbItem objects auto-completing the passed object English name...
QSharedPointer< StelTexture > StelTextureSP
UpdateState getUpdateState(void)
Get the current updateState.
virtual QStringList listMatchingObjectsI18n(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const
Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name...