Satellite and Star tracker plugins: added dark theme option for the charts

pull/856/head
f4exb 2021-04-20 02:27:43 +02:00
rodzic 6f4e596cca
commit b23b33bdc4
23 zmienionych plików z 83 dodań i 5 usunięć

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 35 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 52 KiB

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 1.3 KiB

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 76 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 91 KiB

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 66 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 76 KiB

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -152,6 +152,8 @@ Pass charts can be plotted showing the azimuth and elevation of the target satel
The arrows next to the chart combobox, allow the pass number to be selected. Pass 0 is the next pass, with higher numbered passes occurring later in time. The arrows next to the chart combobox, allow the pass number to be selected. Pass 0 is the next pass, with higher numbered passes occurring later in time.
The amount of passes is determined by the prediction period, which can be set in the Settings dialog. The amount of passes is determined by the prediction period, which can be set in the Settings dialog.
click on this icon ![Star Tracker Chart theme](../../../doc/img/StarTracker_chart_theme.png) to switch between light and dark themes for the charts.
<h2>Satellite Data</h2> <h2>Satellite Data</h2>
The satellite data table displays calculated data about the selected satellites. The satellite data table displays calculated data about the selected satellites.

Wyświetl plik

@ -326,6 +326,7 @@ void SatelliteTrackerGUI::displaySettings()
ui->dateTimeSelect->setCurrentIndex(1); ui->dateTimeSelect->setCurrentIndex(1);
} }
ui->autoTarget->setChecked(m_settings.m_autoTarget); ui->autoTarget->setChecked(m_settings.m_autoTarget);
ui->darkTheme->setChecked(m_settings.m_chartsDarkTheme);
plotChart(); plotChart();
blockApplySettings(false); blockApplySettings(false);
} }
@ -649,6 +650,13 @@ void SatelliteTrackerGUI::on_prevPass_clicked()
} }
} }
void SatelliteTrackerGUI::on_darkTheme_clicked(bool checked)
{
m_settings.m_chartsDarkTheme = checked;
plotChart();
applySettings();
}
void SatelliteTrackerGUI::on_chartSelect_currentIndexChanged(int index) void SatelliteTrackerGUI::on_chartSelect_currentIndexChanged(int index)
{ {
(void) index; (void) index;
@ -689,6 +697,7 @@ void SatelliteTrackerGUI::plotPolarChart()
// Always create a new chart, otherwise sometimes they aren't drawn properly // Always create a new chart, otherwise sometimes they aren't drawn properly
m_polarChart = new QPolarChart(); m_polarChart = new QPolarChart();
m_polarChart->setTheme(m_settings.m_chartsDarkTheme ? QChart::ChartThemeDark : QChart::ChartThemeLight);
QValueAxis *angularAxis = new QValueAxis(); QValueAxis *angularAxis = new QValueAxis();
QCategoryAxis *radialAxis = new QCategoryAxis(); QCategoryAxis *radialAxis = new QCategoryAxis();
@ -892,6 +901,7 @@ void SatelliteTrackerGUI::plotAzElChart()
// Always create a new chart, otherwise sometimes they aren't drawn properly // Always create a new chart, otherwise sometimes they aren't drawn properly
m_lineChart = new QChart(); m_lineChart = new QChart();
m_lineChart->setTheme(m_settings.m_chartsDarkTheme ? QChart::ChartThemeDark : QChart::ChartThemeLight);
QDateTimeAxis *xAxis = new QDateTimeAxis(); QDateTimeAxis *xAxis = new QDateTimeAxis();
QValueAxis *yLeftAxis = new QValueAxis(); QValueAxis *yLeftAxis = new QValueAxis();
QValueAxis *yRightAxis = new QValueAxis(); QValueAxis *yRightAxis = new QValueAxis();

Wyświetl plik

@ -143,6 +143,7 @@ private slots:
void on_chartSelect_currentIndexChanged(int index); void on_chartSelect_currentIndexChanged(int index);
void on_nextPass_clicked(); void on_nextPass_clicked();
void on_prevPass_clicked(); void on_prevPass_clicked();
void on_darkTheme_clicked(bool checked);
void on_satTable_cellDoubleClicked(int row, int column); void on_satTable_cellDoubleClicked(int row, int column);
void satTable_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex); void satTable_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex);
void satTable_sectionResized(int logicalIndex, int oldSize, int newSize); void satTable_sectionResized(int logicalIndex, int oldSize, int newSize);

Wyświetl plik

