SDRdaemo: serialize auto corrections

pull/6/head
f4exb 2016-02-18 01:24:58 +01:00
rodzic 0b0d57724c
commit 07bfcb04dc
4 zmienionych plików z 52 dodań i 18 usunięć

Wyświetl plik

@ -99,6 +99,22 @@ If you use your own location for librtlsdr install directory you need to specify
`-DLIBRTLSDR_LIBRARIES=/opt/install/librtlsdr/lib/librtlsdr.so -DLIBRTLSDR_INCLUDE_DIR=/opt/install/librtlsdr/include`
<h1>Plugins for special devices</h1>
<h2>File input</h2>
The file input plugin allows the playback of a recorded IQ file. Such a file is obtained using the recording feature. Press F7 to start recording and F8 to stop. The file has a fixed name `test.sdriq` created in the current directory.
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 `FileSource[0]` even if no physical device is connected.
<h2>SDRdaemon input</h2>
Warning: this is experimental is buggy (algorithm to retrieve samples is flawed).
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.
<h1>Software build</h1>
<h2>Ubuntu</h2>

Wyświetl plik

@ -223,7 +223,7 @@ void SDRdaemonBuffer::writeToRawBufferUncompressed(const char *array, uint32_t l
{
std::memcpy((void *) &m_rawBuffer[m_rawCount], (const void *) array, m_rawSize - m_rawCount);
m_rawCount = length - (m_rawSize - m_rawCount);
std::memcpy((void *) m_rawBuffer, (const void *) array, m_rawCount);
std::memcpy((void *) m_rawBuffer, (const void *) &array[m_rawSize - m_rawCount], m_rawCount);
}
}

Wyświetl plik

@ -40,6 +40,8 @@ SDRdaemonGui::SDRdaemonGui(PluginAPI* pluginAPI, QWidget* parent) :
m_centerFrequency(0),
m_samplesCount(0),
m_tickCount(0),
m_address("127.0.0.1"),
m_port(9090),
m_dcBlock(false),
m_iqCorrection(false)
{
@ -80,6 +82,10 @@ QString SDRdaemonGui::getName() const
void SDRdaemonGui::resetToDefaults()
{
m_address = "127.0.0.1";
m_port = 9090;
m_dcBlock = false;
m_iqCorrection = false;
displaySettings();
}
@ -87,12 +93,18 @@ QByteArray SDRdaemonGui::serialize() const
{
bool ok;
SimpleSerializer s(1);
s.writeString(1, ui->address->text());
uint32_t uintval = ui->port->text().toInt(&ok);
if((!ok) || (uintval < 1024) || (uintval > 65535)) {
uintval = 9090;
}
s.writeU32(2, uintval);
s.writeBool(3, m_dcBlock);
s.writeBool(4, m_iqCorrection);
return s.final();
}
@ -110,24 +122,27 @@ bool SDRdaemonGui::deserialize(const QByteArray& data)
if(d.getVersion() == 1) {
uint32_t uintval;
d.readString(1, &address, "127.0.0.1");
d.readString(1, &m_address, "127.0.0.1");
d.readU32(2, &uintval, 9090);
if ((uintval > 1024) && (uintval < 65536)) {
port = uintval;
m_port = uintval;
} else {
port = 9090;
m_port = 9090;
}
d.readBool(3, &m_dcBlock, false);
d.readBool(4, &m_iqCorrection, false);
return true;
} else {
resetToDefaults();
return false;
}
ui->address->setText(address);
ui->port->setText(QString::number(port));
displaySettings();
}
qint64 SDRdaemonGui::getCenterFrequency() const
{
return m_centerFrequency;
@ -186,17 +201,12 @@ void SDRdaemonGui::handleSourceMessages()
void SDRdaemonGui::displaySettings()
{
ui->address->setText(m_address);
ui->port->setText(QString::number(m_port));
ui->dcOffset->setChecked(m_dcBlock);
ui->iqImbalance->setChecked(m_iqCorrection);
}
/*
void SDRdaemonGui::on_play_toggled(bool checked)
{
SDRdaemonInput::MsgConfigureSDRdaemonWork* message = SDRdaemonInput::MsgConfigureSDRdaemonWork::create(checked);
m_sampleSource->getInputMessageQueue()->push(message);
}*/
void SDRdaemonGui::on_applyButton_clicked(bool checked)
{
configureUDPLink();
@ -207,8 +217,7 @@ void SDRdaemonGui::on_dcOffset_toggled(bool checked)
if (m_dcBlock != checked)
{
m_dcBlock = checked;
SDRdaemonInput::MsgConfigureSDRdaemonAutoCorr* message = SDRdaemonInput::MsgConfigureSDRdaemonAutoCorr::create(m_dcBlock, m_iqCorrection);
m_sampleSource->getInputMessageQueue()->push(message);
configureAutoCorrections();
}
}
@ -217,8 +226,7 @@ void SDRdaemonGui::on_iqImbalance_toggled(bool checked)
if (m_iqCorrection != checked)
{
m_iqCorrection = checked;
SDRdaemonInput::MsgConfigureSDRdaemonAutoCorr* message = SDRdaemonInput::MsgConfigureSDRdaemonAutoCorr::create(m_dcBlock, m_iqCorrection);
m_sampleSource->getInputMessageQueue()->push(message);
configureAutoCorrections();
}
}
@ -240,6 +248,12 @@ void SDRdaemonGui::configureUDPLink()
m_sampleSource->getInputMessageQueue()->push(message);
}
void SDRdaemonGui::configureAutoCorrections()
{
SDRdaemonInput::MsgConfigureSDRdaemonAutoCorr* message = SDRdaemonInput::MsgConfigureSDRdaemonAutoCorr::create(m_dcBlock, m_iqCorrection);
m_sampleSource->getInputMessageQueue()->push(message);
}
void SDRdaemonGui::updateWithAcquisition()
{
}
@ -267,3 +281,4 @@ void SDRdaemonGui::tick()
m_sampleSource->getInputMessageQueue()->push(message);
}
}

Wyświetl plik

@ -60,12 +60,15 @@ private:
int m_samplesCount;
std::size_t m_tickCount;
QString m_address;
quint16 m_port;
bool m_dcBlock;
bool m_iqCorrection;
void displaySettings();
void displayTime();
void configureUDPLink();
void configureAutoCorrections();
void updateWithAcquisition();
void updateWithStreamData();
void updateWithStreamTime();