Commit 91e4b15f authored by Volker Krause's avatar Volker Krause

Consider live data too for determining arrival time of the previous element

parent f92e0d3b
......@@ -295,8 +295,15 @@ QVariant TimelineDelegateController::previousLocation() const
}
const auto res = m_resMgr->reservation(prevBatch);
const auto endTime = SortUtil::endtDateTime(res);
if (endTime < QDateTime::currentDateTime()) { // TODO take live data into account (also for notification!)
auto endTime = SortUtil::endtDateTime(res);
if (m_liveDataMgr) {
const auto arr = m_liveDataMgr->arrival(prevBatch);
if (arr.hasExpectedArrivalTime()) {
endTime = arr.expectedArrivalTime();
}
}
if (endTime < QDateTime::currentDateTime()) {
// past event, we can use GPS rather than predict our location from the itinerary
return {};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment