mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 06:04:39 -04:00
Massive UI revamping (v7): devices basic
This commit is contained in:
@@ -67,11 +67,14 @@ RemoteInputGui::RemoteInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_doApplySettings(true),
|
||||
m_forceSettings(true)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
m_paletteGreenText.setColor(QPalette::WindowText, Qt::green);
|
||||
m_paletteWhiteText.setColor(QPalette::WindowText, Qt::white);
|
||||
|
||||
m_startingTimeStampms = 0;
|
||||
ui->setupUi(this);
|
||||
ui->setupUi(getContents());
|
||||
getContents()->setStyleSheet("#RemoteInputGui { border: 1px solid #C06900 }");
|
||||
m_helpURL = "plugins/samplesource/remoteinput/readme.md";
|
||||
|
||||
ui->remoteDeviceFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->remoteDeviceFrequency->setValueRange(8, 0, 99999999);
|
||||
@@ -97,6 +100,7 @@ RemoteInputGui::RemoteInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
|
||||
m_forceSettings = true;
|
||||
sendSettings();
|
||||
makeUIConnections();
|
||||
}
|
||||
|
||||
RemoteInputGui::~RemoteInputGui()
|
||||
@@ -684,3 +688,22 @@ void RemoteInputGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void RemoteInputGui::makeUIConnections()
|
||||
{
|
||||
QObject::connect(ui->remoteDeviceFrequency, &ValueDial::changed, this, &RemoteInputGui::on_remoteDeviceFrequency_changed);
|
||||
QObject::connect(ui->decimationFactor, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &RemoteInputGui::on_decimationFactor_currentIndexChanged);
|
||||
QObject::connect(ui->position, &QSlider::valueChanged, this, &RemoteInputGui::on_position_valueChanged);
|
||||
QObject::connect(ui->apiApplyButton, &QPushButton::clicked, this, &RemoteInputGui::on_apiApplyButton_clicked);
|
||||
QObject::connect(ui->dataApplyButton, &QPushButton::clicked, this, &RemoteInputGui::on_dataApplyButton_clicked);
|
||||
QObject::connect(ui->dcOffset, &ButtonSwitch::toggled, this, &RemoteInputGui::on_dcOffset_toggled);
|
||||
QObject::connect(ui->iqImbalance, &ButtonSwitch::toggled, this, &RemoteInputGui::on_iqImbalance_toggled);
|
||||
QObject::connect(ui->apiAddress, &QLineEdit::editingFinished, this, &RemoteInputGui::on_apiAddress_editingFinished);
|
||||
QObject::connect(ui->apiPort, &QLineEdit::editingFinished, this, &RemoteInputGui::on_apiPort_editingFinished);
|
||||
QObject::connect(ui->dataAddress, &QLineEdit::editingFinished, this, &RemoteInputGui::on_dataAddress_editingFinished);
|
||||
QObject::connect(ui->dataPort, &QLineEdit::editingFinished, this, &RemoteInputGui::on_dataPort_editingFinished);
|
||||
QObject::connect(ui->multicastAddress, &QLineEdit::editingFinished, this, &RemoteInputGui::on_multicastAddress_editingFinished);
|
||||
QObject::connect(ui->multicastJoin, &ButtonSwitch::toggled, this, &RemoteInputGui::on_multicastJoin_toggled);
|
||||
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &RemoteInputGui::on_startStop_toggled);
|
||||
QObject::connect(ui->eventCountsReset, &QPushButton::clicked, this, &RemoteInputGui::on_eventCountsReset_clicked);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,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::RemoteInputGui* ui;
|
||||
@@ -116,6 +120,7 @@ private:
|
||||
void applyPosition();
|
||||
void applyRemoteSettings();
|
||||
bool handleMessage(const Message& message);
|
||||
void makeUIConnections();
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
|
||||
@@ -37,6 +37,7 @@ void RemoteInputSettings::resetToDefaults()
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
m_reverseAPIDeviceIndex = 0;
|
||||
m_workspaceIndex = 0;
|
||||
}
|
||||
|
||||
QByteArray RemoteInputSettings::serialize() const
|
||||
@@ -55,6 +56,8 @@ QByteArray RemoteInputSettings::serialize() const
|
||||
s.writeString(12, m_reverseAPIAddress);
|
||||
s.writeU32(13, m_reverseAPIPort);
|
||||
s.writeU32(14, m_reverseAPIDeviceIndex);
|
||||
s.writeS32(15, m_workspaceIndex);
|
||||
s.writeBlob(16, m_geometryBytes);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@@ -95,6 +98,9 @@ bool RemoteInputSettings::deserialize(const QByteArray& data)
|
||||
|
||||
d.readU32(14, &uintval, 0);
|
||||
m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
|
||||
d.readS32(15, &m_workspaceIndex, 0);
|
||||
d.readBlob(16, &m_geometryBytes);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -34,6 +34,8 @@ struct RemoteInputSettings {
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
uint16_t m_reverseAPIDeviceIndex;
|
||||
int m_workspaceIndex;
|
||||
QByteArray m_geometryBytes;
|
||||
|
||||
RemoteInputSettings();
|
||||
void resetToDefaults();
|
||||
|
||||
Reference in New Issue
Block a user