|
|
@ -151,9 +151,10 @@ void Replay::buildTimeline() { |
|
|
|
[(int)cereal::ControlsState::AlertStatus::CRITICAL] = TimelineType::AlertCritical, |
|
|
|
[(int)cereal::ControlsState::AlertStatus::CRITICAL] = TimelineType::AlertCritical, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
for (auto it = segments_.cbegin(); it != segments_.cend() && !exit_; ++it) { |
|
|
|
const auto &route_segments = route_->segments(); |
|
|
|
|
|
|
|
for (auto it = route_segments.cbegin(); it != route_segments.cend() && !exit_; ++it) { |
|
|
|
LogReader log; |
|
|
|
LogReader log; |
|
|
|
if (!log.load(route_->at(it->first).qlog.toStdString(), &exit_, |
|
|
|
if (!log.load(it->second.qlog.toStdString(), &exit_, |
|
|
|
{cereal::Event::Which::CONTROLS_STATE, cereal::Event::Which::USER_FLAG}, |
|
|
|
{cereal::Event::Which::CONTROLS_STATE, cereal::Event::Which::USER_FLAG}, |
|
|
|
!hasFlag(REPLAY_FLAG_NO_FILE_CACHE), 0, 3)) continue; |
|
|
|
!hasFlag(REPLAY_FLAG_NO_FILE_CACHE), 0, 3)) continue; |
|
|
|
|
|
|
|
|
|
|
@ -227,7 +228,10 @@ void Replay::segmentLoadFinished(bool success) { |
|
|
|
if (!success) { |
|
|
|
if (!success) { |
|
|
|
Segment *seg = qobject_cast<Segment *>(sender()); |
|
|
|
Segment *seg = qobject_cast<Segment *>(sender()); |
|
|
|
rWarning("failed to load segment %d, removing it from current replay list", seg->seg_num); |
|
|
|
rWarning("failed to load segment %d, removing it from current replay list", seg->seg_num); |
|
|
|
segments_.erase(seg->seg_num); |
|
|
|
updateEvents([&]() { |
|
|
|
|
|
|
|
segments_.erase(seg->seg_num); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
queueSegment(); |
|
|
|
queueSegment(); |
|
|
|
} |
|
|
|
} |
|
|
@ -456,7 +460,7 @@ void Replay::stream() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (eit == events_->end() && !hasFlag(REPLAY_FLAG_NO_LOOP)) { |
|
|
|
if (eit == events_->end() && !hasFlag(REPLAY_FLAG_NO_LOOP)) { |
|
|
|
int last_segment = segments_.rbegin()->first; |
|
|
|
int last_segment = segments_.empty() ? 0 : segments_.rbegin()->first; |
|
|
|
if (current_segment_ >= last_segment && isSegmentMerged(last_segment)) { |
|
|
|
if (current_segment_ >= last_segment && isSegmentMerged(last_segment)) { |
|
|
|
rInfo("reaches the end of route, restart from beginning"); |
|
|
|
rInfo("reaches the end of route, restart from beginning"); |
|
|
|
QMetaObject::invokeMethod(this, std::bind(&Replay::seekTo, this, 0, false), Qt::QueuedConnection); |
|
|
|
QMetaObject::invokeMethod(this, std::bind(&Replay::seekTo, this, 0, false), Qt::QueuedConnection); |
|
|
|