b5a0b3221c
Wholesale port of the 10 UI files (main.cc, ui.{cc,h}, onroad.{cc,h},
home.{cc,h}, window.{cc,h}, ready.{cc,h}, SConscript). sidebar.{cc,h}
unchanged.
Brings in:
- splash/ready screen rendered via Qt directly (replaces stock home)
- ready page shown when started but gear=park
- ClearPilot offroad menu (Home/Dashcam/Debug panels) replacing stock
- onroad UI: speed widget reading ClearpilotSpeedDisplay (gpsLocation
via speed_logicd), speed-limit widget, cruise-vs-limit warning sign
- nightrider mode: camera suppressed, lane lines/path drawn as 2px
outlines only (ScreenDisplayMode 1 or 4)
- screen power: ScreenDisplayMode 3 forces setAwake(false)
- ignition off blanks screen immediately (tap still wakes)
- Qt-based RPC widget-tree dump server at ipc:///tmp/clearpilot_ui_rpc
- crash handler in main.cc with stack trace
Deviation from broken (3 sites): no_lat_lane_change is read from
paramsMemory (controlsd writes it there in baseline) instead of broken's
custom cereal field frogpilotCarControl.noLatLaneChange. Keeps the
existing self-driving wiring intact.
SConscript drops screenrecorder.cc from qt_src (broken did the same;
omx_encoder.cc still built for dashcamd's future link).
Build clean. UI hasn't been launched yet — that comes after the
controlsd button-handler commit lands.
Translation .ts files are auto-regenerated by Qt's lupdate; included.
80 lines
1.7 KiB
C++
Executable File
80 lines
1.7 KiB
C++
Executable File
#pragma once
|
|
|
|
#include <QButtonGroup>
|
|
#include <QFrame>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QStackedLayout>
|
|
#include <QStackedWidget>
|
|
#include <QTimer>
|
|
#include <QWidget>
|
|
|
|
#include "common/params.h"
|
|
#include "selfdrive/ui/qt/offroad/driverview.h"
|
|
#include "selfdrive/ui/qt/ready.h"
|
|
#include "selfdrive/ui/qt/onroad.h"
|
|
#include "selfdrive/ui/qt/sidebar.h"
|
|
#include "selfdrive/ui/qt/widgets/controls.h"
|
|
#include "selfdrive/ui/qt/widgets/offroad_alerts.h"
|
|
#include "selfdrive/ui/ui.h"
|
|
|
|
class ClearPilotPanel : public QFrame {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ClearPilotPanel(QWidget* parent = 0);
|
|
|
|
signals:
|
|
void openSettings(int index = 0, const QString ¶m = "");
|
|
void openStatus();
|
|
void closePanel();
|
|
|
|
public:
|
|
void resetToGeneral();
|
|
|
|
private:
|
|
QStackedWidget *panel_widget;
|
|
QButtonGroup *nav_group;
|
|
};
|
|
|
|
class HomeWindow : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit HomeWindow(QWidget* parent = 0);
|
|
QWidget* _parent = 0;
|
|
|
|
signals:
|
|
void openSettings(int index = 0, const QString ¶m = "");
|
|
void openStatus();
|
|
void closeSettings();
|
|
|
|
public slots:
|
|
void offroadTransition(bool offroad);
|
|
void showDriverView(bool show, bool started=false);
|
|
void showOnroad();
|
|
void showSidebar(bool show);
|
|
|
|
protected:
|
|
void mousePressEvent(QMouseEvent* e) override;
|
|
void mouseDoubleClickEvent(QMouseEvent* e) override;
|
|
|
|
private:
|
|
Sidebar *sidebar;
|
|
ClearPilotPanel *home;
|
|
OnroadWindow *onroad;
|
|
DriverViewWindow *driver_view;
|
|
QStackedLayout *slayout;
|
|
|
|
// FrogPilot variables
|
|
Params params;
|
|
Params paramsMemory{"/dev/shm/params"};
|
|
|
|
// CLEARPILOT
|
|
ReadyWindow *ready;
|
|
bool was_parked_onroad = false;
|
|
|
|
private slots:
|
|
void updateState(const UIState &s);
|
|
};
|