2 ******************************************************************************
4 * @file scopegadgetconfiguration.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup ScopePlugin Scope Gadget Plugin
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
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
32 #include <coreplugin/iuavgadgetconfiguration.h>
38 struct PlotCurveConfiguration
{
41 int yScalePower
; // This is the power to which each value must be raised
50 class ScopeGadgetConfiguration
: public IUAVGadgetConfiguration
{
53 explicit ScopeGadgetConfiguration(QString classId
, QSettings
*qSettings
= 0, QObject
*parent
= 0);
55 ~ScopeGadgetConfiguration();
57 // configuration setter functions
58 void setPlotType(int value
)
62 void setMathFunctionType(int value
)
64 m_mathFunctionType
= value
;
66 void setDataSize(int 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
85 int mathFunctionType()
87 return m_mathFunctionType
;
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
;
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
136 // The size of the data buffer to render in the curve plot
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