Skip to content

Commit

Permalink
Added custom filter for satellites (#2457)
Browse files Browse the repository at this point in the history
Co-authored-by: Georg Zotti <Georg.Zotti@univie.ac.at>
  • Loading branch information
alex-w and gzotti committed Jun 8, 2022
1 parent fd1eed4 commit 4f3244a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/Satellites/src/Satellite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,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
Expand Down
42 changes: 42 additions & 0 deletions plugins/Satellites/src/Satellites.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,27 @@ void Satellites::loadSettings()
setMinVFAltitude(conf->value("vf_altitude_min", 200.).toDouble());
setMaxVFAltitude(conf->value("vf_altitude_max", 500.).toDouble());

// 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();
}

Expand Down Expand Up @@ -935,6 +956,27 @@ void Satellites::saveSettingsToConfig()
conf->setValue("vf_altitude_min", getMinVFAltitude());
conf->setValue("vf_altitude_max", getMaxVFAltitude());

// 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...
Expand Down
3 changes: 3 additions & 0 deletions plugins/Satellites/src/gui/SatellitesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ void SatellitesDialog::createDialogContent()
commWindow = new SatellitesCommDialog();
connect(ui->commSatelliteButton, SIGNAL(clicked()), commWindow, SLOT(setVisible()));

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()));
Expand Down

0 comments on commit 4f3244a

Please sign in to comment.