1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-14 15:33:34 -04:00

Massive UI revamping (v7): devices basic

This commit is contained in:
f4exb
2022-04-07 16:32:03 +02:00
parent 43f53fe26a
commit aad90aeabc
193 changed files with 2598 additions and 691 deletions
+26 -1
View File
@@ -40,9 +40,12 @@ SDRPlayGui::SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent) :
m_doApplySettings(true),
m_forceSettings(true)
{
setAttribute(Qt::WA_DeleteOnClose, true);
m_sampleSource = (SDRPlayInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
ui->setupUi(this);
ui->setupUi(getContents());
getContents()->setStyleSheet("#SDRPlayGui { border: 1px solid #C06900 }");
m_helpURL = "plugins/samplesource/sdrplay/readme.md";
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->centerFrequency->setValueRange(7, 10U, 12000U);
@@ -78,6 +81,7 @@ SDRPlayGui::SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent) :
connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
displaySettings();
makeUIConnections();
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue);
@@ -456,3 +460,24 @@ void SDRPlayGui::openDeviceSettingsDialog(const QPoint& p)
sendSettings();
}
void SDRPlayGui::makeUIConnections()
{
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &SDRPlayGui::on_centerFrequency_changed);
QObject::connect(ui->ppm, &QSlider::valueChanged, this, &SDRPlayGui::on_ppm_valueChanged);
QObject::connect(ui->dcOffset, &ButtonSwitch::toggled, this, &SDRPlayGui::on_dcOffset_toggled);
QObject::connect(ui->iqImbalance, &ButtonSwitch::toggled, this, &SDRPlayGui::on_iqImbalance_toggled);
QObject::connect(ui->fBand, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_fBand_currentIndexChanged);
QObject::connect(ui->bandwidth, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_bandwidth_currentIndexChanged);
QObject::connect(ui->samplerate, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_samplerate_currentIndexChanged);
QObject::connect(ui->ifFrequency, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_ifFrequency_currentIndexChanged);
QObject::connect(ui->decim, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_decim_currentIndexChanged);
QObject::connect(ui->fcPos, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_fcPos_currentIndexChanged);
QObject::connect(ui->gainTunerOn, &QRadioButton::toggled, this, &SDRPlayGui::on_gainTunerOn_toggled);
QObject::connect(ui->gainTuner, &QDial::valueChanged, this, &SDRPlayGui::on_gainTuner_valueChanged);
QObject::connect(ui->gainManualOn, &QRadioButton::toggled, this, &SDRPlayGui::on_gainManualOn_toggled);
QObject::connect(ui->gainLNA, &ButtonSwitch::toggled, this, &SDRPlayGui::on_gainLNA_toggled);
QObject::connect(ui->gainMixer, &ButtonSwitch::toggled, this, &SDRPlayGui::on_gainMixer_toggled);
QObject::connect(ui->gainBaseband, &QDial::valueChanged, this, &SDRPlayGui::on_gainBaseband_valueChanged);
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &SDRPlayGui::on_startStop_toggled);
}
@@ -46,6 +46,10 @@ public:
virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
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; }
private:
Ui::SDRPlayGui* ui;
@@ -67,6 +71,7 @@ private:
void sendSettings();
void updateSampleRateAndFrequency();
bool handleMessage(const Message& message);
void makeUIConnections();
private slots:
void updateHardware();
@@ -47,6 +47,7 @@ void SDRPlaySettings::resetToDefaults()
m_reverseAPIAddress = "127.0.0.1";
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_workspaceIndex = 0;
}
QByteArray SDRPlaySettings::serialize() const
@@ -72,6 +73,8 @@ QByteArray SDRPlaySettings::serialize() const
s.writeU32(17, m_reverseAPIPort);
s.writeU32(18, m_reverseAPIDeviceIndex);
s.writeBool(19, m_iqOrder);
s.writeS32(20, m_workspaceIndex);
s.writeBlob(21, m_geometryBytes);
return s.final();
}
@@ -119,6 +122,8 @@ bool SDRPlaySettings::deserialize(const QByteArray& data)
d.readU32(18, &uintval, 0);
m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
d.readBool(19, &m_iqOrder, true);
d.readS32(20, &m_workspaceIndex, 0);
d.readBlob(21, &m_geometryBytes);
return true;
}
@@ -50,6 +50,8 @@ struct SDRPlaySettings {
QString m_reverseAPIAddress;
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
SDRPlaySettings();
void resetToDefaults();