Detect if the map is open

This commit is contained in:
FrogAi 2024-02-27 16:34:47 -07:00
parent 3751e9fd84
commit 6093345711
5 changed files with 11 additions and 1 deletions

View File

@ -41,3 +41,8 @@ void MapPanel::toggleMapSettings() {
emit mapPanelRequested();
show();
}
void MapPanel::setVisible(bool visible) {
QFrame::setVisible(visible);
uiState()->scene.map_open = visible;
}

View File

@ -9,6 +9,7 @@ class MapPanel : public QFrame {
public:
explicit MapPanel(const QMapLibre::Settings &settings, QWidget *parent = nullptr);
void setVisible(bool visible);
signals:
void mapPanelRequested();

View File

@ -859,6 +859,8 @@ void AnnotatedCameraWidget::updateFrogPilotWidgets(QPainter &p) {
experimentalMode = scene.experimental_mode;
mapOpen = scene.map_open;
turnSignalLeft = scene.turn_signal_left;
turnSignalRight = scene.turn_signal_right;
@ -950,7 +952,7 @@ void AnnotatedCameraWidget::drawStatusBar(QPainter &p) {
// Update status text
if (alwaysOnLateralActive) {
newStatus = QString("Always On Lateral active. Press the \"Cruise Control\" button to disable");
newStatus = QString("Always On Lateral active") + (mapOpen ? "" : ". Press the \"Cruise Control\" button to disable");
} else if (conditionalExperimental) {
newStatus = conditionalStatusMap[status != STATUS_DISENGAGED ? conditionalStatus : 0];
}

View File

@ -125,6 +125,7 @@ private:
bool blindSpotRight;
bool conditionalExperimental;
bool experimentalMode;
bool mapOpen;
bool turnSignalLeft;
bool turnSignalRight;

View File

@ -179,6 +179,7 @@ typedef struct UIScene {
bool dynamic_path_width;
bool enabled;
bool experimental_mode;
bool map_open;
bool model_ui;
bool turn_signal_left;
bool turn_signal_right;