1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

SDRdaemonFEC: implemented set number of FEC blocks button

This commit is contained in:
f4exb 2017-06-09 00:21:05 +02:00
parent a144b200fc
commit 405d4a2daa
3 changed files with 57 additions and 6 deletions

View File

@ -314,10 +314,12 @@ void SDRdaemonFECGui::displaySettings()
ui->specificParms->setText(m_settings.m_specificParameters);
ui->specificParms->setCursorPosition(0);
ui->txDelayText->setText(tr("%1").arg(m_settings.m_txDelay*100));
ui->nbFECBlocks->setValue(m_settings.m_nbFECBlocks);
QString nstr = QString("%1").arg(m_settings.m_nbFECBlocks, 2, 10, QChar('0'));
ui->nbFECBlocksText->setText(nstr);
QString s0 = QString::number(128 + m_settings.m_nbFECBlocks, 'f', 0);
QString s1 = QString::number(m_settings.m_nbFECBlocks, 'f', 0);
ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s0).arg(s1));
ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s0).arg(nstr));
ui->address->setText(m_settings.m_address);
ui->dataPort->setText(tr("%1").arg(m_settings.m_dataPort));
@ -389,6 +391,13 @@ void SDRdaemonFECGui::sendControl(bool force)
nbArgs++;
}
if ((m_settings.m_nbFECBlocks != m_controlSettings.m_nbFECBlocks) || force)
{
if (nbArgs > 0) os << ",";
os << "fecblk=" << m_settings.m_nbFECBlocks;
nbArgs++;
}
if (m_txDelay != 0.0)
{
if (nbArgs > 0) os << ",";
@ -435,6 +444,7 @@ void SDRdaemonFECGui::sendControl(bool force)
m_controlSettings.m_sampleRate = m_settings.m_sampleRate;
m_controlSettings.m_log2Decim = m_settings.m_log2Decim;
m_controlSettings.m_fcPos = m_settings.m_fcPos;
m_controlSettings.m_nbFECBlocks = m_settings.m_nbFECBlocks;
m_controlSettings.m_specificParameters = m_settings.m_specificParameters;
}
@ -584,6 +594,14 @@ void SDRdaemonFECGui::on_txDelay_valueChanged(int value)
sendControl();
}
void SDRdaemonFECGui::on_nbFECBlocks_valueChanged(int value)
{
m_settings.m_nbFECBlocks = value;
QString nstr = QString("%1").arg(m_settings.m_nbFECBlocks, 2, 10, QChar('0'));
ui->nbFECBlocksText->setText(nstr);
sendControl();
}
void SDRdaemonFECGui::on_startStop_toggled(bool checked)
{
if (checked)
@ -703,11 +721,11 @@ void SDRdaemonFECGui::updateWithStreamTime()
s = QString::number(m_minNbBlocks, 'f', 0);
ui->minNbBlocksText->setText(tr("%1").arg(s));
s = QString::number(m_maxNbRecovery, 'f', 0);
s = QString("%1").arg(m_maxNbRecovery, 2, 10, QChar('0'));
ui->maxNbRecoveryText->setText(tr("%1").arg(s));
s = QString::number(m_nbOriginalBlocks + m_nbFECBlocks, 'f', 0);
QString s1 = QString::number(m_nbFECBlocks, 'f', 0);
QString s1 = QString("%1").arg(m_nbFECBlocks, 2, 10, QChar('0'));
ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s).arg(s1));
if (updateEventCounts)

View File

@ -139,6 +139,7 @@ private slots:
void on_record_toggled(bool checked);
void on_eventCountsReset_clicked(bool checked);
void on_txDelay_valueChanged(int value);
void on_nbFECBlocks_valueChanged(int value);
void updateHardware();
void updateStatus();
void tick();

View File

@ -373,11 +373,43 @@
</item>
<item>
<layout class="QHBoxLayout" name="streamLayout">
<item>
<widget class="QDial" name="nbFECBlocks">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximum">
<number>64</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="nbFECBlocksText">
<property name="minimumSize">
<size>
<width>18</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Given number of FEC blocks per frame</string>
</property>
<property name="text">
<string>00</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="nominalNbBlocksText">
<property name="minimumSize">
<size>
<width>52</width>
<width>48</width>
<height>0</height>
</size>
</property>
@ -385,7 +417,7 @@
<string>Nominal number of blocks per frame: Total/FEC</string>
</property>
<property name="text">
<string>000/000</string>
<string>000/00</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>