From 389577e62a91e0c65c6c17e1029440941c4cb80f Mon Sep 17 00:00:00 2001 From: m_thread Date: Sun, 8 Mar 2015 09:33:54 +0100 Subject: [PATCH] OP-1763 Adding Widget for template selection gui. --- .../src/plugins/setupwizard/setupwizard.pro | 9 +- .../vehicletemplateselectorwidget.cpp | 46 ++++++++++ .../vehicletemplateselectorwidget.h | 61 +++++++++++++ .../vehicletemplateselectorwidget.ui | 86 +++++++++++++++++++ 4 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.cpp create mode 100644 ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.h create mode 100644 ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.ui diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro index d2c6ffd74..2fe4865fd 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro @@ -41,7 +41,8 @@ HEADERS += setupwizardplugin.h \ pages/servopage.h \ pages/selectionpage.h \ pages/airframeinitialtuningpage.h \ - vehicletemplateexportdialog.h + vehicletemplateexportdialog.h \ + vehicletemplateselectorwidget.h SOURCES += setupwizardplugin.cpp \ setupwizard.cpp \ @@ -74,7 +75,8 @@ SOURCES += setupwizardplugin.cpp \ pages/servopage.cpp \ pages/selectionpage.cpp \ pages/airframeinitialtuningpage.cpp \ - vehicletemplateexportdialog.cpp + vehicletemplateexportdialog.cpp \ + vehicletemplateselectorwidget.cpp OTHER_FILES += SetupWizard.pluginspec @@ -99,7 +101,8 @@ FORMS += \ pages/servopage.ui \ pages/selectionpage.ui \ pages/airframeinitialtuningpage.ui \ - vehicletemplateexportdialog.ui + vehicletemplateexportdialog.ui \ + vehicletemplateselectorwidget.ui RESOURCES += \ wizardResources.qrc diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.cpp new file mode 100644 index 000000000..ceb17e2c4 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.cpp @@ -0,0 +1,46 @@ +/** + ****************************************************************************** + * + * @file vehicletemplateselectorwidget.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup [Group] + * @{ + * @addtogroup VehicleTemplateSelectorWidget + * @{ + * @brief [Brief] + *****************************************************************************/ +/* + * This program 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. + * + * This program 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. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "vehicletemplateselectorwidget.h" +#include "ui_vehicletemplateselectorwidget.h" + +VehicleTemplateSelectorWidget::VehicleTemplateSelectorWidget(QWidget *parent) : + QWidget(parent), + ui(new Ui::VehicleTemplateSelectorWidget) +{ + ui->setupUi(this); +} + +VehicleTemplateSelectorWidget::~VehicleTemplateSelectorWidget() +{ + delete ui; +} + +void VehicleTemplateSelectorWidget::updateTemplates() +{ + +} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.h new file mode 100644 index 000000000..e64749645 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.h @@ -0,0 +1,61 @@ +/** + ****************************************************************************** + * + * @file vehicletemplateselectorwidget.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup [Group] + * @{ + * @addtogroup VehicleTemplateSelectorWidget + * @{ + * @brief [Brief] + *****************************************************************************/ +/* + * This program 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. + * + * This program 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. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef VEHICLETEMPLATESELECTORWIDGET_H +#define VEHICLETEMPLATESELECTORWIDGET_H + +#include + +namespace Ui { +class VehicleTemplateSelectorWidget; +} + +class VehicleTemplateSelectorWidget : public QWidget +{ + Q_OBJECT + +public: + explicit VehicleTemplateSelectorWidget(QWidget *parent = 0); + ~VehicleTemplateSelectorWidget(); + void setTemplateInfo(QString path, int vehicleType, int vehicleSubType) { + m_templateFolder = path; + m_vehicleType = vehicleType; + m_vehicleSubType = vehicleSubType; + updateTemplates(); + } + +private: + Ui::VehicleTemplateSelectorWidget *ui; + QString m_templateFolder; + int m_vehicleType; + int m_vehicleSubType; + +private slots: + void updateTemplates(); +}; + +#endif // VEHICLETEMPLATESELECTORWIDGET_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.ui b/ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.ui new file mode 100644 index 000000000..20caa1f19 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicletemplateselectorwidget.ui @@ -0,0 +1,86 @@ + + + VehicleTemplateSelectorWidget + + + + 0 + 0 + 626 + 461 + + + + Form + + + + + + + + + + + + Qt::ScrollBarAlwaysOn + + + QAbstractItemView::NoEditTriggers + + + + + + + + 250 + 250 + + + + background-color: rgba(254, 254, 254, 0); + + + false + + + QPainter::Antialiasing|QPainter::HighQualityAntialiasing|QPainter::TextAntialiasing + + + + + + + + + + 0 + 0 + + + + + 10 + + + + false + + + true + + + Information about the Vehicle in short. + + + + + + + + + + + +