mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-07-10 04:45:24 -04:00
SDRdaemo: serialize auto corrections
This commit is contained in:
parent
0b0d57724c
commit
07bfcb04dc
16
Readme.md
16
Readme.md
@ -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`
|
`-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>
|
<h1>Software build</h1>
|
||||||
|
|
||||||
<h2>Ubuntu</h2>
|
<h2>Ubuntu</h2>
|
||||||
|
@ -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);
|
std::memcpy((void *) &m_rawBuffer[m_rawCount], (const void *) array, m_rawSize - m_rawCount);
|
||||||
m_rawCount = length - (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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ SDRdaemonGui::SDRdaemonGui(PluginAPI* pluginAPI, QWidget* parent) :
|
|||||||
m_centerFrequency(0),
|
m_centerFrequency(0),
|
||||||
m_samplesCount(0),
|
m_samplesCount(0),
|
||||||
m_tickCount(0),
|
m_tickCount(0),
|
||||||
|
m_address("127.0.0.1"),
|
||||||
|
m_port(9090),
|
||||||
m_dcBlock(false),
|
m_dcBlock(false),
|
||||||
m_iqCorrection(false)
|
m_iqCorrection(false)
|
||||||
{
|
{
|
||||||
@ -80,6 +82,10 @@ QString SDRdaemonGui::getName() const
|
|||||||
|
|
||||||
void SDRdaemonGui::resetToDefaults()
|
void SDRdaemonGui::resetToDefaults()
|
||||||
{
|
{
|
||||||
|
m_address = "127.0.0.1";
|
||||||
|
m_port = 9090;
|
||||||
|
m_dcBlock = false;
|
||||||
|
m_iqCorrection = false;
|
||||||
displaySettings();
|
displaySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,12 +93,18 @@ QByteArray SDRdaemonGui::serialize() const
|
|||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
SimpleSerializer s(1);
|
SimpleSerializer s(1);
|
||||||
|
|
||||||
s.writeString(1, ui->address->text());
|
s.writeString(1, ui->address->text());
|
||||||
uint32_t uintval = ui->port->text().toInt(&ok);
|
uint32_t uintval = ui->port->text().toInt(&ok);
|
||||||
|
|
||||||
if((!ok) || (uintval < 1024) || (uintval > 65535)) {
|
if((!ok) || (uintval < 1024) || (uintval > 65535)) {
|
||||||
uintval = 9090;
|
uintval = 9090;
|
||||||
}
|
}
|
||||||
|
|
||||||
s.writeU32(2, uintval);
|
s.writeU32(2, uintval);
|
||||||
|
s.writeBool(3, m_dcBlock);
|
||||||
|
s.writeBool(4, m_iqCorrection);
|
||||||
|
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,24 +122,27 @@ bool SDRdaemonGui::deserialize(const QByteArray& data)
|
|||||||
|
|
||||||
if(d.getVersion() == 1) {
|
if(d.getVersion() == 1) {
|
||||||
uint32_t uintval;
|
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);
|
d.readU32(2, &uintval, 9090);
|
||||||
|
|
||||||
if ((uintval > 1024) && (uintval < 65536)) {
|
if ((uintval > 1024) && (uintval < 65536)) {
|
||||||
port = uintval;
|
m_port = uintval;
|
||||||
} else {
|
} else {
|
||||||
port = 9090;
|
m_port = 9090;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d.readBool(3, &m_dcBlock, false);
|
||||||
|
d.readBool(4, &m_iqCorrection, false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
resetToDefaults();
|
resetToDefaults();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->address->setText(address);
|
displaySettings();
|
||||||
ui->port->setText(QString::number(port));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
qint64 SDRdaemonGui::getCenterFrequency() const
|
qint64 SDRdaemonGui::getCenterFrequency() const
|
||||||
{
|
{
|
||||||
return m_centerFrequency;
|
return m_centerFrequency;
|
||||||
@ -186,17 +201,12 @@ void SDRdaemonGui::handleSourceMessages()
|
|||||||
|
|
||||||
void SDRdaemonGui::displaySettings()
|
void SDRdaemonGui::displaySettings()
|
||||||
{
|
{
|
||||||
|
ui->address->setText(m_address);
|
||||||
|
ui->port->setText(QString::number(m_port));
|
||||||
ui->dcOffset->setChecked(m_dcBlock);
|
ui->dcOffset->setChecked(m_dcBlock);
|
||||||
ui->iqImbalance->setChecked(m_iqCorrection);
|
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)
|
void SDRdaemonGui::on_applyButton_clicked(bool checked)
|
||||||
{
|
{
|
||||||
configureUDPLink();
|
configureUDPLink();
|
||||||
@ -207,8 +217,7 @@ void SDRdaemonGui::on_dcOffset_toggled(bool checked)
|
|||||||
if (m_dcBlock != checked)
|
if (m_dcBlock != checked)
|
||||||
{
|
{
|
||||||
m_dcBlock = checked;
|
m_dcBlock = checked;
|
||||||
SDRdaemonInput::MsgConfigureSDRdaemonAutoCorr* message = SDRdaemonInput::MsgConfigureSDRdaemonAutoCorr::create(m_dcBlock, m_iqCorrection);
|
configureAutoCorrections();
|
||||||
m_sampleSource->getInputMessageQueue()->push(message);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,8 +226,7 @@ void SDRdaemonGui::on_iqImbalance_toggled(bool checked)
|
|||||||
if (m_iqCorrection != checked)
|
if (m_iqCorrection != checked)
|
||||||
{
|
{
|
||||||
m_iqCorrection = checked;
|
m_iqCorrection = checked;
|
||||||
SDRdaemonInput::MsgConfigureSDRdaemonAutoCorr* message = SDRdaemonInput::MsgConfigureSDRdaemonAutoCorr::create(m_dcBlock, m_iqCorrection);
|
configureAutoCorrections();
|
||||||
m_sampleSource->getInputMessageQueue()->push(message);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,6 +248,12 @@ void SDRdaemonGui::configureUDPLink()
|
|||||||
m_sampleSource->getInputMessageQueue()->push(message);
|
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()
|
void SDRdaemonGui::updateWithAcquisition()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -267,3 +281,4 @@ void SDRdaemonGui::tick()
|
|||||||
m_sampleSource->getInputMessageQueue()->push(message);
|
m_sampleSource->getInputMessageQueue()->push(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,12 +60,15 @@ private:
|
|||||||
int m_samplesCount;
|
int m_samplesCount;
|
||||||
std::size_t m_tickCount;
|
std::size_t m_tickCount;
|
||||||
|
|
||||||
|
QString m_address;
|
||||||
|
quint16 m_port;
|
||||||
bool m_dcBlock;
|
bool m_dcBlock;
|
||||||
bool m_iqCorrection;
|
bool m_iqCorrection;
|
||||||
|
|
||||||
void displaySettings();
|
void displaySettings();
|
||||||
void displayTime();
|
void displayTime();
|
||||||
void configureUDPLink();
|
void configureUDPLink();
|
||||||
|
void configureAutoCorrections();
|
||||||
void updateWithAcquisition();
|
void updateWithAcquisition();
|
||||||
void updateWithStreamData();
|
void updateWithStreamData();
|
||||||
void updateWithStreamTime();
|
void updateWithStreamTime();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user