mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-06 00:36:25 +08:00
39 lines
767 B
C++
39 lines
767 B
C++
#pragma once
|
|
|
|
#include "selfdrive/ui/ui.h"
|
|
|
|
struct StatsLabels {
|
|
QLabel *distance;
|
|
QLabel *distance_unit;
|
|
QLabel *hours;
|
|
QLabel *routes;
|
|
};
|
|
|
|
class DriveStats : public QFrame {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DriveStats(QWidget *parent = 0);
|
|
|
|
private:
|
|
void addStatsLayouts(const QString &title, StatsLabels &labels, bool StarPilot = false);
|
|
void showEvent(QShowEvent *event) override;
|
|
void updateStarPilotStatsForLabel(StatsLabels &labels);
|
|
void updateStats();
|
|
void updateStatsForLabel(const QJsonObject &obj, StatsLabels &labels);
|
|
|
|
bool isMetric;
|
|
bool konik;
|
|
|
|
Params params;
|
|
|
|
QJsonDocument stats;
|
|
|
|
StatsLabels all;
|
|
StatsLabels frogPilot;
|
|
StatsLabels week;
|
|
|
|
private slots:
|
|
void parseResponse(const QString &response, bool success);
|
|
};
|