@ -482,6 +482,24 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QToolButton" name="darkTheme">
<property name="toolTip">
<string>Choose between light and dark themes</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/lightdark.png</normaloff>
<normalon>:/darklight.png</normalon>:/lightdark.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>

Wyświetl plik

@ -71,6 +71,7 @@ void SatelliteTrackerSettings::resetToDefaults()
m_reverseAPIPort = 8888; m_reverseAPIPort = 8888;
m_reverseAPIFeatureSetIndex = 0; m_reverseAPIFeatureSetIndex = 0;
m_reverseAPIFeatureIndex = 0; m_reverseAPIFeatureIndex = 0;
m_chartsDarkTheme = false;
for (int i = 0; i < SAT_COL_COLUMNS; i++) for (int i = 0; i < SAT_COL_COLUMNS; i++)
{ {
m_columnIndexes[i] = i; m_columnIndexes[i] = i;
@ -118,6 +119,7 @@ QByteArray SatelliteTrackerSettings::serialize() const
s.writeU32(33, m_reverseAPIPort); s.writeU32(33, m_reverseAPIPort);
s.writeU32(34, m_reverseAPIFeatureSetIndex); s.writeU32(34, m_reverseAPIFeatureSetIndex);
s.writeU32(35, m_reverseAPIFeatureIndex); s.writeU32(35, m_reverseAPIFeatureIndex);
s.writeBool(36, m_chartsDarkTheme);
for (int i = 0; i < SAT_COL_COLUMNS; i++) for (int i = 0; i < SAT_COL_COLUMNS; i++)
s.writeS32(100 + i, m_columnIndexes[i]); s.writeS32(100 + i, m_columnIndexes[i]);
@ -194,6 +196,7 @@ bool SatelliteTrackerSettings::deserialize(const QByteArray& data)
m_reverseAPIFeatureSetIndex = utmp > 99 ? 99 : utmp; m_reverseAPIFeatureSetIndex = utmp > 99 ? 99 : utmp;
d.readU32(35, &utmp, 0); d.readU32(35, &utmp, 0);
m_reverseAPIFeatureIndex = utmp > 99 ? 99 : utmp; m_reverseAPIFeatureIndex = utmp > 99 ? 99 : utmp;
d.readBool(36, &m_chartsDarkTheme, false);
for (int i = 0; i < SAT_COL_COLUMNS; i++) for (int i = 0; i < SAT_COL_COLUMNS; i++)
d.readS32(100 + i, &m_columnIndexes[i], i); d.readS32(100 + i, &m_columnIndexes[i], i);

Wyświetl plik

@ -74,6 +74,7 @@ struct SatelliteTrackerSettings
QString m_losSpeech; //!< Text to say on LOS QString m_losSpeech; //!< Text to say on LOS
QString m_aosCommand; //!< Command/script to execute on AOS QString m_aosCommand; //!< Command/script to execute on AOS
QString m_losCommand; //!< Command/script to execute on LOS QString m_losCommand; //!< Command/script to execute on LOS
bool m_chartsDarkTheme; //!< Set dark theme for charts (effective for GUI only)
QHash<QString, QList<SatelliteDeviceSettings *> *> m_deviceSettings; //!< Settings for each device set for each satellite QHash<QString, QList<SatelliteDeviceSettings *> *> m_deviceSettings; //!< Settings for each device set for each satellite
int m_columnIndexes[SAT_COL_COLUMNS];//!< How the columns are ordered in the table int m_columnIndexes[SAT_COL_COLUMNS];//!< How the columns are ordered in the table

Wyświetl plik

@ -120,6 +120,10 @@ Displays the calculated elevation (angle in degrees - 0 to horizon and 90 to zen
<h2>Plots</h2> <h2>Plots</h2>
<h3>Light or dark theme</h3>
click on this icon ![Star Tracker Chart theme](../../../doc/img/StarTracker_chart_theme.png) to switch between light and dark themes for the charts.
<h3>Elevation vs time</h3> <h3>Elevation vs time</h3>
![Star Tracker Elevation vs Time](../../../doc/img/StarTracker_elevationvstime.png) ![Star Tracker Elevation vs Time](../../../doc/img/StarTracker_elevationvstime.png)
@ -137,11 +141,11 @@ The Solar flux vs frequency plot, shows the solar flux density data from the Lea
![Star Tracker sky temperature](../../../doc/img/StarTracker_skytemp.png) ![Star Tracker sky temperature](../../../doc/img/StarTracker_skytemp.png)
Background sky temperature maps are available for display at 150MHz, 408MHz and 1420MHz, in both equatorial and galactic coordinates. Background sky temperature maps are available for display at 150MHz, 408MHz and 1420MHz, in both equatorial and galactic coordinates.
For these first six temperature maps, the temperature reported, which is in Kelvin, is for the single pixel corresponding to the target coordinates. For these first six temperature maps, the temperature reported, which is in Kelvin, is for the single pixel corresponding to the target coordinates.
This temperature is therefore valid for a beamwidth of less than 1 degree. This temperature is therefore valid for a beamwidth of less than 1 degree.
The Star Tracker plugin can also estimate a sky temperature based on the user entered observation frequency and beamwidth. The Star Tracker plugin can also estimate a sky temperature based on the user entered observation frequency and beamwidth.
To see this figure, which will be typically lower than the above, select one of the last two temperature maps from the right hand combo box. To see this figure, which will be typically lower than the above, select one of the last two temperature maps from the right hand combo box.
<h2>Map</h2> <h2>Map</h2>

Wyświetl plik

@ -304,6 +304,9 @@ void StarTrackerGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor); setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_settings.m_title); setWindowTitle(m_settings.m_title);
blockApplySettings(true); blockApplySettings(true);
ui->darkTheme->setChecked(m_settings.m_chartsDarkTheme);
m_solarFluxChart.setTheme(m_settings.m_chartsDarkTheme ? QChart::ChartThemeDark : QChart::ChartThemeLight);
m_chart.setTheme(m_settings.m_chartsDarkTheme ? QChart::ChartThemeDark : QChart::ChartThemeLight);
ui->latitude->setValue(m_settings.m_latitude); ui->latitude->setValue(m_settings.m_latitude);
ui->longitude->setValue(m_settings.m_longitude); ui->longitude->setValue(m_settings.m_longitude);
ui->target->setCurrentIndex(ui->target->findText(m_settings.m_target)); ui->target->setCurrentIndex(ui->target->findText(m_settings.m_target));
@ -944,6 +947,7 @@ void StarTrackerGUI::plotElevationLineChart()
QChart *oldChart = m_azElLineChart; QChart *oldChart = m_azElLineChart;
m_azElLineChart = new QChart(); m_azElLineChart = new QChart();
m_azElLineChart->setTheme(m_settings.m_chartsDarkTheme ? QChart::ChartThemeDark : QChart::ChartThemeLight);
QDateTimeAxis *xAxis = new QDateTimeAxis(); QDateTimeAxis *xAxis = new QDateTimeAxis();
QValueAxis *yLeftAxis = new QValueAxis(); QValueAxis *yLeftAxis = new QValueAxis();
QValueAxis *yRightAxis = new QValueAxis(); QValueAxis *yRightAxis = new QValueAxis();
@ -1060,6 +1064,7 @@ void StarTrackerGUI::plotElevationPolarChart()
QChart *oldChart = m_azElPolarChart; QChart *oldChart = m_azElPolarChart;
m_azElPolarChart = new QPolarChart(); m_azElPolarChart = new QPolarChart();
m_azElPolarChart->setTheme(m_settings.m_chartsDarkTheme ? QChart::ChartThemeDark : QChart::ChartThemeLight);
QValueAxis *angularAxis = new QValueAxis(); QValueAxis *angularAxis = new QValueAxis();
QCategoryAxis *radialAxis = new QCategoryAxis(); QCategoryAxis *radialAxis = new QCategoryAxis();
@ -1453,7 +1458,7 @@ void StarTrackerGUI::updateSolarFlux(bool all)
QString solarFluxFile = getSolarFluxFilename(); QString solarFluxFile = getSolarFluxFilename();
if (m_dlm.confirmDownload(solarFluxFile, nullptr, 1)) if (m_dlm.confirmDownload(solarFluxFile, nullptr, 1))
{ {
QString urlString = QString("http://www.sws.bom.gov.au/Category/World Data Centre/Data Display and Download/Solar Radio/station/learmonth/SRD/%1/L%2.SRD") QString urlString = QString("https://www.sws.bom.gov.au/Category/World Data Centre/Data Display and Download/Solar Radio/station/learmonth/SRD/%1/L%2.SRD")
.arg(today.year()).arg(today.toString("yyMMdd")); .arg(today.year()).arg(today.toString("yyMMdd"));
m_dlm.download(QUrl(urlString), solarFluxFile, this); m_dlm.download(QUrl(urlString), solarFluxFile, this);
} }
@ -1475,6 +1480,15 @@ void StarTrackerGUI::on_downloadSolarFlux_clicked()
updateSolarFlux(true); updateSolarFlux(true);
} }
void StarTrackerGUI::on_darkTheme_clicked(bool checked)
{
m_settings.m_chartsDarkTheme = checked;
m_solarFluxChart.setTheme(m_settings.m_chartsDarkTheme ? QChart::ChartThemeDark : QChart::ChartThemeLight);
m_chart.setTheme(m_settings.m_chartsDarkTheme ? QChart::ChartThemeDark : QChart::ChartThemeLight);
plotChart();
applySettings();
}
void StarTrackerGUI::downloadFinished(const QString& filename, bool success) void StarTrackerGUI::downloadFinished(const QString& filename, bool success)
{ {
(void) filename; (void) filename;

Wyświetl plik

@ -146,6 +146,7 @@ private slots:
void plotAreaChanged(const QRectF &plotArea); void plotAreaChanged(const QRectF &plotArea);
void autoUpdateSolarFlux(); void autoUpdateSolarFlux();
void on_downloadSolarFlux_clicked(); void on_downloadSolarFlux_clicked();
void on_darkTheme_clicked(bool checked);
void networkManagerFinished(QNetworkReply *reply); void networkManagerFinished(QNetworkReply *reply);
void downloadFinished(const QString& filename, bool success); void downloadFinished(const QString& filename, bool success);
}; };

