Files
clearpilot/selfdrive/ui/qt/window.h
Brian Hanson c33e155c56 UI overhaul, VPN management, controlsd fix, screen recorder removal
- Fix controlsd crash: self.state.name AttributeError when state is int
- Move telemetry tlog import to module level in carstate.py (was per-frame)
- Remove FrogPilot screen recorder from UI (was crashing OMX on init)
- Ready screen: boot logo background, 8-bit READY! sprite, error states
  (panda not connected, car not recognized) with 10s startup grace period
- ClearPilot menu: always opens to General, QButtonGroup for sidebar,
  System Status uses ButtonControl, VPN toggle with process control
- Sidebar hidden on construction (no flash before splash)
- Status window: threaded data collection (QtConcurrent), panda detection
  via scene.pandaType (SPI, not USB), only refreshes when visible
- VPN: moved to system/clearpilot/, SIGTERM graceful shutdown, keepalive
  ping through tunnel, killall openvpn on disable, launched from
  launch_openpilot.sh instead of continue.sh
- Disable gpsd and dashcamd temporarily for perf testing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:43:54 -05:00

85 lines
1.7 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;
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 *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 &param = "");
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();
};