SDRdaemonSink: GUI: display queue length and quality metrics received from remote Tx

pull/60/head
f4exb 2017-06-04 11:43:26 +02:00
rodzic 7b63657fb7
commit 5b48a3f4a9
2 zmienionych plików z 79 dodań i 24 usunięć

Wyświetl plik

@ -22,6 +22,8 @@
#include <QFileDialog>
#include <QMessageBox>
#include <boost/algorithm/string.hpp>
#include <nanomsg/nn.h>
#include <nanomsg/pair.h>
@ -532,7 +534,19 @@ void SDRdaemonSinkGui::tick()
if ((len > 0) && msgBuf)
{
std::string msg((char *) msgBuf, len);
qDebug("SDRdaemonSinkGui::tick: received NN msg: %s", msg.c_str());
std::vector<std::string> strs;
boost::split(strs, msg, boost::is_any_of(":"));
unsigned int nbTokens = strs.size();
if (nbTokens > 0) // at least the queue length is given
{
ui->queueLengthText->setText(QString::fromStdString(strs[0]));
}
if (nbTokens > 1) // the quality indicator is given also
{
ui->qualityStatusText->setText(QString::fromStdString(strs[1]));
}
}
}
}

Wyświetl plik

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>372</width>
<height>190</height>
<height>217</height>
</rect>
</property>
<property name="sizePolicy">
@ -378,6 +378,69 @@
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="queueLengthLabel">
<property name="text">
<string>QL:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="queueLengthText">
<property name="minimumSize">
<size>
<width>18</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Current transmitter queue length in number of vectors</string>
</property>
<property name="text">
<string>00</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="qualityStatusLabel">
<property name="text">
<string>Q:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="qualityStatusText">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Average number of blocks received / Average number of blocks used for recovery</string>
</property>
<property name="text">
<string>100.0/100.0</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
@ -391,28 +454,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="absTimeText">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Record time from start</string>
</property>
<property name="text">
<string>2015-01-01 00:00:00.000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>