OP-1900 have path_progress updated correctly for leg_remaining and error_below end...
[librepilot.git] / ground / openpilotgcs / src / plugins / scope / scopegadgetconfiguration.h
blobc7d95e84f67c296a629644041f3549f2658aa3c3
1 /**
2 ******************************************************************************
4 * @file scopegadgetconfiguration.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup ScopePlugin Scope Gadget Plugin
9 * @{
10 * @brief The scope Gadget, graphically plots the states of UAVObjects
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef SCOPEGADGETCONFIGURATION_H
29 #define SCOPEGADGETCONFIGURATION_H
31 #include "plotdata.h"
32 #include <coreplugin/iuavgadgetconfiguration.h>
34 #include <QVector>
36 using namespace Core;
38 struct PlotCurveConfiguration {
39 QString uavObject;
40 QString uavField;
41 int yScalePower; // This is the power to which each value must be raised
42 QRgb color;
43 int yMeanSamples;
44 QString mathFunction;
45 double yMinimum;
46 double yMaximum;
47 bool drawAntialiased;
50 class ScopeGadgetConfiguration : public IUAVGadgetConfiguration {
51 Q_OBJECT
52 public:
53 explicit ScopeGadgetConfiguration(QString classId, QSettings *qSettings = 0, QObject *parent = 0);
55 ~ScopeGadgetConfiguration();
57 // configuration setter functions
58 void setPlotType(int value)
60 m_plotType = value;
62 void setMathFunctionType(int value)
64 m_mathFunctionType = value;
66 void setDataSize(int value)
68 m_dataSize = value;
70 void setRefreashInterval(int value)
72 m_refreshInterval = value;
74 void addPlotCurveConfig(PlotCurveConfiguration *value)
76 m_plotCurveConfigs.append(value);
78 void replacePlotCurveConfig(QList<PlotCurveConfiguration *> m_plotCurveConfigs);
80 // Configurations getter functions
81 int plotType()
83 return m_plotType;
85 int mathFunctionType()
87 return m_mathFunctionType;
89 int dataSize()
91 return m_dataSize;
93 int refreshInterval()
95 return m_refreshInterval;
97 QList<PlotCurveConfiguration *> plotCurveConfigs()
99 return m_plotCurveConfigs;
102 void saveConfig(QSettings *settings) const; // THIS SEEMS TO BE UNUSED
103 IUAVGadgetConfiguration *clone();
105 bool getLoggingEnabled()
107 return m_loggingEnabled;
109 bool getLoggingNewFileOnConnect()
111 return m_loggingNewFileOnConnect;
113 QString getLoggingPath()
115 return m_loggingPath;
117 void setLoggingEnabled(bool value)
119 m_loggingEnabled = value;
121 void setLoggingNewFileOnConnect(bool value)
123 m_loggingNewFileOnConnect = value;
125 void setLoggingPath(QString value)
127 m_loggingPath = value;
130 private:
132 // Increment this if the stream format is not compatible with previous versions. This would cause existing configs to be discarded.
133 static const uint m_configurationStreamVersion = 1000;
134 // The type of the plot
135 int m_plotType;
136 // The size of the data buffer to render in the curve plot
137 int m_dataSize;
138 // The interval to replot the curve widget. The data buffer is refresh as the data comes in.
139 int m_refreshInterval;
140 // The type of math function to be used in the scope analysis
141 int m_mathFunctionType;
142 QList<PlotCurveConfiguration *> m_plotCurveConfigs;
144 void clearPlotData();
145 bool m_loggingEnabled;
146 bool m_loggingNewFileOnConnect;
147 QString m_loggingPath;
150 #endif // SCOPEGADGETCONFIGURATION_H