mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 06:04:39 -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:
@@ -61,6 +61,9 @@ USRPInputGUI::USRPInputGUI(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_usrpInput->getLPRange(minF, maxF);
|
||||
ui->lpf->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
|
||||
ui->lpf->setValueRange(5, (minF/1000)+1, maxF/1000);
|
||||
@@ -164,6 +167,7 @@ bool USRPInputGUI::handleMessage(const Message& message)
|
||||
|
||||
if (report.getRxElseTx()) {
|
||||
m_settings.m_centerFrequency = report.getCenterFrequency();
|
||||
m_settings.m_loOffset = report.getLOOffset();
|
||||
}
|
||||
|
||||
blockApplySettings(true);
|
||||
@@ -174,7 +178,7 @@ bool USRPInputGUI::handleMessage(const Message& message)
|
||||
}
|
||||
else if (DeviceUSRPShared::MsgReportClockSourceChange::match(message))
|
||||
{
|
||||
qDebug("USRPInputGUI::handleMessage MsgReportClockSourceChange");
|
||||
qDebug("USRPInputGUI::handleMessage MsgReportClockSourceChange");
|
||||
DeviceUSRPShared::MsgReportClockSourceChange& report = (DeviceUSRPShared::MsgReportClockSourceChange&) message;
|
||||
m_settings.m_clockSource = report.getClockSource();
|
||||
|
||||
@@ -289,6 +293,8 @@ void USRPInputGUI::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 USRPInputGUI::updateSampleRateAndFrequency()
|
||||
@@ -350,6 +356,7 @@ void USRPInputGUI::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("%1").arg(m_settings.m_gain));
|
||||
@@ -527,6 +534,12 @@ void USRPInputGUI::on_lpf_changed(quint64 value)
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void USRPInputGUI::on_loOffset_changed(qint64 value)
|
||||
{
|
||||
m_settings.m_loOffset = value * 1000;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void USRPInputGUI::on_gainMode_currentIndexChanged(int index)
|
||||
{
|
||||
m_settings.m_gainMode = (USRPInputSettings::GainMode) index;
|
||||
|
||||
Reference in New Issue
Block a user