mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-09 17:53:45 +08:00
659adb6457
date: 2024-03-17T10:14:38 master commit: 7e9a909e0e57ecb31df4c87c5b9a06b1204fd034
25 lines
527 B
C++
25 lines
527 B
C++
#pragma once
|
|
|
|
#include <QPixmap>
|
|
#include <QPointF>
|
|
#include <vector>
|
|
|
|
#include "tools/cabana/dbc/dbc.h"
|
|
|
|
class Sparkline {
|
|
public:
|
|
void update(const MessageId &msg_id, const cabana::Signal *sig, double last_msg_ts, int range, QSize size);
|
|
inline double freq() const { return freq_; }
|
|
bool isEmpty() const { return pixmap.isNull(); }
|
|
|
|
QPixmap pixmap;
|
|
double min_val = 0;
|
|
double max_val = 0;
|
|
|
|
private:
|
|
void render(const QColor &color, int range, QSize size);
|
|
|
|
std::vector<QPointF> points;
|
|
double freq_ = 0;
|
|
};
|