diff --git a/common/params.cc b/common/params.cc index dc42b6caa..8b2622a0c 100644 --- a/common/params.cc +++ b/common/params.cc @@ -221,7 +221,9 @@ std::unordered_map keys = { {"dp_vag_sng", PERSISTENT}, {"dp_vehicle_list", PERSISTENT}, {"dp_vehicle_assigned", PERSISTENT}, - {"dp_ui_map_panel", PERSISTENT}, + {"dp_nav_free_map", PERSISTENT}, + {"dp_nav_name", PERSISTENT}, + {"dp_nav_traffic", PERSISTENT}, }; } // namespace diff --git a/dp_priv b/dp_priv index 7e782077a..94c23e21c 160000 --- a/dp_priv +++ b/dp_priv @@ -1 +1 @@ -Subproject commit 7e782077a5eaf00e55a7ad8cfef5076da0d22e8f +Subproject commit 94c23e21cf39e2fce3e1686d3fd3f02aa36b49c1 diff --git a/selfdrive/ui/qt/maps/map.cc b/selfdrive/ui/qt/maps/map.cc index 82d78a7e5..1e63b8bfc 100644 --- a/selfdrive/ui/qt/maps/map.cc +++ b/selfdrive/ui/qt/maps/map.cc @@ -10,7 +10,6 @@ #include "selfdrive/ui/qt/util.h" #include "selfdrive/ui/ui.h" -#include "dp_priv/selfdrive/ui/qt/maps/map_helpers.h" const int INTERACTION_TIMEOUT = 100; @@ -48,6 +47,9 @@ MapWindow::MapWindow(const QMapLibre::Settings &settings) : m_settings(settings) last_position = coordinate_from_param("LastGPSPosition"); grabGesture(Qt::GestureType::PinchGesture); qDebug() << "MapWindow initialized"; + #ifdef DP + map_window_ext = new MapWindowExt(); + #endif } MapWindow::~MapWindow() { @@ -55,6 +57,9 @@ MapWindow::~MapWindow() { } void MapWindow::initLayers() { + #ifdef DP + map_window_ext->reconfigure_layer(m_map); + #endif // This doesn't work from initializeGL if (!m_map->layerExists("modelPathLayer")) { qDebug() << "Initializing modelPathLayer"; @@ -264,9 +269,7 @@ void MapWindow::initializeGL() { m_map->setStyleUrl("mapbox://styles/commaai/clkqztk0f00ou01qyhsa5bzpj"); #ifdef DP - if (uiState()->scene.dp_ui_map_panel) { - ReconfigureMapPanel(m_map); - } + map_window_ext->reconfigure_map(m_map); #endif QObject::connect(m_map.data(), &QMapLibre::Map::mapChanged, [=](QMapLibre::Map::MapChange change) { diff --git a/selfdrive/ui/qt/maps/map.h b/selfdrive/ui/qt/maps/map.h index 31a44f27b..ce85f08c4 100644 --- a/selfdrive/ui/qt/maps/map.h +++ b/selfdrive/ui/qt/maps/map.h @@ -24,6 +24,10 @@ #include "selfdrive/ui/qt/maps/map_eta.h" #include "selfdrive/ui/qt/maps/map_instructions.h" +#ifdef DP +#include "dp_priv/selfdrive/ui/qt/maps/map_helpers.h" +#endif + class MapWindow : public QOpenGLWidget { Q_OBJECT @@ -74,6 +78,11 @@ private: void updateDestinationMarker(); uint64_t route_rcv_frame = 0; + // dp + #ifdef DP + MapWindowExt *map_window_ext; + #endif + private slots: void updateState(const UIState &s); diff --git a/selfdrive/ui/qt/onroad/onroad_home.cc b/selfdrive/ui/qt/onroad/onroad_home.cc index ec3e36ed8..a1e6ccc6e 100644 --- a/selfdrive/ui/qt/onroad/onroad_home.cc +++ b/selfdrive/ui/qt/onroad/onroad_home.cc @@ -54,7 +54,7 @@ OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) { #endif // rick - read full screen param dp_ui_map_full = Params().getBool("dp_ui_map_full"); - dp_ui_map_panel = Params().getBool("dp_ui_map_panel"); + dp_nav_free_map = Params().getBool("dp_nav_free_map"); } void OnroadWindow::updateState(const UIState &s) { @@ -116,7 +116,7 @@ void OnroadWindow::createMapWidget() { // hidden by default, made visible when navRoute is published m->setVisible(false); - if (dp_ui_map_panel) { + if (dp_nav_free_map) { nvg->map_settings_btn->setEnabled(false); nvg->map_settings_btn->setVisible(false); } @@ -126,7 +126,7 @@ void OnroadWindow::createMapWidget() { void OnroadWindow::offroadTransition(bool offroad) { #ifdef ENABLE_MAPS if (!offroad) { - if (map == nullptr && (dp_ui_map_panel || uiState()->hasPrime() || !MAPBOX_TOKEN.isEmpty())) { + if (map == nullptr && (dp_nav_free_map || uiState()->hasPrime() || !MAPBOX_TOKEN.isEmpty())) { createMapWidget(); } } @@ -136,12 +136,12 @@ void OnroadWindow::offroadTransition(bool offroad) { void OnroadWindow::primeChanged(bool prime) { #ifdef ENABLE_MAPS - if (map && (!dp_ui_map_panel && !prime && MAPBOX_TOKEN.isEmpty())) { + if (map && (!dp_nav_free_map && !prime && MAPBOX_TOKEN.isEmpty())) { nvg->map_settings_btn->setEnabled(false); nvg->map_settings_btn->setVisible(false); map->deleteLater(); map = nullptr; - } else if (!map && (dp_ui_map_panel || prime || !MAPBOX_TOKEN.isEmpty())) { + } else if (!map && (dp_nav_free_map || prime || !MAPBOX_TOKEN.isEmpty())) { createMapWidget(); } #endif diff --git a/selfdrive/ui/qt/onroad/onroad_home.h b/selfdrive/ui/qt/onroad/onroad_home.h index cfc38265d..325ad05fd 100644 --- a/selfdrive/ui/qt/onroad/onroad_home.h +++ b/selfdrive/ui/qt/onroad/onroad_home.h @@ -30,7 +30,7 @@ private: // dp bool dp_ui_map_full = false; - bool dp_ui_map_panel = false; + bool dp_nav_free_map = false; #ifdef DP BorderIndicator *border_indicator; #endif diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 82becc607..287ac4bc2 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -216,8 +216,6 @@ void ui_update_params(UIState *s) { s->scene.is_metric = params.getBool("IsMetric"); s->scene.map_on_left = params.getBool("NavSettingLeftSide"); - // dp - s->scene.dp_ui_map_panel = params.getBool("dp_ui_map_panel"); } void UIState::updateStatus() { diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index d2c704e3c..eeea87c28 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -109,8 +109,6 @@ typedef struct UIScene { bool world_objects_visible = false; uint64_t started_frame; - // dp - bool dp_ui_map_panel; } UIScene; class UIState : public QObject { diff --git a/system/manager/manager.py b/system/manager/manager.py index 8921a93dd..f5336942c 100755 --- a/system/manager/manager.py +++ b/system/manager/manager.py @@ -53,7 +53,9 @@ def manager_init() -> None: ("dp_vag_sng", "0"), ("dp_vehicle_list", ""), ("dp_vehicle_assigned", ""), - ("dp_ui_map_panel", "0"), + ("dp_nav_free_map", "0"), + ("dp_nav_name", "0"), + ("dp_nav_traffic", "0"), ] if not PC: default_params.append(("LastUpdateTime", datetime.datetime.now(datetime.UTC).replace(tzinfo=None).isoformat().encode('utf8')))