1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-28 13:04:17 -04:00

Removed destroy method leftovers and Sonar lint

This commit is contained in:
f4exb
2024-08-25 23:36:46 +02:00
committed by Edouard Griffiths
parent 704eb403d1
commit 5d0fa7fa67
131 changed files with 518 additions and 621 deletions
@@ -83,7 +83,7 @@ Interferometer::Interferometer(DeviceAPI *deviceAPI) :
&Interferometer::updateDeviceSetList
);
updateDeviceSetList();
startSinks();
Interferometer::startSinks();
}
Interferometer::~Interferometer()
@@ -98,7 +98,7 @@ Interferometer::~Interferometer()
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeMIMOChannel(this);
stopSinks();
Interferometer::stopSinks();
}
void Interferometer::setDeviceAPI(DeviceAPI *deviceAPI)
@@ -229,7 +229,7 @@ void Interferometer::applySettings(const InterferometerSettings& settings, const
QList<ObjectPipe*> pipes;
MainCore::instance()->getMessagePipes().getMessagePipes(this, "settings", pipes);
if (pipes.size() > 0) {
if (!pipes.empty()) {
sendChannelSettings(pipes, settingsKeys, settings, force);
}
@@ -254,7 +254,7 @@ void Interferometer::handleInputMessages()
{
Message* message;
while ((message = m_inputMessageQueue.pop()) != 0)
while ((message = m_inputMessageQueue.pop()) != nullptr)
{
if (handleMessage(*message))
{
@@ -267,14 +267,14 @@ bool Interferometer::handleMessage(const Message& cmd)
{
if (MsgConfigureInterferometer::match(cmd))
{
MsgConfigureInterferometer& cfg = (MsgConfigureInterferometer&) cmd;
auto& cfg = (const MsgConfigureInterferometer&) cmd;
qDebug() << "Interferometer::handleMessage: MsgConfigureInterferometer";
applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce());
return true;
}
else if (DSPMIMOSignalNotification::match(cmd))
{
DSPMIMOSignalNotification& notif = (DSPMIMOSignalNotification&) cmd;
auto& notif = (const DSPMIMOSignalNotification&) cmd;
qDebug() << "Interferometer::handleMessage: DSPMIMOSignalNotification:"
<< " inputSampleRate: " << notif.getSampleRate()
@@ -355,7 +355,7 @@ void Interferometer::validateFilterChainHash(InterferometerSettings& settings)
void Interferometer::calculateFrequencyOffset(uint32_t log2Decim, uint32_t filterChainHash)
{
double shiftFactor = HBFilterChainConverter::getShiftFactor(log2Decim, filterChainHash);
m_frequencyOffset = m_deviceSampleRate * shiftFactor;
m_frequencyOffset = (int64_t) (m_deviceSampleRate * shiftFactor);
}
void Interferometer::applyChannelSettings(uint32_t log2Decim, uint32_t filterChainHash)
@@ -383,7 +383,7 @@ void Interferometer::updateDeviceSetList()
if (deviceSourceEngine)
{
DeviceSampleSource *deviceSource = deviceSourceEngine->getSource();
const DeviceSampleSource *deviceSource = deviceSourceEngine->getSource();
if (deviceSource->getDeviceDescription() == "LocalInput") {
m_localInputDeviceIndexes.append(deviceSetIndex);
@@ -401,7 +401,7 @@ void Interferometer::updateDeviceSetList()
InterferometerSettings settings = m_settings;
int newIndexInList;
if (m_localInputDeviceIndexes.size() != 0) // there are some local input devices
if (!m_localInputDeviceIndexes.empty()) // there are some local input devices
{
if (m_settings.m_localDeviceIndex < 0) { // not set before
newIndexInList = 0; // set to first device in list
@@ -574,13 +574,13 @@ void Interferometer::webapiUpdateChannelSettings(
settings.m_reverseAPIAddress = *response.getInterferometerSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getInterferometerSettings()->getReverseApiPort();
settings.m_reverseAPIPort = (uint16_t) response.getInterferometerSettings()->getReverseApiPort();
}
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getInterferometerSettings()->getReverseApiDeviceIndex();
settings.m_reverseAPIDeviceIndex = (uint16_t) response.getInterferometerSettings()->getReverseApiDeviceIndex();
}
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getInterferometerSettings()->getReverseApiChannelIndex();
settings.m_reverseAPIChannelIndex = (uint16_t) response.getInterferometerSettings()->getReverseApiChannelIndex();
}
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getInterferometerSettings()->getSpectrumConfig());
@@ -632,7 +632,7 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
}
else
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
auto *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
response.getInterferometerSettings()->setSpectrumConfig(swgGLSpectrum);
}
@@ -646,7 +646,7 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
}
else
{
SWGSDRangel::SWGGLScope *swgGLScope = new SWGSDRangel::SWGGLScope();
auto *swgGLScope = new SWGSDRangel::SWGGLScope();
settings.m_scopeGUI->formatTo(swgGLScope);
response.getInterferometerSettings()->setScopeConfig(swgGLScope);
}
@@ -660,7 +660,7 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
}
else
{
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
auto *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
settings.m_channelMarker->formatTo(swgChannelMarker);
response.getInterferometerSettings()->setChannelMarker(swgChannelMarker);
}
@@ -674,7 +674,7 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
}
else
{
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
auto *swgRollupState = new SWGSDRangel::SWGRollupState();
settings.m_rollupState->formatTo(swgRollupState);
response.getInterferometerSettings()->setRollupState(swgRollupState);
}
@@ -683,7 +683,7 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
void Interferometer::webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const InterferometerSettings& settings, bool force)
{
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
@@ -694,8 +694,8 @@ void Interferometer::webapiReverseSendSettings(const QList<QString>& channelSett
m_networkRequest.setUrl(QUrl(channelSettingsURL));
m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
QBuffer *buffer = new QBuffer();
buffer->open((QBuffer::ReadWrite));
auto *buffer = new QBuffer();
buffer->open(QBuffer::ReadWrite);
buffer->write(swgChannelSettings->asJson().toUtf8());
buffer->seek(0);
@@ -710,7 +710,7 @@ void Interferometer::sendChannelSettings(
const QList<ObjectPipe*>& pipes,
const QList<QString>& channelSettingsKeys,
const InterferometerSettings& settings,
bool force)
bool force) const
{
for (const auto& pipe : pipes)
{
@@ -718,7 +718,7 @@ void Interferometer::sendChannelSettings(
if (messageQueue)
{
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create(
this,
@@ -736,7 +736,7 @@ void Interferometer::webapiFormatChannelSettings(
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
const InterferometerSettings& settings,
bool force
)
) const
{
swgChannelSettings->setDirection(2); // MIMO sink
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
@@ -774,34 +774,34 @@ void Interferometer::webapiFormatChannelSettings(
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrumConfig") || force))
{
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
auto *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
swgInterferometerSettings->setSpectrumConfig(swgGLSpectrum);
}
if (settings.m_scopeGUI && (channelSettingsKeys.contains("scopeConfig") || force))
{
SWGSDRangel::SWGGLScope *swgGLScope = new SWGSDRangel::SWGGLScope();
auto *swgGLScope = new SWGSDRangel::SWGGLScope();
settings.m_scopeGUI->formatTo(swgGLScope);
swgInterferometerSettings->setScopeConfig(swgGLScope);
}
if (settings.m_channelMarker && (channelSettingsKeys.contains("channelMarker") || force))
{
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
auto *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
settings.m_channelMarker->formatTo(swgChannelMarker);
swgInterferometerSettings->setChannelMarker(swgChannelMarker);
}
if (settings.m_rollupState && (channelSettingsKeys.contains("rollupState") || force))
{
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
auto *swgRollupState = new SWGSDRangel::SWGRollupState();
settings.m_rollupState->formatTo(swgRollupState);
swgInterferometerSettings->setRollupState(swgRollupState);
}
}
void Interferometer::networkManagerFinished(QNetworkReply *reply)
void Interferometer::networkManagerFinished(QNetworkReply *reply) const
{
QNetworkReply::NetworkError replyError = reply->error();
@@ -108,72 +108,69 @@ public:
{ }
};
Interferometer(DeviceAPI *deviceAPI);
virtual ~Interferometer();
virtual void destroy() { delete this; }
virtual void setDeviceAPI(DeviceAPI *deviceAPI);
virtual DeviceAPI *getDeviceAPI() { return m_deviceAPI; }
explicit Interferometer(DeviceAPI *deviceAPI);
~Interferometer() final;
void destroy() final { delete this; }
void setDeviceAPI(DeviceAPI *deviceAPI) final;
DeviceAPI *getDeviceAPI() final { return m_deviceAPI; }
virtual void startSinks(); //!< thread start()
virtual void stopSinks(); //!< thread exit() and wait()
virtual void startSources() {}
virtual void stopSources() {}
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex);
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getMIMOName() { return objectName(); }
void startSinks() final; //!< thread start()
void stopSinks() final; //!< thread exit() and wait()
void startSources() final { /* not for MIMMO*/ }
void stopSources() final { /* not for MIMMO*/ }
void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex) final;
void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex) final;
void pushMessage(Message *msg) final { m_inputMessageQueue.push(msg); }
QString getMIMOName() final { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual QString getIdentifier() const { return objectName(); }
virtual void getTitle(QString& title) { title = "Interferometer"; }
virtual qint64 getCenterFrequency() const { return m_frequencyOffset; }
virtual void setCenterFrequency(qint64) {}
void getIdentifier(QString& id) final { id = objectName(); }
QString getIdentifier() const final { return objectName(); }
void getTitle(QString& title) final { title = "Interferometer"; }
qint64 getCenterFrequency() const final { return m_frequencyOffset; }
void setCenterFrequency(qint64) final { /* not for MIMMO*/ }
uint32_t getDeviceSampleRate() const { return m_deviceSampleRate; }
virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data);
QByteArray serialize() const final;
bool deserialize(const QByteArray& data) final;
virtual int getNbSinkStreams() const { return 2; }
virtual int getNbSourceStreams() const { return 0; }
virtual int getStreamIndex() const { return -1; }
int getNbSinkStreams() const final { return 2; }
int getNbSourceStreams() const final { return 0; }
int getStreamIndex() const final { return -1; }
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const final
{
(void) streamIndex;
(void) sinkElseSource;
return m_frequencyOffset;
}
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
SpectrumVis *getSpectrumVis() { return &m_spectrumVis; }
ScopeVis *getScopeVis() { return &m_scopeSink; }
void applyChannelSettings(uint32_t log2Decim, uint32_t filterChainHash);
const QList<int>& getDeviceSetList() { return m_localInputDeviceIndexes; }
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage) final;
virtual int webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
int webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage) final;
virtual int webapiWorkspaceGet(
SWGSDRangel::SWGWorkspaceInfo& query,
QString& errorMessage);
int webapiWorkspaceGet(
SWGSDRangel::SWGWorkspaceInfo& query,
QString& errorMessage) final;
static void webapiFormatChannelSettings(
SWGSDRangel::SWGChannelSettings& response,
const InterferometerSettings& settings);
static void webapiUpdateChannelSettings(
InterferometerSettings& settings,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response);
InterferometerSettings& settings,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response);
static const char* const m_channelIdURI;
static const char* const m_channelId;
@@ -196,11 +193,12 @@ private:
uint64_t m_centerFrequency;
int64_t m_frequencyOffset;
uint32_t m_deviceSampleRate;
int m_count0, m_count1;
int m_count0;
int m_count1;
QList<int> m_localInputDeviceIndexes;
virtual bool handleMessage(const Message& cmd); //!< Processing of a message. Returns true if message has actually been processed
bool handleMessage(const Message& cmd) final; //!< Processing of a message. Returns true if message has actually been processed
void applySettings(const InterferometerSettings& settings, const QList<QString>& settingsKeys, bool force = false);
static void validateFilterChainHash(InterferometerSettings& settings);
void calculateFrequencyOffset(uint32_t log2Decim, uint32_t filterChainHash);
@@ -213,17 +211,17 @@ private:
const QList<QString>& channelSettingsKeys,
const InterferometerSettings& settings,
bool force
);
) const;
void webapiFormatChannelSettings(
const QList<QString>& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
const InterferometerSettings& settings,
bool force
);
) const;
private slots:
void handleInputMessages();
void networkManagerFinished(QNetworkReply *reply);
void networkManagerFinished(QNetworkReply *reply) const;
};
#endif // INCLUDE_INTERFEROMETER_H
@@ -32,15 +32,10 @@
InterferometerGUI* InterferometerGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *channelMIMO)
{
InterferometerGUI* gui = new InterferometerGUI(pluginAPI, deviceUISet, channelMIMO);
auto* gui = new InterferometerGUI(pluginAPI, deviceUISet, channelMIMO);
return gui;
}
void InterferometerGUI::destroy()
{
delete this;
}
void InterferometerGUI::resetToDefaults()
{
m_settings.resetToDefaults();
@@ -77,7 +72,7 @@ bool InterferometerGUI::handleMessage(const Message& message)
{
if (Interferometer::MsgBasebandNotification::match(message))
{
Interferometer::MsgBasebandNotification& notif = (Interferometer::MsgBasebandNotification&) message;
auto& notif = (const Interferometer::MsgBasebandNotification&) message;
m_sampleRate = notif.getSampleRate();
m_centerFrequency = notif.getCenterFrequency();
displayRateAndShift();
@@ -86,7 +81,7 @@ bool InterferometerGUI::handleMessage(const Message& message)
}
else if (Interferometer::MsgConfigureInterferometer::match(message))
{
const Interferometer::MsgConfigureInterferometer& cfg = (const Interferometer::MsgConfigureInterferometer&) message;
auto& cfg = (const Interferometer::MsgConfigureInterferometer&) message;
if (cfg.getForce()) {
m_settings = cfg.getSettings();
@@ -102,7 +97,8 @@ bool InterferometerGUI::handleMessage(const Message& message)
}
else if (Interferometer::MsgReportDevices::match(message))
{
Interferometer::MsgReportDevices& report = (Interferometer::MsgReportDevices&) message;
auto& msg = const_cast<Message&>(message);
auto& report = (Interferometer::MsgReportDevices&) msg;
updateDeviceSetList(report.getDeviceSetIndexes());
return true;
}
@@ -135,7 +131,7 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI
m_spectrumVis->setGLSpectrum(ui->glSpectrum);
m_scopeVis = m_interferometer->getScopeVis();
m_scopeVis->setGLScope(ui->glScope);
m_interferometer->setMessageQueueToGUI(getInputMessageQueue());
m_interferometer->setMessageQueueToGUI(InterferometerGUI::getInputMessageQueue());
m_sampleRate = m_interferometer->getDeviceSampleRate();
ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum);
@@ -175,7 +171,7 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI
m_scopeVis->setTraceChunkSize(Interferometer::m_fftSize); // Set scope trace length unit to FFT size
ui->scopeGUI->traceLengthChange();
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
connect(InterferometerGUI::getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
updateDeviceSetList(m_interferometer->getDeviceSetList());
displaySettings();
@@ -243,15 +239,15 @@ void InterferometerGUI::displaySettings()
void InterferometerGUI::displayRateAndShift()
{
int shift = m_shiftFrequencyFactor * m_sampleRate;
auto shift = (int) (m_shiftFrequencyFactor * m_sampleRate);
double channelSampleRate = ((double) m_sampleRate) / (1<<m_settings.m_log2Decim);
QLocale loc;
ui->offsetFrequencyText->setText(tr("%1 Hz").arg(loc.toString(shift)));
ui->channelRateText->setText(tr("%1k").arg(QString::number(channelSampleRate / 1000.0, 'g', 5)));
m_channelMarker.setCenterFrequency(shift);
m_channelMarker.setBandwidth(channelSampleRate);
ui->glSpectrum->setSampleRate(channelSampleRate);
m_scopeVis->setLiveRate(channelSampleRate);
m_channelMarker.setBandwidth((int) channelSampleRate);
ui->glSpectrum->setSampleRate((int) channelSampleRate);
m_scopeVis->setLiveRate((int) channelSampleRate);
}
void InterferometerGUI::leaveEvent(QEvent*)
@@ -268,7 +264,7 @@ void InterferometerGUI::handleSourceMessages()
{
Message* message;
while ((message = getInputMessageQueue()->pop()) != 0)
while ((message = getInputMessageQueue()->pop()) != nullptr)
{
if (handleMessage(*message))
{
@@ -277,7 +273,7 @@ void InterferometerGUI::handleSourceMessages()
}
}
void InterferometerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
void InterferometerGUI::onWidgetRolled(const QWidget* widget, bool rollDown)
{
(void) widget;
(void) rollDown;
@@ -288,7 +284,7 @@ void InterferometerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
void InterferometerGUI::onMenuDialogCalled(const QPoint &p)
{
if (m_contextMenuType == ContextMenuChannelSettings)
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
{
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
@@ -330,7 +326,7 @@ void InterferometerGUI::onMenuDialogCalled(const QPoint &p)
void InterferometerGUI::updateDeviceSetList(const QList<int>& deviceSetIndexes)
{
QList<int>::const_iterator it = deviceSetIndexes.begin();
auto it = deviceSetIndexes.begin();
ui->localDevice->blockSignals(true);
@@ -343,7 +339,7 @@ void InterferometerGUI::updateDeviceSetList(const QList<int>& deviceSetIndexes)
ui->localDevice->blockSignals(false);
}
int InterferometerGUI::getLocalDeviceIndexInCombo(int localDeviceIndex)
int InterferometerGUI::getLocalDeviceIndexInCombo(int localDeviceIndex) const
{
int index = 0;
@@ -457,7 +453,7 @@ void InterferometerGUI::tick()
}
}
void InterferometerGUI::makeUIConnections()
void InterferometerGUI::makeUIConnections() const
{
QObject::connect(ui->decimationFactor, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &InterferometerGUI::on_decimationFactor_currentIndexChanged);
QObject::connect(ui->position, &QSlider::valueChanged, this, &InterferometerGUI::on_position_valueChanged);
@@ -472,5 +468,5 @@ void InterferometerGUI::makeUIConnections()
void InterferometerGUI::updateAbsoluteCenterFrequency()
{
setStatusFrequency(m_centerFrequency + m_shiftFrequencyFactor * m_sampleRate);
setStatusFrequency((qint64) ((double) m_centerFrequency + m_shiftFrequencyFactor * m_sampleRate));
}
@@ -46,22 +46,21 @@ class InterferometerGUI : public ChannelGUI {
public:
static InterferometerGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *mimoChannel);
virtual void destroy();
virtual void resetToDefaults();
virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data);
virtual MessageQueue* getInputMessageQueue();
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; }
virtual bool getHidden() const { return m_settings.m_hidden; }
virtual ChannelMarker& getChannelMarker() { return m_channelMarker; }
virtual int getStreamIndex() const { return -1; }
virtual void setStreamIndex(int streamIndex) { (void) streamIndex; }
void resetToDefaults() final;
QByteArray serialize() const final;
bool deserialize(const QByteArray& data) final;
MessageQueue* getInputMessageQueue() final;
void setWorkspaceIndex(int index) final { m_settings.m_workspaceIndex = index; };
int getWorkspaceIndex() const final { return m_settings.m_workspaceIndex; };
void setGeometryBytes(const QByteArray& blob) final { m_settings.m_geometryBytes = blob; };
QByteArray getGeometryBytes() const final { return m_settings.m_geometryBytes; };
QString getTitle() const final { return m_settings.m_title; };
QColor getTitleColor() const final { return m_settings.m_rgbColor; };
void zetHidden(bool hidden) final { m_settings.m_hidden = hidden; }
bool getHidden() const final { return m_settings.m_hidden; }
ChannelMarker& getChannelMarker() final { return m_channelMarker; }
int getStreamIndex() const final { return -1; }
void setStreamIndex(int streamIndex) final { (void) streamIndex; }
private:
Ui::InterferometerGUI* ui;
@@ -83,7 +82,7 @@ private:
uint32_t m_tickCount;
explicit InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *rxChannel, QWidget* parent = nullptr);
virtual ~InterferometerGUI();
~InterferometerGUI() final;
void blockApplySettings(bool block);
void applySettings(bool force = false);
@@ -92,13 +91,13 @@ private:
void displaySettings();
void displayRateAndShift();
bool handleMessage(const Message& message);
void makeUIConnections();
void makeUIConnections() const;
void updateAbsoluteCenterFrequency();
void updateDeviceSetList(const QList<int>& deviceSetIndexes);
int getLocalDeviceIndexInCombo(int localDeviceIndex);
int getLocalDeviceIndexInCombo(int localDeviceIndex) const;
void leaveEvent(QEvent*);
void enterEvent(EnterEventType*);
void leaveEvent(QEvent*) final;
void enterEvent(EnterEventType*) final;
private slots:
void handleSourceMessages();
@@ -111,7 +110,7 @@ private slots:
void on_correlationType_currentIndexChanged(int index);
void on_localDevice_currentIndexChanged(int index);
void on_localDevicePlay_toggled(bool checked);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onWidgetRolled(const QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void tick();
};