mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-11 04:12:07 +08:00
dc3075790e
* Add navd folder * prints route instructions to console * broadcast NavInstuction without lanes * show basic instructions and eta * parse out lane info * use swaglog * clip distance on ui side * draw lane directions * show route * add to process config * add to release files * small cleanup * show route without gps * pop open map on initial route * fix error messages around no gps * done * make persistent process * handle end of route * clear route on offroad * only one timer * fix layout hacks * explicit rendering at 20Hz old-commit-hash: bef686f2752bcad4bb3116c2be63157ee01eab73
47 lines
1.0 KiB
C++
47 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <optional>
|
|
|
|
#include <QDateTime>
|
|
#include <QLayout>
|
|
#include <QMouseEvent>
|
|
#include <QPainter>
|
|
#include <QSurfaceFormat>
|
|
#include <QWidget>
|
|
|
|
QString getBrand();
|
|
QString getBrandVersion();
|
|
std::optional<QString> getDongleId();
|
|
void configFont(QPainter &p, const QString &family, int size, const QString &style);
|
|
void clearLayout(QLayout* layout);
|
|
void setQtSurfaceFormat();
|
|
QString timeAgo(const QDateTime &date);
|
|
void swagLogMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg);
|
|
void initApp();
|
|
QWidget* topWidget (QWidget* widget);
|
|
|
|
|
|
// convenience class for wrapping layouts
|
|
class LayoutWidget : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
LayoutWidget(QLayout *l, QWidget *parent = nullptr) : QWidget(parent) {
|
|
setLayout(l);
|
|
};
|
|
};
|
|
|
|
class ClickableWidget : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
ClickableWidget(QWidget *parent = nullptr);
|
|
|
|
protected:
|
|
void mouseReleaseEvent(QMouseEvent *event) override;
|
|
void paintEvent(QPaintEvent *) override;
|
|
|
|
signals:
|
|
void clicked();
|
|
};
|