ui: Clear road name cache when going onroad (#305)

* ui: Clear road name cache at UI initiation

* clear on offroad
This commit is contained in:
Jason Wen
2023-09-27 11:17:16 -04:00
committed by GitHub
parent c8cb9b3b75
commit 5bf6368947
2 changed files with 7 additions and 5 deletions
+6 -4
View File
@@ -479,8 +479,10 @@ AnnotatedCameraWidget::AnnotatedCameraWidget(VisionStreamType type, QWidget* par
#ifdef ENABLE_DASHCAM
void AnnotatedCameraWidget::offroadTransition(bool offroad) {
if (offroad && recorder) {
recorder->stop();
if (offroad) {
if (recorder) recorder->stop();
roadName = "";
}
}
#endif
@@ -641,11 +643,11 @@ void AnnotatedCameraWidget::updateState(const UIState &s) {
showDebugUI = s.scene.show_debug_ui;
const auto lmd = sm["liveMapData"].getLiveMapData();
QString road_name = QString::fromStdString(lmd.getCurrentRoadName());
const auto data_type = int(lmd.getDataType());
const QString data_type_draw(data_type == 2 ? "🌐 " : "");
roadName = !road_name.isEmpty() ? data_type_draw + road_name : "";
roadName = QString::fromStdString(lmd.getCurrentRoadName());
roadName = !roadName.isEmpty() ? data_type_draw + roadName : "";
float speed_limit_slc = lp.getSpeedLimit() * (s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH);
const float speed_limit_offset = lp.getSpeedLimitOffset() * (s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH);
+1 -1
View File
@@ -170,7 +170,7 @@ private:
bool showDebugUI = false;
QString roadName;
QString roadName = "";
bool showSpeedLimit = false;
float speedLimitSLC;