20 #ifndef _SATELLITES_HPP_ 21 #define _SATELLITES_HPP_ 1 23 #include "StelObjectModule.hpp" 24 #include "Satellite.hpp" 25 #include "StelFader.hpp" 26 #include "StelGui.hpp" 27 #include "StelDialog.hpp" 28 #include "StelLocation.hpp" 34 #include <QVariantMap> 38 class QNetworkAccessManager;
107 typedef QList<TleData> TleDataList;
109 typedef QHash<QString, TleData> TleDataHash ;
126 typedef QList<TleSource> TleSourceList;
137 typedef QList<IridiumFlaresPrediction> IridiumFlaresPredictionList;
147 Q_PROPERTY(
bool hintsVisible
150 NOTIFY hintsVisibleChanged)
151 Q_PROPERTY(
bool labelsVisible
154 NOTIFY labelsVisibleChanged)
155 Q_PROPERTY(
bool autoAddEnabled
156 READ isAutoAddEnabled
158 NOTIFY settingsChanged)
159 Q_PROPERTY(
bool autoRemoveEnabled
160 READ isAutoRemoveEnabled
161 WRITE enableAutoRemove
162 NOTIFY settingsChanged)
163 Q_PROPERTY(
bool realisticMode
164 READ getFlagRealisticMode
165 WRITE setFlagRelisticMode)
195 virtual void deinit();
196 virtual void update(
double deltaTime);
208 virtual QList<StelObjectP> searchAround(
const Vec3d& v,
double limitFov,
const StelCore* core)
const;
212 virtual StelObjectP searchByNameI18n(
const QString& nameI18n)
const;
223 StelObjectP searchByNoradNumber(
const QString& noradNumber)
const;
230 virtual QStringList listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false,
bool inEnglish=
false)
const;
232 virtual QStringList listAllObjects(
bool inEnglish)
const;
234 virtual QString getName()
const {
return "Satellites"; }
238 virtual bool configureGui(
bool show=
true);
243 void restoreDefaults(
void);
255 QSet<QString> getGroups()
const;
258 QStringList getGroupIdList()
const;
260 void addGroup(
const QString& groupId);
264 QHash<QString,QString> getSatellites(
const QString& group=QString(),
Status vis=Both);
269 SatelliteP getById(
const QString&
id);
272 QStringList listAllIds();
277 void add(
const TleDataList& newSatellites);
281 void remove(
const QStringList& idList);
294 int getSecondsToUpdate(
void);
314 void setTleSources(QStringList tleSources);
317 void saveTleSources(
const QStringList& urls);
327 void updateFromFiles(QStringList paths,
bool deleteFiles=
false);
341 void updateSatellites(TleDataHash& newTleSets);
351 static void parseTleFile(QFile& openFile,
352 TleDataHash& tleList,
353 bool addFlagValue =
false);
359 void parseQSMagFile(QString qsMagFile);
361 bool getFlagHints() {
return hintFader;}
365 bool getFlagLabels();
366 bool getFlagRealisticMode();
368 bool getOrbitLinesFlag();
369 bool isAutoAddEnabled()
const {
return autoAddEnabled; }
370 bool isAutoRemoveEnabled()
const {
return autoRemoveEnabled; }
375 IridiumFlaresPredictionList getIridiumFlaresPrediction();
378 void hintsVisibleChanged(
bool b);
379 void labelsVisibleChanged(
bool b);
383 void settingsChanged();
398 void tleUpdateComplete(
int updated,
int total,
int added,
int missing);
406 void enableInternetUpdates(
bool enabled =
true);
409 void enableAutoAdd(
bool enabled =
true);
412 void enableAutoRemove(
bool enabled =
true);
417 void setFlagHints(
bool b);
422 void setFlagLabels(
bool b);
425 void setFlagRelisticMode(
bool b);
430 void setLabelFontSize(
int size);
434 void setUpdateFrequencyHours(
int hours);
449 void updateFromOnlineSources();
455 void setOrbitLinesFlag(
bool b);
457 void recalculateOrbitLines(
void);
461 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
466 void saveCatalog(QString path=QString());
480 bool add(
const TleData& tleData);
483 void restoreDefaultSettings();
485 void restoreDefaultCatalog();
493 bool backupCatalog(
bool deleteOriginal=
false);
496 const QString readCatalogVersion();
498 void restoreDefaultQSMagFile();
501 bool isValidRangeDates()
const;
506 bool saveDataMap(
const QVariantMap& map, QString path=QString());
509 QVariantMap loadDataMap(QString path=QString());
511 void setDataMap(
const QVariantMap& map);
514 QVariantMap createDataMap();
517 void markLastUpdate();
521 bool checkJsonFileFormat();
527 static void translations();
530 QString qsMagFilePath;
539 QList<SatelliteP> satellites;
542 QHash<QString, double> qsMagList;
548 QSet<QString> groups;
558 QSharedPointer<Planet> earth;
559 Vec3f defaultHintColor;
560 Vec3f defaultOrbitColor;
566 QNetworkAccessManager* downloadMgr;
575 QStringList updateUrls;
581 TleSourceList updateSources;
583 int numberDownloadsComplete;
591 bool autoRemoveEnabled;
592 QDateTime lastUpdate;
593 int updateFrequencyHours;
598 QTimer* messageTimer;
599 QList<int> messageIDs;
602 int iridiumFlaresPredictionDepth;
611 void checkForUpdate(
void);
620 void saveDownloadedUpdate(QNetworkReply* reply);
627 #include "StelPluginInterface.hpp" 633 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
Main configuration window of the Satellites plugin.
Store the informations for a location on a planet.
Error during download phase.
QString id
NORAD catalog number, as extracted from the TLE set.
Define the interface to implement when creating a plugin.
Status
Flags used to filter the satellites list according to their status.
int getIridiumFlaresPredictionDepth(void)
Get depth of prediction for Iridium flares.
QFile * file
The downloaded file, location set after finishing download.
Implementation of StelFader which implements a linear transition.
QDateTime getLastUpdate(void)
get the date and time the TLE elements were updated
UpdateState getUpdateState(void)
get the update frequency in hours
Main class for Stellarium core processing.
Update completed, there we no updates.
Specialization of StelModule which manages a collection of StelObject.
void setIridiumFlaresPredictionDepth(int depth)
Set depth of prediction for Iridium flares.
UpdateState
Used for keeping track of the download/update status.
Data structure containing unvalidated TLE set as read from a TLE list file.
int getLabelFontSize()
get the label font size.
QUrl url
URL from where the source list should be downloaded.
bool addNew
Flag indicating whether new satellites in this list should be added.
QString name
Human readable name, as extracted from the TLE title line.
Provides functions for performing openGL drawing operations.
TLE update source, used only internally for now.
QStringList getTleSources(void)
Get a list of URLs which are sources of TLE data.
int getUpdateFrequencyHours(void)
get the update frequency in hours
StelModuleActionName
Define the possible action for which an order is defined.
This class is used by Qt to manage a plug-in interface.
Maintain the state of a progress bar.
Update completed, there were updates.
Main class of the Satellites plugin.
A model encapsulating a satellite list.
bool getUpdatesEnabled(void)
get whether or not the plugin will try to update TLE data from the internet
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
This is the common base class for all the main components of stellarium.
Contains information about a Stellarium plugin.
bool addThis
Flag indicating whether this satellite should be added.