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_DATA_CONFIG_H 00020 #define RQT_MULTIPLOT_CURVE_DATA_CONFIG_H 00021 00022 #include <rqt_multiplot/Config.h> 00023 00024 namespace rqt_multiplot { 00025 class CurveDataConfig : 00026 public Config { 00027 Q_OBJECT 00028 public: 00029 enum Type { 00030 Vector, 00031 List, 00032 CircularBuffer, 00033 TimeFrame 00034 }; 00035 00036 CurveDataConfig(QObject* parent = 0, Type type = Vector, size_t 00037 circularBufferCapacity = 1000, double timeFrameLength = 10.0); 00038 ~CurveDataConfig(); 00039 00040 void setType(Type type); 00041 Type getType() const; 00042 void setCircularBufferCapacity(size_t capacity); 00043 size_t getCircularBufferCapacity() const; 00044 void setTimeFrameLength(double length); 00045 double getTimeFrameLength() const; 00046 00047 void save(QSettings& settings) const; 00048 void load(QSettings& settings); 00049 void reset(); 00050 00051 void write(QDataStream& stream) const; 00052 void read(QDataStream& stream); 00053 00054 CurveDataConfig& operator=(const CurveDataConfig& src); 00055 00056 signals: 00057 void typeChanged(int type); 00058 void circularBufferCapacityChanged(size_t capacity); 00059 void timeFrameLengthChanged(double length); 00060 00061 private: 00062 Type type_; 00063 size_t circularBufferCapacity_; 00064 double timeFrameLength_; 00065 }; 00066 }; 00067 00068 #endif