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

SpectrumVis and DeviceUISet: add possibility to change spectrum scaling factor for Rx/Tx same spectrum commutation (MIMO)

This commit is contained in:
f4exb
2019-10-26 22:30:53 +02:00
parent 8412260d5a
commit 31a7a0fdde
4 changed files with 43 additions and 0 deletions
+19
View File
@@ -13,6 +13,7 @@ inline double log2f(double n)
#endif
MESSAGE_CLASS_DEFINITION(SpectrumVis::MsgConfigureSpectrumVis, Message)
MESSAGE_CLASS_DEFINITION(SpectrumVis::MsgConfigureScalingFactor, Message)
const Real SpectrumVis::m_mult = (10.0f / log2f(10.0f));
@@ -53,6 +54,12 @@ void SpectrumVis::configure(MessageQueue* msgQueue,
msgQueue->push(cmd);
}
void SpectrumVis::setScalef(MessageQueue* msgQueue, Real scalef)
{
MsgConfigureScalingFactor* cmd = new MsgConfigureScalingFactor(scalef);
getInputMessageQueue()->push(cmd);
}
void SpectrumVis::feedTriggered(const SampleVector::const_iterator& triggerPoint, const SampleVector::const_iterator& end, bool positiveOnly)
{
feed(triggerPoint, end, positiveOnly); // normal feed from trigger point
@@ -322,6 +329,12 @@ bool SpectrumVis::handleMessage(const Message& message)
conf.getLinear());
return true;
}
else if (MsgConfigureScalingFactor::match(message))
{
MsgConfigureScalingFactor& conf = (MsgConfigureScalingFactor&) message;
handleScalef(conf.getScalef());
return true;
}
else
{
return false;
@@ -376,3 +389,9 @@ void SpectrumVis::handleConfigure(int fftSize,
m_ofs = 20.0f * log10f(1.0f / m_fftSize);
m_powFFTDiv = m_fftSize*m_fftSize;
}
void SpectrumVis::handleScalef(Real scalef)
{
QMutexLocker mutexLocker(&m_mutex);
m_scalef = scalef;
}