00001 /****************************************************************************** 00002 * Copyright (C) 2015 by Ralf Kaestner * 00003 * ralf.kaestner@gmail.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the Lesser GNU General Public License as published by* 00007 * the Free Software Foundation; either version 3 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * Lesser GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the Lesser GNU General Public License * 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 00017 ******************************************************************************/ 00018 00019 #ifndef RQT_MULTIPLOT_CURVE_CONFIG_H 00020 #define RQT_MULTIPLOT_CURVE_CONFIG_H 00021 00022 #include <QMap> 00023 #include <QString> 00024 00025 #include <rqt_multiplot/Config.h> 00026 #include <rqt_multiplot/CurveAxisConfig.h> 00027 #include <rqt_multiplot/CurveColorConfig.h> 00028 #include <rqt_multiplot/CurveDataConfig.h> 00029 #include <rqt_multiplot/CurveStyleConfig.h> 00030 00031 namespace rqt_multiplot { 00032 class CurveConfig : 00033 public Config { 00034 Q_OBJECT 00035 public: 00036 enum Axis { 00037 X, 00038 Y 00039 }; 00040 00041 static const QString MimeType; 00042 00043 CurveConfig(QObject* parent = 0, const QString& title = "Untitled Curve", 00044 size_t subscriberQueueSize = 100); 00045 ~CurveConfig(); 00046 00047 void setTitle(const QString& title); 00048 const QString& getTitle() const; 00049 CurveAxisConfig* getAxisConfig(Axis axis) const; 00050 CurveColorConfig* getColorConfig() const; 00051 CurveStyleConfig* getStyleConfig() const; 00052 CurveDataConfig* getDataConfig() const; 00053 void setSubscriberQueueSize(size_t queueSize); 00054 size_t getSubscriberQueueSize() const; 00055 00056 void save(QSettings& settings) const; 00057 void load(QSettings& settings); 00058 void reset(); 00059 00060 void write(QDataStream& stream) const; 00061 void read(QDataStream& stream); 00062 00063 CurveConfig& operator=(const CurveConfig& src); 00064 00065 signals: 00066 void titleChanged(const QString& title); 00067 void subscriberQueueSizeChanged(size_t queueSize); 00068 00069 private: 00070 QString title_; 00071 QMap<Axis, CurveAxisConfig*> axisConfig_; 00072 CurveColorConfig* colorConfig_; 00073 CurveStyleConfig* styleConfig_; 00074 CurveDataConfig* dataConfig_; 00075 size_t subscriberQueueSize_; 00076 00077 private slots: 00078 void axisConfigChanged(); 00079 void colorConfigChanged(); 00080 void styleConfigChanged(); 00081 void dataConfigChanged(); 00082 }; 00083 }; 00084 00085 #endif