Skip to content

Commit

Permalink
Improve marker mag threshold setting
Browse files Browse the repository at this point in the history
  • Loading branch information
gzotti committed Aug 26, 2024
1 parent 4134638 commit 16b08f6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/core/modules/SolarSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3929,3 +3929,10 @@ void SolarSystem::setExtraThreads(int n)
StelApp::immediateSave("astro/solar_system_threads", extraThreads);
emit extraThreadsChanged(extraThreads);
}

void SolarSystem::setMarkerMagThreshold(double m)
{
markerMagThreshold=qBound(-2.,m,37.);
StelApp::immediateSave("astro/planet_markers_mag_threshold", markerMagThreshold);
emit markerMagThresholdChanged(markerMagThreshold);
}
6 changes: 3 additions & 3 deletions src/core/modules/SolarSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,10 +755,10 @@ public slots:
//! The argument will be bounded by 0 and QThreadPool::globalInstance()->maxThreadCount()-1
void setExtraThreads(int n);

//! Return the limiting absolute magnitude configured for plotting minor bodies. 30 means "all".
//! Return the limiting absolute magnitude configured for plotting minor bodies. (min. mag. 37 includes de facto "all".)
double getMarkerMagThreshold() const {return markerMagThreshold;}
//! Configure the limiting absolute magnitude for plotting minor bodies. Configured value is clamped to -2..30, 30 means "all".
void setMarkerMagThreshold(double m) {markerMagThreshold=qBound(-2.,m,35.); emit markerMagThresholdChanged(markerMagThreshold);}
//! Configure the limiting absolute magnitude for plotting minor bodies. Configured value is clamped to -2..37 (practical limit)
void setMarkerMagThreshold(double m);

signals:
void labelsDisplayedChanged(bool b);
Expand Down
7 changes: 5 additions & 2 deletions src/gui/viewDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1425,12 +1425,15 @@
<property name="toolTip">
<string>Draw markers for objects with magnitude brighter than this</string>
</property>
<property name="maximum">
<double>35.000000000000000</double>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>5.000000000000000</double>
</property>
<property name="maximum">
<double>37.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
Expand Down

0 comments on commit 16b08f6

Please sign in to comment.