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.
87 lines
1.8 KiB
C++
Executable File
87 lines
1.8 KiB
C++
Executable File
#pragma once
|
|
|
|
#include <QFutureWatcher>
|
|
#include <QStackedLayout>
|
|
#include <QLabel>
|
|
#include <QSocketNotifier>
|
|
#include <QTimer>
|
|
#include <QWidget>
|
|
|
|
#include "selfdrive/ui/qt/home.h"
|
|
#include "selfdrive/ui/qt/offroad/onboarding.h"
|
|
#include "selfdrive/ui/qt/offroad/settings.h"
|
|
|
|
class StatusWindow : public QFrame {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit StatusWindow(QWidget *parent = 0);
|
|
|
|
struct StatusData {
|
|
QString time, storage, ram, load, temp, fan, ip, wifi;
|
|
QString vpn_status, vpn_ip, gps, telemetry;
|
|
QString dashcam_state, dashcam_frames;
|
|
float temp_c = 0;
|
|
};
|
|
|
|
protected:
|
|
void mousePressEvent(QMouseEvent *e) override;
|
|
|
|
signals:
|
|
void closeStatus();
|
|
|
|
private slots:
|
|
void kickRefresh();
|
|
void applyResults();
|
|
|
|
private:
|
|
|
|
QFutureWatcher<StatusData> watcher;
|
|
bool collecting = false;
|
|
|
|
QLabel *storage_label;
|
|
QLabel *ram_label;
|
|
QLabel *load_label;
|
|
QLabel *temp_label;
|
|
QLabel *fan_label;
|
|
QLabel *ip_label;
|
|
QLabel *wifi_label;
|
|
QLabel *vpn_label;
|
|
QLabel *gps_label;
|
|
QLabel *time_label;
|
|
QLabel *telemetry_label;
|
|
QLabel *dashcam_label;
|
|
QLabel *panda_label;
|
|
};
|
|
|
|
class MainWindow : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = 0);
|
|
|
|
private:
|
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
|
void openSettings(int index = 0, const QString ¶m = "");
|
|
void openStatus();
|
|
void closeSettings();
|
|
QString dumpWidgetTree(QWidget *w, int depth = 0);
|
|
|
|
QStackedLayout *main_layout;
|
|
HomeWindow *homeWindow;
|
|
SettingsWindow *settingsWindow;
|
|
StatusWindow *statusWindow;
|
|
OnboardingWindow *onboardingWindow;
|
|
|
|
// CLEARPILOT: UI introspection RPC
|
|
void *zmq_ctx = nullptr;
|
|
void *zmq_sock = nullptr;
|
|
QSocketNotifier *rpc_notifier = nullptr;
|
|
|
|
// FrogPilot variables
|
|
Params params;
|
|
|
|
private slots:
|
|
void handleRpcRequest();
|
|
};
|