Cabana: warn and exit if no rlogs in route (#26784)

warn and exit if no rlogs in route
old-commit-hash: 322dec1ec835e18a162b32dc75a293f57130ee62
This commit is contained in:
Dean Lee
2022-12-13 16:19:04 +08:00
committed by GitHub
parent bbed3a961a
commit 4fc1724609
+5
View File
@@ -26,6 +26,11 @@ bool CANMessages::loadRoute(const QString &route, const QString &data_dir, uint3
QObject::connect(replay, &Replay::segmentsMerged, this, &CANMessages::eventsMerged);
QObject::connect(replay, &Replay::streamStarted, this, &CANMessages::streamStarted);
if (replay->load()) {
const auto &segments = replay->route()->segments();
if (std::none_of(segments.begin(), segments.end(), [](auto &s) { return s.second.rlog.length() > 0; })) {
qWarning() << "no rlogs in route" << route;
return false;
}
replay->start();
return true;
}