mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05: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; }");
|
||||
break;
|
||||
case DSPDeviceSinkEngine::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
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());
|
||||
break;
|
||||
default:
|
||||
|
@ -227,10 +227,10 @@ void FileSinkGui::updateStatus()
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSinkEngine::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
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());
|
||||
break;
|
||||
default:
|
||||
|
@ -305,10 +305,10 @@ void HackRFOutputGui::updateStatus()
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSinkEngine::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
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());
|
||||
break;
|
||||
default:
|
||||
|
@ -60,7 +60,11 @@ SDRdaemonSinkGui::SDRdaemonSinkGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
||||
nn_setsockopt (m_nnSender, NN_SOL_SOCKET, NN_SNDTIMEO, &millis, sizeof (millis));
|
||||
assert (rc == 0);
|
||||
|
||||
ui->setupUi(this);
|
||||
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->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->centerFrequency->setValueRange(7, 0, pow(10,7));
|
||||
@ -354,10 +358,10 @@ void SDRdaemonSinkGui::updateStatus()
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSinkEngine::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
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());
|
||||
break;
|
||||
default:
|
||||
@ -536,9 +540,11 @@ void SDRdaemonSinkGui::tick()
|
||||
if ((len > 0) && msgBuf)
|
||||
{
|
||||
std::string msg((char *) msgBuf, len);
|
||||
//qDebug("SDRdaemonSinkGui::tick: %s", msg.c_str());
|
||||
std::vector<std::string> strs;
|
||||
boost::split(strs, msg, boost::is_any_of(":"));
|
||||
unsigned int nbTokens = strs.size();
|
||||
unsigned int status = 0;
|
||||
|
||||
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;
|
||||
|
||||
QPalette m_paletteGreenText;
|
||||
QPalette m_paletteRedText;
|
||||
QPalette m_paletteWhiteText;
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
void displaySettings();
|
||||
void displayTime();
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>372</width>
|
||||
<width>380</width>
|
||||
<height>217</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -18,7 +18,7 @@
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>372</width>
|
||||
<width>380</width>
|
||||
<height>190</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -419,9 +419,19 @@
|
||||
</widget>
|
||||
</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">
|
||||
<string>Q:</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrbase/resources/res.qrc">
|
||||
<normaloff>:/locked.png</normaloff>:/locked.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -429,15 +439,73 @@
|
||||
<widget class="QLabel" name="qualityStatusText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<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 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>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user