2026-03-09 16:50:21 +08:00
|
|
|
#ifndef CUSTOMQWTPLOT_H
|
|
|
|
|
#define CUSTOMQWTPLOT_H
|
|
|
|
|
|
2026-03-12 20:23:55 +08:00
|
|
|
#include <QMap>
|
2026-03-09 16:50:21 +08:00
|
|
|
#include <QwtPlot>
|
|
|
|
|
|
|
|
|
|
class QwtPlotCurve;
|
2026-03-12 20:23:55 +08:00
|
|
|
class QwtPlotMarker;
|
2026-03-09 16:50:21 +08:00
|
|
|
|
|
|
|
|
class CustomQwtPlot : public QwtPlot
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit CustomQwtPlot(QWidget* parent = nullptr);
|
|
|
|
|
|
2026-03-12 20:23:55 +08:00
|
|
|
QwtPlotCurve* GetCurve(const QString& curve_name);
|
|
|
|
|
QList<QwtPlotCurve*> GetCurveList() const;
|
2026-03-09 16:50:21 +08:00
|
|
|
void AddCurve(QwtPlotCurve* curve);
|
|
|
|
|
|
2026-03-12 20:23:55 +08:00
|
|
|
QwtPlotMarker* GetMarker(const QString& marker_name, const QString& postion);
|
|
|
|
|
QList<QwtPlotMarker*> GetMarkerList() const;
|
|
|
|
|
void AddMarker(QwtPlotMarker *marker, const QString &marker_name, const QString &postion);
|
|
|
|
|
void RemoveMarker(const QString& marker_name, const QString& postion);
|
|
|
|
|
void CleanMarkers();
|
|
|
|
|
|
2026-03-09 16:50:21 +08:00
|
|
|
private:
|
2026-03-12 20:23:55 +08:00
|
|
|
QMap<QString, QwtPlotCurve*> _curves;
|
|
|
|
|
QMap<QString, QMap<QString, QwtPlotMarker*> > _markers;
|
2026-03-09 16:50:21 +08:00
|
|
|
};
|
|
|
|
|
|
2026-03-12 20:23:55 +08:00
|
|
|
|
2026-03-09 16:50:21 +08:00
|
|
|
QColor getDistinctColorForManyCurves(int curve_index);
|
|
|
|
|
|
|
|
|
|
#endif // CUSTOMQWTPLOT_H
|