Skip to content

Commit

Permalink
Highlight unstable sources in universe view
Browse files Browse the repository at this point in the history
Expands 88aa47a with #242
  • Loading branch information
marcusbirkin committed Dec 18, 2021
1 parent ebcf667 commit 0c56412
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/sacn/sacnlistener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ void sACNListener::checkSourceExpiration()
if((*it)->active.Expired() && (*it)->priority_wait.Expired())
{
(*it)->src_valid = false;
(*it)->src_stable = false;
CID::CIDIntoString((*it)->src_cid, cidstr);
emit sourceLost(*it);
m_mergeAll = true;
Expand Down Expand Up @@ -439,6 +440,7 @@ void sACNListener::processDatagram(QByteArray data, QHostAddress destination, QH
ps->lastseq = sequence;
ps->src_cid = source_cid;
ps->src_valid = true;
ps->src_stable = true;
ps->doing_dmx = (start_code == STARTCODE_DMX);
//If we are in the sampling period, let all packets through
if(m_isSampling)
Expand Down
1 change: 1 addition & 0 deletions src/sacn/streamingacn.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class sACNSource : public QObject
explicit sACNSource();
CID src_cid;
bool src_valid;
bool src_stable;
quint8 lastseq;
ttimer active; //If this expires, we haven't received any data in over a second
//The per-channel priority alternate start code policy requires we detect the source only after
Expand Down
9 changes: 7 additions & 2 deletions src/ui/universeview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,13 @@ void UniverseView::sourceChanged(sACNSource *source)

if (source->src_valid) {
if (source->doing_dmx) {
ui->twSources->item(row,COL_ONLINE)->setBackground(Qt::green);
ui->twSources->item(row,COL_ONLINE)->setText(tr("Online"));
if (source->src_stable) {
ui->twSources->item(row,COL_ONLINE)->setBackground(Qt::green);
ui->twSources->item(row,COL_ONLINE)->setText(tr("Online"));
} else {
ui->twSources->item(row,COL_ONLINE)->setBackground(Qt::yellow);
ui->twSources->item(row,COL_ONLINE)->setText(tr("Online (Unstable)"));
}
} else {
ui->twSources->item(row,COL_ONLINE)->setBackground(Qt::yellow);
ui->twSources->item(row,COL_ONLINE)->setText(tr("No DMX"));
Expand Down

0 comments on commit 0c56412

Please sign in to comment.