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

old-commit-hash: a324d79fa3
beeps
Dean Lee 2 years ago committed by GitHub
parent 8d7e910631
commit 5115b6dc5a
  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