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.
 
 
 
 
 
 

34 lines
806 B

#pragma once
#include <QVBoxLayout>
#include <QWidget>
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <map>
#include "tools/cabana/parser.h"
class ChartsWidget : public QWidget {
Q_OBJECT
public:
ChartsWidget(QWidget *parent = nullptr);
inline bool hasChart(const QString &id, const QString &sig_name) {
return charts.find(id+sig_name) != charts.end();
}
void addChart(const QString &id, const QString &sig_name);
void removeChart(const QString &id, const QString &sig_name);
void updateState();
protected:
QVBoxLayout *main_layout;
struct SignalChart {
QString id;
QString sig_name;
int max_y = 0;
int min_y = 0;
QList<QPointF> data;
QtCharts::QChartView *chart_view = nullptr;
};
std::map<QString, SignalChart> charts;
};