From 4006d9f370d9fa1143504f79f24f9d42c8335770 Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 20:08:23 +0200 Subject: [PATCH 01/11] Update settings.cc --- selfdrive/ui/qt/offroad/settings.cc | 104 ++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 30 deletions(-) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 8d65e1107..cae33c164 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -16,37 +16,8 @@ #include "selfdrive/ui/qt/offroad/developer_panel.h" #include "selfdrive/ui/qt/offroad/firehose.h" -TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) { - // param, title, desc, icon, restart needed +InfiniteCableTogglesPanel::InfiniteCableTogglesPanel(SettingsWindow *parent) : ListWidget(parent) { std::vector> toggle_defs{ - { - "OpenpilotEnabledToggle", - tr("Enable sunnypilot"), - tr("Use the sunnypilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature."), - "../assets/icons/chffr_wheel.png", - true, - }, - { - "ExperimentalMode", - tr("Experimental Mode"), - "", - "../assets/icons/experimental_white.svg", - false, - }, - { - "DynamicExperimentalControl", - tr("Enable Dynamic Experimental Control"), - tr("Enable toggle to allow the model to determine when to use sunnypilot ACC or sunnypilot End to End Longitudinal."), - "../assets/offroad/icon_blank.png", - false, - }, - { - "DisengageOnAccelerator", - tr("Disengage on Accelerator Pedal"), - tr("When enabled, pressing the accelerator pedal will disengage sunnypilot."), - "../assets/icons/disengage_on_accelerator.svg", - false, - }, { "EnableCurvatureController", tr("Enable Curvature Controller"), @@ -96,6 +67,75 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) { "../assets/icons/capslock-fill.png", false, }, + }; + + for (auto &[param, title, desc, icon, needs_restart] : toggle_defs) { + auto toggle = new ParamControl(param, title, desc, icon, this); + + bool locked = params.getBool((param + "Lock").toStdString()); + toggle->setEnabled(!locked); + + if (needs_restart && !locked) { + toggle->setDescription(toggle->getDescription() + tr(" Changing this setting will restart openpilot if the car is powered on.")); + + QObject::connect(uiState(), &UIState::engagedChanged, [toggle](bool engaged) { + toggle->setEnabled(!engaged); + }); + + QObject::connect(toggle, &ParamControl::toggleFlipped, [=](bool state) { + params.putBool("OnroadCycleRequested", true); + }); + } + + addItem(toggle); + toggles[param.toStdString()] = toggle; + } +} + +void InfiniteCableTogglesPanel::expandToggleDescription(const QString ¶m) { + toggles[param.toStdString()]->showDescription(); +} + +void InfiniteCableTogglesPanel::scrollToToggle(const QString ¶m) { + if (auto it = toggles.find(param.toStdString()); it != toggles.end()) { + auto scroll_area = qobject_cast(parent()->parent()); + if (scroll_area) { + scroll_area->ensureWidgetVisible(it->second); + } + } +} + +TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) { + // param, title, desc, icon, restart needed + std::vector> toggle_defs{ + { + "OpenpilotEnabledToggle", + tr("Enable sunnypilot"), + tr("Use the sunnypilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature."), + "../assets/icons/chffr_wheel.png", + true, + }, + { + "ExperimentalMode", + tr("Experimental Mode"), + "", + "../assets/icons/experimental_white.svg", + false, + }, + { + "DynamicExperimentalControl", + tr("Enable Dynamic Experimental Control"), + tr("Enable toggle to allow the model to determine when to use sunnypilot ACC or sunnypilot End to End Longitudinal."), + "../assets/offroad/icon_blank.png", + false, + }, + { + "DisengageOnAccelerator", + tr("Disengage on Accelerator Pedal"), + tr("When enabled, pressing the accelerator pedal will disengage sunnypilot."), + "../assets/icons/disengage_on_accelerator.svg", + false, + }, { "IsLdwEnabled", tr("Enable Lane Departure Warnings"), @@ -530,6 +570,10 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) { QObject::connect(device, &DevicePanel::reviewTrainingGuide, this, &SettingsWindow::reviewTrainingGuide); QObject::connect(device, &DevicePanel::showDriverView, this, &SettingsWindow::showDriverView); + InfiniteCableTogglesPanel *ictoggles = new InfiniteCableTogglesPanel(this); + QObject::connect(this, &SettingsWindow::expandToggleDescription, ictoggles, &InfiniteCableTogglesPanel::expandToggleDescription); + QObject::connect(this, &SettingsWindow::scrollToToggle, ictoggles, &InfiniteCableTogglesPanel::scrollToToggle); + TogglesPanel *toggles = new TogglesPanel(this); QObject::connect(this, &SettingsWindow::expandToggleDescription, toggles, &TogglesPanel::expandToggleDescription); QObject::connect(this, &SettingsWindow::scrollToToggle, toggles, &TogglesPanel::scrollToToggle); From 806f4e15832ea34d7a955552afb2aacce4696e34 Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 20:08:33 +0200 Subject: [PATCH 02/11] Update settings.h --- selfdrive/ui/qt/offroad/settings.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/selfdrive/ui/qt/offroad/settings.h b/selfdrive/ui/qt/offroad/settings.h index a11a30012..501a9732c 100644 --- a/selfdrive/ui/qt/offroad/settings.h +++ b/selfdrive/ui/qt/offroad/settings.h @@ -71,6 +71,20 @@ protected: ButtonControl *resetCalibBtn; }; +class InfiniteCableTogglesPanel : public ListWidget { + Q_OBJECT +public: + explicit InfiniteCableTogglesPanel(SettingsWindow *parent); + +public slots: + void expandToggleDescription(const QString ¶m); + void scrollToToggle(const QString ¶m); + +protected: + Params params; + std::map toggles; +}; + class TogglesPanel : public ListWidget { Q_OBJECT public: From e812a36426f8b455e777d0c0b649d1c0fb4a8fa6 Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 20:17:35 +0200 Subject: [PATCH 03/11] Update settings.cc --- selfdrive/ui/qt/offroad/settings.cc | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index cae33c164..12f21ca98 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -20,25 +20,32 @@ InfiniteCableTogglesPanel::InfiniteCableTogglesPanel(SettingsWindow *parent) : L std::vector> toggle_defs{ { "EnableCurvatureController", - tr("Enable Curvature Controller"), - tr("Enables curvature post-processing
"), + tr("VW MEB: Curvature Correction"), + tr("Enables curvature PID post-processing additionally to QFK curvature offset
"), "../assets/icons/chffr_wheel.png", false, }, { "EnableSpeedLimitControl", - tr("Enable Speed Limit Control"), + tr("VW MEB: Enable Speed Limit Control"), tr("Enables setting maximum speed by speed limit detection
"), "../assets/icons/speed_limit.png", false, }, { "EnableSpeedLimitPredicative", - tr("Enable Predicative Speed Limit"), + tr("VW MEB: Enable Predicative Speed Limit"), tr("Enables setting predicative speed limit
"), "../assets/icons/speed_limit.png", false, }, + { + "BatteryDetails", + tr("VW MEB: Display Battery Details"), + tr("Enable battery details panel."), + "../assets/icons/capslock-fill.png", + false, + }, { "EnableSmoothSteer", tr("Enable Steer Smoothing"), @@ -55,18 +62,11 @@ InfiniteCableTogglesPanel::InfiniteCableTogglesPanel(SettingsWindow *parent) : L }, { "DisableScreenTimer", - tr("Turn onroad screen off after 10 seconds"), + tr("Onroad screen timeout"), tr("the onroad screen is turned of after 10 seconds. It will be temporarily enabled on alerts."), "../assets/icons/eye_closed.png", false, }, - { - "BatteryDetails", - tr("Display Battery Details"), - tr("Enable battery details panel."), - "../assets/icons/capslock-fill.png", - false, - }, }; for (auto &[param, title, desc, icon, needs_restart] : toggle_defs) { @@ -584,6 +584,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) { QList> panels = { {tr("Device"), device}, {tr("Network"), networking}, + {tr("infinitCable Toggles"), ictoggles}, {tr("Toggles"), toggles}, {tr("Software"), new SoftwarePanel(this)}, {tr("Firehose"), new FirehosePanel(this)}, From 68e886cfaa30498256b494a86dd735f4f32c9a1e Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 20:42:51 +0200 Subject: [PATCH 04/11] Update settings.cc --- selfdrive/ui/qt/offroad/settings.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 12f21ca98..2a37abcd9 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -584,7 +584,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) { QList> panels = { {tr("Device"), device}, {tr("Network"), networking}, - {tr("infinitCable Toggles"), ictoggles}, + {tr("infiniteCable Toggles"), ictoggles}, {tr("Toggles"), toggles}, {tr("Software"), new SoftwarePanel(this)}, {tr("Firehose"), new FirehosePanel(this)}, From 8a24c00701ec4dad61cf6f5bd86945ff1c95e19a Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 20:43:57 +0200 Subject: [PATCH 05/11] Update settings.py --- selfdrive/ui/layouts/settings/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/selfdrive/ui/layouts/settings/settings.py b/selfdrive/ui/layouts/settings/settings.py index 674e5005f..61835b257 100644 --- a/selfdrive/ui/layouts/settings/settings.py +++ b/selfdrive/ui/layouts/settings/settings.py @@ -38,6 +38,7 @@ class PanelType(IntEnum): SOFTWARE = 3 FIREHOSE = 4 DEVELOPER = 5 + ICTOGGLES = 6 @dataclass @@ -56,6 +57,7 @@ class SettingsLayout(Widget): self._panels = { PanelType.DEVICE: PanelInfo("Device", DeviceLayout()), PanelType.NETWORK: PanelInfo("Network", NetworkLayout()), + PanelType.ICTOGGLES: PanelInfo("infiniteCable Toggles", TogglesLayout()), PanelType.TOGGLES: PanelInfo("Toggles", TogglesLayout()), PanelType.SOFTWARE: PanelInfo("Software", SoftwareLayout()), PanelType.FIREHOSE: PanelInfo("Firehose", FirehoseLayout()), From ad9f836080a1ee7a52a5fb581001f2bc255c5ca1 Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 20:56:00 +0200 Subject: [PATCH 06/11] Update settings.py --- selfdrive/ui/layouts/settings/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/layouts/settings/settings.py b/selfdrive/ui/layouts/settings/settings.py index 61835b257..a8c9e8a9d 100644 --- a/selfdrive/ui/layouts/settings/settings.py +++ b/selfdrive/ui/layouts/settings/settings.py @@ -57,7 +57,7 @@ class SettingsLayout(Widget): self._panels = { PanelType.DEVICE: PanelInfo("Device", DeviceLayout()), PanelType.NETWORK: PanelInfo("Network", NetworkLayout()), - PanelType.ICTOGGLES: PanelInfo("infiniteCable Toggles", TogglesLayout()), + PanelType.ICTOGGLES: PanelInfo("infiniteCableCustom", TogglesLayout()), PanelType.TOGGLES: PanelInfo("Toggles", TogglesLayout()), PanelType.SOFTWARE: PanelInfo("Software", SoftwareLayout()), PanelType.FIREHOSE: PanelInfo("Firehose", FirehoseLayout()), From ad5debf4819581506b5892cb242b5732e9bce939 Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 20:56:34 +0200 Subject: [PATCH 07/11] Update settings.cc --- selfdrive/ui/qt/offroad/settings.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 2a37abcd9..970b4d4c8 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -584,7 +584,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) { QList> panels = { {tr("Device"), device}, {tr("Network"), networking}, - {tr("infiniteCable Toggles"), ictoggles}, + {tr("infiniteCableCustom"), ictoggles}, {tr("Toggles"), toggles}, {tr("Software"), new SoftwarePanel(this)}, {tr("Firehose"), new FirehosePanel(this)}, From c1242a185d3ad1435735d486ac8beb19b806826a Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 21:02:09 +0200 Subject: [PATCH 08/11] Update settings.cc --- selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc b/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc index 5415e75ea..5c908e940 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc @@ -81,6 +81,7 @@ SettingsWindowSP::SettingsWindowSP(QWidget *parent) : SettingsWindow(parent) { PanelInfo(" " + tr("Device"), device, "../../sunnypilot/selfdrive/assets/offroad/icon_home.svg"), PanelInfo(" " + tr("Network"), networking, "../assets/icons/network.png"), PanelInfo(" " + tr("sunnylink"), new SunnylinkPanel(this), "../assets/icons/wifi_strength_full.svg"), + PanelInfo(" " + tr("infiniteCableCustom"), ictoggles, "../../sunnypilot/selfdrive/assets/offroad/icon_toggle.png"), PanelInfo(" " + tr("Toggles"), toggles, "../../sunnypilot/selfdrive/assets/offroad/icon_toggle.png"), PanelInfo(" " + tr("Software"), new SoftwarePanelSP(this), "../../sunnypilot/selfdrive/assets/offroad/icon_software.png"), PanelInfo(" " + tr("Models"), new ModelsPanel(this), "../../sunnypilot/selfdrive/assets/offroad/icon_models.png"), From e07866eab2e7889b0f6ceafd825ea15944db3136 Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 21:08:51 +0200 Subject: [PATCH 09/11] Update settings.cc --- selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc b/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc index 5c908e940..0f8488712 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/settings.cc @@ -81,7 +81,7 @@ SettingsWindowSP::SettingsWindowSP(QWidget *parent) : SettingsWindow(parent) { PanelInfo(" " + tr("Device"), device, "../../sunnypilot/selfdrive/assets/offroad/icon_home.svg"), PanelInfo(" " + tr("Network"), networking, "../assets/icons/network.png"), PanelInfo(" " + tr("sunnylink"), new SunnylinkPanel(this), "../assets/icons/wifi_strength_full.svg"), - PanelInfo(" " + tr("infiniteCableCustom"), ictoggles, "../../sunnypilot/selfdrive/assets/offroad/icon_toggle.png"), + PanelInfo(" " + tr("infiniteCableCustom"), new InfiniteCableTogglesPanel(this), "../../sunnypilot/selfdrive/assets/offroad/icon_toggle.png"), PanelInfo(" " + tr("Toggles"), toggles, "../../sunnypilot/selfdrive/assets/offroad/icon_toggle.png"), PanelInfo(" " + tr("Software"), new SoftwarePanelSP(this), "../../sunnypilot/selfdrive/assets/offroad/icon_software.png"), PanelInfo(" " + tr("Models"), new ModelsPanel(this), "../../sunnypilot/selfdrive/assets/offroad/icon_models.png"), From 13ecc929d2eac96e2d1aec9c562d59647bb77ef7 Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 21:13:53 +0200 Subject: [PATCH 10/11] Update settings.cc --- selfdrive/ui/qt/offroad/settings.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 970b4d4c8..7d9639ef2 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -20,21 +20,21 @@ InfiniteCableTogglesPanel::InfiniteCableTogglesPanel(SettingsWindow *parent) : L std::vector> toggle_defs{ { "EnableCurvatureController", - tr("VW MEB: Curvature Correction"), + tr("VW MEB: Lateral Correction (Recommended)"), tr("Enables curvature PID post-processing additionally to QFK curvature offset
"), "../assets/icons/chffr_wheel.png", false, }, { "EnableSpeedLimitControl", - tr("VW MEB: Enable Speed Limit Control"), + tr("VW MEB: Speed Limit Control"), tr("Enables setting maximum speed by speed limit detection
"), "../assets/icons/speed_limit.png", false, }, { "EnableSpeedLimitPredicative", - tr("VW MEB: Enable Predicative Speed Limit"), + tr("VW MEB: Predicative Speed Limit"), tr("Enables setting predicative speed limit
"), "../assets/icons/speed_limit.png", false, @@ -42,13 +42,13 @@ InfiniteCableTogglesPanel::InfiniteCableTogglesPanel(SettingsWindow *parent) : L { "BatteryDetails", tr("VW MEB: Display Battery Details"), - tr("Enable battery details panel."), + tr("Display battery detail panel"), "../assets/icons/capslock-fill.png", false, }, { "EnableSmoothSteer", - tr("Enable Steer Smoothing"), + tr("Steer Smoothing"), tr("Enables S-curving on lateral control for smoother steering
"), "../assets/icons/chffr_wheel.png", false, @@ -56,14 +56,14 @@ InfiniteCableTogglesPanel::InfiniteCableTogglesPanel(SettingsWindow *parent) : L { "DarkMode", tr("Dark Mode"), - tr("Force brightness to a minimal value."), + tr("Force brightness to a minimal value"), "../assets/icons/eye_closed.png", false, }, { "DisableScreenTimer", - tr("Onroad screen timeout"), - tr("the onroad screen is turned of after 10 seconds. It will be temporarily enabled on alerts."), + tr("Onroad Screen Timeout"), + tr("the onroad screen is turned of after 10 seconds. It will be temporarily enabled on alerts"), "../assets/icons/eye_closed.png", false, }, From 95ce7f2f876befd95aca93268173898594a129f8 Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Wed, 3 Sep 2025 21:18:06 +0200 Subject: [PATCH 11/11] Update params_keys.h enable by default --- common/params_keys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/params_keys.h b/common/params_keys.h index 425b83700..0cbe48ebf 100644 --- a/common/params_keys.h +++ b/common/params_keys.h @@ -132,7 +132,7 @@ inline static std::unordered_map keys = { // --- infiniteCable params --- // {"DisableScreenTimer", {PERSISTENT, BOOL}}, {"DarkMode", {PERSISTENT, BOOL}}, - {"EnableCurvatureController", {PERSISTENT, BOOL}}, + {"EnableCurvatureController", {PERSISTENT, BOOL, "1"}}, {"EnableScreenEvent", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, {"EnableSmoothSteer", {PERSISTENT, BOOL}}, {"EnableSpeedLimitControl", {PERSISTENT, BOOL}},