mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-03 06:24:48 -04:00
Massive UI revamping (v7): devices basic
This commit is contained in:
@@ -42,9 +42,12 @@ FCDProPlusGui::FCDProPlusGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_sampleSource(NULL),
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
m_sampleSource = (FCDProPlusInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->setupUi(getContents());
|
||||
getContents()->setStyleSheet("#FCDProPlusGui { border: 1px solid #C06900 }");
|
||||
m_helpURL = "plugins/samplesource/fcdproplus/readme.md";
|
||||
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
updateFrequencyLimits();
|
||||
@@ -69,6 +72,7 @@ FCDProPlusGui::FCDProPlusGui(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);
|
||||
@@ -372,3 +376,21 @@ void FCDProPlusGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void FCDProPlusGui::makeUIConnections()
|
||||
{
|
||||
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &FCDProPlusGui::on_centerFrequency_changed);
|
||||
QObject::connect(ui->decim, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FCDProPlusGui::on_decim_currentIndexChanged);
|
||||
QObject::connect(ui->fcPos, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FCDProPlusGui::on_fcPos_currentIndexChanged);
|
||||
QObject::connect(ui->dcOffset, &ButtonSwitch::toggled, this, &FCDProPlusGui::on_dcOffset_toggled);
|
||||
QObject::connect(ui->iqImbalance, &ButtonSwitch::toggled, this, &FCDProPlusGui::on_iqImbalance_toggled);
|
||||
QObject::connect(ui->checkBoxG, &QCheckBox::stateChanged, this, &FCDProPlusGui::on_checkBoxG_stateChanged);
|
||||
QObject::connect(ui->checkBoxB, &QCheckBox::stateChanged, this, &FCDProPlusGui::on_checkBoxB_stateChanged);
|
||||
QObject::connect(ui->mixGain, &QCheckBox::stateChanged, this, &FCDProPlusGui::on_mixGain_stateChanged);
|
||||
QObject::connect(ui->ifGain, &QSlider::valueChanged, this, &FCDProPlusGui::on_ifGain_valueChanged);
|
||||
QObject::connect(ui->filterRF, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FCDProPlusGui::on_filterRF_currentIndexChanged);
|
||||
QObject::connect(ui->filterIF, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FCDProPlusGui::on_filterIF_currentIndexChanged);
|
||||
QObject::connect(ui->ppm, &QSlider::valueChanged, this, &FCDProPlusGui::on_ppm_valueChanged);
|
||||
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &FCDProPlusGui::on_startStop_toggled);
|
||||
QObject::connect(ui->transverter, &TransverterButton::clicked, this, &FCDProPlusGui::on_transverter_clicked);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,10 @@ public:
|
||||
QByteArray serialize() const;
|
||||
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::FCDProPlusGui* ui;
|
||||
@@ -67,6 +71,7 @@ private:
|
||||
void updateSampleRateAndFrequency();
|
||||
void updateFrequencyLimits();
|
||||
bool handleMessage(const Message& message);
|
||||
void makeUIConnections();
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
|
||||
@@ -46,6 +46,7 @@ void FCDProPlusSettings::resetToDefaults()
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
m_reverseAPIDeviceIndex = 0;
|
||||
m_workspaceIndex = 0;
|
||||
}
|
||||
|
||||
QByteArray FCDProPlusSettings::serialize() const
|
||||
@@ -70,6 +71,8 @@ QByteArray FCDProPlusSettings::serialize() const
|
||||
s.writeU32(16, m_reverseAPIPort);
|
||||
s.writeU32(17, m_reverseAPIDeviceIndex);
|
||||
s.writeBool(18, m_iqOrder);
|
||||
s.writeS32(19, m_workspaceIndex);
|
||||
s.writeBlob(20, m_geometryBytes);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@@ -116,6 +119,8 @@ bool FCDProPlusSettings::deserialize(const QByteArray& data)
|
||||
d.readU32(17, &uintval, 0);
|
||||
m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
|
||||
d.readBool(18, &m_iqOrder, true);
|
||||
d.readS32(19, &m_workspaceIndex, 0);
|
||||
d.readBlob(20, &m_geometryBytes);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,8 @@ struct FCDProPlusSettings {
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
uint16_t m_reverseAPIDeviceIndex;
|
||||
int m_workspaceIndex;
|
||||
QByteArray m_geometryBytes;
|
||||
|
||||
FCDProPlusSettings();
|
||||
void resetToDefaults();
|
||||
|
||||
Reference in New Issue
Block a user