1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-07 16:34:45 -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
@@ -59,8 +59,11 @@ SoapySDRInputGui::SoapySDRInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
m_autoDCCorrection(0),
m_autoIQCorrection(0)
{
setAttribute(Qt::WA_DeleteOnClose, true);
m_sampleSource = (SoapySDRInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
ui->setupUi(this);
ui->setupUi(getContents());
getContents()->setStyleSheet("#SoapySDRInputGui { border: 1px solid #C06900 }");
m_helpURL = "plugins/samplesource/soapysdrinput/readme.md";
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
uint64_t f_min, f_max;
@@ -101,6 +104,7 @@ SoapySDRInputGui::SoapySDRInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue);
sendSettings();
makeUIConnections();
}
SoapySDRInputGui::~SoapySDRInputGui()
@@ -924,3 +928,15 @@ void SoapySDRInputGui::openDeviceSettingsDialog(const QPoint& p)
sendSettings();
}
void SoapySDRInputGui::makeUIConnections()
{
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &SoapySDRInputGui::on_centerFrequency_changed);
QObject::connect(ui->LOppm, &QSlider::valueChanged, this, &SoapySDRInputGui::on_LOppm_valueChanged);
QObject::connect(ui->dcOffset, &ButtonSwitch::toggled, this, &SoapySDRInputGui::on_dcOffset_toggled);
QObject::connect(ui->iqImbalance, &ButtonSwitch::toggled, this, &SoapySDRInputGui::on_iqImbalance_toggled);
QObject::connect(ui->decim, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SoapySDRInputGui::on_decim_currentIndexChanged);
QObject::connect(ui->fcPos, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SoapySDRInputGui::on_fcPos_currentIndexChanged);
QObject::connect(ui->transverter, &TransverterButton::clicked, this, &SoapySDRInputGui::on_transverter_clicked);
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &SoapySDRInputGui::on_startStop_toggled);
}
@@ -51,6 +51,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:
void createRangesControl(
@@ -64,6 +68,7 @@ private:
void createIndividualGainsControl(const std::vector<DeviceSoapySDRParams::GainSetting>& individualGainsList);
void createCorrectionsControl();
void createArgumentsControl(const SoapySDR::ArgInfoList& argInfoList, bool deviceArguments);
void makeUIConnections();
Ui::SoapySDRInputGui* ui;
@@ -50,6 +50,7 @@ void SoapySDRInputSettings::resetToDefaults()
m_reverseAPIAddress = "127.0.0.1";
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_workspaceIndex = 0;
}
QByteArray SoapySDRInputSettings::serialize() const
@@ -83,6 +84,8 @@ QByteArray SoapySDRInputSettings::serialize() const
s.writeU32(25, m_reverseAPIPort);
s.writeU32(26, m_reverseAPIDeviceIndex);
s.writeBool(27, m_iqOrder);
s.writeS32(28, m_workspaceIndex);
s.writeBlob(29, m_geometryBytes);
return s.final();
}
@@ -146,6 +149,8 @@ bool SoapySDRInputSettings::deserialize(const QByteArray& data)
d.readU32(26, &uintval, 0);
m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
d.readBool(27, &m_iqOrder, true);
d.readS32(28, &m_workspaceIndex, 0);
d.readBlob(29, &m_geometryBytes);
return true;
}
@@ -56,6 +56,8 @@ struct SoapySDRInputSettings {
QString m_reverseAPIAddress;
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
SoapySDRInputSettings();
void resetToDefaults();