From 717b0d4561a06df9f9282a71aca78878d49c5c44 Mon Sep 17 00:00:00 2001 From: PT_Dreamer Date: Tue, 24 Jul 2012 22:10:17 +0100 Subject: [PATCH] Revert "OP-39 Added some pages and some functionality to the OP SetupWizard." This reverts commit ebe76e4ae65f7b4b94f705e7a418699936186494. --- .../plugins/coreplugin/connectionmanager.cpp | 143 ++++++----- .../plugins/coreplugin/connectionmanager.h | 32 +-- .../setupwizard/pages/abstractwizardpage.cpp | 35 --- .../setupwizard/pages/abstractwizardpage.h | 48 ---- .../setupwizard/pages/controllerpage.cpp | 225 ------------------ .../setupwizard/pages/controllerpage.h | 67 ------ .../setupwizard/pages/controllerpage.ui | 163 ------------- .../src/plugins/setupwizard/pages/endpage.cpp | 30 +-- .../src/plugins/setupwizard/pages/endpage.h | 33 +-- .../src/plugins/setupwizard/pages/endpage.ui | 2 +- .../setupwizard/pages/fixedwingpage.cpp | 42 ---- .../plugins/setupwizard/pages/fixedwingpage.h | 49 ---- .../setupwizard/pages/fixedwingpage.ui | 43 ---- .../plugins/setupwizard/pages/helipage.cpp | 42 ---- .../src/plugins/setupwizard/pages/helipage.h | 49 ---- .../src/plugins/setupwizard/pages/helipage.ui | 43 ---- .../plugins/setupwizard/pages/multipage.cpp | 125 ---------- .../src/plugins/setupwizard/pages/multipage.h | 59 ----- .../plugins/setupwizard/pages/multipage.ui | 146 ------------ .../pages/notyetimplementedpage.cpp | 42 ---- .../setupwizard/pages/notyetimplementedpage.h | 49 ---- .../pages/notyetimplementedpage.ui | 43 ---- .../plugins/setupwizard/pages/startpage.cpp | 30 +-- .../src/plugins/setupwizard/pages/startpage.h | 32 +-- .../plugins/setupwizard/pages/surfacepage.cpp | 42 ---- .../plugins/setupwizard/pages/surfacepage.h | 49 ---- .../plugins/setupwizard/pages/surfacepage.ui | 43 ---- .../plugins/setupwizard/pages/vehiclepage.cpp | 61 ----- .../plugins/setupwizard/pages/vehiclepage.h | 50 ---- .../plugins/setupwizard/pages/vehiclepage.ui | 168 ------------- .../src/plugins/setupwizard/setupwizard.cpp | 59 +---- .../src/plugins/setupwizard/setupwizard.h | 20 +- .../src/plugins/setupwizard/setupwizard.pro | 36 +-- .../plugins/setupwizard/setupwizardplugin.cpp | 4 +- .../plugins/setupwizard/setupwizardplugin.h | 4 +- .../plugins/setupwizard/wizardResources.qrc | 3 - 36 files changed, 109 insertions(+), 2002 deletions(-) delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/abstractwizardpage.cpp delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/abstractwizardpage.h delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.h delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.ui delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.h delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.ui delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.cpp delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.h delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.ui delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.h delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.ui delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.cpp delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.h delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.ui delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.cpp delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.h delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.ui delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.cpp delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.h delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.ui delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc diff --git a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp index 5fa2ead50..f49d98c0e 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp @@ -44,15 +44,15 @@ namespace Core { ConnectionManager::ConnectionManager(Internal::MainWindow *mainWindow, QTabWidget *modeStack) : - QWidget(mainWindow), // Pip - m_availableDevList(0), + QWidget(mainWindow), // Pip + m_availableDevList(0), m_connectBtn(0), - m_ioDev(NULL), - m_mainWindow(mainWindow) + m_ioDev(NULL), + m_mainWindow(mainWindow) { - // Q_UNUSED(mainWindow); + // Q_UNUSED(mainWindow); - /* QVBoxLayout *top = new QVBoxLayout; +/* QVBoxLayout *top = new QVBoxLayout; top->setSpacing(0); top->setMargin(0);*/ @@ -72,7 +72,7 @@ ConnectionManager::ConnectionManager(Internal::MainWindow *mainWindow, QTabWidge m_connectBtn->setEnabled(false); layout->addWidget(m_connectBtn); - /* Utils::StyledBar *bar = new Utils::StyledBar; +/* Utils::StyledBar *bar = new Utils::StyledBar; bar->setLayout(layout); top->addWidget(bar);*/ @@ -81,29 +81,33 @@ ConnectionManager::ConnectionManager(Internal::MainWindow *mainWindow, QTabWidge // modeStack->insertCornerWidget(modeStack->cornerWidgetCount()-1, this); modeStack->setCornerWidget(this, Qt::TopRightCorner); - QObject::connect(m_connectBtn, SIGNAL(pressed()), this, SLOT(onConnectPressed())); + QObject::connect(m_connectBtn, SIGNAL(pressed()), this, SLOT(onConnectPressed())); } ConnectionManager::~ConnectionManager() { - disconnectDevice(); // Pip - suspendPolling(); // Pip + disconnectDevice(); // Pip + suspendPolling(); // Pip } void ConnectionManager::init() { //register to the plugin manager so we can receive //new connection object from plugins - QObject::connect(ExtensionSystem::PluginManager::instance(), SIGNAL(objectAdded(QObject*)), this, SLOT(objectAdded(QObject*))); - QObject::connect(ExtensionSystem::PluginManager::instance(), SIGNAL(aboutToRemoveObject(QObject*)), this, SLOT(aboutToRemoveObject(QObject*))); + QObject::connect(ExtensionSystem::PluginManager::instance(), SIGNAL(objectAdded(QObject*)), this, SLOT(objectAdded(QObject*))); + QObject::connect(ExtensionSystem::PluginManager::instance(), SIGNAL(aboutToRemoveObject(QObject*)), this, SLOT(aboutToRemoveObject(QObject*))); } /** * Method called when the user clicks the "Connect" button */ -bool ConnectionManager::connectDevice(devListItem device) +bool ConnectionManager::connectDevice() { - QIODevice *io_dev = device.connection->openDevice(device.Name); + devListItem connection_device = findDevice(m_availableDevList->itemData(m_availableDevList->currentIndex(),Qt::ToolTipRole).toString()); + if (!connection_device.connection) + return false; + + QIODevice *io_dev = connection_device.connection->openDevice(connection_device.Name); if (!io_dev) return false; @@ -111,23 +115,23 @@ bool ConnectionManager::connectDevice(devListItem device) // check if opening the device worked if (!io_dev->isOpen()) { - qDebug() << "Error: io_dev->isOpen() returned FALSE .. could not open connection to " << device.devName + qDebug() << "Error: io_dev->isOpen() returned FALSE .. could not open connection to " << connection_device.devName << ": " << io_dev->errorString(); // close the device // EDOUARD: why do we close if we could not open ??? try { - device.connection->closeDevice(device.devName); + connection_device.connection->closeDevice(connection_device.devName); } catch (...) { // handle exception - qDebug() << "Exception: connection_device.connection->closeDevice(" << device.devName << ")"; + qDebug() << "Exception: connection_device.connection->closeDevice(" << connection_device.devName << ")"; } return false; } // we appear to have connected to the device OK // remember the connection/device details - m_connectionDevice = device; + m_connectionDevice = connection_device; m_ioDev = io_dev; connect(m_connectionDevice.connection, SIGNAL(destroyed(QObject *)), this, SLOT(onConnectionDestroyed(QObject *)), Qt::QueuedConnection); @@ -167,8 +171,6 @@ bool ConnectionManager::disconnectDevice() m_connectionDevice.connection = NULL; m_ioDev = NULL; - emit deviceDisconnected(); - m_connectBtn->setText("Connect"); m_availableDevList->setEnabled(true); @@ -182,7 +184,7 @@ void ConnectionManager::objectAdded(QObject *obj) { //Check if a plugin added a connection object to the pool IConnection *connection = Aggregation::query(obj); - if (!connection) return; + if (!connection) return; //qDebug() << "Connection object registered:" << connection->connectionName(); //qDebug() << connection->availableDevices(); @@ -194,23 +196,23 @@ void ConnectionManager::objectAdded(QObject *obj) // to do things m_connectionsList.append(connection); - QObject::connect(connection, SIGNAL(availableDevChanged(IConnection *)), this, SLOT(devChanged(IConnection *))); + QObject::connect(connection, SIGNAL(availableDevChanged(IConnection *)), this, SLOT(devChanged(IConnection *))); } void ConnectionManager::aboutToRemoveObject(QObject *obj) { //Check if a plugin added a connection object to the pool IConnection *connection = Aggregation::query(obj); - if (!connection) return; + if (!connection) return; - if (m_connectionDevice.connection && m_connectionDevice.connection == connection) // Pip - { // we are currently using the one that is about to be removed - m_connectionDevice.connection = NULL; - m_ioDev = NULL; - } + if (m_connectionDevice.connection && m_connectionDevice.connection == connection) // Pip + { // we are currently using the one that is about to be removed + m_connectionDevice.connection = NULL; + m_ioDev = NULL; + } - if (m_connectionsList.contains(connection)) - m_connectionsList.removeAt(m_connectionsList.indexOf(connection)); + if (m_connectionsList.contains(connection)) + m_connectionsList.removeAt(m_connectionsList.indexOf(connection)); } @@ -228,11 +230,8 @@ void ConnectionManager::onConnectPressed() { // Check if we have a ioDev already created: if (!m_ioDev) - { - // connecting to currently selected device - devListItem device = findDevice(m_availableDevList->itemData(m_availableDevList->currentIndex(), Qt::ToolTipRole).toString()); - if (device.connection) - connectDevice(device); + { // connecting + connectDevice(); } else { // disconnecting @@ -245,9 +244,9 @@ void ConnectionManager::onConnectPressed() */ devListItem ConnectionManager::findDevice(const QString &devName) { - foreach (devListItem d, m_devList) + foreach (devListItem d, m_devList) { - if (d.devName == devName) + if (d.devName == devName) return d; } @@ -265,13 +264,13 @@ devListItem ConnectionManager::findDevice(const QString &devName) */ void ConnectionManager::suspendPolling() { - foreach (IConnection *cnx, m_connectionsList) - { + foreach (IConnection *cnx, m_connectionsList) + { cnx->suspendPolling(); } - m_connectBtn->setEnabled(false); - m_availableDevList->setEnabled(false); + m_connectBtn->setEnabled(false); + m_availableDevList->setEnabled(false); } /** @@ -280,13 +279,13 @@ void ConnectionManager::suspendPolling() */ void ConnectionManager::resumePolling() { - foreach (IConnection *cnx, m_connectionsList) - { + foreach (IConnection *cnx, m_connectionsList) + { cnx->resumePolling(); } - m_connectBtn->setEnabled(true); - m_availableDevList->setEnabled(true); + m_connectBtn->setEnabled(true); + m_availableDevList->setEnabled(true); } /** @@ -295,21 +294,21 @@ void ConnectionManager::resumePolling() */ void ConnectionManager::unregisterAll(IConnection *connection) { - for (QLinkedList::iterator iter = m_devList.begin(); iter != m_devList.end(); ) - { - if (iter->connection == connection) - { - if (m_connectionDevice.connection && m_connectionDevice.connection == connection) - { // we are currently using the one we are about to erase - //onConnectionClosed(m_connectionDevice.connection); - disconnectDevice(); - } + for (QLinkedList::iterator iter = m_devList.begin(); iter != m_devList.end(); ) + { + if (iter->connection == connection) + { + if (m_connectionDevice.connection && m_connectionDevice.connection == connection) + { // we are currently using the one we are about to erase + //onConnectionClosed(m_connectionDevice.connection); + disconnectDevice(); + } - iter = m_devList.erase(iter); - } - else - ++iter; - } + iter = m_devList.erase(iter); + } + else + ++iter; + } } /** @@ -348,7 +347,7 @@ void ConnectionManager::devChanged(IConnection *connection) unregisterAll(connection); //and add them back in the list - QList availableDev = connection->availableDevices(); + QList availableDev = connection->availableDevices(); foreach (IConnection::device dev, availableDev) { QString cbName = connection->shortName() + ": " + dev.name; @@ -356,35 +355,32 @@ void ConnectionManager::devChanged(IConnection *connection) registerDevice(connection,cbName,dev.name,disp); } - qDebug() << "# devices " << m_devList.count(); - emit availableDevicesChanged(m_devList); - //add all the list again to the combobox - foreach (devListItem device, m_devList) + foreach (devListItem d, m_devList) { - m_availableDevList->addItem(device.displayName); - m_availableDevList->setItemData(m_availableDevList->count() - 1, (const QString)device.devName,Qt::ToolTipRole); - if(!m_ioDev && device.displayName.startsWith("USB")) + m_availableDevList->addItem(d.displayName); + m_availableDevList->setItemData(m_availableDevList->count()-1,(const QString)d.devName,Qt::ToolTipRole); + if(!m_ioDev && d.displayName.startsWith("USB")) { if(m_mainWindow->generalSettings()->autoConnect() || m_mainWindow->generalSettings()->autoSelect()) - m_availableDevList->setCurrentIndex(m_availableDevList->count() - 1); - + m_availableDevList->setCurrentIndex(m_availableDevList->count()-1); if(m_mainWindow->generalSettings()->autoConnect()) { - connectDevice(device); - qDebug() << "ConnectionManager::devChanged autoconnected USB device"; + connectDevice(); + qDebug()<<"ConnectionManager::devChanged autoconnected USB device"; } } } if(m_ioDev)//if a device is connected make it the one selected on the dropbox { - for(int x=0; x < m_availableDevList->count(); ++x) + for(int x=0;xcount();++x) { if(m_connectionDevice.devName==m_availableDevList->itemData(x,Qt::ToolTipRole).toString()) m_availableDevList->setCurrentIndex(x); } } + //disable connection button if the liNameif (m_availableDevList->count() > 0) if (m_availableDevList->count() > 0) m_connectBtn->setEnabled(true); @@ -392,7 +388,7 @@ void ConnectionManager::devChanged(IConnection *connection) m_connectBtn->setEnabled(false); } - +} void Core::ConnectionManager::connectionsCallBack() { @@ -402,5 +398,4 @@ void Core::ConnectionManager::connectionsCallBack() } connectionBackup.clear(); disconnect(ExtensionSystem::PluginManager::instance(),SIGNAL(pluginsLoadEnded()),this,SLOT(connectionsCallBack())); -} } //namespace Core diff --git a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.h b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.h index 4d57319ae..289e65590 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.h @@ -46,12 +46,12 @@ QT_END_NAMESPACE namespace Core { -class IConnection; + class IConnection; namespace Internal { -class FancyTabWidget; -class FancyActionBar; -class MainWindow; + class FancyTabWidget; + class FancyActionBar; + class MainWindow; } // namespace Internal @@ -75,28 +75,19 @@ public: void init(); QIODevice* getCurrentConnection() { return m_ioDev; } - devListItem getCurrentDevice() { return m_connectionDevice; } - devListItem findDevice(const QString &devName); - - QLinkedList getAvailableDevices() { return m_devList; } - - bool isConnected() { return m_ioDev != 0; } - - bool connectDevice(devListItem device); + devListItem getCurrentDevice() { return m_connectionDevice;} bool disconnectDevice(); - void suspendPolling(); void resumePolling(); protected: void unregisterAll(IConnection *connection); void registerDevice(IConnection *conn, const QString &devN, const QString &name, const QString &disp); + devListItem findDevice(const QString &devName); signals: void deviceConnected(QIODevice *dev); - void deviceDisconnected(); void deviceAboutToDisconnect(); - void availableDevicesChanged(const QLinkedList devices); private slots: void objectAdded(QObject *obj); @@ -105,9 +96,9 @@ private slots: void onConnectPressed(); void devChanged(IConnection *connection); - // void onConnectionClosed(QObject *obj); - void onConnectionDestroyed(QObject *obj); - void connectionsCallBack(); //used to call devChange after all the plugins are loaded +// void onConnectionClosed(QObject *obj); + void onConnectionDestroyed(QObject *obj); + void connectionsCallBack(); //used to call devChange after all the plugins are loaded protected: QComboBox *m_availableDevList; QPushButton *m_connectBtn; @@ -121,8 +112,9 @@ protected: QIODevice *m_ioDev; private: - Internal::MainWindow *m_mainWindow; - QList connectionBackup; + bool connectDevice(); + Internal::MainWindow *m_mainWindow; + QList connectionBackup; }; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/abstractwizardpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/abstractwizardpage.cpp deleted file mode 100644 index 31425fc34..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/abstractwizardpage.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/** - ****************************************************************************** - * - * @file abstractwizardpage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup AbstractWizardPage - * @{ - * @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 "abstractwizardpage.h" - -AbstractWizardPage::AbstractWizardPage(SetupWizard* wizard, QWidget *parent) : - QWizardPage(parent) -{ - m_wizard = wizard; - setFixedSize(600, 400); -} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/abstractwizardpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/abstractwizardpage.h deleted file mode 100644 index 072d619e7..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/abstractwizardpage.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - ****************************************************************************** - * - * @file abstractwizardpage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup AbstractWizardPage - * @{ - * @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 ABSTRACTWIZARDPAGE_H -#define ABSTRACTWIZARDPAGE_H - -#include -#include "setupwizard.h" - -class AbstractWizardPage : public QWizardPage -{ - Q_OBJECT -protected: - explicit AbstractWizardPage(SetupWizard *wizard, QWidget *parent = 0); - -private: - SetupWizard *m_wizard; - -public: - SetupWizard* getWizard() { return m_wizard; } - -}; - -#endif // ABSTRACTWIZARDPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp deleted file mode 100644 index 7d66957d9..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/** - ****************************************************************************** - * - * @file controllerpage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup ControllerPage - * @{ - * @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 "controllerpage.h" -#include "ui_controllerpage.h" -#include "setupwizard.h" - -#include -#include - -ControllerPage::ControllerPage(SetupWizard *wizard, QWidget *parent) : - AbstractWizardPage(wizard, parent), - ui(new Ui::ControllerPage) -{ - ui->setupUi(this); - - m_connectionManager = Core::ICore::instance()->connectionManager(); - Q_ASSERT(m_connectionManager); - connect(m_connectionManager, SIGNAL(availableDevicesChanged(QLinkedList)), this, SLOT(devicesChanged(QLinkedList))); - - connect(m_connectionManager, SIGNAL(deviceConnected(QIODevice*)), this, SLOT(connectionStatusChanged())); - connect(m_connectionManager, SIGNAL(deviceDisconnected()), this, SLOT(connectionStatusChanged())); - - connect(ui->manualCB, SIGNAL(toggled(bool)), this, SLOT(identificationModeChanged())); - connect(ui->connectButton, SIGNAL(clicked()), this, SLOT(connectDisconnect())); - - setupBoardTypes(); - setupDeviceList(); -} - -ControllerPage::~ControllerPage() -{ - delete ui; -} - -void ControllerPage::initializePage() -{ - if(anyControllerConnected()) { - SetupWizard::CONTROLLER_TYPE type = getControllerType(); - setControllerType(type); - } - else { - setControllerType(SetupWizard::CONTROLLER_UNKNOWN); - } - emit completeChanged(); -} - -bool ControllerPage::isComplete() const -{ - return (ui->manualCB->isChecked() && ui->boardTypeCombo->currentIndex() > 0) || - (!ui->manualCB->isChecked() && m_connectionManager->isConnected() && ui->boardTypeCombo->currentIndex() > 0); -} - -bool ControllerPage::validatePage() -{ - getWizard()->setControllerType((SetupWizard::CONTROLLER_TYPE)ui->boardTypeCombo->itemData(ui->boardTypeCombo->currentIndex()).toInt()); - return true; -} - -bool ControllerPage::anyControllerConnected() -{ - return m_connectionManager->isConnected(); -} - -SetupWizard::CONTROLLER_TYPE ControllerPage::getControllerType() -{ - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectUtilManager* utilMngr = pm->getObject(); - int id = utilMngr->getBoardModel(); - - switch (id) { - case 0x0301: - return SetupWizard::CONTROLLER_PIPX; - case 0x0401: - return SetupWizard::CONTROLLER_CC; - case 0x0402: - return SetupWizard::CONTROLLER_CC3D; - case 0x0901: - return SetupWizard::CONTROLLER_REVO; - default: - return SetupWizard::CONTROLLER_UNKNOWN; - } -} - -void ControllerPage::setupDeviceList() -{ - devicesChanged(m_connectionManager->getAvailableDevices()); - connectionStatusChanged(); -} - -void ControllerPage::setupBoardTypes() -{ - QVariant v(0); - ui->boardTypeCombo->addItem("", SetupWizard::CONTROLLER_UNKNOWN); - ui->boardTypeCombo->addItem("OpenPilot CopterControl (CC)", SetupWizard::CONTROLLER_CC); - ui->boardTypeCombo->addItem("OpenPilot CopterControl (CC3D)", SetupWizard::CONTROLLER_CC3D); - ui->boardTypeCombo->addItem("OpenPilot Revolution", SetupWizard::CONTROLLER_REVO); - ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(ui->boardTypeCombo->count() - 1, 0), v, Qt::UserRole - 1); - ui->boardTypeCombo->addItem("OP PipX Modem", SetupWizard::CONTROLLER_PIPX); - ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(ui->boardTypeCombo->count() - 1, 0), v, Qt::UserRole - 1); -} - -void ControllerPage::setControllerType(SetupWizard::CONTROLLER_TYPE type) -{ - for(int i = 0; i < ui->boardTypeCombo->count(); ++i) { - if(ui->boardTypeCombo->itemData(i) == type) { - ui->boardTypeCombo->setCurrentIndex(i); - break; - } - } -} - -void ControllerPage::devicesChanged(QLinkedList devices) -{ - // Get the selected item before the update if any - QString currSelectedDeviceName = ui->deviceCombo->currentIndex() != -1 ? - ui->deviceCombo->itemData(ui->deviceCombo->currentIndex(), Qt::ToolTipRole).toString() : ""; - - // Clear the box - ui->deviceCombo->clear(); - - int indexOfSelectedItem = -1; - int i = 0; - - // Loop and fill the combo with items from connectionmanager - foreach (Core::devListItem device, devices) - { - ui->deviceCombo->addItem(device.displayName); - QString deviceName = (const QString)device.devName; - ui->deviceCombo->setItemData(ui->deviceCombo->count() - 1, deviceName, Qt::ToolTipRole); - if(currSelectedDeviceName != "" && currSelectedDeviceName == deviceName) { - indexOfSelectedItem = i; - } - i++; - } - - // Re select the item that was selected before if any - if(indexOfSelectedItem != -1) { - ui->deviceCombo->setCurrentIndex(indexOfSelectedItem); - } - connectionStatusChanged(); -} - -void ControllerPage::connectionStatusChanged() -{ - if(m_connectionManager->isConnected()) { - ui->deviceCombo->setEnabled(false); - ui->connectButton->setText(tr("Disconnect")); - ui->boardTypeCombo->setEnabled(false); - ui->manualCB->setEnabled(false); - QString connectedDeviceName = m_connectionManager->getCurrentDevice().devName; - for(int i = 0; i < ui->deviceCombo->count(); ++i) { - if(connectedDeviceName == ui->deviceCombo->itemData(i, Qt::ToolTipRole).toString()) { - ui->deviceCombo->setCurrentIndex(i); - break; - } - } - - SetupWizard::CONTROLLER_TYPE type = getControllerType(); - setControllerType(type); - } - else { - ui->deviceCombo->setEnabled(true); - ui->connectButton->setText(tr("Connect")); - ui->boardTypeCombo->setEnabled(false); - ui->manualCB->setEnabled(true); - ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(0, 0), QVariant(0), Qt::UserRole - 1); - setControllerType(SetupWizard::CONTROLLER_UNKNOWN); - } - emit completeChanged(); -} - -void ControllerPage::identificationModeChanged() -{ - if(ui->manualCB->isChecked()) { - ui->deviceCombo->setEnabled(false); - ui->boardTypeCombo->setEnabled(true); - ui->connectButton->setEnabled(false); - ui->boardTypeCombo->setCurrentIndex(1); - ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(0, 0), QVariant(0), Qt::UserRole - 1); - } - else { - ui->connectButton->setEnabled(ui->deviceCombo->count() > 0); - ui->deviceCombo->setEnabled(!m_connectionManager->isConnected()); - ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(0, 0), QVariant(1), Qt::UserRole - 1); - ui->boardTypeCombo->setCurrentIndex(0); - ui->boardTypeCombo->setEnabled(false); - } - emit completeChanged(); -} - -void ControllerPage::connectDisconnect() -{ - if(m_connectionManager->isConnected()) { - m_connectionManager->disconnectDevice(); - } - else { - m_connectionManager->connectDevice(m_connectionManager->findDevice(ui->deviceCombo->itemData(ui->deviceCombo->currentIndex(), Qt::ToolTipRole).toString())); - } - emit completeChanged(); -} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.h deleted file mode 100644 index b9b8ae111..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - ****************************************************************************** - * - * @file controllerpage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup ControllerPage - * @{ - * @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 CONTROLLERPAGE_H -#define CONTROLLERPAGE_H - -#include -#include -#include "setupwizard.h" -#include "abstractwizardpage.h" - -namespace Ui { -class ControllerPage; -} - -class ControllerPage : public AbstractWizardPage -{ - Q_OBJECT - -public: - explicit ControllerPage(SetupWizard *wizard, QWidget *parent = 0); - ~ControllerPage(); - void initializePage(); - bool isComplete() const; - bool validatePage(); - -private: - Ui::ControllerPage *ui; - bool anyControllerConnected(); - SetupWizard::CONTROLLER_TYPE getControllerType(); - void setupDeviceList(); - void setupBoardTypes(); - void setControllerType(SetupWizard::CONTROLLER_TYPE type); - Core::ConnectionManager *m_connectionManager; - -private slots: - void devicesChanged(QLinkedList devices); - void connectionStatusChanged(); - void identificationModeChanged(); - void connectDisconnect(); -}; - -#endif // CONTROLLERPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.ui deleted file mode 100644 index a949d6a1d..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.ui +++ /dev/null @@ -1,163 +0,0 @@ - - - ControllerPage - - - - 0 - 0 - 600 - 400 - - - - WizardPage - - - - - 20 - 20 - 550 - 241 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">OpenPilot board identification</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">To continue we need to know what kind of OpenPilot board you want the wizard to create a configuration for. The wizard will try to automatically detect what type of board you have connected.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Please connect the board to a free usb port on your computer, or if a serial modem like BlueTooth, PipX or other is used, then power up the board and select the device to connect with from the list below. Then press Connect.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">If the board already is connected and succesfully detected the board type will allready be displayed. You can disconnect and select another device if you need to detect another board.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">If your board isnt detected or if you want to create a configuration for a board that is not connected. Then select the Manual selection option below and select the board type from the drop down menu.</span></p></body></html> - - - Qt::AutoText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - 20 - 270 - 560 - 110 - - - - - 8 - - - - OpenPilot board type - - - - false - - - - 150 - 70 - 260 - 22 - - - - - - - 150 - 30 - 260 - 22 - - - - - - - 434 - 70 - 111 - 23 - - - - Connect - - - - - - 441 - 33 - 101 - 17 - - - - Manual selection - - - - - - 20 - 32 - 121 - 16 - - - - - 75 - true - - - - Connection device: - - - - - - 20 - 72 - 131 - 16 - - - - - 75 - true - - - - Detected board type: - - - deviceCombo - connectButton - boardTypeCombo - manualCB - label_2 - label_3 - - - - - diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.cpp index dda55196e..3270e23ff 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.cpp @@ -1,34 +1,8 @@ -/** - ****************************************************************************** - * - * @file endpage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup Setup Wizard Plugin - * @{ - * @brief A Wizard to make the initial setup easy for everyone. - *****************************************************************************/ -/* - * 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 "endpage.h" #include "ui_endpage.h" -EndPage::EndPage(SetupWizard *wizard, QWidget *parent) : - AbstractWizardPage(wizard, parent), +EndPage::EndPage(QWidget *parent) : + QWizardPage(parent), ui(new Ui::EndPage) { setFinalPage(true); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.h index afbeb6177..e4179e677 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.h @@ -1,45 +1,18 @@ -/** - ****************************************************************************** - * - * @file endpage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup - * @{ - * @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 ENDPAGE_H #define ENDPAGE_H -#include "abstractwizardpage.h" +#include namespace Ui { class EndPage; } -class EndPage : public AbstractWizardPage +class EndPage : public QWizardPage { Q_OBJECT public: - explicit EndPage(SetupWizard *wizard, QWidget *parent = 0); + explicit EndPage(QWidget *parent = 0); ~EndPage(); private: diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.ui index f72b2d718..cc0a5c162 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.ui +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.ui @@ -71,7 +71,7 @@ p, li { white-space: pre-wrap; } - Upload configuration + Uppload configuration diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp deleted file mode 100644 index 7295cc8a3..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** - ****************************************************************************** - * - * @file fixedwingpage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup FixedWingPage - * @{ - * @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 "fixedwingpage.h" -#include "ui_fixedwingpage.h" - -FixedWingPage::FixedWingPage(SetupWizard *wizard, QWidget *parent) : - AbstractWizardPage(wizard, parent), - ui(new Ui::FixedWingPage) -{ - ui->setupUi(this); - setFinalPage(true); -} - -FixedWingPage::~FixedWingPage() -{ - delete ui; -} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.h deleted file mode 100644 index 697721a9e..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - ****************************************************************************** - * - * @file fixedwingpage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup FixedWingPage - * @{ - * @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 FIXEDWINGPAGE_H -#define FIXEDWINGPAGE_H - -#include "abstractwizardpage.h" - -namespace Ui { -class FixedWingPage; -} - -class FixedWingPage : public AbstractWizardPage -{ - Q_OBJECT - -public: - explicit FixedWingPage(SetupWizard *wizard, QWidget *parent = 0); - ~FixedWingPage(); - -private: - Ui::FixedWingPage *ui; -}; - -#endif // FIXEDWINGPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.ui deleted file mode 100644 index 0e4fde978..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.ui +++ /dev/null @@ -1,43 +0,0 @@ - - - FixedWingPage - - - - 0 - 0 - 600 - 400 - - - - WizardPage - - - - - 50 - 160 - 500 - 41 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">The fixed wing part the OpenPilot Setup Wizard is not yet implemented</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p></body></html> - - - Qt::AlignHCenter|Qt::AlignTop - - - true - - - - - - diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.cpp deleted file mode 100644 index 93bfc3503..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** - ****************************************************************************** - * - * @file helipage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup HeliPage - * @{ - * @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 "helipage.h" -#include "ui_helipage.h" - -HeliPage::HeliPage(SetupWizard *wizard, QWidget *parent) : - AbstractWizardPage(wizard, parent), - ui(new Ui::HeliPage) -{ - ui->setupUi(this); - setFinalPage(true); -} - -HeliPage::~HeliPage() -{ - delete ui; -} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.h deleted file mode 100644 index 2b2b5b894..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - ****************************************************************************** - * - * @file helipage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup HeliPage - * @{ - * @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 HELIPAGE_H -#define HELIPAGE_H - -#include "abstractwizardpage.h" - -namespace Ui { -class HeliPage; -} - -class HeliPage : public AbstractWizardPage -{ - Q_OBJECT - -public: - explicit HeliPage(SetupWizard *wizard, QWidget *parent = 0); - ~HeliPage(); - -private: - Ui::HeliPage *ui; -}; - -#endif // HELIPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.ui deleted file mode 100644 index c3c6efd11..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/helipage.ui +++ /dev/null @@ -1,43 +0,0 @@ - - - HeliPage - - - - 0 - 0 - 600 - 400 - - - - WizardPage - - - - - 50 - 160 - 500 - 41 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">The helicopter part the OpenPilot Setup Wizard is not yet implemented</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p></body></html> - - - Qt::AlignHCenter|Qt::AlignTop - - - true - - - - - - diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp deleted file mode 100644 index 56ffa5fb0..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/** - ****************************************************************************** - * - * @file multipage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup MultiPage - * @{ - * @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 "multipage.h" -#include "ui_multipage.h" -#include "setupwizard.h" - -MultiPage::MultiPage(SetupWizard *wizard, QWidget *parent) : - AbstractWizardPage(wizard, parent), - ui(new Ui::MultiPage) -{ - ui->setupUi(this); - - QSvgRenderer *renderer = new QSvgRenderer(); - renderer->load(QString(":/configgadget/images/multirotor-shapes.svg")); - multiPic = new QGraphicsSvgItem(); - multiPic->setSharedRenderer(renderer); - QGraphicsScene *scene = new QGraphicsScene(this); - scene->addItem(multiPic); - ui->typeGraphicsView->setScene(scene); - - setupMultiTypesCombo(); - - // Default to Quad X since it is the most common setup - ui->typeCombo->setCurrentIndex(1); - connect(ui->typeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateImageAndDescription())); -} - -MultiPage::~MultiPage() -{ - delete ui; -} - -void MultiPage::initializePage() -{ - updateImageAndDescription(); -} - -void MultiPage::setupMultiTypesCombo() -{ - ui->typeCombo->addItem("Tricopter", SetupWizard::MULTI_ROTOR_TRI_Y); - ui->typeCombo->addItem("Quadcopter X", SetupWizard::MULTI_ROTOR_QUAD_X); - ui->typeCombo->addItem("Quadcopter +", SetupWizard::MULTI_ROTOR_QUAD_PLUS); - ui->typeCombo->addItem("Hexacopter", SetupWizard::MULTI_ROTOR_HEXA); - ui->typeCombo->addItem("Hexacopter Coax", SetupWizard::MULTI_ROTOR_HEXA_COAX_Y); - ui->typeCombo->addItem("Hexacopter H", SetupWizard::MULTI_ROTOR_HEXA_H); - ui->typeCombo->addItem("Octocopter", SetupWizard::MULTI_ROTOR_OCTO); - ui->typeCombo->addItem("Octocopter Coax X", SetupWizard::MULTI_ROTOR_OCTO_COAX_X); - ui->typeCombo->addItem("Octocopter Coax +", SetupWizard::MULTI_ROTOR_OCTO_COAX_PLUS); - ui->typeCombo->addItem("Octocopter V", SetupWizard::MULTI_ROTOR_OCTO_V); -} - -void MultiPage::updateImageAndDescription() -{ - SetupWizard::MULTI_ROTOR_SUB_TYPE type = (SetupWizard::MULTI_ROTOR_SUB_TYPE) ui->typeCombo->itemData(ui->typeCombo->currentIndex()).toInt(); - QString elementId = ""; - QString description = "Descriptive text with information about "; - description.append(ui->typeCombo->currentText()); - description.append(" multirotors."); - switch(type) - { - case SetupWizard::MULTI_ROTOR_TRI_Y: - elementId = "tri"; - break; - case SetupWizard::MULTI_ROTOR_QUAD_X: - elementId = "quad-x"; - break; - case SetupWizard::MULTI_ROTOR_QUAD_PLUS: - elementId = "quad-plus"; - break; - case SetupWizard::MULTI_ROTOR_HEXA: - elementId = "quad-hexa"; - break; - case SetupWizard::MULTI_ROTOR_HEXA_COAX_Y: - elementId = "hexa-coax"; - break; - case SetupWizard::MULTI_ROTOR_HEXA_H: - elementId = "quad-hexa-H"; - break; - case SetupWizard::MULTI_ROTOR_OCTO: - elementId = "quad-octo"; - break; - case SetupWizard::MULTI_ROTOR_OCTO_COAX_X: - elementId = "octo-coax-X"; - break; - case SetupWizard::MULTI_ROTOR_OCTO_COAX_PLUS: - elementId = "octo-coax-P"; - break; - case SetupWizard::MULTI_ROTOR_OCTO_V: - elementId = "quad-octo-v"; - break; - default: - elementId = ""; - break; - } - multiPic->setElementId(elementId); - ui->typeGraphicsView->setSceneRect(multiPic->boundingRect()); - ui->typeGraphicsView->fitInView(multiPic, Qt::KeepAspectRatio); - - ui->typeDescription->setText(description); -} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.h deleted file mode 100644 index bc9f822ad..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - ****************************************************************************** - * - * @file multipage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup MultiPage - * @{ - * @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 MULTIPAGE_H -#define MULTIPAGE_H - -#include -#include - -#include "abstractwizardpage.h" - -namespace Ui { -class MultiPage; -} - -class MultiPage : public AbstractWizardPage -{ - Q_OBJECT - -public: - explicit MultiPage(SetupWizard *wizard, QWidget *parent = 0); - ~MultiPage(); - - void initializePage(); - -private: - Ui::MultiPage *ui; - void setupMultiTypesCombo(); - QGraphicsSvgItem *multiPic; - -private slots: - void updateImageAndDescription(); -}; - -#endif // MULTIPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.ui deleted file mode 100644 index 2c33fb4d5..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.ui +++ /dev/null @@ -1,146 +0,0 @@ - - - MultiPage - - - - 0 - 0 - 600 - 400 - - - - WizardPage - - - - - 20 - 20 - 541 - 151 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">OpenPilot multirotor configuration</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">This part of the wizard will set up the OpenPilot controller for use with a flying platform with multiple rotors. The wizard supports the most common types of multirotors. Other variants of multirotors can be configured by using custom configuration options in the configuration plugin in GCS.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Please select the type of multirotor you want to create a configuration for below:</span></p></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - 20 - 180 - 561 - 200 - - - - - 10 - - - - Multirotor type selection - - - - - 20 - 32 - 121 - 16 - - - - - 75 - true - - - - Multirotor type: - - - - - - 150 - 30 - 220 - 22 - - - - - - - 390 - 30 - 150 - 150 - - - - - 0 - 0 - - - - QFrame::NoFrame - - - 0 - - - 0 - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - false - - - - - - 20 - 69 - 351 - 111 - - - - Qt::ScrollBarAlwaysOn - - - Qt::ScrollBarAlwaysOff - - - Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.cpp deleted file mode 100644 index 57a43fda8..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** - ****************************************************************************** - * - * @file notyetimplementedpage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup NotYetImplementedPage - * @{ - * @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 "notyetimplementedpage.h" -#include "ui_notyetimplementedpage.h" - -NotYetImplementedPage::NotYetImplementedPage(SetupWizard *wizard, QWidget *parent) : - AbstractWizardPage(wizard, parent), - ui(new Ui::NotYetImplementedPage) -{ - ui->setupUi(this); - setFinalPage(true); -} - -NotYetImplementedPage::~NotYetImplementedPage() -{ - delete ui; -} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.h deleted file mode 100644 index 4f323d9fc..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - ****************************************************************************** - * - * @file notyetimplementedpage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup NotYetImplementedPage - * @{ - * @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 NOTYETIMPLEMENTEDPAGE_H -#define NOTYETIMPLEMENTEDPAGE_H - -#include "abstractwizardpage.h" - -namespace Ui { -class NotYetImplementedPage; -} - -class NotYetImplementedPage : public AbstractWizardPage -{ - Q_OBJECT - -public: - explicit NotYetImplementedPage(SetupWizard *wizard, QWidget *parent = 0); - ~NotYetImplementedPage(); - -private: - Ui::NotYetImplementedPage *ui; -}; - -#endif // NOTYETIMPLEMENTEDPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.ui deleted file mode 100644 index b5b54240d..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/notyetimplementedpage.ui +++ /dev/null @@ -1,43 +0,0 @@ - - - NotYetImplementedPage - - - - 0 - 0 - 600 - 400 - - - - WizardPage - - - - - 50 - 190 - 501 - 31 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">This part the OpenPilot Setup Wizard is not yet implemented</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/startpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/startpage.cpp index 46110a9e4..f36631bb0 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/startpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/startpage.cpp @@ -1,34 +1,8 @@ -/** - ****************************************************************************** - * - * @file startpage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup Setup Wizard Plugin - * @{ - * @brief A Wizard to make the initial setup easy for everyone. - *****************************************************************************/ -/* - * 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 "startpage.h" #include "ui_startpage.h" -StartPage::StartPage(SetupWizard *wizard, QWidget *parent) : - AbstractWizardPage(wizard, parent), +StartPage::StartPage(QWidget *parent) : + QWizardPage(parent), ui(new Ui::StartPage) { ui->setupUi(this); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/startpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/startpage.h index 3e9e120cc..f6cf9b6cd 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/startpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/startpage.h @@ -1,44 +1,18 @@ -/** - ****************************************************************************** - * - * @file startpage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup Setup Wizard Plugin - * @{ - * @brief A Wizard to make the initial setup easy for everyone. - *****************************************************************************/ -/* - * 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 STARTPAGE_H #define STARTPAGE_H -#include "abstractwizardpage.h" +#include namespace Ui { class StartPage; } -class StartPage : public AbstractWizardPage +class StartPage : public QWizardPage { Q_OBJECT public: - explicit StartPage(SetupWizard *wizard, QWidget *parent = 0); + explicit StartPage(QWidget *parent = 0); ~StartPage(); private: diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.cpp deleted file mode 100644 index a28724f2f..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** - ****************************************************************************** - * - * @file surfacepage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup SurfacePage - * @{ - * @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 "surfacepage.h" -#include "ui_surfacepage.h" - -SurfacePage::SurfacePage(SetupWizard *wizard, QWidget *parent) : - AbstractWizardPage(wizard, parent), - ui(new Ui::SurfacePage) -{ - ui->setupUi(this); - setFinalPage(true); -} - -SurfacePage::~SurfacePage() -{ - delete ui; -} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.h deleted file mode 100644 index 593aa1fca..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - ****************************************************************************** - * - * @file surfacepage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup SurfacePage - * @{ - * @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 SURFACEPAGE_H -#define SURFACEPAGE_H - -#include "abstractwizardpage.h" - -namespace Ui { -class SurfacePage; -} - -class SurfacePage : public AbstractWizardPage -{ - Q_OBJECT - -public: - explicit SurfacePage(SetupWizard *wizard, QWidget *parent = 0); - ~SurfacePage(); - -private: - Ui::SurfacePage *ui; -}; - -#endif // SURFACEPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.ui deleted file mode 100644 index 988bc300a..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/surfacepage.ui +++ /dev/null @@ -1,43 +0,0 @@ - - - SurfacePage - - - - 0 - 0 - 600 - 400 - - - - WizardPage - - - - - 50 - 160 - 500 - 41 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">The surface vehicle part the OpenPilot Setup Wizard is not yet implemented</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p></body></html> - - - Qt::AlignHCenter|Qt::AlignTop - - - true - - - - - - diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.cpp deleted file mode 100644 index a616a1194..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/** - ****************************************************************************** - * - * @file vehiclepage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup VehiclePage - * @{ - * @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 "vehiclepage.h" -#include "ui_vehiclepage.h" - -VehiclePage::VehiclePage(SetupWizard *wizard, QWidget *parent) : - AbstractWizardPage(wizard, parent), - ui(new Ui::VehiclePage) -{ - ui->setupUi(this); -} - -VehiclePage::~VehiclePage() -{ - delete ui; -} - -bool VehiclePage::validatePage() -{ - if(ui->multirotorButton->isChecked()) { - getWizard()->setVehicleType(SetupWizard::VEHICLE_MULTI); - } - else if(ui->fixedwingButton->isChecked()) { - getWizard()->setVehicleType(SetupWizard::VEHICLE_FIXEDWING); - } - else if(ui->heliButton->isChecked()) { - getWizard()->setVehicleType(SetupWizard::VEHICLE_HELI); - } - else if(ui->surfaceButton->isChecked()) { - getWizard()->setVehicleType(SetupWizard::VEHICLE_SURFACE); - } - else { - getWizard()->setVehicleType(SetupWizard::VEHICLE_UNKNOWN); - } - return true; -} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.h deleted file mode 100644 index 5e72a3d21..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - ****************************************************************************** - * - * @file vehiclepage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @addtogroup - * @{ - * @addtogroup VehiclePage - * @{ - * @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 VEHICLEPAGE_H -#define VEHICLEPAGE_H - -#include "abstractwizardpage.h" - -namespace Ui { -class VehiclePage; -} - -class VehiclePage : public AbstractWizardPage -{ - Q_OBJECT - -public: - explicit VehiclePage(SetupWizard *wizard, QWidget *parent = 0); - ~VehiclePage(); - bool validatePage(); - -private: - Ui::VehiclePage *ui; -}; - -#endif // VEHICLEPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.ui deleted file mode 100644 index fdc2d47d2..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/vehiclepage.ui +++ /dev/null @@ -1,168 +0,0 @@ - - - VehiclePage - - - - 0 - 0 - 600 - 400 - - - - WizardPage - - - - - 20 - 20 - 550 - 131 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Vehicle type selection</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">To continue the wizard needs to know what type of vehicle that the OpenPilot controller board is going to be used with. This step is cruicial since most of the following configuration is unique per vehicle type.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">So go ahead and select the type of vehicle you want to create a configuration for.</span></p></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - 20 - 200 - 561 - 181 - - - - - 0 - 0 - - - - Supported vehicle types - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - 50 - 40 - 100 - 100 - - - - Tricopter, Quadcopter, Hexacopter, Octocopter - - - Multirotor - - - true - - - true - - - true - - - false - - - - - - 170 - 40 - 100 - 100 - - - - Airplane, Sloper, Jet - - - Fixed wing - - - true - - - true - - - false - - - - - - 290 - 40 - 100 - 100 - - - - Helicopter - - - true - - - true - - - false - - - - - - 410 - 40 - 100 - 100 - - - - Car, Boat, U-Boat - - - Surface - - - true - - - true - - - false - - - - - - - diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index f11762bf6..26a5e386a 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -2,7 +2,7 @@ ****************************************************************************** * * @file setupwizard.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @addtogroup GCSPlugins GCS Plugins * @{ * @addtogroup Setup Wizard Plugin @@ -28,72 +28,27 @@ #include "setupwizard.h" #include "pages/startpage.h" #include "pages/endpage.h" -#include "pages/controllerpage.h" -#include "pages/vehiclepage.h" -#include "pages/multipage.h" -#include "pages/fixedwingpage.h" -#include "pages/helipage.h" -#include "pages/surfacepage.h" -#include "pages/notyetimplementedpage.h" SetupWizard::SetupWizard(QWidget *parent) : QWizard(parent) { setWindowTitle("OpenPilot Setup Wizard"); - m_controllerType = CONTROLLER_UNKNOWN; - m_vehicleType = VEHICLE_UNKNOWN; createPages(); } int SetupWizard::nextId() const { switch (currentId()) { - case PAGE_START: - return PAGE_CONTROLLER; - case PAGE_CONTROLLER: { - switch(getControllerType()) - { - case CONTROLLER_CC: - case CONTROLLER_CC3D: - return PAGE_VEHICLES; - default: - return PAGE_NOTYETIMPLEMENTED; - } - } - case PAGE_VEHICLES: { - switch(getVehicleType()) - { - case VEHICLE_FIXEDWING: - return PAGE_FIXEDWING; - case VEHICLE_HELI: - return PAGE_HELI; - case VEHICLE_SURFACE: - return PAGE_SURFACE; - case VEHICLE_MULTI: - return PAGE_MULTI; - default: - return PAGE_NOTYETIMPLEMENTED; - } - } - case PAGE_MULTI: - return PAGE_END; - case PAGE_NOTYETIMPLEMENTED: - return PAGE_END; - default: - return -1; + case PAGE_START: + return PAGE_END; + default: + return -1; } } void SetupWizard::createPages() { - setPage(PAGE_START, new StartPage(this)); - setPage(PAGE_CONTROLLER, new ControllerPage(this)); - setPage(PAGE_VEHICLES, new VehiclePage(this)); - setPage(PAGE_MULTI, new MultiPage(this)); - setPage(PAGE_FIXEDWING, new FixedWingPage(this)); - setPage(PAGE_HELI, new HeliPage(this)); - setPage(PAGE_SURFACE, new SurfacePage(this)); - setPage(PAGE_NOTYETIMPLEMENTED, new NotYetImplementedPage(this)); - setPage(PAGE_END, new EndPage(this)); + setPage(PAGE_START, new StartPage()); + setPage(PAGE_END, new EndPage()); setStartId(PAGE_START); } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h index 34b20dd81..42f75556a 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h @@ -2,7 +2,7 @@ ****************************************************************************** * * @file setupwizard.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @addtogroup GCSPlugins GCS Plugins * @{ * @addtogroup Setup Wizard Plugin @@ -37,25 +37,9 @@ class SetupWizard : public QWizard public: SetupWizard(QWidget *parent = 0); int nextId() const; - enum CONTROLLER_TYPE {CONTROLLER_UNKNOWN, CONTROLLER_CC, CONTROLLER_CC3D, CONTROLLER_REVO, CONTROLLER_PIPX}; - enum VEHICLE_TYPE {VEHICLE_UNKNOWN, VEHICLE_MULTI, VEHICLE_FIXEDWING, VEHICLE_HELI, VEHICLE_SURFACE}; - enum MULTI_ROTOR_SUB_TYPE {MULTI_ROTOR_UNKNOWN, MULTI_ROTOR_TRI_Y, MULTI_ROTOR_QUAD_X, MULTI_ROTOR_QUAD_PLUS, - MULTI_ROTOR_HEXA, MULTI_ROTOR_HEXA_H, MULTI_ROTOR_HEXA_COAX_Y, MULTI_ROTOR_OCTO, - MULTI_ROTOR_OCTO_V, MULTI_ROTOR_OCTO_COAX_X, MULTI_ROTOR_OCTO_COAX_PLUS}; - - void setControllerType(SetupWizard::CONTROLLER_TYPE type) { m_controllerType = type; } - SetupWizard::CONTROLLER_TYPE getControllerType() const { return m_controllerType; } - - void setVehicleType(SetupWizard::VEHICLE_TYPE type) { m_vehicleType = type; } - SetupWizard::VEHICLE_TYPE getVehicleType() const { return m_vehicleType; } - private: - enum {PAGE_START, PAGE_CONTROLLER, PAGE_VEHICLES, PAGE_MULTI, PAGE_FIXEDWING, - PAGE_HELI, PAGE_SURFACE, PAGE_NOTYETIMPLEMENTED, PAGE_END}; + enum {PAGE_START, PAGE_END}; void createPages(); - - CONTROLLER_TYPE m_controllerType; - VEHICLE_TYPE m_vehicleType; }; #endif // SETUPWIZARD_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro index 98ece1c83..20d13155d 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro @@ -1,49 +1,21 @@ TEMPLATE = lib TARGET = SetupWizard -QT += svg - + include(../../openpilotgcsplugin.pri) include(../../plugins/coreplugin/coreplugin.pri) -include(../../plugins/uavobjectutil/uavobjectutil.pri) HEADERS += setupwizardplugin.h \ setupwizard.h \ pages/startpage.h \ - pages/endpage.h \ - pages/controllerpage.h \ - pages/vehiclepage.h \ - pages/notyetimplementedpage.h \ - pages/multipage.h \ - pages/fixedwingpage.h \ - pages/helipage.h \ - pages/surfacepage.h \ - pages/abstractwizardpage.h + pages/endpage.h SOURCES += setupwizardplugin.cpp \ setupwizard.cpp \ pages/startpage.cpp \ - pages/endpage.cpp \ - pages/controllerpage.cpp \ - pages/vehiclepage.cpp \ - pages/notyetimplementedpage.cpp \ - pages/multipage.cpp \ - pages/fixedwingpage.cpp \ - pages/helipage.cpp \ - pages/surfacepage.cpp \ - pages/abstractwizardpage.cpp + pages/endpage.cpp OTHER_FILES += SetupWizard.pluginspec FORMS += \ pages/startpage.ui \ - pages/endpage.ui \ - pages/controllerpage.ui \ - pages/vehiclepage.ui \ - pages/notyetimplementedpage.ui \ - pages/multipage.ui \ - pages/fixedwingpage.ui \ - pages/helipage.ui \ - pages/surfacepage.ui - -RESOURCES += \ - wizardResources.qrc + pages/endpage.ui \ No newline at end of file diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp index 9f5b5c67b..a6dddbd4c 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp @@ -1,8 +1,8 @@ /** ****************************************************************************** * - * @file setupwizardplugin.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @file donothingplugin.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @addtogroup GCSPlugins GCS Plugins * @{ * @addtogroup SetupWizardPlugin diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h index 96ca9e038..4caecbcd0 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h @@ -1,8 +1,8 @@ /** ****************************************************************************** * - * @file setupwizardplugin.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @file donothingplugin.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @addtogroup GCSPlugins GCS Plugins * @{ * @addtogroup SetupWizardPlugin diff --git a/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc b/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc deleted file mode 100644 index 1358ce976..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc +++ /dev/null @@ -1,3 +0,0 @@ - - -