mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-07 16:34:45 -04:00
LimeSDR output: implemented antenna select
This commit is contained in:
@@ -688,6 +688,28 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_antennaPath != settings.m_antennaPath) || force)
|
||||
{
|
||||
m_settings.m_antennaPath = settings.m_antennaPath;
|
||||
|
||||
if (m_deviceShared.m_deviceParams->getDevice() != 0)
|
||||
{
|
||||
if (DeviceLimeSDR::setTxAntennaPath(m_deviceShared.m_deviceParams->getDevice(),
|
||||
m_deviceShared.m_channel,
|
||||
m_settings.m_antennaPath))
|
||||
{
|
||||
doCalibration = true;
|
||||
qDebug("LimeSDRInput::applySettings: set antenna path to %d",
|
||||
(int) m_settings.m_antennaPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical("LimeSDRInput::applySettings: could not set antenna path to %d",
|
||||
(int) m_settings.m_antennaPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_centerFrequency != settings.m_centerFrequency) || force)
|
||||
{
|
||||
m_settings.m_centerFrequency = settings.m_centerFrequency;
|
||||
|
||||
@@ -258,6 +258,8 @@ void LimeSDROutputGUI::displaySettings()
|
||||
ui->gain->setValue(m_settings.m_gain);
|
||||
ui->gainText->setText(tr("%1dB").arg(m_settings.m_gain));
|
||||
|
||||
ui->antenna->setCurrentIndex((int) m_settings.m_antennaPath);
|
||||
|
||||
setNCODisplay();
|
||||
}
|
||||
|
||||
@@ -426,3 +428,9 @@ void LimeSDROutputGUI::on_gain_valueChanged(int value)
|
||||
ui->gainText->setText(tr("%1dB").arg(m_settings.m_gain));
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void LimeSDROutputGUI::on_antenna_currentIndexChanged(int index)
|
||||
{
|
||||
m_settings.m_antennaPath = (LimeSDROutputSettings::PathRFE) index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ private slots:
|
||||
void on_lpFIREnable_toggled(bool checked);
|
||||
void on_lpFIR_changed(quint64 value);
|
||||
void on_gain_valueChanged(int value);
|
||||
void on_antenna_currentIndexChanged(int index);
|
||||
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
|
||||
@@ -612,6 +612,50 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="antennaLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../../../sdrbase/resources/res.qrc">:/antenna.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="antenna">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Antenna select: No: none, Lo: 30M:1.9G, Hi: 2:2.6G</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>No</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Lo</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Hi</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -35,6 +35,7 @@ void LimeSDROutputSettings::resetToDefaults()
|
||||
m_gain = 30;
|
||||
m_ncoEnable = false;
|
||||
m_ncoFrequency = 0;
|
||||
m_antennaPath = PATH_RFE_NONE;
|
||||
}
|
||||
|
||||
QByteArray LimeSDROutputSettings::serialize() const
|
||||
@@ -50,6 +51,7 @@ QByteArray LimeSDROutputSettings::serialize() const
|
||||
s.writeU32(10, m_gain);
|
||||
s.writeBool(11, m_ncoEnable);
|
||||
s.writeS32(12, m_ncoFrequency);
|
||||
s.writeS32(13, (int) m_antennaPath);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@@ -77,6 +79,8 @@ bool LimeSDROutputSettings::deserialize(const QByteArray& data)
|
||||
d.readU32(10, &m_gain, 0);
|
||||
d.readBool(11, &m_ncoEnable, false);
|
||||
d.readS32(12, &m_ncoFrequency, 0);
|
||||
d.readS32(13, &intval, 0);
|
||||
m_antennaPath = (PathRFE) intval;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,13 @@ struct LimeSDROutputSettings
|
||||
FC_POS_CENTER
|
||||
} fcPos_t;
|
||||
|
||||
enum PathRFE
|
||||
{
|
||||
PATH_RFE_NONE = 0,
|
||||
PATH_RFE_TXRF1,
|
||||
PATH_RFE_TXEF2
|
||||
};
|
||||
|
||||
// global settings to be saved
|
||||
uint64_t m_centerFrequency;
|
||||
int m_devSampleRate;
|
||||
@@ -44,6 +51,7 @@ struct LimeSDROutputSettings
|
||||
uint32_t m_gain; //!< Optimally distributed gain (dB)
|
||||
bool m_ncoEnable; //!< Enable TSP NCO and mixing
|
||||
int m_ncoFrequency; //!< Actual NCO frequency (the resulting frequency with mixing is displayed)
|
||||
PathRFE m_antennaPath;
|
||||
|
||||
LimeSDROutputSettings();
|
||||
void resetToDefaults();
|
||||
|
||||
Reference in New Issue
Block a user