mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
Import USRP support.
Add LO offset support. Only set tx/rx_bandwidth after getting tx stream, to reduce TX LO leakage for <10MHz bandwidths. Check for reference and LO lock before getting streams.
This commit is contained in:
@@ -57,6 +57,9 @@ USRPOutputGUI::USRPOutputGUI(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
|
||||
ui->sampleRate->setValueRange(8, (uint32_t) minF, (uint32_t) maxF);
|
||||
|
||||
ui->loOffset->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
|
||||
ui->loOffset->setValueRange(false, 5, (int32_t)-maxF/2/1000, (int32_t)maxF/2/1000); // LO offset shouldn't be greater than half the sample rate
|
||||
|
||||
m_usrpOutput->getLPRange(minF, maxF);
|
||||
ui->lpf->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
|
||||
ui->lpf->setValueRange(5, (minF/1000)+1, maxF/1000);
|
||||
@@ -181,6 +184,7 @@ bool USRPOutputGUI::handleMessage(const Message& message)
|
||||
|
||||
if (!report.getRxElseTx()) {
|
||||
m_settings.m_centerFrequency = report.getCenterFrequency();
|
||||
m_settings.m_loOffset = report.getLOOffset();
|
||||
}
|
||||
|
||||
blockApplySettings(true);
|
||||
@@ -293,6 +297,8 @@ void USRPOutputGUI::updateSampleRate()
|
||||
} else {
|
||||
ui->sampleRateLabel->setText(tr("%1M").arg(QString::number(sr / 1000000.0f, 'g', 5)));
|
||||
}
|
||||
// LO offset shouldn't be greater than half the sample rate
|
||||
ui->loOffset->setValueRange(false, 5, -(int32_t)sr/2/1000, (int32_t)sr/2/1000);
|
||||
}
|
||||
|
||||
void USRPOutputGUI::displaySampleRate()
|
||||
@@ -343,6 +349,7 @@ void USRPOutputGUI::displaySettings()
|
||||
updateSampleRate();
|
||||
|
||||
ui->lpf->setValue(m_settings.m_lpfBW / 1000);
|
||||
ui->loOffset->setValue(m_settings.m_loOffset / 1000);
|
||||
|
||||
ui->gain->setValue(m_settings.m_gain);
|
||||
ui->gainText->setText(tr("%1dB").arg(m_settings.m_gain));
|
||||
@@ -497,6 +504,12 @@ void USRPOutputGUI::on_lpf_changed(quint64 value)
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void USRPOutputGUI::on_loOffset_changed(qint64 value)
|
||||
{
|
||||
m_settings.m_loOffset = value * 1000;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void USRPOutputGUI::on_gain_valueChanged(int value)
|
||||
{
|
||||
m_settings.m_gain = value;
|
||||
|
||||
Reference in New Issue
Block a user