Visuals - Quality of Life - Big Map
This commit is contained in:
parent
1ab138a38e
commit
4a27842846
|
@ -77,7 +77,7 @@ void AnnotatedCameraWidget::updateState(const UIState &s) {
|
|||
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));
|
||||
hideBottomIcons = (cs.getAlertSize() != cereal::ControlsState::AlertSize::NONE || customSignals != 0 && (turnSignalLeft || turnSignalRight) || bigMapOpen);
|
||||
status = s.status;
|
||||
|
||||
// update engageability/experimental mode button
|
||||
|
@ -224,10 +224,12 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
|
|||
p.restore();
|
||||
|
||||
// current speed
|
||||
p.setFont(InterFont(176, QFont::Bold));
|
||||
drawText(p, rect().center().x(), 210, speedStr);
|
||||
p.setFont(InterFont(66));
|
||||
drawText(p, rect().center().x(), 290, speedUnit, 200);
|
||||
if (!bigMapOpen) {
|
||||
p.setFont(InterFont(176, QFont::Bold));
|
||||
drawText(p, rect().center().x(), 210, speedStr);
|
||||
p.setFont(InterFont(66));
|
||||
drawText(p, rect().center().x(), 290, speedUnit, 200);
|
||||
}
|
||||
|
||||
p.restore();
|
||||
}
|
||||
|
@ -802,7 +804,7 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
|
|||
|
||||
alwaysOnLateralActive = scene.always_on_lateral_active;
|
||||
showAlwaysOnLateralStatusBar = scene.show_aol_status_bar;
|
||||
if (showAlwaysOnLateralStatusBar || showConditionalExperimentalStatusBar || roadNameUI) {
|
||||
if ((showAlwaysOnLateralStatusBar || showConditionalExperimentalStatusBar || roadNameUI) && !bigMapOpen) {
|
||||
drawStatusBar(painter);
|
||||
}
|
||||
|
||||
|
@ -844,11 +846,12 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
|
|||
leadInfo = scene.lead_info;
|
||||
obstacleDistance = scene.obstacle_distance;
|
||||
obstacleDistanceStock = scene.obstacle_distance_stock;
|
||||
if (leadInfo) {
|
||||
if (leadInfo && !bigMapOpen) {
|
||||
drawLeadInfo(painter);
|
||||
}
|
||||
|
||||
mapOpen = scene.map_open;
|
||||
bigMapOpen = mapOpen && scene.big_map;
|
||||
map_settings_btn_bottom->setEnabled(map_settings_btn->isEnabled());
|
||||
if (map_settings_btn_bottom->isEnabled()) {
|
||||
map_settings_btn_bottom->setVisible(!hideBottomIcons && !compass);
|
||||
|
@ -863,7 +866,7 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
|
|||
bottom_layout->setAlignment(distance_btn, (rightHandDM ? Qt::AlignRight : Qt::AlignLeft) | Qt::AlignBottom);
|
||||
}
|
||||
|
||||
bool enablePedalIcons = scene.pedals_on_ui;
|
||||
bool enablePedalIcons = scene.pedals_on_ui && !bigMapOpen;
|
||||
pedal_icons->setVisible(enablePedalIcons);
|
||||
if (enablePedalIcons) {
|
||||
pedal_icons->updateState(scene);
|
||||
|
@ -888,7 +891,7 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
|
|||
|
||||
turnSignalLeft = scene.turn_signal_left;
|
||||
turnSignalRight = scene.turn_signal_right;
|
||||
if (customSignals != 0 && (turnSignalLeft || turnSignalRight)) {
|
||||
if (customSignals != 0 && (turnSignalLeft || turnSignalRight) && !bigMapOpen) {
|
||||
if (!animationTimer->isActive()) {
|
||||
animationTimer->start(totalFrames * 11); // 440 milliseconds per loop; syncs up perfectly with my 2019 Lexus ES 350 turn signal clicks
|
||||
}
|
||||
|
|
|
@ -106,6 +106,7 @@ private:
|
|||
QHBoxLayout *bottom_layout;
|
||||
|
||||
bool alwaysOnLateralActive;
|
||||
bool bigMapOpen;
|
||||
bool blindSpotLeft;
|
||||
bool blindSpotRight;
|
||||
bool compass;
|
||||
|
|
|
@ -83,8 +83,10 @@ void ExperimentalButton::updateState(const UIState &s, bool leadInfo) {
|
|||
const UIScene &scene = s.scene;
|
||||
|
||||
alwaysOnLateralActive = scene.always_on_lateral_active;
|
||||
bigMap = scene.big_map;
|
||||
conditionalExperimental = scene.conditional_experimental;
|
||||
conditionalStatus = scene.conditional_status;
|
||||
mapOpen = scene.map_open;
|
||||
navigateOnOpenpilot = scene.navigate_on_openpilot;
|
||||
randomEvent = scene.current_random_event;
|
||||
rotatingWheel = scene.rotating_wheel;
|
||||
|
@ -135,10 +137,12 @@ void ExperimentalButton::paintEvent(QPaintEvent *event) {
|
|||
(navigateOnOpenpilot ? bg_colors[STATUS_NAVIGATION_ACTIVE] : QColor(0, 0, 0, 166)))))) :
|
||||
QColor(0, 0, 0, 166);
|
||||
|
||||
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 (!(bigMap && mapOpen)) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,9 @@ private:
|
|||
|
||||
// FrogPilot variables
|
||||
bool alwaysOnLateralActive;
|
||||
bool bigMap;
|
||||
bool conditionalExperimental;
|
||||
bool mapOpen;
|
||||
bool navigateOnOpenpilot;
|
||||
bool rotatingWheel;
|
||||
bool trafficModeActive;
|
||||
|
|
|
@ -173,6 +173,11 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
|
|||
bool sidebarVisible = geometry().x() > 0;
|
||||
bool show_map = 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)
|
||||
|
|
|
@ -417,6 +417,9 @@ void ui_update_frogpilot_params(UIState *s, Params ¶ms) {
|
|||
scene.reverse_cruise = quality_of_life_controls && params.getBool("ReverseCruise");
|
||||
scene.reverse_cruise_ui = params.getBool("ReverseCruiseUI");
|
||||
|
||||
bool quality_of_life_visuals = params.getBool("QOLVisuals");
|
||||
scene.big_map = quality_of_life_visuals && params.getBool("BigMap");
|
||||
|
||||
scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
|
||||
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");
|
||||
scene.show_slc_offset_ui = scene.speed_limit_controller && params.getBool("ShowSLCOffsetUI");
|
||||
|
|
|
@ -126,6 +126,7 @@ typedef struct UIScene {
|
|||
bool adjacent_path;
|
||||
bool adjacent_path_metrics;
|
||||
bool always_on_lateral_active;
|
||||
bool big_map;
|
||||
bool blind_spot_left;
|
||||
bool blind_spot_path;
|
||||
bool blind_spot_right;
|
||||
|
|
Loading…
Reference in New Issue