wip
This commit is contained in:
@@ -13,10 +13,6 @@
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
#include "selfdrive/ui/qt/util.h"
|
||||
#ifdef ENABLE_MAPS
|
||||
#include "selfdrive/ui/qt/maps/map_helpers.h"
|
||||
#include "selfdrive/ui/qt/maps/map_panel.h"
|
||||
#endif
|
||||
|
||||
static void drawIcon(QPainter &p, const QPoint ¢er, const QPixmap &img, const QBrush &bg, float opacity, const int angle = 0) {
|
||||
p.setRenderHint(QPainter::Antialiasing);
|
||||
@@ -60,16 +56,6 @@ OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent), scene(uiState()->
|
||||
split->setSpacing(0);
|
||||
split->addWidget(nvg);
|
||||
|
||||
if (getenv("DUAL_CAMERA_VIEW")) {
|
||||
CameraWidget *arCam = new CameraWidget("camerad", VISION_STREAM_ROAD, true, this);
|
||||
split->insertWidget(0, arCam);
|
||||
}
|
||||
|
||||
if (getenv("MAP_RENDER_VIEW")) {
|
||||
CameraWidget *map_render = new CameraWidget("navd", VISION_STREAM_MAP, false, this);
|
||||
split->insertWidget(0, map_render);
|
||||
}
|
||||
|
||||
stacked_layout->addWidget(split_wrapper);
|
||||
|
||||
alerts = new OnroadAlerts(this);
|
||||
@@ -82,7 +68,6 @@ OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent), scene(uiState()->
|
||||
setAttribute(Qt::WA_OpaquePaintEvent);
|
||||
QObject::connect(uiState(), &UIState::uiUpdate, this, &OnroadWindow::updateState);
|
||||
QObject::connect(uiState(), &UIState::offroadTransition, this, &OnroadWindow::offroadTransition);
|
||||
QObject::connect(uiState(), &UIState::primeChanged, this, &OnroadWindow::primeChanged);
|
||||
|
||||
QObject::connect(&clickTimer, &QTimer::timeout, this, [this]() {
|
||||
clickTimer.stop();
|
||||
@@ -99,12 +84,6 @@ void OnroadWindow::updateState(const UIState &s) {
|
||||
Alert alert = Alert::get(*(s.sm), s.scene.started_frame);
|
||||
alerts->updateAlert(alert);
|
||||
|
||||
if (s.scene.map_on_left || scene.full_map) {
|
||||
split->setDirection(QBoxLayout::LeftToRight);
|
||||
} else {
|
||||
split->setDirection(QBoxLayout::RightToLeft);
|
||||
}
|
||||
|
||||
nvg->updateState(s);
|
||||
|
||||
QColor bgColor = bg_colors[s.status];
|
||||
@@ -194,19 +173,6 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
|
||||
// widgetClicked = true;
|
||||
// }
|
||||
|
||||
#ifdef ENABLE_MAPS
|
||||
if (map != nullptr && !widgetClicked) {
|
||||
// Switch between map and sidebar when using navigate on openpilot
|
||||
bool sidebarVisible = geometry().x() > 0;
|
||||
bool show_map = uiState()->scene.navigate_on_openpilot ? sidebarVisible : !sidebarVisible;
|
||||
map->setVisible(show_map && !map->isVisible());
|
||||
if (scene.big_map) {
|
||||
map->setFixedWidth(width());
|
||||
} else {
|
||||
map->setFixedWidth(topWidget(this)->width() / 2 - UI_BORDER_SIZE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// propagation event to parent(HomeWindow)
|
||||
if (!widgetClicked) {
|
||||
QWidget::mousePressEvent(e);
|
||||
@@ -214,39 +180,10 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
|
||||
}
|
||||
|
||||
void OnroadWindow::offroadTransition(bool offroad) {
|
||||
#ifdef ENABLE_MAPS
|
||||
if (!offroad) {
|
||||
if (map == nullptr && (uiState()->hasPrime() || !MAPBOX_TOKEN.isEmpty())) {
|
||||
auto m = new MapPanel(get_mapbox_settings());
|
||||
map = m;
|
||||
|
||||
QObject::connect(m, &MapPanel::mapPanelRequested, this, &OnroadWindow::mapPanelRequested);
|
||||
QObject::connect(nvg->map_settings_btn, &MapSettingsButton::clicked, m, &MapPanel::toggleMapSettings);
|
||||
QObject::connect(nvg->map_settings_btn_bottom, &MapSettingsButton::clicked, m, &MapPanel::toggleMapSettings);
|
||||
nvg->map_settings_btn->setEnabled(true);
|
||||
|
||||
m->setFixedWidth(topWidget(this)->width() / 2 - UI_BORDER_SIZE);
|
||||
split->insertWidget(0, m);
|
||||
|
||||
// hidden by default, made visible when navRoute is published
|
||||
m->setVisible(false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
alerts->updateAlert({});
|
||||
}
|
||||
|
||||
void OnroadWindow::primeChanged(bool prime) {
|
||||
#ifdef ENABLE_MAPS
|
||||
if (map && (!prime && MAPBOX_TOKEN.isEmpty())) {
|
||||
nvg->map_settings_btn->setEnabled(false);
|
||||
nvg->map_settings_btn->setVisible(false);
|
||||
map->deleteLater();
|
||||
map = nullptr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OnroadWindow::paintEvent(QPaintEvent *event) {
|
||||
QPainter p(this);
|
||||
@@ -448,100 +385,85 @@ void ExperimentalButton::changeMode() {
|
||||
}
|
||||
|
||||
void ExperimentalButton::updateState(const UIState &s, bool leadInfo) {
|
||||
const auto cs = (*s.sm)["controlsState"].getControlsState();
|
||||
bool eng = cs.getEngageable() || cs.getEnabled() || scene.always_on_lateral_active;
|
||||
if ((cs.getExperimentalMode() != experimental_mode) || (eng != engageable)) {
|
||||
engageable = eng;
|
||||
experimental_mode = cs.getExperimentalMode();
|
||||
update();
|
||||
}
|
||||
// const auto cs = (*s.sm)["controlsState"].getControlsState();
|
||||
// bool eng = cs.getEngageable() || cs.getEnabled() || scene.always_on_lateral_active;
|
||||
// if ((cs.getExperimentalMode() != experimental_mode) || (eng != engageable)) {
|
||||
// engageable = eng;
|
||||
// experimental_mode = cs.getExperimentalMode();
|
||||
// update();
|
||||
// }
|
||||
|
||||
// FrogPilot variables
|
||||
int randomEvent = scene.current_random_event;
|
||||
// // FrogPilot variables
|
||||
// int randomEvent = scene.current_random_event;
|
||||
|
||||
rotatingWheel = scene.rotating_wheel;
|
||||
wheelIcon = scene.wheel_icon;
|
||||
wheelIconGif = 0;
|
||||
// rotatingWheel = scene.rotating_wheel;
|
||||
// wheelIcon = scene.wheel_icon;
|
||||
// wheelIconGif = 0;
|
||||
|
||||
y_offset = leadInfo ? 10 : 0;
|
||||
// y_offset = leadInfo ? 10 : 0;
|
||||
|
||||
if (randomEvent == 0 && gifLabel) {
|
||||
delete gifLabel;
|
||||
gifLabel = nullptr;
|
||||
} else if (randomEvent == 1) {
|
||||
static int rotationDegree = 0;
|
||||
rotationDegree = (rotationDegree + 36) % 360;
|
||||
steeringAngleDeg = rotationDegree;
|
||||
wheelIcon = 7;
|
||||
update();
|
||||
// if (randomEvent == 0 && gifLabel) {
|
||||
// delete gifLabel;
|
||||
// gifLabel = nullptr;
|
||||
// } else if (randomEvent == 1) {
|
||||
// static int rotationDegree = 0;
|
||||
// rotationDegree = (rotationDegree + 36) % 360;
|
||||
// steeringAngleDeg = rotationDegree;
|
||||
// wheelIcon = 7;
|
||||
// update();
|
||||
|
||||
} else if (randomEvent == 2 || randomEvent == 3 || randomEvent == 4) {
|
||||
if (!gifLabel) {
|
||||
gifLabel = new QLabel(this);
|
||||
QMovie *movie = wheelImagesGif[randomEvent - 1];
|
||||
if (movie) {
|
||||
gifLabel->setMovie(movie);
|
||||
gifLabel->setFixedSize(img_size, img_size);
|
||||
gifLabel->move((width() - gifLabel->width()) / 2, (height() - gifLabel->height()) / 2 + y_offset);
|
||||
gifLabel->movie()->start();
|
||||
}
|
||||
}
|
||||
gifLabel->show();
|
||||
wheelIconGif = randomEvent - 1;
|
||||
update();
|
||||
// } else if (randomEvent == 2 || randomEvent == 3 || randomEvent == 4) {
|
||||
// if (!gifLabel) {
|
||||
// gifLabel = new QLabel(this);
|
||||
// QMovie *movie = wheelImagesGif[randomEvent - 1];
|
||||
// if (movie) {
|
||||
// gifLabel->setMovie(movie);
|
||||
// gifLabel->setFixedSize(img_size, img_size);
|
||||
// gifLabel->move((width() - gifLabel->width()) / 2, (height() - gifLabel->height()) / 2 + y_offset);
|
||||
// gifLabel->movie()->start();
|
||||
// }
|
||||
// }
|
||||
// gifLabel->show();
|
||||
// wheelIconGif = randomEvent - 1;
|
||||
// update();
|
||||
|
||||
} else if (rotatingWheel && steeringAngleDeg != scene.steering_angle_deg) {
|
||||
steeringAngleDeg = scene.steering_angle_deg;
|
||||
update();
|
||||
steeringAngleDeg = scene.steering_angle_deg;
|
||||
} else if (!rotatingWheel) {
|
||||
steeringAngleDeg = 0;
|
||||
}
|
||||
// } else if (rotatingWheel && steeringAngleDeg != scene.steering_angle_deg) {
|
||||
// steeringAngleDeg = scene.steering_angle_deg;
|
||||
// update();
|
||||
// steeringAngleDeg = scene.steering_angle_deg;
|
||||
// } else if (!rotatingWheel) {
|
||||
// steeringAngleDeg = 0;
|
||||
// }
|
||||
}
|
||||
|
||||
void ExperimentalButton::paintEvent(QPaintEvent *event) {
|
||||
if (wheelIcon < 0) {
|
||||
return;
|
||||
}
|
||||
// if (wheelIcon < 0) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
QPainter p(this);
|
||||
engage_img = wheelImages[wheelIcon];
|
||||
QPixmap img = wheelIcon != 0 ? engage_img : (experimental_mode ? experimental_img : engage_img);
|
||||
QMovie *gif = wheelImagesGif[wheelIconGif];
|
||||
// QPainter p(this);
|
||||
// engage_img = wheelImages[wheelIcon];
|
||||
// QPixmap img = wheelIcon != 0 ? engage_img : (experimental_mode ? experimental_img : engage_img);
|
||||
// QMovie *gif = wheelImagesGif[wheelIconGif];
|
||||
|
||||
QColor background_color = wheelIcon != 0 && !isDown() && engageable ?
|
||||
(scene.always_on_lateral_active ? QColor(10, 186, 181, 255) :
|
||||
(scene.conditional_status == 1 || scene.conditional_status == 3 || scene.conditional_status == 5 ? QColor(255, 246, 0, 255) :
|
||||
(experimental_mode ? QColor(218, 111, 37, 241) :
|
||||
(scene.traffic_mode_active ? QColor(201, 34, 49, 255) :
|
||||
(scene.navigate_on_openpilot ? QColor(49, 161, 238, 255) : QColor(0, 0, 0, 166)))))) :
|
||||
QColor(0, 0, 0, 166);
|
||||
// QColor background_color = wheelIcon != 0 && !isDown() && engageable ?
|
||||
// (scene.always_on_lateral_active ? QColor(10, 186, 181, 255) :
|
||||
// (scene.conditional_status == 1 || scene.conditional_status == 3 || scene.conditional_status == 5 ? QColor(255, 246, 0, 255) :
|
||||
// (experimental_mode ? QColor(218, 111, 37, 241) :
|
||||
// (scene.traffic_mode_active ? QColor(201, 34, 49, 255) :
|
||||
// (scene.navigate_on_openpilot ? QColor(49, 161, 238, 255) : QColor(0, 0, 0, 166)))))) :
|
||||
// QColor(0, 0, 0, 166);
|
||||
|
||||
if (!(scene.map_open && scene.big_map)) {
|
||||
if (wheelIconGif != 0) {
|
||||
drawIconGif(p, QPoint(btn_size / 2, btn_size / 2 + y_offset), *gif, background_color, 1.0);
|
||||
} else {
|
||||
drawIcon(p, QPoint(btn_size / 2, btn_size / 2 + y_offset), img, background_color, (isDown() || !engageable) ? 0.6 : 1.0, steeringAngleDeg);
|
||||
}
|
||||
}
|
||||
// if (!(scene.map_open && scene.big_map)) {
|
||||
// if (wheelIconGif != 0) {
|
||||
// drawIconGif(p, QPoint(btn_size / 2, btn_size / 2 + y_offset), *gif, background_color, 1.0);
|
||||
// } else {
|
||||
// drawIcon(p, QPoint(btn_size / 2, btn_size / 2 + y_offset), img, background_color, (isDown() || !engageable) ? 0.6 : 1.0, steeringAngleDeg);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// MapSettingsButton
|
||||
MapSettingsButton::MapSettingsButton(QWidget *parent) : QPushButton(parent) {
|
||||
setFixedSize(btn_size, btn_size + 20);
|
||||
settings_img = loadPixmap("../assets/navigation/icon_directions_outlined.svg", {img_size, img_size});
|
||||
|
||||
// hidden by default, made visible if map is created (has prime or mapbox token)
|
||||
setVisible(false);
|
||||
setEnabled(false);
|
||||
}
|
||||
|
||||
void MapSettingsButton::paintEvent(QPaintEvent *event) {
|
||||
QPainter p(this);
|
||||
drawIcon(p, QPoint(btn_size / 2, btn_size / 2), settings_img, QColor(0, 0, 0, 166), isDown() ? 0.6 : 1.0);
|
||||
}
|
||||
|
||||
|
||||
// Window that shows camera view and variety of info drawn on top
|
||||
AnnotatedCameraWidget::AnnotatedCameraWidget(VisionStreamType type, QWidget* parent) : fps_filter(UI_FREQ, 3, 1. / UI_FREQ), CameraWidget("camerad", type, true, parent), scene(uiState()->scene) {
|
||||
@@ -572,9 +494,6 @@ AnnotatedCameraWidget::AnnotatedCameraWidget(VisionStreamType type, QWidget* par
|
||||
main_layout->addLayout(top_right_layout, 0);
|
||||
main_layout->setAlignment(top_right_layout, Qt::AlignTop | Qt::AlignRight);
|
||||
|
||||
map_settings_btn = new MapSettingsButton(this);
|
||||
main_layout->addWidget(map_settings_btn, 0, Qt::AlignBottom | Qt::AlignRight);
|
||||
|
||||
dm_img = loadPixmap("../assets/img_driver_face.png", {img_size + 5, img_size + 5});
|
||||
|
||||
// Initialize FrogPilot widgets
|
||||
@@ -586,10 +505,8 @@ void AnnotatedCameraWidget::updateState(const UIState &s) {
|
||||
const SubMaster &sm = *(s.sm);
|
||||
|
||||
const bool cs_alive = sm.alive("controlsState");
|
||||
const bool nav_alive = sm.alive("navInstruction") && sm["navInstruction"].getValid();
|
||||
const auto cs = sm["controlsState"].getControlsState();
|
||||
const auto car_state = sm["carState"].getCarState();
|
||||
const auto nav_instruction = sm["navInstruction"].getNavInstruction();
|
||||
|
||||
// Handle older routes where vCruiseCluster is not set
|
||||
float v_cruise = cs.getVCruiseCluster() == 0.0 ? cs.getVCruise() : cs.getVCruiseCluster();
|
||||
@@ -605,19 +522,19 @@ void AnnotatedCameraWidget::updateState(const UIState &s) {
|
||||
speed = cs_alive ? std::max<float>(0.0, v_ego) : 0.0;
|
||||
speed *= s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH;
|
||||
|
||||
auto speed_limit_sign = nav_instruction.getSpeedLimitSign();
|
||||
speedLimit = slcOverridden ? scene.speed_limit_overridden_speed : speedLimitController ? scene.speed_limit : nav_alive ? nav_instruction.getSpeedLimit() : 0.0;
|
||||
speedLimit *= (s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH);
|
||||
if (speedLimitController && !slcOverridden) {
|
||||
speedLimit = speedLimit - (showSLCOffset ? slcSpeedLimitOffset : 0);
|
||||
}
|
||||
// auto speed_limit_sign = nav_instruction.getSpeedLimitSign();
|
||||
// speedLimit = slcOverridden ? scene.speed_limit_overridden_speed : speedLimitController ? scene.speed_limit : nav_alive ? nav_instruction.getSpeedLimit() : 0.0;
|
||||
// speedLimit *= (s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH);
|
||||
// if (speedLimitController && !slcOverridden) {
|
||||
// speedLimit = speedLimit - (showSLCOffset ? slcSpeedLimitOffset : 0);
|
||||
// }
|
||||
|
||||
has_us_speed_limit = (nav_alive && speed_limit_sign == cereal::NavInstruction::SpeedLimitSign::MUTCD) || (speedLimitController && !useViennaSLCSign);
|
||||
has_eu_speed_limit = (nav_alive && speed_limit_sign == cereal::NavInstruction::SpeedLimitSign::VIENNA) && !(speedLimitController && !useViennaSLCSign) || (speedLimitController && useViennaSLCSign);
|
||||
is_metric = s.scene.is_metric;
|
||||
speedUnit = s.scene.is_metric ? tr("km/h") : tr("mph");
|
||||
hideBottomIcons = (cs.getAlertSize() != cereal::ControlsState::AlertSize::NONE || customSignals != 0 && (turnSignalLeft || turnSignalRight) || bigMapOpen);
|
||||
status = s.status;
|
||||
// has_us_speed_limit = (nav_alive && speed_limit_sign == cereal::NavInstruction::SpeedLimitSign::MUTCD) || (speedLimitController && !useViennaSLCSign);
|
||||
// has_eu_speed_limit = (nav_alive && speed_limit_sign == cereal::NavInstruction::SpeedLimitSign::VIENNA) && !(speedLimitController && !useViennaSLCSign) || (speedLimitController && useViennaSLCSign);
|
||||
// is_metric = s.scene.is_metric;
|
||||
// speedUnit = s.scene.is_metric ? tr("km/h") : tr("mph");
|
||||
// hideBottomIcons = (cs.getAlertSize() != cereal::ControlsState::AlertSize::NONE || customSignals != 0 && (turnSignalLeft || turnSignalRight));
|
||||
// status = s.status;
|
||||
|
||||
// update engageability/experimental mode button
|
||||
experimental_btn->updateState(s, leadInfo);
|
||||
@@ -630,12 +547,6 @@ void AnnotatedCameraWidget::updateState(const UIState &s) {
|
||||
rightHandDM = dm_state.getIsRHD();
|
||||
// DM icon transition
|
||||
dm_fade_state = std::clamp(dm_fade_state+0.2*(0.5-dmActive), 0.0, 1.0);
|
||||
|
||||
// hide map settings button for alerts and flip for right hand DM
|
||||
if (map_settings_btn->isEnabled()) {
|
||||
map_settings_btn->setVisible(!hideBottomIcons && compass && !scene.hide_map_icon);
|
||||
main_layout->setAlignment(map_settings_btn, (rightHandDM ? Qt::AlignLeft : Qt::AlignRight) | Qt::AlignTop);
|
||||
}
|
||||
|
||||
updateFrogPilotWidgets();
|
||||
}
|
||||
@@ -777,7 +688,7 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
|
||||
}
|
||||
|
||||
// current speed
|
||||
if (!(scene.hide_speed || bigMapOpen)) {
|
||||
if (!(scene.hide_speed)) {
|
||||
// CLEARPILOT changes to 120 from ~176
|
||||
// Maybe we want to hide this?
|
||||
p.setFont(InterFont(140, QFont::Bold));
|
||||
@@ -1193,9 +1104,6 @@ void AnnotatedCameraWidget::initializeFrogPilotWidgets() {
|
||||
compass_img = new Compass(this);
|
||||
// bottom_layout->addWidget(compass_img);
|
||||
|
||||
map_settings_btn_bottom = new MapSettingsButton(this);
|
||||
bottom_layout->addWidget(map_settings_btn_bottom);
|
||||
|
||||
main_layout->addLayout(bottom_layout);
|
||||
|
||||
themeConfiguration = {
|
||||
@@ -1293,9 +1201,6 @@ void AnnotatedCameraWidget::updateFrogPilotWidgets() {
|
||||
obstacleDistance = scene.obstacle_distance;
|
||||
obstacleDistanceStock = scene.obstacle_distance_stock;
|
||||
|
||||
mapOpen = scene.map_open;
|
||||
bigMapOpen = mapOpen && scene.big_map;
|
||||
|
||||
onroadDistanceButton = scene.onroad_distance_button;
|
||||
|
||||
roadNameUI = scene.road_name_ui;
|
||||
@@ -1350,7 +1255,7 @@ void AnnotatedCameraWidget::updateFrogPilotWidgets() {
|
||||
}
|
||||
|
||||
void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &p) {
|
||||
if ((showAlwaysOnLateralStatusBar || showConditionalExperimentalStatusBar || roadNameUI) && !bigMapOpen) {
|
||||
if ((showAlwaysOnLateralStatusBar || showConditionalExperimentalStatusBar || roadNameUI)) {
|
||||
drawStatusBar(p);
|
||||
}
|
||||
|
||||
@@ -1363,7 +1268,7 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &p) {
|
||||
// animationTimer->stop();
|
||||
// }
|
||||
|
||||
if (leadInfo && !bigMapOpen) {
|
||||
if (leadInfo) {
|
||||
drawLeadInfo(p);
|
||||
}
|
||||
|
||||
@@ -1391,12 +1296,6 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &p) {
|
||||
// pedal_icons->updateState();
|
||||
// }
|
||||
|
||||
map_settings_btn_bottom->setEnabled(map_settings_btn->isEnabled());
|
||||
if (map_settings_btn_bottom->isEnabled()) {
|
||||
map_settings_btn_bottom->setVisible(!hideBottomIcons && !compass && !scene.hide_map_icon);
|
||||
bottom_layout->setAlignment(map_settings_btn_bottom, rightHandDM ? Qt::AlignLeft : Qt::AlignRight);
|
||||
}
|
||||
|
||||
// recorder_btn->setVisible(scene.screen_recorder && !mapOpen);
|
||||
recorder_btn->setVisible(false);
|
||||
}
|
||||
@@ -1581,7 +1480,7 @@ void AnnotatedCameraWidget::drawLeadInfo(QPainter &p) {
|
||||
constexpr int maxAccelDuration = 5000;
|
||||
|
||||
QString accelerationUnit = tr(" m/s²");
|
||||
leadDistanceUnit = tr(mapOpen ? "m" : "meters");
|
||||
leadDistanceUnit = tr("meters");
|
||||
leadSpeedUnit = tr("m/s");
|
||||
|
||||
float accelerationConversion = 1.0f;
|
||||
@@ -1635,15 +1534,15 @@ void AnnotatedCameraWidget::drawLeadInfo(QPainter &p) {
|
||||
.arg(accelerationUnit);
|
||||
|
||||
QString maxAccSuffix;
|
||||
if (!mapOpen) {
|
||||
|
||||
maxAccSuffix = tr(" - Max: %1%2")
|
||||
.arg(maxAcceleration * accelerationConversion, 0, 'f', 2)
|
||||
.arg(accelerationUnit);
|
||||
}
|
||||
|
||||
QString obstacleText = createText(mapOpen ? tr(" | Obstacle: ") : tr(" | Obstacle Factor: "), obstacleDistance);
|
||||
QString stopText = createText(mapOpen ? tr(" - Stop: ") : tr(" - Stop Factor: "), scene.stopped_equivalence);
|
||||
QString followText = " = " + createText(mapOpen ? tr("Follow: ") : tr("Follow Distance: "), scene.desired_follow);
|
||||
|
||||
QString obstacleText = createText(tr(" | Obstacle Factor: "), obstacleDistance);
|
||||
QString stopText = createText(tr(" - Stop Factor: "), scene.stopped_equivalence);
|
||||
QString followText = " = " + createText(tr("Follow Distance: "), scene.desired_follow);
|
||||
|
||||
auto createDiffText = [&](const double data, const double stockData) {
|
||||
double difference = std::round((data - stockData) * distanceConversion);
|
||||
@@ -1784,21 +1683,21 @@ void AnnotatedCameraWidget::drawStatusBar(QPainter &p) {
|
||||
{4, tr("Experimental Mode manually activated")},
|
||||
{5, tr("Conditional Experimental overridden")},
|
||||
{6, tr("Experimental Mode manually activated")},
|
||||
{7, tr("Experimental Mode activated for") + (mapOpen ? tr(" intersection") : tr(" upcoming intersection"))},
|
||||
{8, tr("Experimental Mode activated for") + (mapOpen ? tr(" turn") : tr(" upcoming turn"))},
|
||||
{9, tr("Experimental Mode activated due to") + (mapOpen ? tr(" SLC") : tr(" no speed limit set"))},
|
||||
{10, tr("Experimental Mode activated due to") + (mapOpen ? tr(" speed") : tr(" speed being less than ") + QString::number(scene.conditional_speed_lead) + (is_metric ? tr(" kph") : tr(" mph")))},
|
||||
{11, tr("Experimental Mode activated due to") + (mapOpen ? tr(" speed") : tr(" speed being less than ") + QString::number(scene.conditional_speed) + (is_metric ? tr(" kph") : tr(" mph")))},
|
||||
{7, tr("Experimental Mode activated for") + (tr(" upcoming intersection"))},
|
||||
{8, tr("Experimental Mode activated for") + (tr(" upcoming turn"))},
|
||||
{9, tr("Experimental Mode activated due to") + (tr(" no speed limit set"))},
|
||||
{10, tr("Experimental Mode activated due to") + (tr(" speed being less than ") + QString::number(scene.conditional_speed_lead) + (is_metric ? tr(" kph") : tr(" mph")))},
|
||||
{11, tr("Experimental Mode activated due to") + (tr(" speed being less than ") + QString::number(scene.conditional_speed) + (is_metric ? tr(" kph") : tr(" mph")))},
|
||||
{12, tr("Experimental Mode activated for slower lead")},
|
||||
{13, tr("Experimental Mode activated for turn") + (mapOpen ? "" : tr(" / lane change"))},
|
||||
{13, tr("Experimental Mode activated for turn") + (tr(" / lane change"))},
|
||||
{14, tr("Experimental Mode activated for curve")},
|
||||
{15, tr("Experimental Mode activated for stop") + (mapOpen ? "" : tr(" sign / stop light"))},
|
||||
{15, tr("Experimental Mode activated for stop") + (tr(" sign / stop light"))},
|
||||
};
|
||||
|
||||
QString roadName = roadNameUI ? QString::fromStdString(paramsMemory.get("RoadName")) : QString();
|
||||
|
||||
if (alwaysOnLateralActive && showAlwaysOnLateralStatusBar) {
|
||||
newStatus = tr("Always On Lateral active") + (mapOpen ? "" : tr(". Press the \"Cruise Control\" button to disable"));
|
||||
newStatus = tr("Always On Lateral active") + (tr(". Press the \"Cruise Control\" button to disable"));
|
||||
} else if (showConditionalExperimentalStatusBar) {
|
||||
newStatus = conditionalStatusMap[status != STATUS_DISENGAGED ? conditionalStatus : 0];
|
||||
}
|
||||
@@ -1807,7 +1706,7 @@ void AnnotatedCameraWidget::drawStatusBar(QPainter &p) {
|
||||
QString lkasSuffix = tr(". Double press the \"LKAS\" button to revert");
|
||||
QString screenSuffix = tr(". Double tap the screen to revert");
|
||||
|
||||
if (!alwaysOnLateralActive && !mapOpen && status != STATUS_DISENGAGED && !newStatus.isEmpty()) {
|
||||
if (!alwaysOnLateralActive && status != STATUS_DISENGAGED && !newStatus.isEmpty()) {
|
||||
if (conditionalStatus == 1 || conditionalStatus == 2) {
|
||||
newStatus += distanceSuffix;
|
||||
} else if (conditionalStatus == 3 || conditionalStatus == 4) {
|
||||
|
||||
Reference in New Issue
Block a user