LP-106 Setup Wizard refresh : Add dual servo setup (dual aileron or
[librepilot.git] / ground / gcs / src / plugins / setupwizard / connectiondiagram.h
blob238d01b06d8f46a53db5f8310280015692491a96
1 /**
2 ******************************************************************************
4 * @file connectiondiagram.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
6 * @addtogroup
7 * @{
8 * @addtogroup ConnectionDiagram
9 * @{
10 * @brief
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 #ifndef CONNECTIONDIAGRAM_H
29 #define CONNECTIONDIAGRAM_H
31 #include <QDialog>
32 #include <QHash>
33 #include <QSvgRenderer>
35 #include <QGraphicsSvgItem>
36 #include "vehicleconfigurationsource.h"
39 namespace Ui {
40 class ConnectionDiagram;
43 class ConnectionDiagram : public QDialog {
44 Q_OBJECT
46 public:
47 explicit ConnectionDiagram(QWidget *parent, VehicleConfigurationSource *configSource);
48 ~ConnectionDiagram();
50 void fitInView();
51 private:
52 static const char *FILE_NAME;
53 static const int IMAGE_PADDING;
54 Ui::ConnectionDiagram *ui;
55 VehicleConfigurationSource *m_configSource;
57 QSvgRenderer *m_renderer;
58 QGraphicsScene *m_scene;
60 void setupGraphicsScene();
61 void setupGraphicsSceneItems(QList<QString> elementsToShow);
62 protected:
63 void resizeEvent(QResizeEvent *event);
64 void showEvent(QShowEvent *event);
66 private slots:
68 void on_saveButton_clicked();
71 #endif // CONNECTIONDIAGRAM_H