1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-07 08:24:43 -04:00

Massive UI revamping (v7): display channel absolute frequency in status bar. Manage shift frequency limits

This commit is contained in:
f4exb
2022-04-13 11:08:21 +02:00
parent f1cf2f4f18
commit af13b31d85
135 changed files with 999 additions and 205 deletions
@@ -20,6 +20,7 @@
#include "device/deviceapi.h"
#include "device/deviceuiset.h"
#include "dsp/hbfilterchainconverter.h"
#include "dsp/dspcommands.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/devicestreamselectiondialog.h"
#include "mainwindow.h"
@@ -66,10 +67,12 @@ bool RemoteSourceGUI::deserialize(const QByteArray& data)
bool RemoteSourceGUI::handleMessage(const Message& message)
{
if (RemoteSource::MsgBasebandSampleRateNotification::match(message))
if (DSPSignalNotification::match(message))
{
RemoteSource::MsgBasebandSampleRateNotification& notif = (RemoteSource::MsgBasebandSampleRateNotification&) message;
m_basebandSampleRate = notif.getBasebandSampleRate();
DSPSignalNotification& notif = (DSPSignalNotification&) message;
m_deviceCenterFrequency = notif.getCenterFrequency();
m_basebandSampleRate = notif.getSampleRate();
updateAbsoluteCenterFrequency();
displayRateAndShift();
return true;
}
@@ -156,6 +159,7 @@ RemoteSourceGUI::RemoteSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet,
ui(new Ui::RemoteSourceGUI),
m_pluginAPI(pluginAPI),
m_deviceUISet(deviceUISet),
m_deviceCenterFrequency(0),
m_remoteSampleRate(48000),
m_basebandSampleRate(48000),
m_shiftFrequencyFactor(0.0),
@@ -245,6 +249,7 @@ void RemoteSourceGUI::displaySettings()
ui->dataAddress->setText(m_settings.m_dataAddress);
ui->dataPort->setText(tr("%1").arg(m_settings.m_dataPort));
getRollupContents()->restoreState(m_rollupState);
updateAbsoluteCenterFrequency();
blockApplySettings(false);
}
@@ -432,6 +437,7 @@ void RemoteSourceGUI::applyPosition()
m_shiftFrequencyFactor = HBFilterChainConverter::convertToString(m_settings.m_log2Interp, m_settings.m_filterChainHash, s);
ui->filterChainText->setText(s);
updateAbsoluteCenterFrequency();
displayRateAndShift();
applySettings();
}
@@ -496,3 +502,10 @@ void RemoteSourceGUI::makeUIConnections()
QObject::connect(ui->dataApplyButton, &QPushButton::clicked, this, &RemoteSourceGUI::on_dataApplyButton_clicked);
QObject::connect(ui->eventCountsReset, &QPushButton::clicked, this, &RemoteSourceGUI::on_eventCountsReset_clicked);
}
void RemoteSourceGUI::updateAbsoluteCenterFrequency()
{
int shift = m_shiftFrequencyFactor * m_basebandSampleRate;
setStatusFrequency(m_deviceCenterFrequency + shift);
}