mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-09 10:17:47 -04:00
Standardize all output sinks to the same ready/running/error color status
This commit is contained in:
parent
34b1910cd0
commit
5e62da4437
@ -342,10 +342,10 @@ void BladerfOutputGui::updateStatus()
|
|||||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||||
break;
|
break;
|
||||||
case DSPDeviceSinkEngine::StRunning:
|
case DSPDeviceSinkEngine::StRunning:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||||
break;
|
break;
|
||||||
case DSPDeviceSinkEngine::StError:
|
case DSPDeviceSinkEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : magenta; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||||
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
|
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -227,10 +227,10 @@ void FileSinkGui::updateStatus()
|
|||||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||||
break;
|
break;
|
||||||
case DSPDeviceSinkEngine::StRunning:
|
case DSPDeviceSinkEngine::StRunning:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||||
break;
|
break;
|
||||||
case DSPDeviceSinkEngine::StError:
|
case DSPDeviceSinkEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : magenta; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||||
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
|
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -305,10 +305,10 @@ void HackRFOutputGui::updateStatus()
|
|||||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||||
break;
|
break;
|
||||||
case DSPDeviceSinkEngine::StRunning:
|
case DSPDeviceSinkEngine::StRunning:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||||
break;
|
break;
|
||||||
case DSPDeviceSinkEngine::StError:
|
case DSPDeviceSinkEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : magenta; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||||
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
|
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -60,6 +60,10 @@ SDRdaemonSinkGui::SDRdaemonSinkGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
|||||||
nn_setsockopt (m_nnSender, NN_SOL_SOCKET, NN_SNDTIMEO, &millis, sizeof (millis));
|
nn_setsockopt (m_nnSender, NN_SOL_SOCKET, NN_SNDTIMEO, &millis, sizeof (millis));
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
|
|
||||||
|
m_paletteGreenText.setColor(QPalette::WindowText, Qt::green);
|
||||||
|
m_paletteRedText.setColor(QPalette::WindowText, Qt::red);
|
||||||
|
m_paletteWhiteText.setColor(QPalette::WindowText, Qt::white);
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||||
@ -354,10 +358,10 @@ void SDRdaemonSinkGui::updateStatus()
|
|||||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||||
break;
|
break;
|
||||||
case DSPDeviceSinkEngine::StRunning:
|
case DSPDeviceSinkEngine::StRunning:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||||
break;
|
break;
|
||||||
case DSPDeviceSinkEngine::StError:
|
case DSPDeviceSinkEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : magenta; }");
|
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||||
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
|
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -536,9 +540,11 @@ void SDRdaemonSinkGui::tick()
|
|||||||
if ((len > 0) && msgBuf)
|
if ((len > 0) && msgBuf)
|
||||||
{
|
{
|
||||||
std::string msg((char *) msgBuf, len);
|
std::string msg((char *) msgBuf, len);
|
||||||
|
//qDebug("SDRdaemonSinkGui::tick: %s", msg.c_str());
|
||||||
std::vector<std::string> strs;
|
std::vector<std::string> strs;
|
||||||
boost::split(strs, msg, boost::is_any_of(":"));
|
boost::split(strs, msg, boost::is_any_of(":"));
|
||||||
unsigned int nbTokens = strs.size();
|
unsigned int nbTokens = strs.size();
|
||||||
|
unsigned int status = 0;
|
||||||
|
|
||||||
if (nbTokens > 0) // at least the queue length is given
|
if (nbTokens > 0) // at least the queue length is given
|
||||||
{
|
{
|
||||||
@ -583,9 +589,26 @@ void SDRdaemonSinkGui::tick()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbTokens > 1) // the quality indicator is given also
|
if (nbTokens > 1) // the quality status is given also
|
||||||
{
|
{
|
||||||
ui->qualityStatusText->setText(QString::fromStdString(strs[1]));
|
if (strs[1] == "2") {
|
||||||
|
status = 2;
|
||||||
|
} else if (strs[1] == "1") {
|
||||||
|
status = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nbTokens > 2) // the quality indicator message is given also
|
||||||
|
{
|
||||||
|
ui->qualityStatusText->setText(QString::fromStdString(strs[2]));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status == 2) { // all OK
|
||||||
|
ui->allFramesDecoded->setStyleSheet("QToolButton { background-color : green; }");
|
||||||
|
} else if (status == 1) { // unrecoverable errors
|
||||||
|
ui->allFramesDecoded->setStyleSheet("QToolButton { background-color : red; }");
|
||||||
|
} else { // recoverable errors or unknown status
|
||||||
|
ui->allFramesDecoded->setStyleSheet("QToolButton { background:rgb(56,56,56); }");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,10 @@ private:
|
|||||||
|
|
||||||
int m_nnSender;
|
int m_nnSender;
|
||||||
|
|
||||||
|
QPalette m_paletteGreenText;
|
||||||
|
QPalette m_paletteRedText;
|
||||||
|
QPalette m_paletteWhiteText;
|
||||||
|
|
||||||
void blockApplySettings(bool block);
|
void blockApplySettings(bool block);
|
||||||
void displaySettings();
|
void displaySettings();
|
||||||
void displayTime();
|
void displayTime();
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>372</width>
|
<width>380</width>
|
||||||
<height>217</height>
|
<height>217</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>372</width>
|
<width>380</width>
|
||||||
<height>190</height>
|
<height>190</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -419,9 +419,19 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="qualityStatusLabel">
|
<widget class="QToolButton" name="allFramesDecoded">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Frames status: green = all original received, none = some recovered by FEC, red = some lost</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Q:</string>
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../sdrbase/resources/res.qrc">
|
||||||
|
<normaloff>:/locked.png</normaloff>:/locked.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -429,15 +439,73 @@
|
|||||||
<widget class="QLabel" name="qualityStatusText">
|
<widget class="QLabel" name="qualityStatusText">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>80</width>
|
<width>50</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Transmitter average number of blocks received / average number of blocks used for recovery</string>
|
<string>Tx status since last poll: minimum of blocks received / maximum number of blocks used for recovery</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>100.0/100.0</string>
|
<string>100/100</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="eventCountsReset">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>22</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Event counts reset</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>0</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="eventUnrecText">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>18</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Number of uncrecoverable errors since event counts reset</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>00</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="eventRecText">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>18</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Number of correctable errors since event counts reset</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>00</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="eventCountsTimeText">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Time since last event counts reset</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>00:00:00</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user