LimeSDR input: status bar updated

This commit is contained in:
f4exb 2017-04-19 22:43:18 +02:00
parent db67e07ab9
commit 2c5ea336da
4 changed files with 107 additions and 17 deletions

View File

@ -358,7 +358,7 @@ bool LimeSDRInput::handleMessage(const Message& message)
}
else
{
qDebug() << "LimeSDRInput::handleMessage: got stream status at %llu" << status.timestamp
qDebug() << "LimeSDRInput::handleMessage: got stream status at: " << status.timestamp
<< " fifoFilledCount: " << status.fifoFilledCount
<< " fifoSize: " << status.fifoSize
<< " underrun: " << status.underrun

View File

@ -128,6 +128,7 @@ public:
uint64_t getTimestamp() const { return m_timestamp; }
static MsgReportStreamInfo* create(
bool success,
bool active,
uint32_t fifoFilledCount,
uint32_t fifoSize,
@ -140,6 +141,7 @@ public:
)
{
return new MsgReportStreamInfo(
success,
active,
fifoFilledCount,
fifoSize,

View File

@ -186,21 +186,34 @@ void LimeSDRInputGUI::handleMessagesToGUI()
if (report->getSuccess())
{
if (report->getActive())
{
ui->streamStatusLabel->setStyleSheet("QLabel { background-color : green; }");
}
else
{
ui->streamStatusLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
ui->streamStatusLabel->setStyleSheet("QLabel { background-color : green; }");
ui->streamLinkRateText->setText(tr("%1 MB/s").arg(QString::number(report->getLinkRate() / 1000000.0f, 'f', 3)));
if (report->getUnderrun() > 0) {
ui->underrunLabel->setStyleSheet("QLabel { background-color : red; }");
} else {
ui->underrunLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
}
ui->streamSampleRateText->setText(tr("%1kS").arg(QString::number(report->getSampleRate() / 1000.0f, 'f', 0)));
ui->streamLinkRateText->setText(tr("%1kB").arg(QString::number(report->getLinkRate() / 1000.0f, 'f', 0)));
if (report->getOverrun() > 0) {
ui->overrunLabel->setStyleSheet("QLabel { background-color : red; }");
} else {
ui->overrunLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
}
if (report->getDroppedPackets() > 0) {
ui->droppedLabel->setStyleSheet("QLabel { background-color : red; }");
} else {
ui->droppedLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
}
ui->fifoBar->setMaximum(report->getFifoSize());
ui->fifoBar->setValue(report->getFifoFilledCount());
ui->fifoBar->setToolTip(tr("FIFO fill %1/%2 bytes").arg(QString::number(report->getFifoFilledCount())).arg(QString::number(report->getFifoSize())));
}
else
{
ui->streamStatusLabel->setStyleSheet("QLabel { background-color : red; }");
ui->streamStatusLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
}
}
}

View File

@ -628,18 +628,68 @@
</widget>
</item>
<item>
<widget class="QLabel" name="streamSampleRateText">
<widget class="QLabel" name="underrunLabel">
<property name="minimumSize">
<size>
<width>50</width>
<width>12</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Red if underruns</string>
</property>
<property name="styleSheet">
<string notr="true">background:rgb(79,79,79);</string>
</property>
<property name="text">
<string>00000kS</string>
<string>U</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="overrunLabel">
<property name="minimumSize">
<size>
<width>12</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Red if overruns</string>
</property>
<property name="styleSheet">
<string notr="true">background:rgb(79,79,79);</string>
</property>
<property name="text">
<string>O</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="droppedLabel">
<property name="minimumSize">
<size>
<width>12</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Red if dropped packets</string>
</property>
<property name="styleSheet">
<string notr="true">background:rgb(79,79,79);</string>
</property>
<property name="text">
<string>D</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
@ -647,18 +697,43 @@
<widget class="QLabel" name="streamLinkRateText">
<property name="minimumSize">
<size>
<width>50</width>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Stream link rate (MB/s)</string>
</property>
<property name="text">
<string>00000kB</string>
<string>000.000 MB/s</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="fifoBar">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>15</height>
</size>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">border: 2px solid rgb(79, 79, 79);
text-align: center;</string>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">