2 ******************************************************************************
4 * @file lineardialgadgetconfiguration.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup LinearDialPlugin Linear Dial Plugin
10 * @brief Impliments a gadget that displays linear gauges
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 LINEARDIALGADGETCONFIGURATION_H
29 #define LINEARDIALGADGETCONFIGURATION_H
31 #include <coreplugin/iuavgadgetconfiguration.h>
35 /* This is a generic bargraph dial
36 supporting one indicator.
38 class LineardialGadgetConfiguration
: public IUAVGadgetConfiguration
{
41 explicit LineardialGadgetConfiguration(QString classId
, QSettings
&settings
, QObject
*parent
= 0);
42 explicit LineardialGadgetConfiguration(const LineardialGadgetConfiguration
&obj
);
44 IUAVGadgetConfiguration
*clone() const;
45 void saveConfig(QSettings
&settings
) const;
47 // set dial configuration functions
48 void setDialFile(QString filename
)
52 void setRange(double min
, double max
)
54 minValue
= min
; maxValue
= max
;
56 void setGreenRange(double min
, double max
)
58 greenMin
= min
; greenMax
= max
;
60 void setYellowRange(double min
, double max
)
62 yellowMin
= min
; yellowMax
= max
;
64 void setRedRange(double min
, double max
)
66 redMin
= min
; redMax
= max
;
68 void setFont(QString text
)
72 void setFactor(double val
)
76 void setDecimalPlaces(int val
)
80 void setSourceDataObject(QString text
)
82 sourceDataObject
= text
;
84 void setSourceObjField(QString text
)
86 sourceObjectField
= text
;
88 void setUseOpenGL(bool flag
)
93 // get dial configuration functions
114 double getYellowMin()
118 double getYellowMax()
130 QString
getSourceDataObject()
132 return sourceDataObject
;
134 QString
getSourceObjectField()
136 return sourceObjectField
;
142 int getDecimalPlaces()
144 return decimalPlaces
;
152 return useOpenGLFlag
;
156 // A linear or "bargraph" dial contains:
157 // * A SVG background file
158 // The source file should have at least the following IDs
159 // defined: "background", "green", "yellow", "red", "needle"
161 // * The name of the UAVObject field to display
162 QString sourceDataObject
;
163 QString sourceObjectField
;
164 // The font used for the dial
166 // * The minimum and maximum values to be displayed
169 // * Three start-stop values for green/yellow/red
181 #endif // LINEARDIALGADGETCONFIGURATION_H