diff --git a/guide/pictures/satellites_plugin_filters.jpg b/guide/pictures/satellites_plugin_filters.jpg new file mode 100644 index 0000000000000..f4ab49619f3d1 Binary files /dev/null and b/guide/pictures/satellites_plugin_filters.jpg differ diff --git a/guide/pictures/satellites_plugin_satellites.jpg b/guide/pictures/satellites_plugin_satellites.jpg new file mode 100644 index 0000000000000..69c57fa19b3ed Binary files /dev/null and b/guide/pictures/satellites_plugin_satellites.jpg differ diff --git a/guide/pictures/satellites_plugin_satellites.png b/guide/pictures/satellites_plugin_satellites.png deleted file mode 100644 index c30aa32007f9b..0000000000000 Binary files a/guide/pictures/satellites_plugin_satellites.png and /dev/null differ diff --git a/guide/plg_catalogs.tex b/guide/plg_catalogs.tex index 848dd766b2944..2e22b9abca915 100644 --- a/guide/plg_catalogs.tex +++ b/guide/plg_catalogs.tex @@ -1239,12 +1239,18 @@ \section{Satellites Plugin} To calculate satellite positions, the plugin uses an implementation of the SGP4/SDP4 algorithms (J.L. Canales' \program{gsat} library), using as its input data in NORAD's two-line element set -(TLE\footnote{TLE: \url{https://en.wikipedia.org/wiki/Two-line_element_set}}) +(\indexterm[TLE, two-line element]{TLE}\footnote{TLE: \url{https://en.wikipedia.org/wiki/Two-line_element_set}}) format. Lists with TLEs for hundreds of satellites are available online and are regularly updated. The plugin downloads the lists prepared by \url{https://celestrak.com} to keep itself up-to-date, but the users can specify other sources online or load updates from local files. +\begin{figure}[htbp] + \centering\includegraphics[width=0.8\textwidth]{satellites_plugin_configuration.jpg} + \caption{Configuration of the Satellites plugin.} + \label{fig:plugins:Satellites:Configuration} +\end{figure} + If the plugin has been enabled (see section~\ref{sec:Plugins:EnablingPlugins}), just click on the Satellite button \guibutton{0.6}{bt_hint.png} on the bottom @@ -1265,22 +1271,55 @@ \section{Satellites Plugin} section~\ref{sec:Eclipses:lunar}), at the distance of the currently selected satellite, or at a fixed distance from Earth's surface. -\begin{figure}[htbp] -\centering\includegraphics[width=0.8\textwidth]{satellites_plugin_configuration.jpg} -\caption{Configuration of the Satellites plugin.} -\label{fig:plugins:Satellites:Configuration} -\end{figure} - \subsection{Satellite Properties} \label{sec:plugins:Satellites:properties} -\begin{description} -\item[Name and identifiers] Each satellite has a name. It's displayed as a label of the satellite hint and in the list of satellites. Names are not unique though, so they are used only -for presentation purposes. - -\item[Satellite Catalog] In the \emph{Satellite Catalog} satellites are uniquely identified by their NORAD number, which is encoded in TLEs. +\begin{figure}[tbp] + \centering\includegraphics[width=0.8\textwidth]{satellites_plugin_satellites.jpg} + \caption{Configuration of the Satellites plugin --- satellites properties.} + \label{fig:plugins:Satellites:Configuration:Satellites} +\end{figure} -\item[Grouping] +\begin{description} +\item[Name] Each satellite has a name. It's displayed as a label of + the satellite hint and in the list of satellites. Names are not + unique though, so they are used only for presentation purposes. +\item[Catalog number] In the \emph{Satellite Catalog} satellites are + uniquely identified by their NORAD number, which is encoded in + \indexterm[TLE, two-line element]{TLE}s. +\item[I.D. (The International Designator)] In the \emph{Satellite + Catalog} satellites are also uniquely identified by their + International Designator also known as \indexterm[COSPAR ID (satellite ID)]{COSPAR ID}, which is encoded + in TLEs. +\item[Standard magnitude] The \indexterm[standard magnitude + (satellites)]{standard magnitude} may be an estimate based on the + mean cross-sectional area derived from its dimensions, or it may be + a mean value derived from visual observations.\footnote{The standard + magnitude and RCS data were obtained from Mike McCants' quicksat + catalog with his permissions.} +\item[RCS] The \indexterm[RCS, Radar Cross Section]{Radar Cross + Section} is a median value derived from the last several years of + values in the Satellite Situation Report. The units of the RCS are + square meters. +\item[Perigee] The \indexterm{perigee} is the nearest point respectively of a + satellite's direct orbit around the Earth. The unit of perigee is + kilometers. +\item[Apogee] The \indexterm{apogee} is the farthest point + respectively of a satellite's direct orbit around the Earth. The + unit of apogee is kilometers. +\item[Period] The orbital period is simply how long an orbiting + satellite takes to complete one orbit. The unit of period is + minutes. +\item[Displayed] In the \emph{Satellite Catalog} tab this property + controls whether the selected satellite should be displayed on the + sky. +\item[Orbit] In the \emph{Satellite Catalog} tab this property + controls whether the orbit of the selected satellite should be + displayed in the sky. +\item[Do not update] In the \emph{Satellite Catalog} tab this property + marks satellites for which TLE should not be updated. +\item[Description] The user-defined notes for the selected satellite. +\item[Groups] A satellite can belong to one or more groups such as ``amateur'', ``geostationary'' or ``navigation''. They have no other function but to help the user organize the satellite collection. Group names are @@ -1289,14 +1328,40 @@ \subsection{Satellite Properties} grouping. A satellite may also not belong to any group at all. By convention, group names are in lowercase. The GUI translates some of the groups used in the default catalog. + +The group names also can be used as an additional filters for the satellites (see UI elements on the left side). + +\item[TLE set] The raw TLE data of selected satellite. A two-line + element set (TLE) is a data format encoding a list of orbital + elements of an Earth-orbiting object for a given point in time, the + epoch. Using a suitable prediction model, the state (position and + velocity) at any point in the past or future can be estimated to + some accuracy. + +\item[Epoch of the TLE] Human-readable epoch of current set of the TLE. \end{description} -\begin{figure}[tbp] - \centering\includegraphics[width=0.8\textwidth]{satellites_plugin_satellites.png} - \caption{Configuration of the Satellites plugin --- satellites properties.} - \label{fig:plugins:Satellites:Configuration:Satellites} +On the left side of this tab you may see tools for filtering the +satellites. The upper part shows a drop-down list with many predefined +filters. Some filters are connected to user defined groups to quickly +get a list of satellites in some group, such as all satellites from +group ``navigation''. Some filters are connected to orbital properties +of satellites, e.g., selecting the filter ``[LEO]'' will show all +low-orbital satellites. + +\begin{figure}[ht] + \centering\includegraphics[width=0.6\textwidth]{satellites_plugin_filters.jpg} + \caption{Configuration of the Satellites plugin --- satellites custom filter.} + \label{fig:plugins:Satellites:Configuration:SatellitesFilter} \end{figure} +You can display \newFeature{0.22.2} a list of satellites by specific +selection of their properties, when filter ``[custom filter]'' has +been selected (see +\ref{fig:plugins:Satellites:Configuration:SatellitesFilter}). The +settings of this filter available through button +\guibutton{0.6}{uibtSettings.png}, which is located at the right of +the drop-down list. \subsection{Satellite Catalog} \label{sec:plugins:Satellites:catalog} diff --git a/plugins/Satellites/src/CMakeLists.txt b/plugins/Satellites/src/CMakeLists.txt index c0ab887a6479e..84172397522d3 100644 --- a/plugins/Satellites/src/CMakeLists.txt +++ b/plugins/Satellites/src/CMakeLists.txt @@ -39,11 +39,14 @@ SET(Satellites_SRCS gui/SatellitesDialog.cpp gui/SatellitesImportDialog.hpp gui/SatellitesImportDialog.cpp + gui/SatellitesFilterDialog.hpp + gui/SatellitesFilterDialog.cpp ) SET(SatellitesDialog_UIS gui/satellitesDialog.ui gui/satellitesImportDialog.ui + gui/satellitesFilterDialog.ui ) QT5_WRAP_UI(SatellitesDialog_UIS_H ${SatellitesDialog_UIS}) diff --git a/plugins/Satellites/src/Satellite.cpp b/plugins/Satellites/src/Satellite.cpp index c3aec8ee90943..2def42fd7f8e7 100644 --- a/plugins/Satellites/src/Satellite.cpp +++ b/plugins/Satellites/src/Satellite.cpp @@ -65,6 +65,26 @@ Vec3f Satellite::transitSatelliteColor = Vec3f(0.f,0.f,0.f); double Satellite::timeRateLimit = 1.0; // one JD per second by default int Satellite::tleEpochAge = 30; // default age of TLE's epoch to mark TLE as outdated (using for filters) +bool Satellite::flagCFKnownStdMagnitude = false; +bool Satellite::flagCFApogee = false; +double Satellite::minCFApogee = 20000.; +double Satellite::maxCFApogee = 55000.; +bool Satellite::flagCFPerigee = false; +double Satellite::minCFPerigee = 200.; +double Satellite::maxCFPerigee = 1500.; +bool Satellite::flagCFEccentricity = false; +double Satellite::minCFEccentricity = 0.3; +double Satellite::maxCFEccentricity = 0.9; +bool Satellite::flagCFPeriod = false; +double Satellite::minCFPeriod = 0.; +double Satellite::maxCFPeriod = 150.; +bool Satellite::flagCFInclination = false; +double Satellite::minCFInclination = 120.; +double Satellite::maxCFInclination = 360.; +bool Satellite::flagCFRCS = false; +double Satellite::minCFRCS = 0.1; +double Satellite::maxCFRCS = 100.; + #if (SATELLITES_PLUGIN_IRIDIUM == 1) double Satellite::sunReflAngle = 180.; //double Satellite::timeShift = 0.; @@ -854,6 +874,31 @@ SatFlags Satellite::getFlags() const flags |= SatHGSO; if (qAbs(StelApp::getInstance().getCore()->getJD() - tleEpochJD) > tleEpochAge) flags |= SatOutdatedTLE; + // custom filters + bool cfa = true; + if (flagCFApogee) + cfa = (apogee>=minCFApogee && apogee<=maxCFApogee); + bool cfp = true; + if (flagCFPerigee) + cfp = (perigee>=minCFPerigee && perigee<=maxCFPerigee); + bool cfe = true; + if (flagCFEccentricity) + cfe = (eccentricity>=minCFEccentricity && eccentricity<=maxCFEccentricity); + bool cfm = true; + if (flagCFKnownStdMagnitude) + cfm = (stdMag<99.0); + bool cft = true; + if (flagCFPeriod) + cft = (orbitalPeriod>=minCFPeriod && orbitalPeriod<=maxCFPeriod); + bool cfi = true; + if (flagCFInclination) + cfi = (inclination>=minCFInclination && inclination<=maxCFInclination); + bool cfr = true; + if (flagCFRCS) + cfr = (RCS>=minCFRCS && RCS<=maxCFRCS); + if (cfa && cfp && cfe && cfm && cft && cfi && cfr) + flags |= SatCustomFilter; + return flags; } diff --git a/plugins/Satellites/src/Satellite.hpp b/plugins/Satellites/src/Satellite.hpp index a994285f92f64..d037b19f57b95 100644 --- a/plugins/Satellites/src/Satellite.hpp +++ b/plugins/Satellites/src/Satellite.hpp @@ -72,22 +72,23 @@ typedef QSet GroupSet; //! @ingroup satellites enum SatFlag { - SatNoFlags = 0x0000, - SatDisplayed = 0x0001, - SatNotDisplayed = 0x0002, - SatUser = 0x0004, - SatOrbit = 0x0008, - SatNew = 0x0010, - SatError = 0x0020, - SatSmallSize = 0x0040, - SatMediumSize = 0x0080, - SatLargeSize = 0x0100, - SatLEO = 0x0200, - SatMEO = 0x0400, - SatGSO = 0x0800, - SatHEO = 0x1000, - SatHGSO = 0x2000, - SatOutdatedTLE = 0x4000 + SatNoFlags = 0x0000, + SatDisplayed = 0x0001, + SatNotDisplayed = 0x0002, + SatUser = 0x0004, + SatOrbit = 0x0008, + SatNew = 0x0010, + SatError = 0x0020, + SatSmallSize = 0x0040, + SatMediumSize = 0x0080, + SatLargeSize = 0x0100, + SatLEO = 0x0200, + SatMEO = 0x0400, + SatGSO = 0x0800, + SatHEO = 0x1000, + SatHGSO = 0x2000, + SatOutdatedTLE = 0x4000, + SatCustomFilter = 0x8000 }; typedef QFlags SatFlags; Q_DECLARE_OPERATORS_FOR_FLAGS(SatFlags) @@ -116,11 +117,11 @@ class Satellite : public StelObject //! @enum OptStatus operational statuses enum OptStatus { - StatusOperational = 1, + StatusOperational = 1, StatusNonoperational = 2, StatusPartiallyOperational = 3, StatusStandby = 4, - StatusSpare = 5, + StatusSpare = 5, StatusExtendedMission = 6, StatusDecayed = 7, StatusUnknown = 0 @@ -322,6 +323,26 @@ class Satellite : public StelObject static double timeRateLimit; static int tleEpochAge; + static bool flagCFKnownStdMagnitude; + static bool flagCFApogee; + static double minCFApogee; + static double maxCFApogee; + static bool flagCFPerigee; + static double minCFPerigee; + static double maxCFPerigee; + static bool flagCFEccentricity; + static double minCFEccentricity; + static double maxCFEccentricity; + static bool flagCFPeriod; + static double minCFPeriod; + static double maxCFPeriod; + static bool flagCFInclination; + static double minCFInclination; + static double maxCFInclination; + static bool flagCFRCS; + static double minCFRCS; + static double maxCFRCS; + void draw(StelCore *core, StelPainter& painter); //Satellite Orbit Position calculation diff --git a/plugins/Satellites/src/Satellites.cpp b/plugins/Satellites/src/Satellites.cpp index 6f1edbcf1fd47..fef71c96ccda8 100644 --- a/plugins/Satellites/src/Satellites.cpp +++ b/plugins/Satellites/src/Satellites.cpp @@ -656,6 +656,25 @@ void Satellites::restoreDefaultSettings() conf->setValue("umbra_fixed_distance", 1000.0); conf->setValue("penumbra_flag", false); conf->setValue("penumbra_color", "1.0,0.0,0.0"); + conf->setValue("cf_magnitude_flag", false); + conf->setValue("cf_apogee_flag", false); + conf->setValue("cf_apogee_min", 20000.); + conf->setValue("cf_apogee_max", 55000.); + conf->setValue("cf_perigee_flag", false); + conf->setValue("cf_perigee_min", 200.); + conf->setValue("cf_perigee_max", 1500.); + conf->setValue("cf_eccentricity_flag", false); + conf->setValue("cf_eccentricity_min", 0.3); + conf->setValue("cf_eccentricity_max", 0.9); + conf->setValue("cf_period_flag", false); + conf->setValue("cf_period_min", 0.); + conf->setValue("cf_period_max", 150.); + conf->setValue("cf_inclination_flag", false); + conf->setValue("cf_inclination_min", 120.); + conf->setValue("cf_inclination_max", 180.); + conf->setValue("cf_rcs_flag", false); + conf->setValue("cf_rcs_min", 0.1); + conf->setValue("cf_rcs_max", 100.); conf->endGroup(); // saveTleSources() opens it for itself @@ -826,6 +845,27 @@ void Satellites::loadSettings() setFlagIconicMode(conf->value("iconic_mode_enabled", false).toBool()); setFlagHideInvisible(conf->value("hide_invisible_satellites", false).toBool()); + // custom filter + setFlagCFKnownStdMagnitude(conf->value("cf_magnitude_flag", false).toBool()); + setFlagCFApogee(conf->value("cf_apogee_flag", false).toBool()); + setMinCFApogee(conf->value("cf_apogee_min", 20000.).toDouble()); + setMaxCFApogee(conf->value("cf_apogee_max", 55000.).toDouble()); + setFlagCFPerigee(conf->value("cf_perigee_flag", false).toBool()); + setMinCFPerigee(conf->value("cf_perigee_min", 200.).toDouble()); + setMaxCFPerigee(conf->value("cf_perigee_max", 1500.).toDouble()); + setFlagCFEccentricity(conf->value("cf_eccentricity_flag", false).toBool()); + setMinCFEccentricity(conf->value("cf_eccentricity_min", 0.3).toDouble()); + setMaxCFEccentricity(conf->value("cf_eccentricity_max", 0.9).toDouble()); + setFlagCFPeriod(conf->value("cf_period_flag", false).toBool()); + setMinCFPeriod(conf->value("cf_period_min", 0.).toDouble()); + setMaxCFPeriod(conf->value("cf_period_max", 150.).toDouble()); + setFlagCFInclination(conf->value("cf_inclination_flag", false).toBool()); + setMinCFInclination(conf->value("cf_inclination_min", 120.).toDouble()); + setMaxCFInclination(conf->value("cf_inclination_max", 180.).toDouble()); + setFlagCFRCS(conf->value("cf_rcs_flag", false).toBool()); + setMinCFRCS(conf->value("cf_rcs_min", 0.1).toDouble()); + setMaxCFRCS(conf->value("cf_rcs_max", 100.).toDouble()); + conf->endGroup(); } @@ -868,6 +908,27 @@ void Satellites::saveSettingsToConfig() conf->setValue("iconic_mode_enabled", getFlagIconicMode()); conf->setValue("hide_invisible_satellites", getFlagHideInvisible()); + // custom filter + conf->setValue("cf_magnitude_flag", getFlagCFKnownStdMagnitude()); + conf->setValue("cf_apogee_flag", getFlagCFApogee()); + conf->setValue("cf_apogee_min", getMinCFApogee()); + conf->setValue("cf_apogee_max", getMaxCFApogee()); + conf->setValue("cf_perigee_flag", getFlagCFPerigee()); + conf->setValue("cf_perigee_min", getMinCFPerigee()); + conf->setValue("cf_perigee_max", getMaxCFPerigee()); + conf->setValue("cf_eccentricity_flag", getFlagCFEccentricity()); + conf->setValue("cf_eccentricity_min", getMinCFEccentricity()); + conf->setValue("cf_eccentricity_max", getMaxCFEccentricity()); + conf->setValue("cf_period_flag", getFlagCFPeriod()); + conf->setValue("cf_period_min", getMinCFPeriod()); + conf->setValue("cf_period_max", getMaxCFPeriod()); + conf->setValue("cf_inclination_flag", getFlagCFInclination()); + conf->setValue("cf_inclination_min", getMinCFInclination()); + conf->setValue("cf_inclination_max", getMaxCFInclination()); + conf->setValue("cf_rcs_flag", getFlagCFRCS()); + conf->setValue("cf_rcs_min", getMinCFRCS()); + conf->setValue("cf_rcs_max", getMaxCFRCS()); + conf->endGroup(); // Update sources... @@ -1556,6 +1617,159 @@ void Satellites::setPenumbraColor(const Vec3f &c) emit penumbraColorChanged(c); } +void Satellites::setFlagCFKnownStdMagnitude(bool b) +{ + if (Satellite::flagCFKnownStdMagnitude != b) + { + Satellite::flagCFKnownStdMagnitude = b; + emit customFilterChanged(); + emit flagCFKnownStdMagnitudeChanged(b); + } +} + +void Satellites::setFlagCFApogee(bool b) +{ + if (Satellite::flagCFApogee != b) + { + Satellite::flagCFApogee = b; + emit customFilterChanged(); + emit flagCFApogeeChanged(b); + } +} + +void Satellites::setMinCFApogee(double v) +{ + Satellite::minCFApogee = v; + emit customFilterChanged(); + emit minCFApogeeChanged(v); +} + +void Satellites::setMaxCFApogee(double v) +{ + Satellite::maxCFApogee = v; + emit customFilterChanged(); + emit maxCFApogeeChanged(v); +} + +void Satellites::setFlagCFPerigee(bool b) +{ + if (Satellite::flagCFPerigee != b) + { + Satellite::flagCFPerigee = b; + emit customFilterChanged(); + emit flagCFPerigeeChanged(b); + } +} + +void Satellites::setMinCFPerigee(double v) +{ + Satellite::minCFPerigee = v; + emit customFilterChanged(); + emit minCFPerigeeChanged(v); +} + +void Satellites::setMaxCFPerigee(double v) +{ + Satellite::maxCFPerigee = v; + emit customFilterChanged(); + emit maxCFPerigeeChanged(v); +} + +void Satellites::setFlagCFEccentricity(bool b) +{ + if (Satellite::flagCFEccentricity != b) + { + Satellite::flagCFEccentricity = b; + emit customFilterChanged(); + emit flagCFEccentricityChanged(b); + } +} + +void Satellites::setMinCFEccentricity(double v) +{ + Satellite::minCFEccentricity = v; + emit customFilterChanged(); + emit minCFEccentricityChanged(v); +} + +void Satellites::setMaxCFEccentricity(double v) +{ + Satellite::maxCFEccentricity = v; + emit customFilterChanged(); + emit maxCFEccentricityChanged(v); +} + +void Satellites::setFlagCFPeriod(bool b) +{ + if (Satellite::flagCFPeriod != b) + { + Satellite::flagCFPeriod = b; + emit customFilterChanged(); + emit flagCFPeriodChanged(b); + } +} + +void Satellites::setMinCFPeriod(double v) +{ + Satellite::minCFPeriod = v; + emit customFilterChanged(); + emit minCFPeriodChanged(v); +} + +void Satellites::setMaxCFPeriod(double v) +{ + Satellite::maxCFPeriod = v; + emit customFilterChanged(); + emit maxCFPeriodChanged(v); +} + +void Satellites::setFlagCFInclination(bool b) +{ + if (Satellite::flagCFInclination != b) + { + Satellite::flagCFInclination = b; + emit customFilterChanged(); + emit flagCFInclinationChanged(b); + } +} + +void Satellites::setMinCFInclination(double v) +{ + Satellite::minCFInclination = v; + emit customFilterChanged(); + emit minCFInclinationChanged(v); +} + +void Satellites::setMaxCFInclination(double v) +{ + Satellite::maxCFInclination = v; + emit customFilterChanged(); + emit maxCFInclinationChanged(v); +} + +void Satellites::setFlagCFRCS(bool b) +{ + if (Satellite::flagCFRCS != b) + { + Satellite::flagCFRCS = b; + emit customFilterChanged(); + emit flagCFRCSChanged(b); + } +} + +void Satellites::setMinCFRCS(double v) +{ + Satellite::minCFRCS = v; + emit customFilterChanged(); + emit minCFRCSChanged(v); +} + +void Satellites::setMaxCFRCS(double v) +{ + Satellite::maxCFRCS = v; + emit customFilterChanged(); + emit maxCFRCSChanged(v); +} void Satellites::setLabelFontSize(int size) { diff --git a/plugins/Satellites/src/Satellites.hpp b/plugins/Satellites/src/Satellites.hpp index 2fe931e314a11..d47815c5e8149 100644 --- a/plugins/Satellites/src/Satellites.hpp +++ b/plugins/Satellites/src/Satellites.hpp @@ -148,29 +148,49 @@ typedef QList IridiumFlaresPredictionList; class Satellites : public StelObjectModule { Q_OBJECT - Q_PROPERTY(bool flagHintsVisible READ getFlagHintsVisible WRITE setFlagHintsVisible NOTIFY flagHintsVisibleChanged) - Q_PROPERTY(bool flagLabelsVisible READ getFlagLabelsVisible WRITE setFlagLabelsVisible NOTIFY flagLabelsVisibleChanged) - Q_PROPERTY(int labelFontSize READ getLabelFontSize WRITE setLabelFontSize NOTIFY labelFontSizeChanged) - Q_PROPERTY(bool autoAddEnabled READ isAutoAddEnabled WRITE setAutoAddEnabled NOTIFY autoAddEnabledChanged) - Q_PROPERTY(bool autoRemoveEnabled READ isAutoRemoveEnabled WRITE setAutoRemoveEnabled NOTIFY autoRemoveEnabledChanged) - Q_PROPERTY(bool flagIconicMode READ getFlagIconicMode WRITE setFlagIconicMode NOTIFY flagIconicModeChanged) - Q_PROPERTY(bool flagHideInvisible READ getFlagHideInvisible WRITE setFlagHideInvisible NOTIFY flagHideInvisibleChanged) - Q_PROPERTY(bool flagOrbitLines READ getFlagOrbitLines WRITE setFlagOrbitLines NOTIFY flagOrbitLinesChanged) - Q_PROPERTY(bool updatesEnabled READ getUpdatesEnabled WRITE setUpdatesEnabled NOTIFY updatesEnabledChanged) - Q_PROPERTY(int updateFrequencyHours READ getUpdateFrequencyHours WRITE setUpdateFrequencyHours NOTIFY updateFrequencyHoursChanged) - Q_PROPERTY(int orbitLineSegments READ getOrbitLineSegments WRITE setOrbitLineSegments NOTIFY orbitLineSegmentsChanged) - Q_PROPERTY(int orbitLineFadeSegments READ getOrbitLineFadeSegments WRITE setOrbitLineFadeSegments NOTIFY orbitLineFadeSegmentsChanged) - Q_PROPERTY(int orbitLineSegmentDuration READ getOrbitLineSegmentDuration WRITE setOrbitLineSegmentDuration NOTIFY orbitLineSegmentDurationChanged) - Q_PROPERTY(int tleEpochAgeDays READ getTleEpochAgeDays WRITE setTleEpochAgeDays NOTIFY tleEpochAgeDaysChanged) - Q_PROPERTY(Vec3f invisibleSatelliteColor READ getInvisibleSatelliteColor WRITE setInvisibleSatelliteColor NOTIFY invisibleSatelliteColorChanged) - Q_PROPERTY(Vec3f transitSatelliteColor READ getTransitSatelliteColor WRITE setTransitSatelliteColor NOTIFY transitSatelliteColorChanged) - Q_PROPERTY(bool flagUmbraVisible READ getFlagUmbraVisible WRITE setFlagUmbraVisible NOTIFY flagUmbraVisibleChanged) - Q_PROPERTY(bool flagUmbraAtFixedDistance READ getFlagUmbraAtFixedDistance WRITE setFlagUmbraAtFixedDistance NOTIFY flagUmbraAtFixedDistanceChanged) - Q_PROPERTY(double umbraDistance READ getUmbraDistance WRITE setUmbraDistance NOTIFY umbraDistanceChanged) - Q_PROPERTY(Vec3f umbraColor READ getUmbraColor WRITE setUmbraColor NOTIFY umbraColorChanged) - Q_PROPERTY(bool flagPenumbraVisible READ getFlagPenumbraVisible WRITE setFlagPenumbraVisible NOTIFY flagPenumbraVisibleChanged) - Q_PROPERTY(Vec3f penumbraColor READ getPenumbraColor WRITE setPenumbraColor NOTIFY penumbraColorChanged) - + Q_PROPERTY(bool flagHintsVisible READ getFlagHintsVisible WRITE setFlagHintsVisible NOTIFY flagHintsVisibleChanged) + Q_PROPERTY(bool flagLabelsVisible READ getFlagLabelsVisible WRITE setFlagLabelsVisible NOTIFY flagLabelsVisibleChanged) + Q_PROPERTY(int labelFontSize READ getLabelFontSize WRITE setLabelFontSize NOTIFY labelFontSizeChanged) + Q_PROPERTY(bool autoAddEnabled READ isAutoAddEnabled WRITE setAutoAddEnabled NOTIFY autoAddEnabledChanged) + Q_PROPERTY(bool autoRemoveEnabled READ isAutoRemoveEnabled WRITE setAutoRemoveEnabled NOTIFY autoRemoveEnabledChanged) + Q_PROPERTY(bool flagIconicMode READ getFlagIconicMode WRITE setFlagIconicMode NOTIFY flagIconicModeChanged) + Q_PROPERTY(bool flagHideInvisible READ getFlagHideInvisible WRITE setFlagHideInvisible NOTIFY flagHideInvisibleChanged) + Q_PROPERTY(bool flagOrbitLines READ getFlagOrbitLines WRITE setFlagOrbitLines NOTIFY flagOrbitLinesChanged) + Q_PROPERTY(bool updatesEnabled READ getUpdatesEnabled WRITE setUpdatesEnabled NOTIFY updatesEnabledChanged) + Q_PROPERTY(int updateFrequencyHours READ getUpdateFrequencyHours WRITE setUpdateFrequencyHours NOTIFY updateFrequencyHoursChanged) + Q_PROPERTY(int orbitLineSegments READ getOrbitLineSegments WRITE setOrbitLineSegments NOTIFY orbitLineSegmentsChanged) + Q_PROPERTY(int orbitLineFadeSegments READ getOrbitLineFadeSegments WRITE setOrbitLineFadeSegments NOTIFY orbitLineFadeSegmentsChanged) + Q_PROPERTY(int orbitLineSegmentDuration READ getOrbitLineSegmentDuration WRITE setOrbitLineSegmentDuration NOTIFY orbitLineSegmentDurationChanged) + Q_PROPERTY(int tleEpochAgeDays READ getTleEpochAgeDays WRITE setTleEpochAgeDays NOTIFY tleEpochAgeDaysChanged) + Q_PROPERTY(Vec3f invisibleSatelliteColor READ getInvisibleSatelliteColor WRITE setInvisibleSatelliteColor NOTIFY invisibleSatelliteColorChanged) + Q_PROPERTY(Vec3f transitSatelliteColor READ getTransitSatelliteColor WRITE setTransitSatelliteColor NOTIFY transitSatelliteColorChanged) + Q_PROPERTY(bool flagUmbraVisible READ getFlagUmbraVisible WRITE setFlagUmbraVisible NOTIFY flagUmbraVisibleChanged) + Q_PROPERTY(bool flagUmbraAtFixedDistance READ getFlagUmbraAtFixedDistance WRITE setFlagUmbraAtFixedDistance NOTIFY flagUmbraAtFixedDistanceChanged) + Q_PROPERTY(double umbraDistance READ getUmbraDistance WRITE setUmbraDistance NOTIFY umbraDistanceChanged) + Q_PROPERTY(Vec3f umbraColor READ getUmbraColor WRITE setUmbraColor NOTIFY umbraColorChanged) + Q_PROPERTY(bool flagPenumbraVisible READ getFlagPenumbraVisible WRITE setFlagPenumbraVisible NOTIFY flagPenumbraVisibleChanged) + Q_PROPERTY(Vec3f penumbraColor READ getPenumbraColor WRITE setPenumbraColor NOTIFY penumbraColorChanged) + // custom filter + Q_PROPERTY(bool flagCFKnownStdMagnitude READ getFlagCFKnownStdMagnitude WRITE setFlagCFKnownStdMagnitude NOTIFY flagCFKnownStdMagnitudeChanged) + Q_PROPERTY(bool flagCFApogee READ getFlagCFApogee WRITE setFlagCFApogee NOTIFY flagCFApogeeChanged) + Q_PROPERTY(double minCFApogee READ getMinCFApogee WRITE setMinCFApogee NOTIFY minCFApogeeChanged) + Q_PROPERTY(double maxCFApogee READ getMaxCFApogee WRITE setMaxCFApogee NOTIFY maxCFApogeeChanged) + Q_PROPERTY(bool flagCFPerigee READ getFlagCFPerigee WRITE setFlagCFPerigee NOTIFY flagCFPerigeeChanged) + Q_PROPERTY(double minCFPerigee READ getMinCFPerigee WRITE setMinCFPerigee NOTIFY minCFPerigeeChanged) + Q_PROPERTY(double maxCFPerigee READ getMaxCFPerigee WRITE setMaxCFPerigee NOTIFY maxCFPerigeeChanged) + Q_PROPERTY(bool flagCFEccentricity READ getFlagCFEccentricity WRITE setFlagCFEccentricity NOTIFY flagCFEccentricityChanged) + Q_PROPERTY(double minCFEccentricity READ getMinCFEccentricity WRITE setMinCFEccentricity NOTIFY minCFEccentricityChanged) + Q_PROPERTY(double maxCFEccentricity READ getMaxCFEccentricity WRITE setMaxCFEccentricity NOTIFY maxCFEccentricityChanged) + Q_PROPERTY(bool flagCFPeriod READ getFlagCFPeriod WRITE setFlagCFPeriod NOTIFY flagCFPeriodChanged) + Q_PROPERTY(double minCFPeriod READ getMinCFPeriod WRITE setMinCFPeriod NOTIFY minCFPeriodChanged) + Q_PROPERTY(double maxCFPeriod READ getMaxCFPeriod WRITE setMaxCFPeriod NOTIFY maxCFPeriodChanged) + Q_PROPERTY(bool flagCFInclination READ getFlagCFInclination WRITE setFlagCFInclination NOTIFY flagCFInclinationChanged) + Q_PROPERTY(double minCFInclination READ getMinCFInclination WRITE setMinCFInclination NOTIFY minCFInclinationChanged) + Q_PROPERTY(double maxCFInclination READ getMaxCFInclination WRITE setMaxCFInclination NOTIFY maxCFInclinationChanged) + Q_PROPERTY(bool flagCFRCS READ getFlagCFRCS WRITE setFlagCFRCS NOTIFY flagCFRCSChanged) + Q_PROPERTY(double minCFRCS READ getMinCFRCS WRITE setMinCFRCS NOTIFY minCFRCSChanged) + Q_PROPERTY(double maxCFRCS READ getMaxCFRCS WRITE setMaxCFRCS NOTIFY maxCFRCSChanged) + public: //! @enum UpdateState //! Used for keeping track of the download/update status @@ -405,10 +425,33 @@ class Satellites : public StelObjectModule void umbraDistanceChanged(double d); void flagPenumbraVisibleChanged(bool b); void penumbraColorChanged(Vec3f); + void flagCFKnownStdMagnitudeChanged(bool b); + void flagCFApogeeChanged(bool b); + void minCFApogeeChanged(double v); + void maxCFApogeeChanged(double v); + void flagCFPerigeeChanged(bool b); + void minCFPerigeeChanged(double v); + void maxCFPerigeeChanged(double v); + void flagCFEccentricityChanged(bool b); + void minCFEccentricityChanged(double v); + void maxCFEccentricityChanged(double v); + void flagCFPeriodChanged(bool b); + void minCFPeriodChanged(double v); + void maxCFPeriodChanged(double v); + void flagCFInclinationChanged(bool b); + void minCFInclinationChanged(double v); + void maxCFInclinationChanged(double v); + void flagCFRCSChanged(bool b); + void minCFRCSChanged(double v); + void maxCFRCSChanged(double v); //! Emitted when some of the plugin settings have been changed. //! Used to communicate with the configuration window. void settingsChanged(); + + //! Emitted when custom filters of the plugin have been changed. + //! Used to communicate with the configuration window. + void customFilterChanged(); //! emitted when the update status changes, e.g. when //! an update starts, completes and so on. Note that @@ -572,6 +615,101 @@ public slots: //! Save the current satellite catalog to disk. void saveCatalog(QString path=QString()); + //! Set whether custom filter 'known standard magnitude' enabled. + //! Emits customFilterChanged() + void setFlagCFKnownStdMagnitude(bool b); + bool getFlagCFKnownStdMagnitude() { return Satellite::flagCFKnownStdMagnitude; } + + //! Set whether custom filter 'apogee' enabled. + //! Emits customFilterChanged() + void setFlagCFApogee(bool b); + bool getFlagCFApogee() { return Satellite::flagCFApogee; } + + //! Set whether custom filter 'apogee' maximum value (in kilometers). + //! Emits customFilterChanged() + void setMaxCFApogee(double v); + double getMaxCFApogee() { return Satellite::maxCFApogee; } + + //! Set whether custom filter 'apogee' minimum value (in kilometers). + //! Emits customFilterChanged() + void setMinCFApogee(double v); + double getMinCFApogee() { return Satellite::minCFApogee; } + + //! Set whether custom filter 'perigee' enabled. + //! Emits customFilterChanged() + void setFlagCFPerigee(bool b); + bool getFlagCFPerigee() { return Satellite::flagCFPerigee; } + + //! Set whether custom filter 'perigee' maximum value (in kilometers). + //! Emits customFilterChanged() + void setMaxCFPerigee(double v); + double getMaxCFPerigee() { return Satellite::maxCFPerigee; } + + //! Set whether custom filter 'perigee' minimum value (in kilometers). + //! Emits customFilterChanged() + void setMinCFPerigee(double v); + double getMinCFPerigee() { return Satellite::minCFPerigee; } + + //! Set whether custom filter 'eccentricity' enabled. + //! Emits customFilterChanged() + void setFlagCFEccentricity(bool b); + bool getFlagCFEccentricity() { return Satellite::flagCFEccentricity; } + + //! Set whether custom filter 'eccentricity' maximum value. + //! Emits customFilterChanged() + void setMaxCFEccentricity(double v); + double getMaxCFEccentricity() { return Satellite::maxCFEccentricity; } + + //! Set whether custom filter 'eccentricity' minimum value. + //! Emits customFilterChanged() + void setMinCFEccentricity(double v); + double getMinCFEccentricity() { return Satellite::minCFEccentricity; } + + //! Set whether custom filter 'period' enabled. + //! Emits customFilterChanged() + void setFlagCFPeriod(bool b); + bool getFlagCFPeriod() { return Satellite::flagCFPeriod; } + + //! Set whether custom filter 'period' maximum value (in minutes). + //! Emits customFilterChanged() + void setMaxCFPeriod(double v); + double getMaxCFPeriod() { return Satellite::maxCFPeriod; } + + //! Set whether custom filter 'period' minimum value (in minutes). + //! Emits customFilterChanged() + void setMinCFPeriod(double v); + double getMinCFPeriod() { return Satellite::minCFPeriod; } + + //! Set whether custom filter 'inclination' enabled. + //! Emits customFilterChanged() + void setFlagCFInclination(bool b); + bool getFlagCFInclination() { return Satellite::flagCFInclination; } + + //! Set whether custom filter 'inclination' maximum value (in degrees). + //! Emits customFilterChanged() + void setMaxCFInclination(double v); + double getMaxCFInclination() { return Satellite::maxCFInclination; } + + //! Set whether custom filter 'inclination' minimum value (in degrees). + //! Emits customFilterChanged() + void setMinCFInclination(double v); + double getMinCFInclination() { return Satellite::minCFInclination; } + + //! Set whether custom filter 'rcs' enabled. + //! Emits customFilterChanged() + void setFlagCFRCS(bool b); + bool getFlagCFRCS() { return Satellite::flagCFRCS; } + + //! Set whether custom filter 'rcs' maximum value (in square meters). + //! Emits customFilterChanged() + void setMaxCFRCS(double v); + double getMaxCFRCS() { return Satellite::maxCFRCS; } + + //! Set whether custom filter 'rcs' minimum value (in square meters). + //! Emits customFilterChanged() + void setMinCFRCS(double v); + double getMinCFRCS() { return Satellite::minCFRCS; } + #if(SATELLITES_PLUGIN_IRIDIUM == 1) //! Set depth of prediction for Iridium flares //! @param depth in days @@ -724,7 +862,7 @@ private slots: //! Used to track whether earth shadow enlargement shall be computed after Danjon (1951) bool earthShadowEnlargementDanjon; //@} - + //! @name Screen message infrastructure //@{ QList messageIDs; diff --git a/plugins/Satellites/src/gui/SatellitesDialog.cpp b/plugins/Satellites/src/gui/SatellitesDialog.cpp index 86d3121626d0f..89e8f64584915 100644 --- a/plugins/Satellites/src/gui/SatellitesDialog.cpp +++ b/plugins/Satellites/src/gui/SatellitesDialog.cpp @@ -36,6 +36,7 @@ #include "ui_satellitesDialog.h" #include "SatellitesDialog.hpp" #include "SatellitesImportDialog.hpp" +#include "SatellitesFilterDialog.hpp" #include "SatellitesListModel.hpp" #include "SatellitesListFilterModel.hpp" #include "Satellites.hpp" @@ -66,6 +67,7 @@ SatellitesDialog::SatellitesDialog() , satelliteModified(false) , updateTimer(Q_NULLPTR) , importWindow(Q_NULLPTR) + , filterWindow(Q_NULLPTR) , filterModel(Q_NULLPTR) , checkStateRole(Qt::UserRole) , delimiter(", ") @@ -91,6 +93,12 @@ SatellitesDialog::~SatellitesDialog() importWindow = Q_NULLPTR; } + if (filterWindow) + { + delete filterWindow; + filterWindow = Q_NULLPTR; + } + delete ui; } @@ -147,7 +155,8 @@ void SatellitesDialog::createDialogContent() ui->addSourceButton->setFixedSize(bs); ui->deleteSourceButton->setFixedSize(bs); ui->editSourceButton->setFixedSize(bs); - ui->saveSourceButton->setFixedSize(bs); + ui->saveSourceButton->setFixedSize(bs); + ui->customFilterButton->setFixedSize(bs); // Settings tab / updates group // These controls are refreshed by updateSettingsPage(), which in @@ -251,6 +260,9 @@ void SatellitesDialog::createDialogContent() connect(importWindow, SIGNAL(satellitesAccepted(TleDataList)), this, SLOT(addSatellites(TleDataList))); connect(ui->removeSatellitesButton, SIGNAL(clicked()), this, SLOT(removeSatellites())); + filterWindow = new SatellitesFilterDialog(); + connect(ui->customFilterButton, SIGNAL(clicked()), filterWindow, SLOT(setVisible())); + // Sources tab connect(ui->sourceList, SIGNAL(currentRowChanged(int)), this, SLOT(updateButtonsProperties())); connect(ui->sourceList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(saveSourceList())); @@ -258,11 +270,12 @@ void SatellitesDialog::createDialogContent() //FIXME: pressing Enter cause a call of addSourceRow() method... //connect(ui->sourceEdit, SIGNAL(returnPressed()), this, SLOT(saveEditedSource())); connect(ui->deleteSourceButton, SIGNAL(clicked()), this, SLOT(deleteSourceRow())); - connect(ui->addSourceButton, SIGNAL(clicked()), this, SLOT(addSourceRow())); + connect(ui->addSourceButton, SIGNAL(clicked()), this, SLOT(addSourceRow())); connect(ui->editSourceButton, SIGNAL(clicked()), this, SLOT(editSourceRow())); connect(ui->saveSourceButton, SIGNAL(clicked()), this, SLOT(saveEditedSource())); - connect(plugin, SIGNAL(satGroupVisibleChanged()), this, SLOT(updateSatelliteAndSaveData())); - connect(plugin, SIGNAL(settingsChanged()), this, SLOT(toggleCheckableSources())); + connect(plugin, SIGNAL(satGroupVisibleChanged()), this, SLOT(updateSatelliteAndSaveData())); + connect(plugin, SIGNAL(settingsChanged()), this, SLOT(toggleCheckableSources())); + connect(plugin, SIGNAL(customFilterChanged()), this, SLOT(updateFilteredSatellitesList())); // bug #1350669 (https://bugs.launchpad.net/stellarium/+bug/1350669) connect(ui->sourceList, SIGNAL(currentRowChanged(int)), ui->sourceList, SLOT(repaint())); ui->editSourceButton->setEnabled(false); @@ -408,11 +421,7 @@ void SatellitesDialog::descriptionTextChanged() { const QModelIndex& index = selection.at(i); sat = SatellitesMgr->getById(index.data(Qt::UserRole).toString()); - - if (sat->description != newdesc) - { - sat->description = newdesc; - } + sat->description = newdesc; } saveSatellites(); } @@ -427,6 +436,7 @@ void SatellitesDialog::filterListByGroup(int index) if (index < 0) return; + ui->customFilterButton->setEnabled(false); QString groupId = ui->groupFilterCombo->itemData(index).toString(); if (groupId == "all") filterModel->setSecondaryFilters(QString(), SatNoFlags); @@ -458,6 +468,11 @@ void SatellitesDialog::filterListByGroup(int index) filterModel->setSecondaryFilters(QString(), SatHGSO); else if (groupId == "[outdatedTLE]") filterModel->setSecondaryFilters(QString(), SatOutdatedTLE); + else if (groupId == "[custom]") + { + ui->customFilterButton->setEnabled(true); + filterModel->setSecondaryFilters(QString(), SatCustomFilter); + } else filterModel->setSecondaryFilters(groupId, SatNoFlags); @@ -477,7 +492,7 @@ void SatellitesDialog::filterListByGroup(int index) void SatellitesDialog::updateFilteredSatellitesList() { QString groupId = ui->groupFilterCombo->currentData(Qt::UserRole).toString(); - if (groupId == "[outdatedTLE]") + if (groupId == "[outdatedTLE]" || groupId == "[custom]") { filterListByGroup(ui->groupFilterCombo->currentIndex()); } @@ -1063,8 +1078,9 @@ void SatellitesDialog::populateFilterMenu() // TRANSLATORS: HGEO = High geosynchronous orbit ui->groupFilterCombo->insertItem(0, q_("[HGSO satellites]"), QVariant("[HGSO]")); ui->groupFilterCombo->insertItem(0, q_("[outdated TLE]"), QVariant("[outdatedTLE]")); + ui->groupFilterCombo->insertItem(0, q_("[custom filter]"), QVariant("[custom]")); ui->groupFilterCombo->insertItem(0, q_("[all user defined]"), QVariant("[userdefined]")); - ui->groupFilterCombo->insertItem(0, q_("[all]"), QVariant("all")); + ui->groupFilterCombo->insertItem(0, q_("[all]"), QVariant("all")); // Restore current selection index = 0; diff --git a/plugins/Satellites/src/gui/SatellitesDialog.hpp b/plugins/Satellites/src/gui/SatellitesDialog.hpp index 51095312a8c92..bedf1b1648575 100644 --- a/plugins/Satellites/src/gui/SatellitesDialog.hpp +++ b/plugins/Satellites/src/gui/SatellitesDialog.hpp @@ -37,6 +37,7 @@ class QStandardItemModel; class QTimer; class SatellitesImportDialog; +class SatellitesFilterDialog; class SatellitesListFilterModel; //! Main configuration window of the %Satellites plugin. @@ -171,6 +172,7 @@ private slots: QTimer* updateTimer; SatellitesImportDialog* importWindow; + SatellitesFilterDialog* filterWindow; SatellitesListFilterModel* filterModel; diff --git a/plugins/Satellites/src/gui/SatellitesFilterDialog.cpp b/plugins/Satellites/src/gui/SatellitesFilterDialog.cpp new file mode 100644 index 0000000000000..68398606decf6 --- /dev/null +++ b/plugins/Satellites/src/gui/SatellitesFilterDialog.cpp @@ -0,0 +1,146 @@ +/* + * Stellarium Satellites Plug-in: satellites custom filter feature + * Copyright (C) 2022 Alexander Wolf + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include "SatellitesFilterDialog.hpp" +#include "ui_satellitesFilterDialog.h" + +#include "StelApp.hpp" +#include "StelTranslator.hpp" + +SatellitesFilterDialog::SatellitesFilterDialog() + : StelDialog("SatellitesFilter") +{ + ui = new Ui_satellitesFilterDialog; +} + +SatellitesFilterDialog::~SatellitesFilterDialog() +{ + delete ui; +} + +void SatellitesFilterDialog::retranslate() +{ + if (dialog) + { + ui->retranslateUi(dialog); + populateTexts(); + } +} + +void SatellitesFilterDialog::setVisible(bool visible) +{ + StelDialog::setVisible(visible); +} + +void SatellitesFilterDialog::createDialogContent() +{ + ui->setupUi(dialog); + + connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); + connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); + + connectBoolProperty(ui->inclinationCheckBox, "Satellites.flagCFInclination"); + connectDoubleProperty(ui->minInclination, "Satellites.minCFInclination"); + connectDoubleProperty(ui->maxInclination, "Satellites.maxCFInclination"); + connectBoolProperty(ui->periodCheckBox, "Satellites.flagCFPeriod"); + connectDoubleProperty(ui->minPeriod, "Satellites.minCFPeriod"); + connectDoubleProperty(ui->maxPeriod, "Satellites.maxCFPeriod"); + connectBoolProperty(ui->eccentricityCheckBox, "Satellites.flagCFEccentricity"); + connectDoubleProperty(ui->minEccentricity, "Satellites.minCFEccentricity"); + connectDoubleProperty(ui->maxEccentricity, "Satellites.maxCFEccentricity"); + connectBoolProperty(ui->apogeeCheckBox, "Satellites.flagCFApogee"); + connectDoubleProperty(ui->minApogee, "Satellites.minCFApogee"); + connectDoubleProperty(ui->maxApogee, "Satellites.maxCFApogee"); + connectBoolProperty(ui->perigeeCheckBox, "Satellites.flagCFPerigee"); + connectDoubleProperty(ui->minPerigee, "Satellites.minCFPerigee"); + connectDoubleProperty(ui->maxPerigee, "Satellites.maxCFPerigee"); + connectBoolProperty(ui->rcsCheckBox, "Satellites.flagCFRCS"); + connectDoubleProperty(ui->minRCS, "Satellites.minCFRCS"); + connectDoubleProperty(ui->maxRCS, "Satellites.maxCFRCS"); + connectBoolProperty(ui->stdMagnitudeCheckBox, "Satellites.flagCFKnownStdMagnitude"); + + updateMinMaxInclination(ui->inclinationCheckBox->isChecked()); + connect(ui->inclinationCheckBox, SIGNAL(clicked(bool)), this, SLOT(updateMinMaxInclination(bool))); + updateMinMaxApogee(ui->apogeeCheckBox->isChecked()); + connect(ui->apogeeCheckBox, SIGNAL(clicked(bool)), this, SLOT(updateMinMaxApogee(bool))); + updateMinMaxPerigee(ui->perigeeCheckBox->isChecked()); + connect(ui->perigeeCheckBox, SIGNAL(clicked(bool)), this, SLOT(updateMinMaxPerigee(bool))); + updateMinMaxPeriod(ui->periodCheckBox->isChecked()); + connect(ui->periodCheckBox, SIGNAL(clicked(bool)), this, SLOT(updateMinMaxPeriod(bool))); + updateMinMaxEccentricity(ui->eccentricityCheckBox->isChecked()); + connect(ui->eccentricityCheckBox, SIGNAL(clicked(bool)), this, SLOT(updateMinMaxEccentricity(bool))); + updateMinMaxRCS(ui->rcsCheckBox->isChecked()); + connect(ui->rcsCheckBox, SIGNAL(clicked(bool)), this, SLOT(updateMinMaxRCS(bool))); + + populateTexts(); +} + +void SatellitesFilterDialog::updateMinMaxInclination(bool state) +{ + ui->minInclination->setEnabled(state); + ui->maxInclination->setEnabled(state); +} + +void SatellitesFilterDialog::updateMinMaxApogee(bool state) +{ + ui->minApogee->setEnabled(state); + ui->maxApogee->setEnabled(state); +} + +void SatellitesFilterDialog::updateMinMaxPerigee(bool state) +{ + ui->minPerigee->setEnabled(state); + ui->maxPerigee->setEnabled(state); +} + +void SatellitesFilterDialog::updateMinMaxPeriod(bool state) +{ + ui->minPeriod->setEnabled(state); + ui->maxPeriod->setEnabled(state); +} + +void SatellitesFilterDialog::updateMinMaxEccentricity(bool state) +{ + ui->minEccentricity->setEnabled(state); + ui->maxEccentricity->setEnabled(state); +} + +void SatellitesFilterDialog::updateMinMaxRCS(bool state) +{ + ui->minRCS->setEnabled(state); + ui->maxRCS->setEnabled(state); +} + +void SatellitesFilterDialog::populateTexts() +{ + QString km = qc_("km", "distance"); + QString m = qc_("m", "time"); + QString sm = qc_("m", "distance"); + ui->minApogee->setSuffix(QString(" %1").arg(km)); + ui->maxApogee->setSuffix(QString(" %1").arg(km)); + ui->minPerigee->setSuffix(QString(" %1").arg(km)); + ui->maxPerigee->setSuffix(QString(" %1").arg(km)); + ui->minPeriod->setSuffix(QString(" %1").arg(m)); + ui->maxPeriod->setSuffix(QString(" %1").arg(m)); + ui->minInclination->setSuffix("°"); + ui->maxInclination->setSuffix("°"); + ui->rcsCheckBox->setToolTip(q_("Radar cross-section")); + ui->minRCS->setSuffix(QString(" %1%2").arg(sm, "²")); + ui->maxRCS->setSuffix(QString(" %1%2").arg(sm, "²")); +} diff --git a/plugins/Satellites/src/gui/SatellitesFilterDialog.hpp b/plugins/Satellites/src/gui/SatellitesFilterDialog.hpp new file mode 100644 index 0000000000000..976d1e7a5c743 --- /dev/null +++ b/plugins/Satellites/src/gui/SatellitesFilterDialog.hpp @@ -0,0 +1,55 @@ +/* + * Stellarium Satellites Plug-in: satellites custom filter feature + * Copyright (C) 2022 Alexander Wolf + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef FILTERSATELLITESWINDOW_HPP +#define FILTERSATELLITESWINDOW_HPP + +#include "StelDialog.hpp" +#include "Satellites.hpp" + +class Ui_satellitesFilterDialog; + +//! @ingroup satellites +class SatellitesFilterDialog : public StelDialog +{ + Q_OBJECT + +public: + SatellitesFilterDialog(); + ~SatellitesFilterDialog() Q_DECL_OVERRIDE; + +public slots: + void retranslate() Q_DECL_OVERRIDE; + void setVisible(bool visible = true) Q_DECL_OVERRIDE; + +private slots: + void populateTexts(); + void updateMinMaxInclination(bool state); + void updateMinMaxApogee(bool state); + void updateMinMaxPerigee(bool state); + void updateMinMaxPeriod(bool state); + void updateMinMaxEccentricity(bool state); + void updateMinMaxRCS(bool state); + +private: + void createDialogContent() Q_DECL_OVERRIDE; + Ui_satellitesFilterDialog* ui; +}; + +#endif // FILTERSATELLITESWINDOW_HPP diff --git a/plugins/Satellites/src/gui/satellitesDialog.ui b/plugins/Satellites/src/gui/satellitesDialog.ui index 93d8b4a4a312e..2793eb049df7c 100644 --- a/plugins/Satellites/src/gui/satellitesDialog.ui +++ b/plugins/Satellites/src/gui/satellitesDialog.ui @@ -793,14 +793,36 @@ - - - true - - - QComboBox::NoInsert - - + + + + + + 0 + 0 + + + + true + + + QComboBox::NoInsert + + + + + + + Settings of custom filter + + + + :/graphicGui/uibtSettings.png + :/graphicGui/uibtSettings.png:/graphicGui/uibtSettings.png + + + + @@ -1557,7 +1579,6 @@ restoreDefaultsButton saveSettingsButton tabs - groupFilterCombo lineEditSearch satellitesList satMarkerColorPickerButton diff --git a/plugins/Satellites/src/gui/satellitesFilterDialog.ui b/plugins/Satellites/src/gui/satellitesFilterDialog.ui new file mode 100644 index 0000000000000..4c540ddca7ab3 --- /dev/null +++ b/plugins/Satellites/src/gui/satellitesFilterDialog.ui @@ -0,0 +1,452 @@ + + + satellitesFilterDialog + + + + 0 + 0 + 312 + 289 + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 16 + 25 + + + + + 16777215 + 25 + + + + QFrame::StyledPanel + + + + 0 + + + 0 + + + 4 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + + Satellites filter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + Qt::NoFocus + + + + + + + + + + + + + Settings of custom filter + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 1 + + + 1.000000000000000 + + + 0.100000000000000 + + + 0.300000000000000 + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 1 + + + 1.000000000000000 + + + 0.100000000000000 + + + 0.900000000000000 + + + + + + + true + + + Known standard magnitude + + + + + + + Eccentricity + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 360.000000000000000 + + + 120.000000000000000 + + + + + + + Inclination + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 360.000000000000000 + + + 180.000000000000000 + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 75.000000000000000 + + + 100000.000000000000000 + + + 200.000000000000000 + + + + + + + Max. + + + Qt::AlignCenter + + + + + + + Min. + + + Qt::AlignCenter + + + + + + + Period + + + + + + + Perigee + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 75.000000000000000 + + + 100000.000000000000000 + + + 20000.000000000000000 + + + + + + + Apogee + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 100000.000000000000000 + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 75.000000000000000 + + + 100000.000000000000000 + + + 1500.000000000000000 + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 75.000000000000000 + + + 100000.000000000000000 + + + 55000.000000000000000 + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 100000.000000000000000 + + + 150.000000000000000 + + + + + + + RCS + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0.100000000000000 + + + 10000.000000000000000 + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0.100000000000000 + + + 10000.000000000000000 + + + + + + + + + + + BarFrame + QFrame +
Dialog.hpp
+ 1 +
+
+ + +
diff --git a/po/stellarium/POTFILES.in b/po/stellarium/POTFILES.in index d28230dd49088..593035501679a 100644 --- a/po/stellarium/POTFILES.in +++ b/po/stellarium/POTFILES.in @@ -105,8 +105,10 @@ plugins/Satellites/src/Satellites.cpp plugins/Satellites/src/Satellite.cpp plugins/Satellites/src/gui/SatellitesDialog.cpp plugins/Satellites/src/gui/SatellitesImportDialog.cpp +plugins/Satellites/src/gui/SatellitesFilterDialog.cpp plugins/Satellites/src/ui_satellitesDialog.h plugins/Satellites/src/ui_satellitesImportDialog.h +plugins/Satellites/src/ui_satellitesFilterDialog.h plugins/TelescopeControl/src/TelescopeControl.cpp plugins/TelescopeControl/src/Rts2/TelescopeClientJsonRts2.cpp plugins/TelescopeControl/src/INDI/ui_TelescopeClientINDIWidget.h