openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

53 lines
1.3 KiB

#pragma once
#include <QWidget>
#include <QStackedWidget>
#include <QTextEdit>
#include <QMouseEvent>
#include <QImage>
#include "selfdrive/common/params.h"
class TrainingGuide : public QFrame {
Q_OBJECT
public:
explicit TrainingGuide(QWidget *parent = 0);
protected:
void mouseReleaseEvent(QMouseEvent* e) override;
void paintEvent(QPaintEvent *event) override;
private:
int currentIndex = 0;
QImage image;
// Vector of bounding boxes for the a given training guide step. (minx, maxx, miny, maxy)
QVector<QVector<int>> boundingBox {{250, 930, 750, 900}, {280, 1280, 650, 950}, {330, 1130, 590, 900}, {910, 1580, 500, 1000}, {1180, 1300, 630, 720}, {290, 1050, 590, 960},
{1090, 1240, 550, 660}, {1050, 1580, 250, 900}, {320, 1130, 670, 1020}, {1010, 1580, 410, 750}, {1040, 1500, 230, 1030}, {300, 1190, 590, 920}, {1050, 1310, 170, 870}, {950, 1530, 460, 770}, {190, 970, 750, 970}};
signals:
void completedTraining();
};
class OnboardingWindow : public QStackedWidget {
Q_OBJECT
public:
explicit OnboardingWindow(QWidget *parent = 0);
private:
Params params;
std::string current_terms_version;
std::string current_training_version;
QTextEdit *terms_text;
QWidget *terms_screen();
QWidget *training_screen();
signals:
void onboardingDone();
public slots:
void updateActiveScreen();
};