Onroad compass

Added toggle for an onroad compass.
This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent 7546fe114a
commit 672a0e05e2
8 changed files with 162 additions and 3 deletions

View File

@@ -39,6 +39,28 @@ private:
UIScene &scene;
};
class Compass : public QWidget {
public:
explicit Compass(QWidget *parent = nullptr);
void initializeStaticElements();
void updateState(int bearing_deg);
protected:
void paintEvent(QPaintEvent *event) override;
private:
int bearingDeg;
int circleOffset;
int compassSize;
int degreeLabelOffset;
int innerCompass;
int x;
int y;
QPixmap compassInnerImg;
QPixmap staticElements;
};
class ExperimentalButton : public QPushButton {
Q_OBJECT
@@ -126,6 +148,8 @@ private:
UIScene &scene;
Compass *compass_img;
QHBoxLayout *bottom_layout;
bool accelerationPath;
@@ -133,6 +157,7 @@ private:
bool alwaysOnLateral;
bool blindSpotLeft;
bool blindSpotRight;
bool compass;
bool conditionalExperimental;
bool experimentalMode;
bool leadInfo;
@@ -146,6 +171,7 @@ private:
float cruiseAdjustment;
float laneWidthLeft;
float laneWidthRight;
int bearingDeg;
int cameraView;
int conditionalSpeed;
int conditionalSpeedLead;