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

pull/27943/head
Dean Lee 2 years ago committed by GitHub
parent 30ff0bface
commit a324d79fa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      tools/cabana/messageswidget.cc

@ -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 "--";

Loading…
Cancel
Save