Skip to content

Commit

Permalink
Merge pull request #1618 from Karry/navigation-model-fixes
Browse files Browse the repository at this point in the history
reset suggested lanes on route change
  • Loading branch information
Framstag authored Nov 2, 2024
2 parents 3560ce8 + d4f327e commit 0da3c57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class OSMSCOUT_CLIENT_QT_API NavigationModel : public QAbstractListModel
Q_PROPERTY(bool positionEstimateInTunnel READ getPositionEstimateInTunnel NOTIFY positionEstimateInTunnelChanged)

Q_PROPERTY(QDateTime arrivalEstimate READ getArrivalEstimate NOTIFY arrivalUpdate)
Q_PROPERTY(double remainingDistance READ getRemainingDinstance NOTIFY arrivalUpdate)
Q_PROPERTY(double remainingDistance READ getRemainingDistance NOTIFY arrivalUpdate)

// km/h, <0 when unknown
Q_PROPERTY(double currentSpeed READ getCurrentSpeed NOTIFY currentSpeedUpdate)
Expand Down Expand Up @@ -180,7 +180,7 @@ public slots:
return arrivalEstimate;
}

inline double getRemainingDinstance() const
inline double getRemainingDistance() const
{
if (!remainingDistance.has_value()){
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,15 @@ void NavigationModel::setRoute(QObject *o)
}
arrivalEstimate=QDateTime();
remainingDistance=std::nullopt;
lane=LaneAgent::Lane();
endResetModel();

emit arrivalUpdate();
emit routeChanged(this->route, vehicle);
emit vehiclePositionChanged();
emit positionEstimateInTunnelChanged();
emit update();
emit laneUpdate();
emit currentSpeedUpdate(0);
emit maxAllowedSpeedUpdate(0);
}
Expand Down

0 comments on commit 0da3c57

Please sign in to comment.