1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-29 06:55:56 -04:00

PlutoSDR MIMO: fixed MO thread and att setting in GUI

This commit is contained in:
f4exb
2021-05-04 16:32:58 +02:00
parent bfa4c62d81
commit 94d037aa16
7 changed files with 35 additions and 9 deletions
@@ -228,7 +228,7 @@ bool PlutoSDRMIMO::startTx()
m_plutoParams->getBox()->openSecondTx();
}
m_plutoTxBuffer = m_plutoParams->getBox()->createRxBuffer(PlutoSDRMIMOSettings::m_plutoSDRBlockSizeSamples, false);
m_plutoTxBuffer = m_plutoParams->getBox()->createTxBuffer(PlutoSDRMIMOSettings::m_plutoSDRBlockSizeSamples, false);
m_sinkThread->startWork();
mutexLocker.unlock();
m_runningTx = true;
@@ -771,6 +771,19 @@ void PlutoSDRMIMOGUI::on_gain_valueChanged(int value)
sendSettings();
}
void PlutoSDRMIMOGUI::on_att_valueChanged(int value)
{
ui->attText->setText(QString("%1 dB").arg(QString::number(value*0.25, 'f', 2)));
if (m_streamIndex == 0) {
m_settings.m_tx0Att = value;
} else {
m_settings.m_tx1Att = value;
}
sendSettings();
}
void PlutoSDRMIMOGUI::on_antenna_currentIndexChanged(int index)
{
if (m_rxElseTx)
@@ -103,6 +103,7 @@ private slots:
void on_gainLock_toggled(bool checked);
void on_gainMode_currentIndexChanged(int index);
void on_gain_valueChanged(int value);
void on_att_valueChanged(int value);
void on_transverter_clicked();
void on_rfDCOffset_toggled(bool checked);
void on_bbDCOffset_toggled(bool checked);
@@ -90,13 +90,14 @@ int PlutoSDRMIThread::getFcPos() const
void PlutoSDRMIThread::run()
{
std::ptrdiff_t p_inc = m_plutoBox->rxBufferStep();
int sampleSize = 4; // I/Q sample size in bytes
int sampleSize = 2*m_plutoBox->getRxSampleBytes(); // I/Q sample size in bytes
int nbChan = p_inc / sampleSize; // number of I/Q channels
qDebug("PlutoSDRMOThread::run: nbChan: %d", nbChan);
qDebug("PlutoSDRMOThread::run: I+Q bytes %d", sampleSize);
qDebug("PlutoSDRMIThread::run: rxBufferStep: %ld bytes", p_inc);
qDebug("PlutoSDRMIThread::run: Rx sample size is %ld bytes", m_plutoBox->getRxSampleSize()); // couple of I/Q
qDebug("PlutoSDRMIThread::run: Tx sample size is %ld bytes", m_plutoBox->getTxSampleSize());
qDebug("PlutoSDRMIThread::run: Rx all samples size is %ld bytes", m_plutoBox->getRxSampleSize());
qDebug("PlutoSDRMIThread::run: Tx all samples size is %ld bytes", m_plutoBox->getTxSampleSize());
qDebug("PlutoSDRMIThread::run: nominal nbytes_rx is %ld bytes with 1 refill", m_plutoSDRBlockSizeSamples*p_inc);
m_running = true;
@@ -86,13 +86,14 @@ int PlutoSDRMOThread::getFcPos() const
void PlutoSDRMOThread::run()
{
std::ptrdiff_t p_inc = m_plutoBox->txBufferStep();
int sampleSize = 4; // I/Q sample size in bytes
int sampleSize = 2*m_plutoBox->getTxSampleBytes(); // I/Q sample size in bytes
int nbChan = p_inc / sampleSize; // number of I/Q channels
qDebug("PlutoSDRMOThread::run: nbChan: %d", nbChan);
qDebug("PlutoSDRMOThread::run: I+Q bytes %d", sampleSize);
qDebug("PlutoSDRMOThread::run: txBufferStep: %ld bytes", p_inc);
qDebug("PlutoSDRMOThread::run: Rx sample size is %ld bytes", m_plutoBox->getRxSampleSize()); // couple of I/Q
qDebug("PlutoSDRMOThread::run: Tx sample size is %ld bytes", m_plutoBox->getTxSampleSize());
qDebug("PlutoSDRMOThread::run: Rx all samples size is %ld bytes", m_plutoBox->getRxSampleSize());
qDebug("PlutoSDRMOThread::run: Tx all samples size is %ld bytes", m_plutoBox->getTxSampleSize());
qDebug("PlutoSDRMOThread::run: nominal nbytes_tx is %ld bytes", PlutoSDRMIMOSettings::m_plutoSDRBlockSizeSamples*p_inc);
m_running = true;
@@ -126,7 +127,7 @@ void PlutoSDRMOThread::run()
// Schedule TX buffer for sending
nbytes_tx = m_plutoBox->txBufferPush();
if (nbytes_tx != sampleSize*PlutoSDRMIMOSettings::m_plutoSDRBlockSizeSamples)
if (nbytes_tx != nbChan*sampleSize*PlutoSDRMIMOSettings::m_plutoSDRBlockSizeSamples)
{
qDebug("PlutoSDRMOThread::run: error pushing buf %d / %d",
(int) nbytes_tx, (int) sampleSize*PlutoSDRMIMOSettings::m_plutoSDRBlockSizeSamples);