mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-08-03 08:41:41 +08:00
ea8eaed1aa
# Conflicts: # README.md # opendbc_repo # panda # selfdrive/ui/qt/offroad/settings.cc # selfdrive/ui/translations/main_ar.ts # selfdrive/ui/translations/main_de.ts # selfdrive/ui/translations/main_es.ts # selfdrive/ui/translations/main_fr.ts # selfdrive/ui/translations/main_ja.ts # selfdrive/ui/translations/main_ko.ts # selfdrive/ui/translations/main_pt-BR.ts # selfdrive/ui/translations/main_th.ts # selfdrive/ui/translations/main_tr.ts # selfdrive/ui/translations/main_zh-CHS.ts # selfdrive/ui/translations/main_zh-CHT.ts # system/manager/build.py # system/ui/spinner.py # tinygrad_repo # tools/lib/framereader.py Merge branch 'comma-202506127-bedcb896644528aed6af448e63eeadb3dd8b2c77' into sync-20250627 # Conflicts: # opendbc/safety/tests/libsafety/SConscript Merge branch 'comma-202506127-bedcb896644528aed6af448e63eeadb3dd8b2c77' into sync-20250627 # Conflicts: # opendbc/safety/tests/libsafety/SConscript Merge remote-tracking branch 'comma/master' into sync-20250627 # Conflicts: # opendbc/safety/tests/libsafety/SConscript Merge branch 'comma-20250627-1020d355584265391eb3acb556e4353b581fa9c0' into sync-20250627 Merge branch 'comma-20250627-1020d355584265391eb3acb556e4353b581fa9c0' into sync-20250627 Sync: `commaai/opendbc:master` into `sunnypilot/opendbc:master-new` Sync: `commaai/opendbc:master` into `sunnypilot/opendbc:master-new` Sync: `commaai/panda:master` into `sunnypilot/panda:master-new` Sync: `commaai/panda:master` into `sunnypilot/panda:master-new`
119 lines
2.5 KiB
C++
119 lines
2.5 KiB
C++
#pragma once
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
#include <QButtonGroup>
|
|
#include <QFrame>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QStackedWidget>
|
|
#include <QWidget>
|
|
|
|
#include "selfdrive/ui/qt/util.h"
|
|
|
|
#ifdef SUNNYPILOT
|
|
#include "selfdrive/ui/sunnypilot/ui.h"
|
|
#include "selfdrive/ui/sunnypilot/qt/widgets/controls.h"
|
|
#define ListWidget ListWidgetSP
|
|
#define ParamControl ParamControlSP
|
|
#define ButtonControl ButtonControlSP
|
|
#define ButtonParamControl ButtonParamControlSP
|
|
#define ToggleControl ToggleControlSP
|
|
#define LabelControl LabelControlSP
|
|
#else
|
|
#include "selfdrive/ui/ui.h"
|
|
#include "selfdrive/ui/qt/widgets/controls.h"
|
|
#endif
|
|
|
|
// ********** settings window + top-level panels **********
|
|
class SettingsWindow : public QFrame {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit SettingsWindow(QWidget *parent = 0);
|
|
void setCurrentPanel(int index, const QString ¶m = "");
|
|
|
|
protected:
|
|
void showEvent(QShowEvent *event) override;
|
|
|
|
signals:
|
|
void closeSettings();
|
|
void reviewTrainingGuide();
|
|
void showDriverView();
|
|
void expandToggleDescription(const QString ¶m);
|
|
void scrollToToggle(const QString ¶m);
|
|
|
|
protected:
|
|
QPushButton *sidebar_alert_widget;
|
|
QWidget *sidebar_widget;
|
|
QButtonGroup *nav_btns;
|
|
QStackedWidget *panel_widget;
|
|
};
|
|
|
|
class DevicePanel : public ListWidget {
|
|
Q_OBJECT
|
|
public:
|
|
explicit DevicePanel(SettingsWindow *parent);
|
|
|
|
signals:
|
|
void reviewTrainingGuide();
|
|
void showDriverView();
|
|
|
|
protected slots:
|
|
void poweroff();
|
|
void reboot();
|
|
void updateCalibDescription();
|
|
|
|
protected:
|
|
Params params;
|
|
ButtonControl *pair_device;
|
|
ButtonControl *resetCalibBtn;
|
|
};
|
|
|
|
class TogglesPanel : public ListWidget {
|
|
Q_OBJECT
|
|
public:
|
|
explicit TogglesPanel(SettingsWindow *parent);
|
|
void showEvent(QShowEvent *event) override;
|
|
|
|
public slots:
|
|
void expandToggleDescription(const QString ¶m);
|
|
void scrollToToggle(const QString ¶m);
|
|
|
|
protected slots:
|
|
virtual void updateState(const UIState &s);
|
|
|
|
protected:
|
|
Params params;
|
|
std::map<std::string, ParamControl*> toggles;
|
|
ButtonParamControl *long_personality_setting;
|
|
|
|
virtual void updateToggles();
|
|
};
|
|
|
|
class SoftwarePanel : public ListWidget {
|
|
Q_OBJECT
|
|
public:
|
|
explicit SoftwarePanel(QWidget* parent = nullptr);
|
|
|
|
protected:
|
|
void showEvent(QShowEvent *event) override;
|
|
virtual void updateLabels();
|
|
void checkForUpdates();
|
|
|
|
bool is_onroad = false;
|
|
|
|
QLabel *onroadLbl;
|
|
LabelControl *versionLbl;
|
|
ButtonControl *installBtn;
|
|
ButtonControl *downloadBtn;
|
|
ButtonControl *targetBranchBtn;
|
|
|
|
Params params;
|
|
ParamWatcher *fs_watch;
|
|
};
|
|
|
|
// Forward declaration
|
|
class FirehosePanel;
|