2 ******************************************************************************
5 * @author Edouard Lafargue and David Carlson Copyright (C) 2010.
6 * @see The GNU Public License (GPL) Version 3
7 * @addtogroup GCSPlugins GCS Plugins
9 * @addtogroup DialPlugin Dial Plugin
11 * @brief Plots flight information rotary style dials
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include "dialgadget.h"
30 #include "dialgadgetwidget.h"
31 #include "dialgadgetconfiguration.h"
33 DialGadget::DialGadget(QString classId
, DialGadgetWidget
*widget
, QWidget
*parent
) :
34 IUAVGadget(classId
, parent
),
38 DialGadget::~DialGadget()
44 This is called when a configuration is loaded, and updates the plugin's settings.
45 Careful: the plugin is already drawn before the loadConfiguration method is called the
46 first time, so you have to be careful not to assume all the plugin values are initialized
47 the first time you use them
49 void DialGadget::loadConfiguration(IUAVGadgetConfiguration
*config
)
51 DialGadgetConfiguration
*m
= qobject_cast
<DialGadgetConfiguration
*>(config
);
53 m_widget
->setDialFile(m
->dialFile(), m
->dialBackground(), m
->dialForeground(), m
->dialNeedle1(),
54 m
->dialNeedle2(), m
->dialNeedle3(), m
->getN1Move(), m
->getN2Move(),
57 m_widget
->enableOpenGL(m
->useOpenGL());
58 m_widget
->enableSmoothUpdates(m
->getBeSmooth());
60 m_widget
->setN1Min(m
->getN1Min());
61 m_widget
->setN1Max(m
->getN1Max());
62 m_widget
->setN1Factor(m
->getN1Factor());
63 m_widget
->setN2Min(m
->getN2Min());
64 m_widget
->setN2Max(m
->getN2Max());
65 m_widget
->setN2Factor(m
->getN2Factor());
66 m_widget
->setN3Min(m
->getN3Min());
67 m_widget
->setN3Max(m
->getN3Max());
68 m_widget
->setN3Factor(m
->getN3Factor());
69 m_widget
->setDialFont(m
->getFont());
70 m_widget
->connectNeedles(m
->getN1DataObject(), m
->getN1ObjField(),
71 m
->getN2DataObject(), m
->getN2ObjField(),
72 m
->getN3DataObject(), m
->getN3ObjField()