1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-28 04:54:13 -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
+31 -1
View File
@@ -52,6 +52,7 @@ TestMIGui::TestMIGui(DeviceUISet *deviceUISet, QWidget* parent) :
m_lastEngineState(DeviceAPI::StNotStarted)
{
qDebug("TestMIGui::TestMIGui");
setAttribute(Qt::WA_DeleteOnClose, true);
m_sampleMIMO = m_deviceUISet->m_deviceAPI->getSampleMIMO();
m_streamIndex = 0;
m_deviceCenterFrequencies.push_back(m_settings.m_streams[0].m_centerFrequency);
@@ -59,7 +60,9 @@ TestMIGui::TestMIGui(DeviceUISet *deviceUISet, QWidget* parent) :
m_deviceSampleRates.push_back(m_settings.m_streams[0].m_sampleRate / (1<<m_settings.m_streams[0].m_log2Decim));
m_deviceSampleRates.push_back(m_settings.m_streams[1].m_sampleRate / (1<<m_settings.m_streams[1].m_log2Decim));
ui->setupUi(this);
ui->setupUi(getContents());
getContents()->setStyleSheet("#TestMIGui { border: 1px solid #C06900 }");
m_helpURL = "plugins/samplemimo/testmi/readme.md";
ui->spectrumSource->addItem("0");
ui->spectrumSource->addItem("1");
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
@@ -81,6 +84,8 @@ TestMIGui::TestMIGui(DeviceUISet *deviceUISet, QWidget* parent) :
CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
makeUIConnections();
}
TestMIGui::~TestMIGui()
@@ -559,3 +564,28 @@ void TestMIGui::openDeviceSettingsDialog(const QPoint& p)
sendSettings();
}
void TestMIGui::makeUIConnections()
{
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &TestMIGui::on_startStop_toggled);
QObject::connect(ui->streamIndex, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TestMIGui::on_streamIndex_currentIndexChanged);
QObject::connect(ui->spectrumSource, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TestMIGui::on_spectrumSource_currentIndexChanged);
QObject::connect(ui->streamLock, &QToolButton::toggled, this, &TestMIGui::on_streamLock_toggled);
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &TestMIGui::on_centerFrequency_changed);
QObject::connect(ui->autoCorr, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TestMIGui::on_autoCorr_currentIndexChanged);
QObject::connect(ui->frequencyShift, &ValueDialZ::changed, this, &TestMIGui::on_frequencyShift_changed);
QObject::connect(ui->decimation, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TestMIGui::on_decimation_currentIndexChanged);
QObject::connect(ui->fcPos, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TestMIGui::on_fcPos_currentIndexChanged);
QObject::connect(ui->sampleRate, &ValueDial::changed, this, &TestMIGui::on_sampleRate_changed);
QObject::connect(ui->sampleSize, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TestMIGui::on_sampleSize_currentIndexChanged);
QObject::connect(ui->amplitudeCoarse, &QSlider::valueChanged, this, &TestMIGui::on_amplitudeCoarse_valueChanged);
QObject::connect(ui->amplitudeFine, &QSlider::valueChanged, this, &TestMIGui::on_amplitudeFine_valueChanged);
QObject::connect(ui->modulation, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TestMIGui::on_modulation_currentIndexChanged);
QObject::connect(ui->modulationFrequency, &QDial::valueChanged, this, &TestMIGui::on_modulationFrequency_valueChanged);
QObject::connect(ui->amModulation, &QDial::valueChanged, this, &TestMIGui::on_amModulation_valueChanged);
QObject::connect(ui->fmDeviation, &QDial::valueChanged, this, &TestMIGui::on_fmDeviation_valueChanged);
QObject::connect(ui->dcBias, &QSlider::valueChanged, this, &TestMIGui::on_dcBias_valueChanged);
QObject::connect(ui->iBias, &QSlider::valueChanged, this, &TestMIGui::on_iBias_valueChanged);
QObject::connect(ui->qBias, &QSlider::valueChanged, this, &TestMIGui::on_qBias_valueChanged);
QObject::connect(ui->phaseImbalance, &QSlider::valueChanged, this, &TestMIGui::on_phaseImbalance_valueChanged);
}
+5
View File
@@ -45,6 +45,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::TestMIGui* ui;
@@ -73,6 +77,7 @@ private:
void updateAmpFineLimit();
void updateFrequencyShiftLimit();
bool handleMessage(const Message& message);
void makeUIConnections();
private slots:
void handleInputMessages();
+11 -12
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>360</width>
<height>300</height>
<height>368</height>
</rect>
</property>
<property name="sizePolicy">
@@ -19,7 +19,7 @@
<property name="minimumSize">
<size>
<width>360</width>
<height>300</height>
<height>0</height>
</size>
</property>
<property name="font">
@@ -224,6 +224,9 @@
<font>
<family>Liberation Mono</family>
<pointsize>20</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="cursor">
@@ -488,6 +491,9 @@
<font>
<family>Liberation Mono</family>
<pointsize>12</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="cursor">
@@ -644,6 +650,9 @@
<font>
<family>Liberation Mono</family>
<pointsize>12</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="cursor">
@@ -764,13 +773,6 @@
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
@@ -1052,9 +1054,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="fillerLayout"/>
</item>
</layout>
</widget>
<customwidgets>
@@ -50,6 +50,7 @@ TestMISettings::TestMISettings()
m_reverseAPIAddress = "127.0.0.1";
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_workspaceIndex = 0;
m_streams.push_back(TestMIStreamSettings());
m_streams.push_back(TestMIStreamSettings());
}
@@ -61,6 +62,7 @@ TestMISettings::TestMISettings(const TestMISettings& other) :
m_reverseAPIAddress = other.m_reverseAPIAddress;
m_reverseAPIPort = other.m_reverseAPIPort;
m_reverseAPIDeviceIndex = other.m_reverseAPIDeviceIndex;
m_workspaceIndex = other.m_workspaceIndex;
}
void TestMISettings::resetToDefaults()
@@ -78,6 +80,8 @@ QByteArray TestMISettings::serialize() const
s.writeString(2, m_reverseAPIAddress);
s.writeU32(3, m_reverseAPIPort);
s.writeU32(4, m_reverseAPIDeviceIndex);
s.writeS32(5, m_workspaceIndex);
s.writeBlob(6, m_geometryBytes);
for (unsigned int i = 0; i < m_streams.size(); i++)
{
@@ -128,6 +132,8 @@ bool TestMISettings::deserialize(const QByteArray& data)
d.readU32(4, &utmp, 0);
m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
d.readS32(5, &m_workspaceIndex, 0);
d.readBlob(6, &m_geometryBytes);
for (unsigned int i = 0; i < m_streams.size(); i++)
{
@@ -70,6 +70,8 @@ struct TestMISettings {
QString m_reverseAPIAddress;
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
std::vector<TestMIStreamSettings> m_streams;
TestMISettings();