cabana: fixed the freq column for high-freq messages may be incorrectly displayed as a --. (#27940)

old-commit-hash: a324d79fa3529c00363fb8a5aa802da2dc81d737
This commit is contained in:
Dean Lee
2023-04-18 06:08:22 +08:00
committed by GitHub
parent 8d7e910631
commit 5115b6dc5a

View File

@@ -133,7 +133,7 @@ QVariant MessageListModel::data(const QModelIndex &index, int role) const {
auto &can_data = can->lastMessage(id);
auto getFreq = [](const CanData &d) -> QString {
if (d.freq > 0 && (can->currentSec() - d.ts) < (5.0 / d.freq)) {
if (d.freq > 0 && (can->currentSec() - d.ts - 1.0 / settings.fps) < (5.0 / d.freq)) {
return d.freq >= 1 ? QString::number(std::nearbyint(d.freq)) : QString::number(d.freq, 'f', 2);
} else {
return "--";