1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-18 22:31:48 -05:00

DSD demod plugin: slow down channel power refresh rate

This commit is contained in:
f4exb 2017-08-17 17:48:47 +02:00
parent 05e52edd1e
commit 315d408eee
2 changed files with 7 additions and 15 deletions

View File

@ -308,7 +308,6 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
m_slot2On(false), m_slot2On(false),
m_tdmaStereo(false), m_tdmaStereo(false),
m_squelchOpen(false), m_squelchOpen(false),
m_channelPowerDbAvg(20,0),
m_tickCount(0) m_tickCount(0)
{ {
ui->setupUi(this); ui->setupUi(this);
@ -594,11 +593,9 @@ void DSDDemodGUI::tick()
(100.0f + powDbPeak) / 100.0f, (100.0f + powDbPeak) / 100.0f,
nbMagsqSamples); nbMagsqSamples);
if (m_tickCount % 4 == 0) {
ui->channelPower->setText(tr("%1 dB").arg(powDbAvg, 0, 'f', 1)); ui->channelPower->setText(tr("%1 dB").arg(powDbAvg, 0, 'f', 1));
}
// Real powDb = CalcDb::dbPower(m_dsdDemod->getMagSq());
// m_channelPowerDbAvg.feed(powDb);
// ui->channelPower->setText(QString::number(m_channelPowerDbAvg.average(), 'f', 1));
bool squelchOpen = m_dsdDemod->getSquelchOpen(); bool squelchOpen = m_dsdDemod->getSquelchOpen();
@ -615,11 +612,7 @@ void DSDDemodGUI::tick()
// "slow" updates // "slow" updates
if (m_tickCount < 10) if (m_tickCount % 10 == 0)
{
m_tickCount++;
}
else
{ {
ui->inLevelText->setText(QString::number(m_dsdDemod->getDecoder().getInLevel())); ui->inLevelText->setText(QString::number(m_dsdDemod->getDecoder().getInLevel()));
ui->inCarrierPosText->setText(QString::number(m_dsdDemod->getDecoder().getCarrierPos())); ui->inCarrierPosText->setText(QString::number(m_dsdDemod->getDecoder().getCarrierPos()));
@ -662,9 +655,9 @@ void DSDDemodGUI::tick()
} else { } else {
ui->symbolPLLLock->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); ui->symbolPLLLock->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
} }
m_tickCount = 0;
} }
m_tickCount++;
} }
unsigned int DSDDemodBaudRates::getRate(unsigned int rate_index) unsigned int DSDDemodBaudRates::getRate(unsigned int rate_index)

View File

@ -109,8 +109,7 @@ private:
bool m_tdmaStereo; bool m_tdmaStereo;
bool m_audioMute; bool m_audioMute;
bool m_squelchOpen; bool m_squelchOpen;
MovingAverage<double> m_channelPowerDbAvg; uint32_t m_tickCount;
int m_tickCount;
float m_myLatitude; float m_myLatitude;
float m_myLongitude; float m_myLongitude;