diff options
| author | Christoph Berg <myon@debian.org> | 2026-10-09 14:12:35 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-10-09 14:12:35 +0200 |
| commit | ffc62c792c9a5196cb4ce7a353287dfe20db6524 (patch) | |
| tree | 1269efa852935b183daae4bb33a58d1b4d2ffb53 /map65/widegraph.cpp | |
| parent | 059831534c7e884f0a607ed86b582fd00d821731 (diff) | |
New upstream version 3.3.0~beta1+dfsgupstream/3.3.0_beta1+dfsg
Diffstat (limited to 'map65/widegraph.cpp')
| -rw-r--r-- | map65/widegraph.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/map65/widegraph.cpp b/map65/widegraph.cpp index ff3650b0..fbdf048d 100644 --- a/map65/widegraph.cpp +++ b/map65/widegraph.cpp @@ -215,14 +215,15 @@ void WideGraph::saveSettings() void WideGraph::addDecodeLabel(double freq_khz, const QString& callsign, bool is_jt65, bool mode_reliable, - bool freq_reliable) + bool freq_reliable, int decode_utc) { if (callsign.isEmpty()) return; if (!m_decodeLabelsEnabled) return; const qint64 now = QDateTime::currentMSecsSinceEpoch(); for (auto& lab : m_decodeLabels) { if (lab.callsign == callsign) { - lab.last_seen_ms = now; + if (decode_utc < 0 || decode_utc != lab.last_utc) lab.last_seen_ms = now; + if (decode_utc >= 0) lab.last_utc = decode_utc; // Only overwrite freq when the caller has sub-kHz precision. // The "&" bandmap tap only has 3-char integer-kHz precision // (display.f90 cfreq0 is character(3) � no ndf field), so it @@ -230,24 +231,28 @@ void WideGraph::addDecodeLabel(double freq_khz, const QString& callsign, // includes ndf, leaving the tick up to ~500 Hz off the signal. if (freq_reliable) lab.freq_khz = freq_khz; // Only overwrite the mode flag when the caller knows for sure. - // The "&" bandmap-line tap has no cmode in its payload, so it - // would otherwise stomp on an authoritative JT65 mark from the - // "!" decoder tap and flip the label color. + // An "&" bandmap line without the mode character would otherwise + // stomp on an authoritative JT65 mark from the "!" decoder tap and + // flip the label color. if (mode_reliable) lab.is_jt65 = is_jt65; ++lab.hits; if (ui && ui->widePlot) ui->widePlot->setDecodeLabels(m_decodeLabels); return; } } + if (decode_utc >= 0 && m_expiredLabelUtc.value(callsign, -1) == decode_utc) return; + m_expiredLabelUtc.remove(callsign); if (m_decodeLabels.size() >= kDecodeLabelMax) { m_decodeLabels.removeFirst(); } m_decodeLabels.append(DecodeLabel{freq_khz, callsign, now, 1, is_jt65}); + m_decodeLabels.last().last_utc = decode_utc; if (ui && ui->widePlot) ui->widePlot->setDecodeLabels(m_decodeLabels); } void WideGraph::clearDecodeLabels() { + m_expiredLabelUtc.clear(); if (m_decodeLabels.isEmpty()) return; m_decodeLabels.clear(); if (ui && ui->widePlot) ui->widePlot->setDecodeLabels(m_decodeLabels); @@ -260,6 +265,10 @@ void WideGraph::ageDecodeLabels() const qint64 ttl_ms = static_cast<qint64>(trp * m_decodeLabelPeriods * 1000.0); const qint64 cutoff = QDateTime::currentMSecsSinceEpoch() - ttl_ms; const int before = m_decodeLabels.size(); + for (const auto& l : m_decodeLabels) { + if (l.last_seen_ms < cutoff && l.last_utc >= 0) + m_expiredLabelUtc.insert(l.callsign, l.last_utc); + } m_decodeLabels.erase( std::remove_if(m_decodeLabels.begin(), m_decodeLabels.end(), [cutoff](const DecodeLabel& l) { @@ -277,6 +286,7 @@ void WideGraph::setDecodeLabelsEnabled(bool on) m_decodeLabelsEnabled = on; if (!on) { m_decodeLabels.clear(); + m_expiredLabelUtc.clear(); if (ui && ui->widePlot) ui->widePlot->setDecodeLabels(m_decodeLabels); } // Persist immediately so the choice survives a crash before saveSettings runs. |
