From ea0ef1b95ca11932640b378634f4531b1a5dcf3c Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Mon, 24 May 2021 13:22:38 +0100 Subject: [PATCH] Don't use gui/dmsspinbox.h for settings, as not available in server build --- plugins/feature/startracker/startrackergui.cpp | 9 +++++---- plugins/feature/startracker/startrackersettings.cpp | 4 ++-- plugins/feature/startracker/startrackersettings.h | 3 +-- .../feature/startracker/startrackersettingsdialog.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/feature/startracker/startrackergui.cpp b/plugins/feature/startracker/startrackergui.cpp index a50da8f89..4cb1e23db 100644 --- a/plugins/feature/startracker/startrackergui.cpp +++ b/plugins/feature/startracker/startrackergui.cpp @@ -32,6 +32,7 @@ #include "feature/featureuiset.h" #include "feature/featurewebapiutils.h" #include "gui/basicfeaturesettingsdialog.h" +#include "gui/dmsspinbox.h" #include "mainwindow.h" #include "device/deviceuiset.h" #include "util/units.h" @@ -304,8 +305,8 @@ void StarTrackerGUI::displaySettings() ui->latitude->setValue(m_settings.m_latitude); ui->longitude->setValue(m_settings.m_longitude); ui->target->setCurrentIndex(ui->target->findText(m_settings.m_target)); - ui->azimuth->setUnits(m_settings.m_azElUnits); - ui->elevation->setUnits(m_settings.m_azElUnits); + ui->azimuth->setUnits((DMSSpinBox::DisplayUnits)m_settings.m_azElUnits); + ui->elevation->setUnits((DMSSpinBox::DisplayUnits)m_settings.m_azElUnits); if (m_settings.m_target == "Custom RA/Dec") { ui->rightAscension->setText(m_settings.m_ra); @@ -599,8 +600,8 @@ void StarTrackerGUI::on_displaySettings_clicked() if (dialog.exec() == QDialog::Accepted) { applySettings(); - ui->elevation->setUnits(m_settings.m_azElUnits); - ui->azimuth->setUnits(m_settings.m_azElUnits); + ui->elevation->setUnits((DMSSpinBox::DisplayUnits)m_settings.m_azElUnits); + ui->azimuth->setUnits((DMSSpinBox::DisplayUnits)m_settings.m_azElUnits); displaySolarFlux(); if (ui->chartSelect->currentIndex() == 1) plotChart(); diff --git a/plugins/feature/startracker/startrackersettings.cpp b/plugins/feature/startracker/startrackersettings.cpp index 75ec6f1a9..64bfbb6de 100644 --- a/plugins/feature/startracker/startrackersettings.cpp +++ b/plugins/feature/startracker/startrackersettings.cpp @@ -46,7 +46,7 @@ void StarTrackerSettings::resetToDefaults() m_beamwidth = 25.0; m_enableServer = true; m_serverPort = 10001; - m_azElUnits = DMSSpinBox::DM; + m_azElUnits = DM; m_solarFluxData = DRAO_2800; m_solarFluxUnits = SFU; m_updatePeriod = 1.0; @@ -137,7 +137,7 @@ bool StarTrackerSettings::deserialize(const QByteArray& data) } else { m_serverPort = 10001; } - d.readS32(9, (qint32 *)&m_azElUnits, DMSSpinBox::DM); + d.readS32(9, (qint32 *)&m_azElUnits, DM); d.readFloat(10, &m_updatePeriod, 1.0f); d.readBool(11, &m_jnow, false); d.readString(12, &m_refraction, "Positional Astronomy Library"); diff --git a/plugins/feature/startracker/startrackersettings.h b/plugins/feature/startracker/startrackersettings.h index 63b6c21a2..7161c1d3e 100644 --- a/plugins/feature/startracker/startrackersettings.h +++ b/plugins/feature/startracker/startrackersettings.h @@ -23,7 +23,6 @@ #include #include "util/message.h" -#include "gui/dmsspinbox.h" class Serializable; @@ -45,7 +44,7 @@ struct StarTrackerSettings double m_beamwidth; // Beamwidth in degrees uint16_t m_serverPort; bool m_enableServer; // Enable Stellarium server - enum DMSSpinBox::DisplayUnits m_azElUnits; + enum AzElUnits {DMS, DM, D, Decimal} m_azElUnits; // This needs to match DMSSpinBox::DisplayUnits enum SolarFluxData {DRAO_2800, L_245, L_410, L_610, L_1415, L2695, L_4995, L_8800, L_15400, TARGET_FREQ} m_solarFluxData; // What Solar flux density data to display enum SolarFluxUnits {SFU, JANSKY, WATTS_M_HZ} m_solarFluxUnits; float m_updatePeriod; diff --git a/plugins/feature/startracker/startrackersettingsdialog.cpp b/plugins/feature/startracker/startrackersettingsdialog.cpp index a47adad17..33bd94519 100644 --- a/plugins/feature/startracker/startrackersettingsdialog.cpp +++ b/plugins/feature/startracker/startrackersettingsdialog.cpp @@ -51,7 +51,7 @@ StarTrackerSettingsDialog::~StarTrackerSettingsDialog() void StarTrackerSettingsDialog::accept() { m_settings->m_jnow = ui->epoch->currentIndex() == 1; - m_settings->m_azElUnits = (DMSSpinBox::DisplayUnits)ui->azElUnits->currentIndex(); + m_settings->m_azElUnits = (StarTrackerSettings::AzElUnits)ui->azElUnits->currentIndex(); m_settings->m_updatePeriod = ui->updatePeriod->value(); m_settings->m_serverPort = (uint16_t)ui->serverPort->value(); m_settings->m_enableServer = ui->enableServer->isChecked();