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

pull/28168/head
Dean Lee 2 years ago committed by GitHub
parent 5ca14c072f
commit f01652cc41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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