mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-22 03:33:53 +08:00
* support muxed signals * write multiplexor in generateDBC * edit multiplex_switch_value in signalView * no overlapping warning for mux signals * group signals by multiplexer indicator * display freq for each multiplexed signals * remove all multiplexed signals after switch deleted * disable switch value * cleanup * historyView: use getValue * sort by switch value * check address * rename variables * rename signale type * parse multiplexed signals in dbcmanater * cache signal color in member variable * cleanup num_decimals * remove sources from dbcmanager and cleanup code * fix sort * check mltiplex in operator== * fix sizehint * convert multipledxed to normal after changing multiplxor to normal * throw error on multiple 'M' signals * add comment * parse multipled signals in test case * cleanup * change order * cleanup open * display multiplexed/overlapping signals in binaryview * sort overlapped signals by size * refactor dbcmanager * trimmed * parse multiplexed signals in test case * cleanup * merge master * space * use pointer for sigs * alldbcFiles * cleanup * cleanup sparkline * use std::vector * skip draw sparkline if isnull * bigger capacity
28 lines
698 B
C++
28 lines
698 B
C++
#pragma once
|
|
|
|
#include <QPixmap>
|
|
#include <QPointF>
|
|
#include <vector>
|
|
|
|
#include "tools/cabana/dbc/dbcmanager.h"
|
|
|
|
class Sparkline {
|
|
public:
|
|
void update(const MessageId &msg_id, const cabana::Signal *sig, double last_msg_ts, int range, QSize size);
|
|
const QSize size() const { return pixmap.size() / pixmap.devicePixelRatio(); }
|
|
inline double freq() const {
|
|
return values.empty() ? 0 : values.size() / std::max(values.back().x() - values.front().x(), 1.0);
|
|
}
|
|
|
|
QPixmap pixmap;
|
|
double min_val = 0;
|
|
double max_val = 0;
|
|
double last_ts = 0;
|
|
int time_range = 0;
|
|
|
|
private:
|
|
void render(const QColor &color, QSize size);
|
|
std::vector<QPointF> values;
|
|
std::vector<QPointF> points;
|
|
};
|