feat: integrate tactile stream decoding
This commit is contained in:
@@ -5,12 +5,8 @@
|
||||
#include "heatmap.hh"
|
||||
#include "heatmap.impl.hh"
|
||||
#include "qcustomplot/qcustomplot.h"
|
||||
#include <qcolor.h>
|
||||
#include <qcolormap.h>
|
||||
#include <qcontainerfwd.h>
|
||||
#include <qdebug.h>
|
||||
#include <qnamespace.h>
|
||||
#include <qobject.h>
|
||||
#include <qsize.h>
|
||||
|
||||
using namespace creeper::plot_widget::internal;
|
||||
@@ -21,32 +17,30 @@ BasicPlot::BasicPlot() : pimpl{std::make_unique<Impl>(*this)} {
|
||||
setBackground(Qt::transparent);
|
||||
}
|
||||
|
||||
BasicPlot::~BasicPlot() {}
|
||||
BasicPlot::~BasicPlot() = default;
|
||||
|
||||
void BasicPlot::set_matrix_size(const QSize& size) {
|
||||
qDebug() << "set matrix size" << size;
|
||||
void BasicPlot::set_matrix_size(const QSize& size)const {
|
||||
pimpl->set_matrix_size(size);
|
||||
}
|
||||
|
||||
void BasicPlot::set_matrix_size(const int& w, const int& h) {
|
||||
void BasicPlot::set_matrix_size(const int& w, const int& h)const {
|
||||
QSize size(w, h);
|
||||
qDebug() << "set matrix size" << size;
|
||||
pimpl->set_matrix_size(size);
|
||||
}
|
||||
|
||||
void BasicPlot::set_color_gradient_range(const double& min, const double& max) {
|
||||
void BasicPlot::set_color_gradient_range(const double& min, const double& max)const {
|
||||
pimpl->set_color_gradient_range(min, max);
|
||||
}
|
||||
|
||||
void BasicPlot::set_xlabel_text(const QString& text) {
|
||||
void BasicPlot::set_xlabel_text(const QString& text)const {
|
||||
pimpl->set_xlabel_text(text);
|
||||
}
|
||||
|
||||
void BasicPlot::set_ylabel_text(const QString& text) {
|
||||
void BasicPlot::set_ylabel_text(const QString& text)const {
|
||||
pimpl->set_ylabel_text(text);
|
||||
}
|
||||
|
||||
void BasicPlot::load_theme_manager(ThemeManager& mgr) {
|
||||
void BasicPlot::load_theme_manager(ThemeManager& mgr)const {
|
||||
pimpl->load_theme_manager(mgr);
|
||||
}
|
||||
|
||||
@@ -54,8 +48,7 @@ QSize BasicPlot::get_matrix_size() const {
|
||||
return pimpl->get_matrix_size();
|
||||
}
|
||||
|
||||
void BasicPlot::set_data(const QVector<PointData>& data) {
|
||||
qDebug() << "set data" << data.size();
|
||||
void BasicPlot::set_data(const QVector<PointData>& data)const {
|
||||
pimpl->set_data(data);
|
||||
}
|
||||
|
||||
@@ -63,7 +56,7 @@ bool BasicPlot::is_initialized() const {
|
||||
return pimpl->is_plot_initialized();
|
||||
}
|
||||
|
||||
void BasicPlot::init_plot() {
|
||||
void BasicPlot::init_plot()const {
|
||||
pimpl->initialize_plot();
|
||||
}
|
||||
|
||||
@@ -75,17 +68,17 @@ void BasicPlot::paintEvent(QPaintEvent* event) {
|
||||
QCustomPlot::paintEvent(event);
|
||||
}
|
||||
|
||||
void BasicPlot::dataChanged(const QVector<PointData>& map) {
|
||||
void BasicPlot::dataChanged(const QVector<PointData>& map)const {
|
||||
set_data(map);
|
||||
// emit dataChanged(map);
|
||||
}
|
||||
|
||||
void BasicPlot::dataRangeChanged(const double& min, const double& max) {
|
||||
void BasicPlot::dataRangeChanged(const double& min, const double& max)const {
|
||||
set_color_gradient_range(min, max);
|
||||
// emit dataRangeChanged(min, max);
|
||||
}
|
||||
|
||||
void BasicPlot::update_dynamic_heatmap(const QVector<PointData>& map) {
|
||||
void BasicPlot::update_dynamic_heatmap(const QVector<PointData>& map)const {
|
||||
set_data(map);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,21 +35,21 @@ public:
|
||||
// BasicPlot(const BasicPlot&) = delete;
|
||||
// BasicPlot& operator=(const BasicPlot&) = delete;
|
||||
|
||||
void init_plot();
|
||||
void load_theme_manager(ThemeManager&);
|
||||
void set_xlabel_text(const QString&);
|
||||
void set_ylabel_text(const QString&);
|
||||
void set_matrix_size(const QSize&);
|
||||
void set_matrix_size(const int& w, const int& h);
|
||||
void set_data(const QVector<PointData>& data);
|
||||
void set_color_gradient_range(const double& min, const double& max);
|
||||
void init_plot()const;
|
||||
void load_theme_manager(ThemeManager&)const;
|
||||
void set_xlabel_text(const QString&)const;
|
||||
void set_ylabel_text(const QString&)const;
|
||||
void set_matrix_size(const QSize&)const;
|
||||
void set_matrix_size(const int& w, const int& h)const;
|
||||
void set_data(const QVector<PointData>& data)const;
|
||||
void set_color_gradient_range(const double& min, const double& max)const;
|
||||
QSize get_matrix_size() const;
|
||||
bool is_initialized() const;
|
||||
|
||||
public slots:
|
||||
void update_dynamic_heatmap(const QVector<PointData>& map);
|
||||
void dataChanged(const QVector<PointData>& map);
|
||||
void dataRangeChanged(const double& min, const double& max);
|
||||
void update_dynamic_heatmap(const QVector<PointData>& map)const;
|
||||
void dataChanged(const QVector<PointData>& map)const;
|
||||
void dataRangeChanged(const double& min, const double& max)const;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent*) override;
|
||||
|
||||
@@ -75,7 +75,6 @@ public:
|
||||
|
||||
// 创建颜色映射
|
||||
QCPColorMap* cpmp = new QCPColorMap(self.xAxis, self.yAxis);
|
||||
qDebug() << "initialize_plot() size:" << matrix_size;
|
||||
cpmp->data()->setSize(matrix_size.width(), matrix_size.height());
|
||||
cpmp->data()->setRange(QCPRange(0.5, matrix_size.width() - 0.5),
|
||||
QCPRange(0.5, matrix_size.height() - 0.5));
|
||||
|
||||
Reference in New Issue
Block a user