From 364ce71c2442ede784e47edc67dfc142ea12e597 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Thu, 30 Mar 2023 16:50:01 +0100 Subject: [PATCH] Fix missing GUI connections in Radio Astronomy plugin. Scan for features on startup. --- .../radioastronomy/radioastronomy.cpp | 6 +++++ .../channelrx/radioastronomy/radioastronomy.h | 18 +++++++++++++ .../radioastronomy/radioastronomygui.cpp | 27 ++++++++++++++++++- 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/radioastronomy/radioastronomy.cpp b/plugins/channelrx/radioastronomy/radioastronomy.cpp index 9b0ad59c2..da610551e 100644 --- a/plugins/channelrx/radioastronomy/radioastronomy.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomy.cpp @@ -60,6 +60,7 @@ MESSAGE_CLASS_DEFINITION(RadioAstronomy::MsgStartSweep, Message) MESSAGE_CLASS_DEFINITION(RadioAstronomy::MsgStopSweep, Message) MESSAGE_CLASS_DEFINITION(RadioAstronomy::MsgSweepComplete, Message) MESSAGE_CLASS_DEFINITION(RadioAstronomy::MsgSweepStatus, Message) +MESSAGE_CLASS_DEFINITION(RadioAstronomy::MsgScanAvailableFeatures, Message) MESSAGE_CLASS_DEFINITION(RadioAstronomy::MsgReportAvailableFeatures, Message) MESSAGE_CLASS_DEFINITION(RadioAstronomy::MsgReportAvailableRotators, Message) @@ -328,6 +329,11 @@ bool RadioAstronomy::handleMessage(const Message& cmd) } return true; } + else if (MsgScanAvailableFeatures::match(cmd)) + { + scanAvailableFeatures(); + return true; + } else { return false; diff --git a/plugins/channelrx/radioastronomy/radioastronomy.h b/plugins/channelrx/radioastronomy/radioastronomy.h index 9b4b78f03..3e937aa3c 100644 --- a/plugins/channelrx/radioastronomy/radioastronomy.h +++ b/plugins/channelrx/radioastronomy/radioastronomy.h @@ -307,6 +307,24 @@ public: } }; + class MsgScanAvailableFeatures : public Message { + MESSAGE_CLASS_DECLARATION + + public: + + static MsgScanAvailableFeatures* create() + { + return new MsgScanAvailableFeatures(); + } + + private: + + MsgScanAvailableFeatures() : + Message() + { + } + }; + class MsgReportAvailableFeatures : public Message { MESSAGE_CLASS_DECLARATION diff --git a/plugins/channelrx/radioastronomy/radioastronomygui.cpp b/plugins/channelrx/radioastronomy/radioastronomygui.cpp index d108511db..2a467daf0 100644 --- a/plugins/channelrx/radioastronomy/radioastronomygui.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomygui.cpp @@ -2205,6 +2205,8 @@ RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI plotCalSpectrum(); plotSpectrum(); plotPowerChart(); + + m_radioAstronomy->getInputMessageQueue()->push(RadioAstronomy::MsgScanAvailableFeatures::create()); } void RadioAstronomyGUI::customContextMenuRequested(QPoint pos) @@ -6235,9 +6237,32 @@ void RadioAstronomyGUI::makeUIConnections() QObject::connect(ui->powerGaussianHPBW, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_powerGaussianHPBW_valueChanged); QObject::connect(ui->runMode, QOverload::of(&QComboBox::currentIndexChanged), this, &RadioAstronomyGUI::on_runMode_currentIndexChanged); QObject::connect(ui->sweepType, QOverload::of(&QComboBox::currentIndexChanged), this, &RadioAstronomyGUI::on_sweepType_currentIndexChanged); - QObject::connect(ui->startStop, &ButtonSwitch::clicked, this, &RadioAstronomyGUI::on_startStop_clicked); + QObject::connect(ui->sweep1Start, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_sweep1Start_valueChanged); + QObject::connect(ui->sweep1Stop, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_sweep1Stop_valueChanged); + QObject::connect(ui->sweep1Step, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_sweep1Step_valueChanged); + QObject::connect(ui->sweep1Delay, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_sweep1Delay_valueChanged); + QObject::connect(ui->sweep2Start, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_sweep2Start_valueChanged); + QObject::connect(ui->sweep2Stop, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_sweep2Stop_valueChanged); + QObject::connect(ui->sweep2Step, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_sweep2Step_valueChanged); + QObject::connect(ui->sweep2Delay, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_sweep2Delay_valueChanged); QObject::connect(ui->sweepStartAtTime, QOverload::of(&QComboBox::currentIndexChanged), this, &RadioAstronomyGUI::on_sweepStartAtTime_currentIndexChanged); QObject::connect(ui->sweepStartDateTime, &QDateTimeEdit::dateTimeChanged, this, &RadioAstronomyGUI::on_sweepStartDateTime_dateTimeChanged); + QObject::connect(ui->startStop, &ButtonSwitch::clicked, this, &RadioAstronomyGUI::on_startStop_clicked); + QObject::connect(ui->power2DAutoscale, &QToolButton::clicked, this, &RadioAstronomyGUI::on_power2DAutoscale_clicked); + QObject::connect(ui->power2DLinkSweep, &ButtonSwitch::clicked, this, &RadioAstronomyGUI::on_power2DLinkSweep_toggled); + QObject::connect(ui->power2DSweepType, QOverload::of(&QComboBox::currentIndexChanged), this, &RadioAstronomyGUI::on_power2DSweepType_currentIndexChanged); + QObject::connect(ui->power2DWidth, QOverload::of(&QSpinBox::valueChanged), this, &RadioAstronomyGUI::on_power2DWidth_valueChanged); + QObject::connect(ui->power2DHeight, QOverload::of(&QSpinBox::valueChanged), this, &RadioAstronomyGUI::on_power2DHeight_valueChanged); + QObject::connect(ui->power2DXMin, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_power2DXMin_valueChanged); + QObject::connect(ui->power2DXMax, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_power2DXMax_valueChanged); + QObject::connect(ui->power2DYMin, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_power2DYMin_valueChanged); + QObject::connect(ui->power2DYMax, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_power2DYMax_valueChanged); + QObject::connect(ui->powerShowSensor1, &ButtonSwitch::toggled, this, &RadioAstronomyGUI::on_powerShowSensor1_toggled); + QObject::connect(ui->powerShowSensor2, &ButtonSwitch::toggled, this, &RadioAstronomyGUI::on_powerShowSensor1_toggled); + QObject::connect(ui->powerShowFiltered, &ButtonSwitch::clicked, this, &RadioAstronomyGUI::on_powerShowFiltered_clicked); + QObject::connect(ui->powerFilter, QOverload::of(&QComboBox::currentIndexChanged), this, &RadioAstronomyGUI::on_powerFilter_currentIndexChanged); + QObject::connect(ui->powerFilterN, QOverload::of(&QSpinBox::valueChanged), this, &RadioAstronomyGUI::on_powerFilterN_valueChanged); + QObject::connect(ui->powerShowMeasurement, &ButtonSwitch::clicked, this, &RadioAstronomyGUI::on_powerShowMeasurement_clicked); QObject::connect(ui->powerColourAutoscale, &QToolButton::toggled, this, &RadioAstronomyGUI::on_powerColourAutoscale_toggled); QObject::connect(ui->powerColourScaleMin, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_powerColourScaleMin_valueChanged); QObject::connect(ui->powerColourScaleMax, QOverload::of(&QDoubleSpinBox::valueChanged), this, &RadioAstronomyGUI::on_powerColourScaleMax_valueChanged);