mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
SDRDaemonSink: GUI: completed status display
This commit is contained in:
parent
e20e14ac75
commit
829299cb74
@ -55,6 +55,9 @@ SDRdaemonSinkGui::SDRdaemonSinkGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
{
|
||||
m_countUnrecoverable = 0;
|
||||
m_countRecovered = 0;
|
||||
m_lastCountUnrecoverable = 0;
|
||||
m_lastCountRecovered = 0;
|
||||
m_resetCounts = true;
|
||||
|
||||
m_paletteGreenText.setColor(QPalette::WindowText, Qt::green);
|
||||
m_paletteRedText.setColor(QPalette::WindowText, Qt::red);
|
||||
@ -68,6 +71,8 @@ SDRdaemonSinkGui::SDRdaemonSinkGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
|
||||
ui->sampleRate->setValueRange(7, 32000U, 9000000U);
|
||||
|
||||
ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
||||
|
||||
connect(&(m_deviceUISet->m_deviceSinkAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
|
||||
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
||||
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||
@ -428,6 +433,23 @@ void SDRdaemonSinkGui::displayEventCounts()
|
||||
ui->eventRecText->setText(nstr);
|
||||
}
|
||||
|
||||
void SDRdaemonSinkGui::displayEventStatus(int recoverableCount, int unrecoverableCount)
|
||||
{
|
||||
|
||||
if (unrecoverableCount == 0)
|
||||
{
|
||||
if (recoverableCount == 0) {
|
||||
ui->allFramesDecoded->setStyleSheet("QToolButton { background-color : green; }");
|
||||
} else {
|
||||
ui->allFramesDecoded->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->allFramesDecoded->setStyleSheet("QToolButton { background-color : red; }");
|
||||
}
|
||||
}
|
||||
|
||||
void SDRdaemonSinkGui::displayEventTimer()
|
||||
{
|
||||
int elapsedTimeMillis = m_time.elapsed();
|
||||
@ -473,6 +495,7 @@ void SDRdaemonSinkGui::networkManagerFinished(QNetworkReply *reply)
|
||||
{
|
||||
if (reply->error())
|
||||
{
|
||||
ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
||||
qDebug() << "SDRdaemonSinkGui::networkManagerFinished" << reply->errorString();
|
||||
return;
|
||||
}
|
||||
@ -487,16 +510,19 @@ void SDRdaemonSinkGui::networkManagerFinished(QNetworkReply *reply)
|
||||
|
||||
if (error.error == QJsonParseError::NoError)
|
||||
{
|
||||
ui->apiAddressLabel->setStyleSheet("QLabel { background-color : green; }");
|
||||
analyzeChannelReport(doc.object());
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
||||
QString errorMsg = QString("Reply JSON error: ") + error.errorString() + QString(" at offset ") + QString::number(error.offset);
|
||||
qDebug().noquote() << "SDRdaemonSinkGui::networkManagerFinished" << errorMsg;
|
||||
}
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
||||
QString errorMsg = QString("Error parsing request: ") + ex.what();
|
||||
qDebug().noquote() << "SDRdaemonSinkGui::networkManagerFinished" << errorMsg;
|
||||
}
|
||||
@ -513,5 +539,21 @@ void SDRdaemonSinkGui::analyzeChannelReport(const QJsonObject& jsonObject)
|
||||
QString queueLengthText = QString("%1/%2").arg(queueLength).arg(queueSize);
|
||||
ui->queueLengthText->setText(queueLengthText);
|
||||
ui->queueLengthGauge->setValue((queueLength*100)/queueSize);
|
||||
int unrecoverableCount = report["uncorrectableErrorsCount"].toInt();
|
||||
int recoverableCount = report["correctableErrorsCount"].toInt();
|
||||
|
||||
if (!m_resetCounts)
|
||||
{
|
||||
int recoverableCountDelta = recoverableCount - m_lastCountRecovered;
|
||||
int unrecoverableCountDelta = unrecoverableCount - m_lastCountUnrecoverable;
|
||||
displayEventStatus(recoverableCountDelta, unrecoverableCountDelta);
|
||||
m_countRecovered += recoverableCountDelta;
|
||||
m_countUnrecoverable += unrecoverableCountDelta;
|
||||
displayEventCounts();
|
||||
}
|
||||
|
||||
m_resetCounts = false;
|
||||
m_lastCountRecovered = recoverableCount;
|
||||
m_lastCountUnrecoverable = unrecoverableCount;
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +79,9 @@ private:
|
||||
|
||||
uint32_t m_countUnrecoverable;
|
||||
uint32_t m_countRecovered;
|
||||
uint32_t m_lastCountUnrecoverable;
|
||||
uint32_t m_lastCountRecovered;
|
||||
bool m_resetCounts;
|
||||
QTime m_time;
|
||||
|
||||
QPalette m_paletteGreenText;
|
||||
@ -99,6 +102,7 @@ private:
|
||||
void updateSampleRateAndFrequency();
|
||||
void updateTxDelayTooltip();
|
||||
void displayEventCounts();
|
||||
void displayEventStatus(int recoverableCount, int unrecoverableCount);
|
||||
void displayEventTimer();
|
||||
void analyzeChannelReport(const QJsonObject& jsonObject);
|
||||
|
||||
|
@ -498,6 +498,9 @@
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Green if communication OK else KO</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>API</string>
|
||||
</property>
|
||||
|
Loading…
Reference in New Issue
Block a user