dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
lineardialgadget.cpp
Go to the documentation of this file.
1 
12 /*
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.
17  *
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.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
27 #include "lineardialgadget.h"
28 #include "lineardialgadgetwidget.h"
30 
31 LineardialGadget::LineardialGadget(QString classId, LineardialGadgetWidget *widget, QWidget *parent)
32  : IUAVGadget(classId, parent)
33  , m_widget(widget)
34 {
35 }
36 
38 {
39  delete m_widget;
40 }
41 
42 /*
43  This is called when a configuration is loaded, and updates the plugin's settings.
44  Careful: the plugin is already drawn before the loadConfiguration method is called the
45  first time, so you have to be careful not to assume all the plugin values are initialized
46  the first time you use them
47  */
48 void LineardialGadget::loadConfiguration(IUAVGadgetConfiguration *config)
49 {
51  m_widget->setFactor(m->getFactor());
52  m_widget->setDecimalPlaces(m->getDecimalPlaces());
53  m_widget->setRange(m->getMin(), m->getMax());
54  m_widget->setGreenRange(m->getGreenMin(), m->getGreenMax());
55  m_widget->setYellowRange(m->getYellowMin(), m->getYellowMax());
56  m_widget->setRedRange(m->getRedMin(), m->getRedMax());
57  m_widget->setDialFile(m->getDialFile()); // Triggers widget repaint
58  m_widget->setDialFont(m->getFont());
60 }
void setRedRange(double min, double max)
LineardialGadget(QString classId, LineardialGadgetWidget *widget, QWidget *parent=nullptr)
void setGreenRange(double min, double max)
void loadConfiguration(IUAVGadgetConfiguration *config)
void setDialFont(QString fontProps)
void connectInput(QString obj, QString field)
Connects the widget to the relevant UAVObjects.
void setDialFile(QString dfn)
Setup dial using its master SVG template.
void setRange(double min, double max)
void setYellowRange(double min, double max)