cabana: fix the frequency was incorrect when replay from a specified segment (#28165)

old-commit-hash: f01652cc41
beeps
Dean Lee 2 years ago committed by GitHub
parent 7133d5b9cc
commit bd4d5ff3d4
  1. 3
      tools/cabana/streams/abstractstream.cc

@ -165,7 +165,8 @@ static inline QColor blend(const QColor &a, const QColor &b) {
void CanData::compute(const char *can_data, const int size, double current_sec, double playback_speed, const QList<uint8_t> &mask, uint32_t in_freq) {
ts = current_sec;
++count;
freq = in_freq == 0 ? count / std::max(1.0, current_sec) : in_freq;
const double sec_to_first_event = current_sec - (can->allEvents().front()->mono_time / 1e9 - can->routeStartTime());
freq = in_freq == 0 ? count / std::max(1.0, sec_to_first_event) : in_freq;
if (dat.size() != size) {
dat.resize(size);
bit_change_counts.resize(size);

Loading…
Cancel
Save