From 2cd3485cf69caf03f1988bd7fc31ba613872448c Mon Sep 17 00:00:00 2001 From: Fredrik Arvidsson Date: Sun, 3 Mar 2013 19:33:24 +0100 Subject: [PATCH] OP-816 Fixed Revolution identification and Revolution + OPLink firmware auto-update functionality. --- .../src/plugins/setupwizard/connectiondiagram.cpp | 2 +- .../src/plugins/setupwizard/pages/autoupdatepage.cpp | 6 +++--- .../src/plugins/setupwizard/pages/controllerpage.cpp | 8 +++----- .../openpilotgcs/src/plugins/setupwizard/setupwizard.cpp | 4 ++-- .../src/plugins/setupwizard/vehicleconfigurationsource.h | 2 +- .../src/plugins/uploader/uploadergadgetwidget.cpp | 8 ++++++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp b/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp index 1b94c1cae..8d7db60f8 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp @@ -82,7 +82,7 @@ void ConnectionDiagram::setupGraphicsScene() case VehicleConfigurationSource::CONTROLLER_CC: case VehicleConfigurationSource::CONTROLLER_CC3D: case VehicleConfigurationSource::CONTROLLER_REVO: - case VehicleConfigurationSource::CONTROLLER_PIPX: + case VehicleConfigurationSource::CONTROLLER_OPLINK: default: elementsToShow << "controller"; break; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp index 440e8b4d5..6542940f1 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp @@ -15,9 +15,9 @@ AutoUpdatePage::AutoUpdatePage(SetupWizard *wizard, QWidget *parent) : Q_ASSERT(pm); UploaderGadgetFactory *uploader = pm->getObject(); Q_ASSERT(uploader); - connect(ui->startUpdate,SIGNAL(clicked()), this, SLOT(disableButtons())); - connect(ui->startUpdate,SIGNAL(clicked()),uploader,SIGNAL(autoUpdate())); - connect(uploader,SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep,QVariant)),this,SLOT(updateStatus(uploader::AutoUpdateStep,QVariant))); + connect(ui->startUpdate, SIGNAL(clicked()), this, SLOT(disableButtons())); + connect(ui->startUpdate, SIGNAL(clicked()), uploader, SIGNAL(autoUpdate())); + connect(uploader, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep,QVariant)), this, SLOT(updateStatus(uploader::AutoUpdateStep, QVariant))); } AutoUpdatePage::~AutoUpdatePage() diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp index 7601fff62..595928931 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp @@ -97,12 +97,12 @@ SetupWizard::CONTROLLER_TYPE ControllerPage::getControllerType() switch (id) { case 0x0301: - return SetupWizard::CONTROLLER_PIPX; + return SetupWizard::CONTROLLER_OPLINK; case 0x0401: return SetupWizard::CONTROLLER_CC; case 0x0402: return SetupWizard::CONTROLLER_CC3D; - case 0x0901: + case 0x0903: return SetupWizard::CONTROLLER_REVO; default: return SetupWizard::CONTROLLER_UNKNOWN; @@ -122,9 +122,7 @@ void ControllerPage::setupBoardTypes() ui->boardTypeCombo->addItem(tr("OpenPilot CopterControl"), SetupWizard::CONTROLLER_CC); ui->boardTypeCombo->addItem(tr("OpenPilot CopterControl 3D"), SetupWizard::CONTROLLER_CC3D); ui->boardTypeCombo->addItem(tr("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(tr("OpenPilot OPLink Radio Modem"), SetupWizard::CONTROLLER_PIPX); - //ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(ui->boardTypeCombo->count() - 1, 0), v, Qt::UserRole - 1); + ui->boardTypeCombo->addItem(tr("OpenPilot OPLink Radio Modem"), SetupWizard::CONTROLLER_OPLINK); } void ControllerPage::setControllerType(SetupWizard::CONTROLLER_TYPE type) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index 3e6b6916b..d6b6bb86b 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -83,7 +83,7 @@ int SetupWizard::nextId() const case CONTROLLER_CC3D: return PAGE_INPUT; case CONTROLLER_REVO: - case CONTROLLER_PIPX: + case CONTROLLER_OPLINK: default: return PAGE_NOTYETIMPLEMENTED; } @@ -147,7 +147,7 @@ QString SetupWizard::getSummaryText() case CONTROLLER_REVO: summary.append(tr("OpenPilot Revolution")); break; - case CONTROLLER_PIPX: + case CONTROLLER_OPLINK: summary.append(tr("OpenPilot OPLink Radio Modem")); break; default: diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h index 5e36902e9..5bb15ceb0 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h @@ -56,7 +56,7 @@ class VehicleConfigurationSource public: VehicleConfigurationSource(); - enum CONTROLLER_TYPE {CONTROLLER_UNKNOWN, CONTROLLER_CC, CONTROLLER_CC3D, CONTROLLER_REVO, CONTROLLER_PIPX}; + enum CONTROLLER_TYPE {CONTROLLER_UNKNOWN, CONTROLLER_CC, CONTROLLER_CC3D, CONTROLLER_REVO, CONTROLLER_OPLINK}; enum VEHICLE_TYPE {VEHICLE_UNKNOWN, VEHICLE_MULTI, VEHICLE_FIXEDWING, VEHICLE_HELI, VEHICLE_SURFACE}; enum VEHICLE_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, diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp index d4ef26ba6..508003f9f 100755 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp @@ -552,12 +552,16 @@ bool UploaderGadgetWidget::autoUpdate() emit autoUpdateSignal(LOADING_FW,QVariant()); switch (dfu->devices[0].ID) { - case 0x401: - filename="fw_coptercontrol"; + case 0x0301: + filename="fw_pipxtreme"; break; + case 0x401: case 0x402: filename="fw_coptercontrol"; break; + case 0x903: + filename="fw_revomini"; + break; default: emit autoUpdateSignal(FAILURE,QVariant()); return false;