1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

SDRdaemonFEC support: debug (4). Corrected buffer gauge display

This commit is contained in:
f4exb 2016-06-22 01:10:58 +02:00
parent a628357f76
commit cded6772ae
2 changed files with 6 additions and 12 deletions

View File

@ -123,18 +123,12 @@ public:
if (m_framesNbBytes) if (m_framesNbBytes)
{ {
int32_t val = (m_wrDeltaEstimate * 100) / (int32_t) m_framesNbBytes; int32_t val = (m_wrDeltaEstimate * 100) / (int32_t) m_framesNbBytes;
// conversion: [-100:-50[ : read leads (+) / [-50:0[ : read lags (-) / [0:50[ : read leads (+) / [50:100{ : read lags (-)
if (val < -50) { return val < 0 ? -val - 50 : 50 -val;
return val + 100; // read leads (positive)
} else if (val < 50) {
return val; // read leads (positive) or write leads (negative)
} else {
return val - 100; // write leads (negative)
}
} }
else else
{ {
return -50; // default position return 0; // default position
} }
} }

View File

@ -608,11 +608,11 @@ void SDRdaemonFECGui::updateWithStreamTime()
QString s = QString::number(m_bufferLengthInSecs, 'f', 1); QString s = QString::number(m_bufferLengthInSecs, 'f', 1);
ui->bufferLenSecsText->setText(tr("%1").arg(s)); ui->bufferLenSecsText->setText(tr("%1").arg(s));
s = QString::number((m_bufferGauge < 0 ? -50 - m_bufferGauge : 50 - m_bufferGauge), 'f', 0); s = QString::number(m_bufferGauge, 'f', 0);
ui->bufferRWBalanceText->setText(tr("%1").arg(s)); ui->bufferRWBalanceText->setText(tr("%1").arg(s));
ui->bufferGaugeNegative->setValue((m_bufferGauge < 0 ? 50 + m_bufferGauge : 0)); ui->bufferGaugeNegative->setValue((m_bufferGauge < 0 ? -m_bufferGauge : 0));
ui->bufferGaugePositive->setValue((m_bufferGauge < 0 ? 0 : 50 - m_bufferGauge)); ui->bufferGaugePositive->setValue((m_bufferGauge < 0 ? 0 : m_bufferGauge));
s = QString::number(m_curNbBlocks, 'f', 0); s = QString::number(m_curNbBlocks, 'f', 0);
ui->avgNbBlocksText->setText(tr("%1").arg(s)); ui->avgNbBlocksText->setText(tr("%1").arg(s));