mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-10 10:33:29 -05:00
SDRdaemon plugin: update settings after deserialization
This commit is contained in:
parent
b59c28d4c7
commit
952a32172d
@ -109,8 +109,6 @@ Note that this plugin does not require any of the hardware support libraries nor
|
||||
|
||||
<h2>SDRdaemon input</h2>
|
||||
|
||||
Warning: this is experimental and not fulle debugged yet.
|
||||
|
||||
This is the client side of the SDRdaemon server. See the [SDRdaemon](https://github.com/f4exb/sdrdaemon) project in this Github repository. You must specify the address and UDP port to which the server connects and samples will flow into the SDRangel application (default is `127.0.0.1`port `9090`). It uses the meta data to retrieve the sample flow characteristics such as sample rate and receiveng center frequency.
|
||||
|
||||
Note that this plugin does not require any of the hardware support libraries nor the libusb library. It is alwasys available in the list of devices as `SDRdaemon[0]` even if no physical device is connected.
|
||||
|
@ -114,33 +114,54 @@ bool SDRdaemonGui::deserialize(const QByteArray& data)
|
||||
QString address;
|
||||
uint32_t uintval;
|
||||
quint16 port;
|
||||
bool dcBlock;
|
||||
bool iqCorrection;
|
||||
|
||||
if(!d.isValid()) {
|
||||
if (!d.isValid())
|
||||
{
|
||||
resetToDefaults();
|
||||
displaySettings();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(d.getVersion() == 1) {
|
||||
if (d.getVersion() == 1)
|
||||
{
|
||||
uint32_t uintval;
|
||||
d.readString(1, &m_address, "127.0.0.1");
|
||||
d.readString(1, &address, "127.0.0.1");
|
||||
d.readU32(2, &uintval, 9090);
|
||||
|
||||
if ((uintval > 1024) && (uintval < 65536)) {
|
||||
m_port = uintval;
|
||||
port = uintval;
|
||||
} else {
|
||||
m_port = 9090;
|
||||
port = 9090;
|
||||
}
|
||||
|
||||
d.readBool(3, &m_dcBlock, false);
|
||||
d.readBool(4, &m_iqCorrection, false);
|
||||
d.readBool(3, &dcBlock, false);
|
||||
d.readBool(4, &iqCorrection, false);
|
||||
|
||||
return true;
|
||||
} else {
|
||||
resetToDefaults();
|
||||
return false;
|
||||
if ((address != m_address) || (port != m_port))
|
||||
{
|
||||
m_address = address;
|
||||
m_port = port;
|
||||
configureUDPLink();
|
||||
}
|
||||
|
||||
if ((dcBlock != m_dcBlock) || (iqCorrection != m_iqCorrection))
|
||||
{
|
||||
m_dcBlock = dcBlock;
|
||||
m_iqCorrection = iqCorrection;
|
||||
configureAutoCorrections();
|
||||
}
|
||||
|
||||
displaySettings();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
resetToDefaults();
|
||||
displaySettings();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
qint64 SDRdaemonGui::getCenterFrequency() const
|
||||
@ -260,7 +281,7 @@ void SDRdaemonGui::updateWithAcquisition()
|
||||
|
||||
void SDRdaemonGui::updateWithStreamData()
|
||||
{
|
||||
ui->centerFrequency->setValue(m_centerFrequency);
|
||||
ui->centerFrequency->setValue(m_centerFrequency / 1000);
|
||||
QString s = QString::number(m_sampleRate/1000.0, 'f', 0);
|
||||
ui->sampleRateText->setText(tr("%1k").arg(s));
|
||||
updateWithStreamTime(); // TODO: remove when time data is implemented
|
||||
|
@ -136,7 +136,7 @@ void SDRdaemonUDPHandler::processData()
|
||||
DSPEngine::instance()->getInputMessageQueue()->push(notif);
|
||||
SDRdaemonInput::MsgReportSDRdaemonStreamData *report = SDRdaemonInput::MsgReportSDRdaemonStreamData::create(
|
||||
m_samplerate,
|
||||
m_centerFrequency, // Frequency in kHz for the GUI
|
||||
m_centerFrequency * 1000, // Frequency in Hz for the GUI
|
||||
m_tv_sec,
|
||||
m_tv_usec);
|
||||
m_outputMessageQueueToGUI->push(report);
|
||||
|
Loading…
Reference in New Issue
Block a user