ui: sunnypilot panel in settings (#513)

* ui: sunnypilot panel in settings

* add panel to comment

* test populate screenshot

* Revert "test populate screenshot"

This reverts commit 426b6c26c5.
This commit is contained in:
Jason Wen
2025-01-03 17:18:38 -05:00
committed by GitHub
parent 3a64efe52f
commit a3ab6db7eb
6 changed files with 53 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ jobs:
run: >-
sudo apt-get install -y imagemagick
scenes="homescreen settings_device settings_software settings_toggles settings_developer offroad_alert update_available prime onroad onroad_disengaged onroad_override onroad_sidebar onroad_wide onroad_wide_sidebar onroad_alert_small onroad_alert_mid onroad_alert_full driver_camera body keyboard"
scenes="homescreen settings_device settings_software settings_toggles settings_sunnypilot settings_developer offroad_alert update_available prime onroad onroad_disengaged onroad_override onroad_sidebar onroad_wide onroad_wide_sidebar onroad_alert_small onroad_alert_mid onroad_alert_full driver_camera body keyboard"
A=($scenes)
DIFF=""

View File

@@ -10,6 +10,7 @@ qt_src = [
"sunnypilot/qt/window.cc",
"sunnypilot/qt/home.cc",
"sunnypilot/qt/offroad/settings/settings.cc",
"sunnypilot/qt/offroad/settings/sunnypilot_panel.cc",
"sunnypilot/qt/onroad/onroad_home.cc",
]

View File

@@ -11,6 +11,8 @@
#include "selfdrive/ui/sunnypilot/qt/widgets/scrollview.h"
#include "selfdrive/ui/qt/offroad/developer_panel.h"
#include "selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h"
TogglesPanelSP::TogglesPanelSP(SettingsWindow *parent) : TogglesPanel(parent) {
QObject::connect(uiStateSP(), &UIStateSP::uiUpdate, this, &TogglesPanelSP::updateState);
}
@@ -68,6 +70,7 @@ SettingsWindowSP::SettingsWindowSP(QWidget *parent) : SettingsWindow(parent) {
PanelInfo(" " + tr("Network"), networking, "../assets/offroad/icon_network.png"),
PanelInfo(" " + tr("Toggles"), toggles, "../../sunnypilot/selfdrive/assets/offroad/icon_toggle.png"),
PanelInfo(" " + tr("Software"), new SoftwarePanel(this), "../../sunnypilot/selfdrive/assets/offroad/icon_software.png"),
PanelInfo(" " + tr("sunnypilot"), new SunnypilotPanel(this), "../assets/images/button_home.png"),
PanelInfo(" " + tr("Developer"), new DeveloperPanel(this), "../assets/offroad/icon_shell.png"),
};

View File

@@ -0,0 +1,14 @@
/**
* Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
*
* This file is part of sunnypilot and is licensed under the MIT License.
* See the LICENSE.md file in the root directory for more details.
*/
#include "selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h"
#include "common/util.h"
#include "selfdrive/ui/sunnypilot/qt/widgets/controls.h"
SunnypilotPanel::SunnypilotPanel(SettingsWindowSP *parent) : ListWidget(parent) {
}

View File

@@ -0,0 +1,25 @@
/**
* Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
*
* This file is part of sunnypilot and is licensed under the MIT License.
* See the LICENSE.md file in the root directory for more details.
*/
#pragma once
#include <map>
#include <string>
#include "selfdrive/ui/sunnypilot/ui.h"
#include "selfdrive/ui/qt/util.h"
#include "selfdrive/ui/sunnypilot/qt/offroad/settings/settings.h"
class SunnypilotPanel : public ListWidget {
Q_OBJECT
public:
explicit SunnypilotPanel(SettingsWindowSP *parent = nullptr);
private:
QStackedLayout* main_layout = nullptr;
};

View File

@@ -42,17 +42,22 @@ def setup_settings_device(click, pm: PubMaster):
def setup_settings_toggles(click, pm: PubMaster):
setup_settings_device(click, pm)
click(278, 650)
click(278, 586)
time.sleep(UI_DELAY)
def setup_settings_software(click, pm: PubMaster):
setup_settings_device(click, pm)
click(278, 800)
click(278, 716)
time.sleep(UI_DELAY)
def setup_settings_sunnypilot(click, pm: PubMaster):
setup_settings_device(click, pm)
click(278, 846)
time.sleep(UI_DELAY)
def setup_settings_developer(click, pm: PubMaster):
setup_settings_device(click, pm)
click(278, 960)
click(278, 976)
time.sleep(UI_DELAY)
def setup_onroad(click, pm: PubMaster):
@@ -183,6 +188,7 @@ CASES = {
"settings_device": setup_settings_device,
"settings_toggles": setup_settings_toggles,
"settings_software": setup_settings_software,
"settings_sunnypilot": setup_settings_sunnypilot,
"settings_developer": setup_settings_developer,
"onroad": setup_onroad,
"onroad_disengaged": setup_onroad_disengaged,