mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-19 06:08:51 -04:00
Massive UI revamping (v7): implemented device common settings from top bar and added documentation on device windows top and bottom bars
This commit is contained in:
@@ -10,6 +10,8 @@ The plugin is always built.
|
||||
|
||||
<h2>Interface</h2>
|
||||
|
||||
The top and bottom bars of the device window are described [here](../../../sdrgui/device/readme.md)
|
||||
|
||||

|
||||
|
||||
<h3>1: Start/Stop</h3>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "gui/colormapper.h"
|
||||
#include "gui/glspectrum.h"
|
||||
#include "gui/basicdevicesettingsdialog.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/spectrumvis.h"
|
||||
@@ -83,6 +84,7 @@ TestMOSyncGui::TestMOSyncGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_deviceUISet->m_deviceAPI->setSpectrumSinkInput(false, 0);
|
||||
m_deviceUISet->setSpectrumScalingFactor(SDR_TX_SCALEF);
|
||||
|
||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
|
||||
}
|
||||
|
||||
TestMOSyncGui::~TestMOSyncGui()
|
||||
@@ -289,6 +291,30 @@ void TestMOSyncGui::tick()
|
||||
{
|
||||
}
|
||||
|
||||
void TestMOSyncGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuDeviceSettings)
|
||||
{
|
||||
BasicDeviceSettingsDialog dialog(this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
|
||||
dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
|
||||
dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
|
||||
|
||||
dialog.move(p);
|
||||
dialog.exec();
|
||||
|
||||
m_settings.m_useReverseAPI = dialog.useReverseAPI();
|
||||
m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
|
||||
m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
|
||||
m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
resetContextMenuType();
|
||||
}
|
||||
|
||||
void TestMOSyncGui::makeUIConnections()
|
||||
{
|
||||
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &TestMOSyncGui::on_centerFrequency_changed);
|
||||
|
||||
@@ -85,6 +85,7 @@ private slots:
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_interp_currentIndexChanged(int index);
|
||||
void on_spectrumIndex_currentIndexChanged(int index);
|
||||
void openDeviceSettingsDialog(const QPoint& p);
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
void tick();
|
||||
|
||||
@@ -32,6 +32,10 @@ void TestMOSyncSettings::resetToDefaults()
|
||||
m_log2Interp = 0;
|
||||
m_fcPosTx = FC_POS_CENTER;
|
||||
m_workspaceIndex = 0;
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
m_reverseAPIDeviceIndex = 0;
|
||||
}
|
||||
|
||||
QByteArray TestMOSyncSettings::serialize() const
|
||||
@@ -43,6 +47,10 @@ QByteArray TestMOSyncSettings::serialize() const
|
||||
s.writeS32(3, (int) m_fcPosTx);
|
||||
s.writeS32(4, m_workspaceIndex);
|
||||
s.writeBlob(5, m_geometryBytes);
|
||||
s.writeBool(6, m_useReverseAPI);
|
||||
s.writeString(7, m_reverseAPIAddress);
|
||||
s.writeU32(8, m_reverseAPIPort);
|
||||
s.writeU32(9, m_reverseAPIDeviceIndex);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@@ -60,6 +68,7 @@ bool TestMOSyncSettings::deserialize(const QByteArray& data)
|
||||
if (d.getVersion() == 1)
|
||||
{
|
||||
int intval;
|
||||
uint32_t utmp;
|
||||
|
||||
d.readU64(1, &m_sampleRate, 48000);
|
||||
d.readU32(2, &m_log2Interp, 0);
|
||||
@@ -67,6 +76,18 @@ bool TestMOSyncSettings::deserialize(const QByteArray& data)
|
||||
m_fcPosTx = (fcPos_t) intval;
|
||||
d.readS32(4, &m_workspaceIndex, 0);
|
||||
d.readBlob(5, &m_geometryBytes);
|
||||
d.readBool(1, &m_useReverseAPI, false);
|
||||
d.readString(2, &m_reverseAPIAddress, "127.0.0.1");
|
||||
d.readU32(3, &utmp, 0);
|
||||
|
||||
if ((utmp > 1023) && (utmp < 65535)) {
|
||||
m_reverseAPIPort = utmp;
|
||||
} else {
|
||||
m_reverseAPIPort = 8888;
|
||||
}
|
||||
|
||||
d.readU32(4, &utmp, 0);
|
||||
m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,10 @@ struct TestMOSyncSettings {
|
||||
quint64 m_sampleRate;
|
||||
quint32 m_log2Interp;
|
||||
fcPos_t m_fcPosTx;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
uint16_t m_reverseAPIDeviceIndex;
|
||||
int m_workspaceIndex;
|
||||
QByteArray m_geometryBytes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user