Wyświetl plik

@ -563,6 +563,24 @@ This can be specified as a decimal (E.g. 12.23) or in hours, minutes and seconds
<item> <item>
<widget class="QComboBox" name="chartSubSelect"/> <widget class="QComboBox" name="chartSubSelect"/>
</item> </item>
<item>
<widget class="QToolButton" name="darkTheme">
<property name="toolTip">
<string>Choose between light and dark themes</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/lightdark.png</normaloff>
<normalon>:/darklight.png</normalon>:/lightdark.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>

Wyświetl plik

@ -54,6 +54,7 @@ void StarTrackerSettings::resetToDefaults()
m_drawSunOnMap = true; m_drawSunOnMap = true;
m_drawMoonOnMap = true; m_drawMoonOnMap = true;
m_drawStarOnMap = true; m_drawStarOnMap = true;
m_chartsDarkTheme = false;
m_title = "Star Tracker"; m_title = "Star Tracker";
m_rgbColor = QColor(225, 25, 99).rgb(); m_rgbColor = QColor(225, 25, 99).rgb();
m_useReverseAPI = false; m_useReverseAPI = false;
@ -98,6 +99,7 @@ QByteArray StarTrackerSettings::serialize() const
s.writeU32(29, m_solarFluxUnits); s.writeU32(29, m_solarFluxUnits);
s.writeDouble(30, m_beamwidth); s.writeDouble(30, m_beamwidth);
s.writeU32(31, m_solarFluxData); s.writeU32(31, m_solarFluxData);
s.writeBool(32, m_chartsDarkTheme);
return s.final(); return s.final();
} }
@ -165,6 +167,7 @@ bool StarTrackerSettings::deserialize(const QByteArray& data)
d.readU32(29, (quint32 *)&m_solarFluxUnits, SFU); d.readU32(29, (quint32 *)&m_solarFluxUnits, SFU);
d.readDouble(30, &m_beamwidth, 25.0); d.readDouble(30, &m_beamwidth, 25.0);
d.readU32(31, (quint32 *)&m_solarFluxData, DRAO_2800); d.readU32(31, (quint32 *)&m_solarFluxData, DRAO_2800);
d.readBool(32, &m_chartsDarkTheme, false);
return true; return true;
} }

Wyświetl plik

@ -52,6 +52,7 @@ struct StarTrackerSettings
bool m_drawSunOnMap; bool m_drawSunOnMap;
bool m_drawMoonOnMap; bool m_drawMoonOnMap;
bool m_drawStarOnMap; bool m_drawStarOnMap;
bool m_chartsDarkTheme; // Dark theme for charts
QString m_title; QString m_title;
quint32 m_rgbColor; quint32 m_rgbColor;

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 936 B

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 941 B

Wyświetl plik

@ -1,6 +1,8 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>info.png</file> <file>info.png</file>
<file>darklight.png</file>
<file>lightdark.png</file>
<file>arrow_left.png</file> <file>arrow_left.png</file>
<file>arrow_right.png</file> <file>arrow_right.png</file>
<file>star.png</file> <file>star.png</file>