PlotConfig.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2015 by Ralf Kaestner *
3  * ralf.kaestner@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the Lesser GNU General Public License as published by*
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * Lesser GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the Lesser GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ******************************************************************************/
18 
19 #ifndef RQT_MULTIPLOT_PLOT_CONFIG_H
20 #define RQT_MULTIPLOT_PLOT_CONFIG_H
21 
22 #include <QString>
23 #include <QVector>
24 
25 #include <rqt_multiplot/Config.h>
29 
30 namespace rqt_multiplot {
31  class PlotConfig :
32  public Config {
33  Q_OBJECT
34  public:
35  PlotConfig(QObject* parent = 0, const QString& title = "Untitled Plot",
36  double plotRate = 30.0);
37  ~PlotConfig();
38 
39  void setTitle(const QString& title);
40  const QString& getTitle() const;
41  void setNumCurves(size_t numCurves);
42  size_t getNumCurves() const;
43  CurveConfig* getCurveConfig(size_t index) const;
46  void setPlotRate(double rate);
47  double getPlotRate() const;
48 
50  void removeCurve(CurveConfig* curveConfig);
51  void removeCurve(size_t index);
52  void clearCurves();
53 
54  QVector<CurveConfig*> findCurves(const QString& title) const;
55 
56  void save(QSettings& settings) const;
57  void load(QSettings& settings);
58  void reset();
59 
60  void write(QDataStream& stream) const;
61  void read(QDataStream& stream);
62 
63  PlotConfig& operator=(const PlotConfig& src);
64 
65  signals:
66  void titleChanged(const QString& title);
67  void curveAdded(size_t index);
68  void curveRemoved(size_t index);
69  void curvesCleared();
70  void curveConfigChanged(size_t index);
71  void plotRateChanged(double rate);
72 
73  private:
74  QString title_;
75  QVector<CurveConfig*> curveConfig_;
78  double plotRate_;
79 
80  private slots:
81  void curveConfigChanged();
82  void curveConfigDestroyed();
83  void axesConfigChanged();
84  void legendConfigChanged();
85  };
86 };
87 
88 #endif
void write(QDataStream &stream) const
Definition: PlotConfig.cpp:229
PlotAxesConfig * getAxesConfig() const
Definition: PlotConfig.cpp:79
QVector< CurveConfig * > findCurves(const QString &title) const
Definition: PlotConfig.cpp:145
PlotConfig & operator=(const PlotConfig &src)
Definition: PlotConfig.cpp:266
CurveConfig * addCurve()
Definition: PlotConfig.cpp:104
PlotConfig(QObject *parent=0, const QString &title="Untitled Plot", double plotRate=30.0)
Definition: PlotConfig.cpp:27
QVector< CurveConfig * > curveConfig_
Definition: PlotConfig.h:75
void setNumCurves(size_t numCurves)
Definition: PlotConfig.cpp:60
PlotLegendConfig * getLegendConfig() const
Definition: PlotConfig.cpp:83
void read(QDataStream &stream)
Definition: PlotConfig.cpp:242
PlotAxesConfig * axesConfig_
Definition: PlotConfig.h:76
void save(QSettings &settings) const
Definition: PlotConfig.cpp:155
const QString & getTitle() const
Definition: PlotConfig.cpp:56
double getPlotRate() const
Definition: PlotConfig.cpp:96
void curveRemoved(size_t index)
PlotLegendConfig * legendConfig_
Definition: PlotConfig.h:77
void setPlotRate(double rate)
Definition: PlotConfig.cpp:87
CurveConfig * getCurveConfig(size_t index) const
Definition: PlotConfig.cpp:72
size_t getNumCurves() const
Definition: PlotConfig.cpp:68
void setTitle(const QString &title)
Definition: PlotConfig.cpp:47
void removeCurve(CurveConfig *curveConfig)
Definition: PlotConfig.cpp:121
void titleChanged(const QString &title)
void curveAdded(size_t index)
void plotRateChanged(double rate)
void load(QSettings &settings)
Definition: PlotConfig.cpp:179


rqt_multiplot
Author(s): Ralf Kaestner
autogenerated on Wed Jul 10 2019 03:49:44