OP-1900 have path_progress updated correctly for leg_remaining and error_below end...
[librepilot.git] / ground / openpilotgcs / src / plugins / modelview / modelviewgadgetconfiguration.cpp
blobdd886d17fcc88792696dc5eab5eef536cb998ee2
1 /**
2 ******************************************************************************
4 * @file modelviewgadgetconfiguration.cpp
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup ModelViewPlugin ModelView Plugin
9 * @{
10 * @brief A gadget that displays a 3D representation of the UAV
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 #include "modelviewgadgetconfiguration.h"
29 #include "utils/pathutils.h"
31 ModelViewGadgetConfiguration::ModelViewGadgetConfiguration(QString classId, QSettings *qSettings, QObject *parent) :
32 IUAVGadgetConfiguration(classId, parent),
33 m_acFilename("../share/openpilotgcs/models/planes/Easystar/EasyStar.3ds"),
34 m_bgFilename(""),
35 m_enableVbo(false)
37 // if a saved configuration exists load it
38 if (qSettings != 0) {
39 QString modelFile = qSettings->value("acFilename").toString();
40 QString bgFile = qSettings->value("bgFilename").toString();
41 m_enableVbo = qSettings->value("enableVbo").toBool();
42 m_acFilename = Utils::PathUtils().InsertDataPath(modelFile);
43 m_bgFilename = Utils::PathUtils().InsertDataPath(bgFile);
47 IUAVGadgetConfiguration *ModelViewGadgetConfiguration::clone()
49 ModelViewGadgetConfiguration *mv = new ModelViewGadgetConfiguration(this->classId());
51 mv->m_acFilename = m_acFilename;
52 mv->m_bgFilename = m_bgFilename;
53 mv->m_enableVbo = m_enableVbo;
54 return mv;
57 /**
58 * Saves a configuration.
61 void ModelViewGadgetConfiguration::saveConfig(QSettings *qSettings) const
63 qSettings->setValue("acFilename", Utils::PathUtils().RemoveDataPath(m_acFilename));
64 qSettings->setValue("bgFilename", Utils::PathUtils().RemoveDataPath(m_bgFilename));
65 qSettings->setValue("enableVbo", m_enableVbo);