SetupView.cc 2.98 KB
Newer Older
1
/*=====================================================================
dogmaphobic's avatar
dogmaphobic committed
2

3
 QGroundControl Open Source Ground Control Station
dogmaphobic's avatar
dogmaphobic committed
4

5
 (c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
dogmaphobic's avatar
dogmaphobic committed
6

7
 This file is part of the QGROUNDCONTROL project
dogmaphobic's avatar
dogmaphobic committed
8

9 10 11 12
 QGROUNDCONTROL is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
dogmaphobic's avatar
dogmaphobic committed
13

14 15 16 17
 QGROUNDCONTROL is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
dogmaphobic's avatar
dogmaphobic committed
18

19 20
 You should have received a copy of the GNU General Public License
 along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
dogmaphobic's avatar
dogmaphobic committed
21

22 23 24 25 26 27 28
 ======================================================================*/

/// @file
///     @author Don Gagne <don@thegagnes.com>

#include "SetupView.h"

29
#include "AutoPilotPluginManager.h"
30
#include "VehicleComponent.h"
Don Gagne's avatar
Don Gagne committed
31
#include "QGCQmlWidgetHolder.h"
32
#include "MainWindow.h"
33
#include "QGCMessageBox.h"
dogmaphobic's avatar
dogmaphobic committed
34
#ifndef __mobile__
35
#include "FirmwareUpgradeController.h"
36
#endif
Don Gagne's avatar
Don Gagne committed
37
#include "ParameterEditorController.h"
38 39 40 41 42 43

#include <QQmlError>
#include <QQmlContext>
#include <QDebug>

SetupView::SetupView(QWidget* parent) :
44
    QGCQmlWidgetHolder(parent)
45
{
46
    setSource(QUrl::fromUserInput("qrc:/qml/SetupView.qml"));
47 48 49 50
}

SetupView::~SetupView()
{
51

52 53
}

54 55
#ifdef UNITTEST_BUILD
void SetupView::showFirmware(void)
56
{
dogmaphobic's avatar
dogmaphobic committed
57
#ifndef __mobile__
58 59 60 61 62
    QVariant returnedValue;
    bool success = QMetaObject::invokeMethod(getRootObject(),
                                             "showFirmwarePanel",
                                             Q_RETURN_ARG(QVariant, returnedValue));
    Q_ASSERT(success);
63
    Q_UNUSED(success);
64
#endif
65 66
}

67
void SetupView::showParameters(void)
68
{
69 70 71 72 73
    QVariant returnedValue;
    bool success = QMetaObject::invokeMethod(getRootObject(),
                                             "showParametersPanel",
                                             Q_RETURN_ARG(QVariant, returnedValue));
    Q_ASSERT(success);
74
    Q_UNUSED(success);
Don Gagne's avatar
Don Gagne committed
75 76
}

77
void SetupView::showSummary(void)
Don Gagne's avatar
Don Gagne committed
78
{
79 80 81 82 83
    QVariant returnedValue;
    bool success = QMetaObject::invokeMethod(getRootObject(),
                                             "showSummaryPanel",
                                             Q_RETURN_ARG(QVariant, returnedValue));
    Q_ASSERT(success);
84
    Q_UNUSED(success);
85 86
}

Don Gagne's avatar
Don Gagne committed
87
void SetupView::showVehicleComponentSetup(VehicleComponent* vehicleComponent)
88
{
89 90 91 92
    QVariant returnedValue;
    bool success = QMetaObject::invokeMethod(getRootObject(),
                                             "showVehicleComponentPanel",
                                             Q_RETURN_ARG(QVariant, returnedValue),
Don Gagne's avatar
Don Gagne committed
93
                                             Q_ARG(QVariant, QVariant::fromValue((VehicleComponent*)vehicleComponent)));
94
    Q_ASSERT(success);
95
    Q_UNUSED(success);
96
}
97
#endif