mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
Merge branch 'thread/OP-1628_Reboot_Board_In_Wizard' into next
This commit is contained in:
commit
f61a013e0b
@ -8,7 +8,7 @@
|
||||
|
||||
AutoUpdatePage::AutoUpdatePage(SetupWizard *wizard, QWidget *parent) :
|
||||
AbstractWizardPage(wizard, parent),
|
||||
ui(new Ui::AutoUpdatePage)
|
||||
ui(new Ui::AutoUpdatePage), m_isUpdating(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
@ -16,8 +16,8 @@ AutoUpdatePage::AutoUpdatePage(SetupWizard *wizard, QWidget *parent) :
|
||||
UploaderGadgetFactory *uploader = pm->getObject<UploaderGadgetFactory>();
|
||||
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(autoUpdate()));
|
||||
connect(uploader, SIGNAL(progressUpdate(uploader::ProgressStep, QVariant)), this, SLOT(updateStatus(uploader::ProgressStep, QVariant)));
|
||||
}
|
||||
|
||||
AutoUpdatePage::~AutoUpdatePage()
|
||||
@ -25,6 +25,11 @@ AutoUpdatePage::~AutoUpdatePage()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool AutoUpdatePage::isComplete() const
|
||||
{
|
||||
return !m_isUpdating;
|
||||
}
|
||||
|
||||
void AutoUpdatePage::enableButtons(bool enable = false)
|
||||
{
|
||||
ui->startUpdate->setEnabled(enable);
|
||||
@ -35,10 +40,19 @@ void AutoUpdatePage::enableButtons(bool enable = false)
|
||||
QApplication::processEvents();
|
||||
}
|
||||
|
||||
void AutoUpdatePage::updateStatus(uploader::AutoUpdateStep status, QVariant value)
|
||||
void AutoUpdatePage::autoUpdate()
|
||||
{
|
||||
QString msg;
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
|
||||
Q_ASSERT(pm);
|
||||
UploaderGadgetFactory *uploader = pm->getObject<UploaderGadgetFactory>();
|
||||
Q_ASSERT(uploader);
|
||||
m_isUpdating = true;
|
||||
uploader->autoUpdate(ui->eraseSettings->isChecked());
|
||||
}
|
||||
|
||||
void AutoUpdatePage::updateStatus(uploader::ProgressStep status, QVariant value)
|
||||
{
|
||||
switch (status) {
|
||||
case uploader::WAITING_DISCONNECT:
|
||||
disableButtons();
|
||||
@ -48,16 +62,6 @@ void AutoUpdatePage::updateStatus(uploader::AutoUpdateStep status, QVariant valu
|
||||
ui->levellinProgressBar->setValue(value.toInt());
|
||||
break;
|
||||
case uploader::WAITING_CONNECT:
|
||||
// Note:
|
||||
// the following commented out lines were probably added to fix an issue when uploader opened a popup requesting
|
||||
// user to disconnect all boards
|
||||
// Side effect is that the wizard dialog flickers
|
||||
// the uploader was changed to avoid popups alltogether and that fix is not need anymore
|
||||
// same commented fix can be found in FAILURE case and they are kept for future ref.
|
||||
// getWizard()->setWindowFlags(getWizard()->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
// getWizard()->setWindowIcon(qApp->windowIcon());
|
||||
// getWizard()->show();
|
||||
// End of Note
|
||||
disableButtons();
|
||||
ui->statusLabel->setText(tr("Please connect the board to the USB port (don't use external supply)."));
|
||||
// TODO get rid of magic number 20s (should use UploaderGadgetWidget::BOARD_EVENT_TIMEOUT)
|
||||
@ -65,8 +69,10 @@ void AutoUpdatePage::updateStatus(uploader::AutoUpdateStep status, QVariant valu
|
||||
ui->levellinProgressBar->setValue(value.toInt());
|
||||
break;
|
||||
case uploader::JUMP_TO_BL:
|
||||
ui->levellinProgressBar->setValue(0);
|
||||
ui->statusLabel->setText(tr("Board going into bootloader mode."));
|
||||
disableButtons();
|
||||
ui->levellinProgressBar->setValue(value.toInt());
|
||||
ui->levellinProgressBar->setMaximum(5);
|
||||
ui->statusLabel->setText(tr("Board going into bootloader mode. Please wait."));
|
||||
break;
|
||||
case uploader::LOADING_FW:
|
||||
ui->statusLabel->setText(tr("Loading firmware."));
|
||||
@ -80,20 +86,24 @@ void AutoUpdatePage::updateStatus(uploader::AutoUpdateStep status, QVariant valu
|
||||
ui->statusLabel->setText(tr("Uploading description."));
|
||||
break;
|
||||
case uploader::BOOTING:
|
||||
ui->statusLabel->setText(tr("Booting the board."));
|
||||
ui->statusLabel->setText(tr("Booting the board. Please wait"));
|
||||
break;
|
||||
case uploader::BOOTING_AND_ERASING:
|
||||
ui->statusLabel->setText(tr("Booting and erasing the board. Please wait"));
|
||||
break;
|
||||
case uploader::SUCCESS:
|
||||
m_isUpdating = false;
|
||||
enableButtons(true);
|
||||
ui->statusLabel->setText(tr("Board updated, please press 'Next' to continue."));
|
||||
break;
|
||||
case uploader::FAILURE:
|
||||
// getWizard()->setWindowFlags(getWizard()->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
// getWizard()->setWindowIcon(qApp->windowIcon());
|
||||
m_isUpdating = false;
|
||||
enableButtons(true);
|
||||
QString msg = value.toString();
|
||||
if (msg.isEmpty()) {
|
||||
msg = tr("Something went wrong, you will have to manually upgrade the board using the uploader plugin.");
|
||||
msg = tr("Something went wrong.");
|
||||
}
|
||||
msg += tr(" You will have to manually upgrade the board using the uploader plugin.");
|
||||
ui->statusLabel->setText(QString("<font color='red'>%1</font>").arg(msg));
|
||||
break;
|
||||
}
|
||||
|
@ -44,17 +44,20 @@ class AutoUpdatePage : public AbstractWizardPage {
|
||||
public:
|
||||
explicit AutoUpdatePage(SetupWizard *wizard, QWidget *parent = 0);
|
||||
~AutoUpdatePage();
|
||||
bool isComplete() const;
|
||||
|
||||
private slots:
|
||||
void updateStatus(uploader::AutoUpdateStep, QVariant);
|
||||
void updateStatus(uploader::ProgressStep, QVariant);
|
||||
void disableButtons()
|
||||
{
|
||||
enableButtons(false);
|
||||
}
|
||||
void enableButtons(bool enable);
|
||||
void autoUpdate();
|
||||
|
||||
private:
|
||||
Ui::AutoUpdatePage *ui;
|
||||
bool m_isUpdating;
|
||||
};
|
||||
|
||||
#endif // AUTOUPDATEPAGE_H
|
||||
|
@ -20,13 +20,11 @@
|
||||
<string><!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:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;">Firmware Update</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">It is necessary that your firmware and ground control software are the same version.</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">To update your firmware to the correct version now:</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">- Unplug all batteries and USB from OpenPilot</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">- Ensure your board is powered down &amp; no LED's are active.</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">When you are ready you can start the upgrade below by pushing the button and follow the onscreen prompts, it is critical that nothing disturbs the board while the firmware is being written.</span></p></body></html></string>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">When you are ready you can start the upgrade below by pushing the button. It is critical that nothing disturbs the board while the firmware is being written.</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">It is recommended that you erase all settings on the board when upgrading firmware. Using saved settings for a previous version of the firmware </span><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;">may result in undefined behaviour</span><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;"> and in worst case danger. It is possible to suppress the erase by deselecting the check box below.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
@ -49,6 +47,16 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item alignment="Qt::AlignHCenter">
|
||||
<widget class="QCheckBox" name="eraseSettings">
|
||||
<property name="text">
|
||||
<string>Erase all settings</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
|
@ -98,17 +98,17 @@ bool InputPage::restartNeeded(VehicleConfigurationSource::INPUT_TYPE selectedTyp
|
||||
{
|
||||
switch (selectedType) {
|
||||
case VehicleConfigurationSource::INPUT_PWM:
|
||||
return data.RM_RcvrPort != HwSettings::CC_RCVRPORT_PWM;
|
||||
return data.RM_RcvrPort != HwSettings::RM_RCVRPORT_PWM;
|
||||
|
||||
case VehicleConfigurationSource::INPUT_PPM:
|
||||
return data.RM_RcvrPort != HwSettings::CC_RCVRPORT_PPM;
|
||||
return data.RM_RcvrPort != HwSettings::RM_RCVRPORT_PPM;
|
||||
|
||||
case VehicleConfigurationSource::INPUT_SBUS:
|
||||
return data.RM_MainPort != HwSettings::CC_MAINPORT_SBUS;
|
||||
return data.RM_MainPort != HwSettings::RM_MAINPORT_SBUS;
|
||||
|
||||
case VehicleConfigurationSource::INPUT_DSM:
|
||||
// TODO: Handle all of the DSM types ?? Which is most common?
|
||||
return data.RM_MainPort != HwSettings::CC_MAINPORT_DSM;
|
||||
return data.RM_MainPort != HwSettings::RM_MAINPORT_DSM;
|
||||
|
||||
default: return true;
|
||||
}
|
||||
|
@ -1,67 +0,0 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file rebootpage.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup
|
||||
* @{
|
||||
* @addtogroup RebootPage
|
||||
* @{
|
||||
* @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 "rebootpage.h"
|
||||
#include "ui_rebootpage.h"
|
||||
|
||||
RebootPage::RebootPage(SetupWizard *wizard, QWidget *parent) :
|
||||
AbstractWizardPage(wizard, parent),
|
||||
ui(new Ui::RebootPage), m_toggl(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->yellowLabel->setVisible(false);
|
||||
ui->redLabel->setVisible(true);
|
||||
}
|
||||
|
||||
RebootPage::~RebootPage()
|
||||
{
|
||||
disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(toggleLabel()));
|
||||
m_timer.stop();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void RebootPage::initializePage()
|
||||
{
|
||||
if (!m_timer.isActive()) {
|
||||
connect(&m_timer, SIGNAL(timeout()), this, SLOT(toggleLabel()));
|
||||
m_timer.setInterval(500);
|
||||
m_timer.setSingleShot(false);
|
||||
m_timer.start();
|
||||
}
|
||||
}
|
||||
|
||||
bool RebootPage::validatePage()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void RebootPage::toggleLabel()
|
||||
{
|
||||
m_toggl = !m_toggl;
|
||||
ui->yellowLabel->setVisible(m_toggl);
|
||||
ui->redLabel->setVisible(!m_toggl);
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>RebootPage</class>
|
||||
<widget class="QWizardPage" name="RebootPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>WizardPage</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="redLabel">
|
||||
<property name="text">
|
||||
<string><!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:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:18pt; color:#ff0000;">PLEASE REBOOT YOUR CONTROLLER</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="yellowLabel">
|
||||
<property name="text">
|
||||
<string><!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:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:18pt; color:#ffd500;">PLEASE REBOOT YOUR CONTROLLER</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string><!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:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; color:#000000;">The configuration created by the wizard contains settings that require a reboot of your controller. Please power cycle the controller before continuing. To power cycle the controller remove all batteries and the USB cable for at least 30 seconds.</span></p>
|
||||
<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; color:#000000;">After 30 seconds, plug in the board again and wait for it to connect, this can take a few seconds. Then press next.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>yellowLabel</zorder>
|
||||
<zorder>redLabel</zorder>
|
||||
<zorder>label_3</zorder>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -44,7 +44,6 @@
|
||||
#include "pages/summarypage.h"
|
||||
#include "pages/savepage.h"
|
||||
#include "pages/notyetimplementedpage.h"
|
||||
#include "pages/rebootpage.h"
|
||||
#include "pages/outputcalibrationpage.h"
|
||||
#include "pages/revocalibrationpage.h"
|
||||
#include "pages/airframeinitialtuningpage.h"
|
||||
@ -141,11 +140,8 @@ int SetupWizard::nextId() const
|
||||
case PAGE_INPUT:
|
||||
if (isRestartNeeded()) {
|
||||
saveHardwareSettings();
|
||||
return PAGE_REBOOT;
|
||||
} else {
|
||||
return PAGE_VEHICLES;
|
||||
reboot();
|
||||
}
|
||||
case PAGE_REBOOT:
|
||||
return PAGE_VEHICLES;
|
||||
|
||||
case PAGE_ESC:
|
||||
@ -470,7 +466,6 @@ void SetupWizard::createPages()
|
||||
setPage(PAGE_OUTPUT_CALIBRATION, new OutputCalibrationPage(this));
|
||||
setPage(PAGE_SUMMARY, new SummaryPage(this));
|
||||
setPage(PAGE_SAVE, new SavePage(this));
|
||||
setPage(PAGE_REBOOT, new RebootPage(this));
|
||||
setPage(PAGE_NOTYETIMPLEMENTED, new NotYetImplementedPage(this));
|
||||
setPage(PAGE_AIRFRAME_INITIAL_TUNING, new AirframeInitialTuningPage(this));
|
||||
setPage(PAGE_END, new OPEndPage(this));
|
||||
@ -500,6 +495,23 @@ void SetupWizard::pageChanged(int currId)
|
||||
button(QWizard::CancelButton)->setVisible(currId != PAGE_END);
|
||||
}
|
||||
|
||||
void SetupWizard::reboot() const
|
||||
{
|
||||
SetupWizard *wiz = const_cast<SetupWizard *>(this);
|
||||
|
||||
wiz->setWindowFlags(wiz->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Q_ASSERT(pm);
|
||||
UploaderGadgetFactory *uploader = pm->getObject<UploaderGadgetFactory>();
|
||||
Q_ASSERT(uploader);
|
||||
uploader->reboot();
|
||||
|
||||
wiz->setRestartNeeded(false);
|
||||
wiz->setWindowFlags(wiz->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
wiz->show();
|
||||
}
|
||||
|
||||
bool SetupWizard::saveHardwareSettings() const
|
||||
{
|
||||
VehicleConfigurationHelper helper(const_cast<SetupWizard *>(this));
|
||||
|
@ -192,6 +192,7 @@ private:
|
||||
void createPages();
|
||||
bool saveHardwareSettings() const;
|
||||
bool canAutoUpdate() const;
|
||||
void reboot() const;
|
||||
|
||||
CONTROLLER_TYPE m_controllerType;
|
||||
VEHICLE_TYPE m_vehicleType;
|
||||
|
@ -31,7 +31,6 @@ HEADERS += setupwizardplugin.h \
|
||||
connectiondiagram.h \
|
||||
pages/outputcalibrationpage.h \
|
||||
outputcalibrationutil.h \
|
||||
pages/rebootpage.h \
|
||||
pages/savepage.h \
|
||||
pages/autoupdatepage.h \
|
||||
pages/revocalibrationpage.h \
|
||||
@ -65,7 +64,6 @@ SOURCES += setupwizardplugin.cpp \
|
||||
connectiondiagram.cpp \
|
||||
pages/outputcalibrationpage.cpp \
|
||||
outputcalibrationutil.cpp \
|
||||
pages/rebootpage.cpp \
|
||||
pages/savepage.cpp \
|
||||
pages/autoupdatepage.cpp \
|
||||
pages/revocalibrationpage.cpp \
|
||||
@ -92,7 +90,6 @@ FORMS += \
|
||||
pages/summarypage.ui \
|
||||
connectiondiagram.ui \
|
||||
pages/outputcalibrationpage.ui \
|
||||
pages/rebootpage.ui \
|
||||
pages/savepage.ui \
|
||||
pages/autoupdatepage.ui \
|
||||
pages/revocalibrationpage.ui \
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/threadmanager.h>
|
||||
|
||||
TelemetryManager::TelemetryManager() : m_isAutopilotConnected(false)
|
||||
TelemetryManager::TelemetryManager() : m_connectionState(TELEMETRY_DISCONNECTED)
|
||||
{
|
||||
moveToThread(Core::ICore::instance()->threadManager()->getRealTimeThread());
|
||||
// Get UAVObjectManager instance
|
||||
@ -47,13 +47,21 @@ TelemetryManager::TelemetryManager() : m_isAutopilotConnected(false)
|
||||
TelemetryManager::~TelemetryManager()
|
||||
{}
|
||||
|
||||
bool TelemetryManager::isConnected()
|
||||
bool TelemetryManager::isConnected() const
|
||||
{
|
||||
return m_isAutopilotConnected;
|
||||
return m_connectionState == TELEMETRY_CONNECTED;
|
||||
}
|
||||
|
||||
TelemetryManager::ConnectionState TelemetryManager::connectionState() const
|
||||
{
|
||||
return m_connectionState;
|
||||
}
|
||||
|
||||
void TelemetryManager::start(QIODevice *dev)
|
||||
{
|
||||
m_connectionState = TELEMETRY_CONNECTING;
|
||||
emit connecting();
|
||||
|
||||
m_telemetryDevice = dev;
|
||||
// OP-1383
|
||||
// take ownership of the device by moving it to the TelemetryManager thread (see TelemetryManager constructor)
|
||||
@ -98,6 +106,8 @@ void TelemetryManager::onStart()
|
||||
|
||||
void TelemetryManager::stop()
|
||||
{
|
||||
m_connectionState = TELEMETRY_DISCONNECTING;
|
||||
emit disconnecting();
|
||||
emit myStop();
|
||||
|
||||
if (false) {
|
||||
@ -117,13 +127,13 @@ void TelemetryManager::onStop()
|
||||
|
||||
void TelemetryManager::onConnect()
|
||||
{
|
||||
m_isAutopilotConnected = true;
|
||||
m_connectionState = TELEMETRY_CONNECTED;
|
||||
emit connected();
|
||||
}
|
||||
|
||||
void TelemetryManager::onDisconnect()
|
||||
{
|
||||
m_isAutopilotConnected = false;
|
||||
m_connectionState = TELEMETRY_DISCONNECTED;
|
||||
emit disconnected();
|
||||
}
|
||||
|
||||
|
@ -41,15 +41,25 @@ class UAVTALK_EXPORT TelemetryManager : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum ConnectionState {
|
||||
TELEMETRY_DISCONNECTED,
|
||||
TELEMETRY_CONNECTED,
|
||||
TELEMETRY_DISCONNECTING,
|
||||
TELEMETRY_CONNECTING
|
||||
};
|
||||
|
||||
TelemetryManager();
|
||||
~TelemetryManager();
|
||||
|
||||
void start(QIODevice *dev);
|
||||
void stop();
|
||||
bool isConnected();
|
||||
bool isConnected() const;
|
||||
ConnectionState connectionState() const;
|
||||
|
||||
signals:
|
||||
void connecting();
|
||||
void connected();
|
||||
void disconnecting();
|
||||
void disconnected();
|
||||
void telemetryUpdated(double txRate, double rxRate);
|
||||
void myStart();
|
||||
@ -68,7 +78,7 @@ private:
|
||||
Telemetry *m_telemetry;
|
||||
TelemetryMonitor *m_telemetryMonitor;
|
||||
QIODevice *m_telemetryDevice;
|
||||
bool m_isAutopilotConnected;
|
||||
ConnectionState m_connectionState;
|
||||
QThread m_telemetryReaderThread;
|
||||
};
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>584</width>
|
||||
<width>621</width>
|
||||
<height>500</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -20,6 +20,18 @@
|
||||
<string>Device Information</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
@ -200,15 +212,15 @@
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>filename</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -226,6 +238,18 @@
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
@ -285,6 +309,18 @@
|
||||
<string>On Device</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
@ -350,6 +386,18 @@
|
||||
<string>Loaded</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
|
@ -28,7 +28,10 @@
|
||||
#define ENUMS_H
|
||||
|
||||
namespace uploader {
|
||||
typedef enum { IAP_STATE_READY, IAP_STATE_STEP_1, IAP_STATE_STEP_2, IAP_STEP_RESET, IAP_STATE_BOOTLOADER } IAPStep;
|
||||
typedef enum { WAITING_DISCONNECT, WAITING_CONNECT, JUMP_TO_BL, LOADING_FW, UPLOADING_FW, UPLOADING_DESC, BOOTING, SUCCESS, FAILURE } AutoUpdateStep;
|
||||
typedef enum { IAP_STATE_READY, IAP_STATE_STEP_1, IAP_STATE_STEP_2,
|
||||
IAP_STEP_RESET, IAP_STATE_BOOTLOADER } IAPStep;
|
||||
typedef enum { WAITING_DISCONNECT, WAITING_CONNECT, JUMP_TO_BL, LOADING_FW,
|
||||
UPLOADING_FW, UPLOADING_DESC, BOOTING, BOOTING_AND_ERASING,
|
||||
SUCCESS, FAILURE } ProgressStep;
|
||||
}
|
||||
#endif // ENUMS_H
|
||||
|
78
ground/openpilotgcs/src/plugins/uploader/rebootdialog.cpp
Normal file
78
ground/openpilotgcs/src/plugins/uploader/rebootdialog.cpp
Normal file
@ -0,0 +1,78 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file rebootdialog.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup [Group]
|
||||
* @{
|
||||
* @addtogroup RebootDialog
|
||||
* @{
|
||||
* @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 "rebootdialog.h"
|
||||
#include "ui_rebootdialog.h"
|
||||
|
||||
RebootDialog::RebootDialog(UploaderGadgetWidget *uploader) :
|
||||
QDialog(uploader),
|
||||
ui(new Ui::RebootDialog), m_uploader(uploader)
|
||||
{
|
||||
setWindowFlags(((windowFlags() | Qt::CustomizeWindowHint)
|
||||
& ~Qt::WindowCloseButtonHint & ~Qt::WindowMinMaxButtonsHint));
|
||||
ui->setupUi(this);
|
||||
connect(this, SIGNAL(reboot()), m_uploader, SLOT(systemReboot()));
|
||||
ui->rebootProgressBar->setVisible(true);
|
||||
ui->okButton->setVisible(false);
|
||||
}
|
||||
|
||||
RebootDialog::~RebootDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void RebootDialog::on_okButton_clicked()
|
||||
{
|
||||
reject();
|
||||
}
|
||||
|
||||
int RebootDialog::exec()
|
||||
{
|
||||
show();
|
||||
connect(m_uploader, SIGNAL(progressUpdate(uploader::ProgressStep, QVariant)), this, SLOT(progressUpdate(uploader::ProgressStep, QVariant)));
|
||||
emit reboot();
|
||||
return result();
|
||||
}
|
||||
|
||||
void RebootDialog::progressUpdate(uploader::ProgressStep progress, QVariant message)
|
||||
{
|
||||
Q_UNUSED(message);
|
||||
if (progress == uploader::SUCCESS || progress == uploader::FAILURE) {
|
||||
disconnect(m_uploader, SIGNAL(progressUpdate(uploader::ProgressStep, QVariant)), this, SLOT(progressUpdate(uploader::ProgressStep, QVariant)));
|
||||
if (progress == uploader::FAILURE) {
|
||||
ui->rebootProgressBar->setVisible(false);
|
||||
ui->okButton->setVisible(true);
|
||||
ui->label->setText(tr("<font color='red'>Reboot failed!</font><p>Please perform a manual reboot by power cycling the board.<br>"
|
||||
"To power cycle the controller remove all batteries and the USB cable for at least 30 seconds.<br>"
|
||||
"After 30 seconds, plug in the board again and wait for it to connect, this can take a few seconds.<br>"
|
||||
"Then press Ok.</p>"));
|
||||
QDialog::exec();
|
||||
} else {
|
||||
accept();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file rebootpage.h
|
||||
* @file rebootdialog.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup
|
||||
* @addtogroup [Group]
|
||||
* @{
|
||||
* @addtogroup RebootPage
|
||||
* @addtogroup RebootDialog
|
||||
* @{
|
||||
* @brief
|
||||
* @brief [Brief]
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -25,32 +25,36 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef REBOOTPAGE_H
|
||||
#define REBOOTPAGE_H
|
||||
#ifndef REBOOTDIALOG_H
|
||||
#define REBOOTDIALOG_H
|
||||
|
||||
#include "abstractwizardpage.h"
|
||||
#include <QDialog>
|
||||
#include "uploadergadgetwidget.h"
|
||||
|
||||
namespace Ui {
|
||||
class RebootPage;
|
||||
class RebootDialog;
|
||||
}
|
||||
|
||||
class RebootPage : public AbstractWizardPage {
|
||||
class RebootDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RebootPage(SetupWizard *wizard, QWidget *parent = 0);
|
||||
~RebootPage();
|
||||
explicit RebootDialog(UploaderGadgetWidget *uploader);
|
||||
~RebootDialog();
|
||||
|
||||
void initializePage();
|
||||
bool validatePage();
|
||||
|
||||
private:
|
||||
Ui::RebootPage *ui;
|
||||
QTimer m_timer;
|
||||
bool m_toggl;
|
||||
signals:
|
||||
void reboot();
|
||||
|
||||
private slots:
|
||||
void toggleLabel();
|
||||
void on_okButton_clicked();
|
||||
void progressUpdate(uploader::ProgressStep progress, QVariant message);
|
||||
|
||||
private:
|
||||
Ui::RebootDialog *ui;
|
||||
UploaderGadgetWidget *m_uploader;
|
||||
|
||||
public slots:
|
||||
int exec();
|
||||
};
|
||||
|
||||
#endif // REBOOTPAGE_H
|
||||
#endif // REBOOTDIALOG_H
|
84
ground/openpilotgcs/src/plugins/uploader/rebootdialog.ui
Normal file
84
ground/openpilotgcs/src/plugins/uploader/rebootdialog.ui
Normal file
@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>RebootDialog</class>
|
||||
<widget class="QDialog" name="RebootDialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::ApplicationModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>445</width>
|
||||
<height>180</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Reboot</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../coreplugin/core.qrc">
|
||||
<normaloff>:/core/images/flight.png</normaloff>:/core/images/flight.png</iconset>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Please wait. Your controller is rebooting.<br/>This can take up to a minute.</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="rebootProgressBar">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QProgressBar {
|
||||
border: 2px solid grey;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
QProgressBar::chunk {
|
||||
background-color: #3D6699;
|
||||
width: 10px;
|
||||
margin: 0.5px;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignRight">
|
||||
<widget class="QPushButton" name="okButton">
|
||||
<property name="text">
|
||||
<string>Ok</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../coreplugin/core.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
@ -20,6 +20,18 @@
|
||||
<string>Device Information</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGraphicsView" name="devicePicture">
|
||||
<property name="minimumSize">
|
||||
@ -109,8 +121,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblCPU">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -123,16 +138,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="CPUSerial">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="CPUSerial">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -175,6 +187,18 @@
|
||||
<string>Firmware Information</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="_2">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
|
@ -30,7 +30,8 @@ HEADERS += uploadergadget.h \
|
||||
SSP/common.h \
|
||||
runningdevicewidget.h \
|
||||
uploader_global.h \
|
||||
enums.h
|
||||
enums.h \
|
||||
rebootdialog.h
|
||||
|
||||
SOURCES += uploadergadget.cpp \
|
||||
uploadergadgetconfiguration.cpp \
|
||||
@ -44,14 +45,16 @@ SOURCES += uploadergadget.cpp \
|
||||
SSP/port.cpp \
|
||||
SSP/qssp.cpp \
|
||||
SSP/qsspt.cpp \
|
||||
runningdevicewidget.cpp
|
||||
runningdevicewidget.cpp \
|
||||
rebootdialog.cpp
|
||||
|
||||
OTHER_FILES += Uploader.pluginspec
|
||||
|
||||
FORMS += \
|
||||
uploader.ui \
|
||||
devicewidget.ui \
|
||||
runningdevicewidget.ui
|
||||
runningdevicewidget.ui \
|
||||
rebootdialog.ui
|
||||
|
||||
RESOURCES += uploader.qrc
|
||||
|
||||
|
@ -70,28 +70,10 @@
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="3" colspan="2">
|
||||
<widget class="QPushButton" name="bootButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Boots the system.
|
||||
Only useful if the system is halted
|
||||
(mainboard blue LED blinking slowly, green LED on)
|
||||
|
||||
If telemetry is not running, select the link using the dropdown
|
||||
menu on the right.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Boot</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5" colspan="3">
|
||||
<item row="1" column="5" colspan="2">
|
||||
<widget class="QPushButton" name="eraseBootButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -104,16 +86,31 @@ menu on the right.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5" colspan="3">
|
||||
<widget class="QPushButton" name="rescueButton">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="autoUpdateEraseButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Start a guided procedure to manually
|
||||
recover a system which does not boot.
|
||||
|
||||
Rescue is possible in USB mode only.</string>
|
||||
<string><html><head/><body><p>Automatic firmware upgrade.</p><p>This <span style=" font-weight:600; color:#e21111;">will erase ALL settings</span> in the board. Please<br/>backup settings before using this if you want to<br/>be able to retain them.</p><p>This can be done with board already connected<br/>or by connecting board after button is clicked.<br/>Running upgrade with a connected board works <br/>for all boards <span style=" font-weight:600;">except OPLink</span> that needs to be <br/>connected after the button is clicked.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rescue</string>
|
||||
<string>Upgrade && Erase</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="resetButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Reset the system.
|
||||
(Only enabled if telemetry link is established, either
|
||||
through serial or USB)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -135,7 +132,89 @@ menu on the right.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="9">
|
||||
<item row="1" column="8">
|
||||
<widget class="QLabel" name="boardStatus">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Running</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="autoUpdateButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Automatic firmware upgrade. </p><p>This can be done with board already connected<br/>or by connecting board after button is clicked.<br/>Running upgrade with a connected board works <br/>for all boards <span style=" font-weight:600;">except OPLink</span> that needs to be <br/>connected after the button is clicked.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Upgrade</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="5" colspan="2">
|
||||
<widget class="QPushButton" name="rescueButton">
|
||||
<property name="toolTip">
|
||||
<string>Start a guided procedure to manually
|
||||
recover a system which does not boot.
|
||||
|
||||
Rescue is possible in USB mode only.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rescue</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3" colspan="2">
|
||||
<widget class="QPushButton" name="bootButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Boots the system.
|
||||
Only useful if the system is halted
|
||||
(mainboard blue LED blinking slowly, green LED on)
|
||||
|
||||
If telemetry is not running, select the link using the dropdown
|
||||
menu on the right.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Boot</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QComboBox" name="telemetryLink">
|
||||
<property name="toolTip">
|
||||
<string>When telemetry is not connected, select the communication
|
||||
@ -147,22 +226,6 @@ halting a running board.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="10">
|
||||
<widget class="QToolButton" name="refreshPorts">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Refresh the list of serial ports</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="haltButton">
|
||||
<property name="enabled">
|
||||
@ -179,7 +242,23 @@ through serial or USB)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="12">
|
||||
<item row="0" column="10" alignment="Qt::AlignHCenter">
|
||||
<widget class="QToolButton" name="refreshPorts">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Refresh the list of serial ports</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="10">
|
||||
<widget class="QPushButton" name="pbHelp">
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -199,75 +278,6 @@ through serial or USB)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="11">
|
||||
<widget class="QLabel" name="boardStatus">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Running</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="resetButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Reset the system.
|
||||
(Only enabled if telemetry link is established, either
|
||||
through serial or USB)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="autoUpdateButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Start a guided procedure to manually
|
||||
recover a system which does not boot.
|
||||
|
||||
Rescue is possible in USB mode only.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auto Update</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
@ -276,7 +286,7 @@ Rescue is possible in USB mode only.</string>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="autoUpdateGroupBox">
|
||||
<property name="title">
|
||||
<string>Auto update</string>
|
||||
<string>Upgrade</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="1">
|
||||
@ -326,17 +336,17 @@ Rescue is possible in USB mode only.</string>
|
||||
<string><!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-family:'Ubuntu'; font-size:11pt;">To upgrade the firmware in your boards,</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-family:'Ubuntu'; font-size:11pt;">press Auto Update and follow instructions</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-family:'Ubuntu'; font-size:11pt;">or</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-family:'Ubuntu'; font-size:11pt;">proceed as follows:</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-family:'Ubuntu'; font-size:11pt;"><br /></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-family:'Ubuntu'; font-size:11pt;">- Connect telemetry</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-family:'Ubuntu'; font-size:11pt;">- Once telemetry is running, press &quot;Halt&quot; above</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-family:'Ubuntu'; font-size:11pt;">- You will get a list of devices.</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-family:'Ubuntu'; font-size:11pt;">- You can then upload/download to/from each board as you wish</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-family:'Ubuntu'; font-size:11pt;">- You can resume operations by pressing &quot;Boot&quot;</span></p></body></html></string>
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; 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;">To upgrade the firmware in your boards, press Upgrade or </p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Upgrade &amp; Erase and follow instructions.</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">or</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">proceed as follows:</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;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- Connect telemetry</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- Once telemetry is running, press &quot;Halt&quot; above</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- You will get a list of devices.</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- You can then upload/download to/from each board as you wish</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- You can resume operations by pressing &quot;Boot&quot;</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -351,8 +361,8 @@ p, li { white-space: pre-wrap; }
|
||||
<string><!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="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p></body></html></string>
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<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;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -44,8 +44,9 @@ Core::IUAVGadget *UploaderGadgetFactory::createGadget(QWidget *parent)
|
||||
UploaderGadgetWidget *gadgetWidget = new UploaderGadgetWidget(parent);
|
||||
|
||||
isautocapable = gadgetWidget->autoUpdateCapable();
|
||||
connect(this, SIGNAL(autoUpdate()), gadgetWidget, SLOT(autoUpdate()));
|
||||
connect(gadgetWidget, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)), this, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)));
|
||||
connect(this, SIGNAL(autoUpdate(bool)), gadgetWidget, SLOT(autoUpdate(bool)));
|
||||
connect(this, SIGNAL(reboot()), gadgetWidget, SLOT(rebootWithDialog()));
|
||||
connect(gadgetWidget, SIGNAL(progressUpdate(uploader::ProgressStep, QVariant)), this, SIGNAL(progressUpdate(uploader::ProgressStep, QVariant)));
|
||||
return new UploaderGadget(QString("Uploader"), gadgetWidget, parent);
|
||||
}
|
||||
|
||||
|
@ -49,9 +49,11 @@ public:
|
||||
bool isAutoUpdateCapable();
|
||||
private:
|
||||
bool isautocapable;
|
||||
|
||||
signals:
|
||||
void autoUpdateSignal(uploader::AutoUpdateStep, QVariant);
|
||||
void autoUpdate();
|
||||
void progressUpdate(uploader::ProgressStep, QVariant);
|
||||
void autoUpdate(bool erase);
|
||||
void reboot();
|
||||
};
|
||||
|
||||
#endif // UPLOADERGADGETFACTORY_H
|
||||
|
@ -41,11 +41,15 @@
|
||||
#include <QMessageBox>
|
||||
#include <QProgressBar>
|
||||
#include <QDebug>
|
||||
#include "rebootdialog.h"
|
||||
|
||||
#define DFU_DEBUG true
|
||||
|
||||
const int UploaderGadgetWidget::BOARD_EVENT_TIMEOUT = 20000;
|
||||
const int UploaderGadgetWidget::AUTOUPDATE_CLOSE_TIMEOUT = 7000;
|
||||
const int UploaderGadgetWidget::REBOOT_TIMEOUT = 20000;
|
||||
const int UploaderGadgetWidget::ERASE_TIMEOUT = 20000;
|
||||
const int UploaderGadgetWidget::BOOTLOADER_TIMEOUT = 20000;
|
||||
|
||||
TimedDialog::TimedDialog(const QString &title, const QString &labelText, int timeout, QWidget *parent, Qt::WindowFlags flags) :
|
||||
QProgressDialog(labelText, tr("Cancel"), 0, timeout, parent, flags), bar(new QProgressBar(this))
|
||||
@ -157,8 +161,10 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent)
|
||||
getSerialPorts();
|
||||
|
||||
connect(m_config->autoUpdateButton, SIGNAL(clicked()), this, SLOT(startAutoUpdate()));
|
||||
connect(m_config->autoUpdateEraseButton, SIGNAL(clicked()), this, SLOT(startAutoUpdateErase()));
|
||||
connect(m_config->autoUpdateOkButton, SIGNAL(clicked()), this, SLOT(closeAutoUpdate()));
|
||||
m_config->autoUpdateButton->setEnabled(autoUpdateCapable());
|
||||
m_config->autoUpdateEraseButton->setEnabled(autoUpdateCapable());
|
||||
m_config->autoUpdateGroupBox->setVisible(false);
|
||||
|
||||
m_config->refreshPorts->setIcon(QIcon(":uploader/images/view-refresh.svg"));
|
||||
@ -330,6 +336,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
clearLog();
|
||||
log("IAP Step 1");
|
||||
fwIAP->updated();
|
||||
emit progressUpdate(JUMP_TO_BL, QVariant(1));
|
||||
break;
|
||||
case IAP_STATE_STEP_1:
|
||||
if (!success) {
|
||||
@ -338,6 +345,8 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
currentStep = IAP_STATE_READY;
|
||||
disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(goToBootloader(UAVObject *, bool)));
|
||||
m_config->haltButton->setEnabled(true);
|
||||
emit progressUpdate(FAILURE, QVariant());
|
||||
emit bootloaderFailed();
|
||||
break;
|
||||
}
|
||||
sleep(600);
|
||||
@ -345,6 +354,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
currentStep = IAP_STATE_STEP_2;
|
||||
log("IAP Step 2");
|
||||
fwIAP->updated();
|
||||
emit progressUpdate(JUMP_TO_BL, QVariant(2));
|
||||
break;
|
||||
case IAP_STATE_STEP_2:
|
||||
if (!success) {
|
||||
@ -353,12 +363,15 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
currentStep = IAP_STATE_READY;
|
||||
disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(goToBootloader(UAVObject *, bool)));
|
||||
m_config->haltButton->setEnabled(true);
|
||||
emit progressUpdate(FAILURE, QVariant());
|
||||
emit bootloaderFailed();
|
||||
break;
|
||||
}
|
||||
sleep(600);
|
||||
fwIAP->getField("Command")->setValue("3344");
|
||||
currentStep = IAP_STEP_RESET;
|
||||
log("IAP Step 3");
|
||||
emit progressUpdate(JUMP_TO_BL, QVariant(3));
|
||||
fwIAP->updated();
|
||||
break;
|
||||
case IAP_STEP_RESET:
|
||||
@ -369,6 +382,8 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
log("Reset did NOT happen");
|
||||
disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(goToBootloader(UAVObject *, bool)));
|
||||
m_config->haltButton->setEnabled(true);
|
||||
emit progressUpdate(FAILURE, QVariant());
|
||||
emit bootloaderFailed();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -382,6 +397,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
cm->suspendPolling();
|
||||
sleep(200);
|
||||
log("Board Halt");
|
||||
emit progressUpdate(JUMP_TO_BL, QVariant(4));
|
||||
m_config->boardStatus->setText(tr("Bootloader"));
|
||||
if (dlj.startsWith("USB")) {
|
||||
m_config->telemetryLink->setCurrentIndex(m_config->telemetryLink->findText("USB"));
|
||||
@ -410,6 +426,8 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
currentStep = IAP_STATE_READY;
|
||||
m_config->boardStatus->setText(tr("Bootloader?"));
|
||||
m_config->haltButton->setEnabled(true);
|
||||
emit progressUpdate(FAILURE, QVariant());
|
||||
emit bootloaderFailed();
|
||||
return;
|
||||
}
|
||||
dfu->AbortOperation();
|
||||
@ -420,9 +438,10 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
cm->resumePolling();
|
||||
currentStep = IAP_STATE_READY;
|
||||
m_config->boardStatus->setText(tr("Bootloader?"));
|
||||
emit progressUpdate(FAILURE, QVariant());
|
||||
emit bootloaderFailed();
|
||||
return;
|
||||
}
|
||||
// dfu.StatusRequest();
|
||||
|
||||
sleep(500);
|
||||
dfu->findDevices();
|
||||
@ -432,6 +451,8 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
delete dfu;
|
||||
dfu = NULL;
|
||||
cm->resumePolling();
|
||||
emit progressUpdate(FAILURE, QVariant());
|
||||
emit bootloaderFailed();
|
||||
return;
|
||||
}
|
||||
// Delete all previous tabs:
|
||||
@ -449,8 +470,12 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
m_config->systemElements->addTab(dw, tr("Device") + QString::number(i));
|
||||
}
|
||||
|
||||
QApplication::processEvents();
|
||||
|
||||
// Need to re-enable in case we were not connected
|
||||
bootButtonsSetEnable(true);
|
||||
emit progressUpdate(JUMP_TO_BL, QVariant(5));
|
||||
emit bootloaderSuccess();
|
||||
|
||||
if (resetOnly) {
|
||||
resetOnly = false;
|
||||
@ -462,6 +487,8 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
|
||||
break;
|
||||
case IAP_STATE_BOOTLOADER:
|
||||
// We should never end up here anyway.
|
||||
emit progressUpdate(FAILURE, QVariant());
|
||||
emit bootloaderFailed();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -526,6 +553,53 @@ void UploaderGadgetWidget::systemEraseBoot()
|
||||
}
|
||||
}
|
||||
|
||||
void UploaderGadgetWidget::rebootWithDialog()
|
||||
{
|
||||
RebootDialog dialog(this);
|
||||
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void UploaderGadgetWidget::systemReboot()
|
||||
{
|
||||
ResultEventLoop eventLoop;
|
||||
|
||||
connect(this, SIGNAL(bootloaderSuccess()), &eventLoop, SLOT(success()));
|
||||
connect(this, SIGNAL(bootloaderFailed()), &eventLoop, SLOT(fail()));
|
||||
|
||||
goToBootloader();
|
||||
|
||||
if (eventLoop.run(REBOOT_TIMEOUT) != 0) {
|
||||
emit progressUpdate(FAILURE, QVariant());
|
||||
return;
|
||||
}
|
||||
|
||||
disconnect(this, SIGNAL(bootloaderSuccess()), &eventLoop, SLOT(success()));
|
||||
disconnect(this, SIGNAL(bootloaderFailed()), &eventLoop, SLOT(fail()));
|
||||
|
||||
commonSystemBoot(false, false);
|
||||
|
||||
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
|
||||
Q_ASSERT(pluginManager);
|
||||
TelemetryManager *telemetryManager = pluginManager->getObject<TelemetryManager>();
|
||||
Q_ASSERT(telemetryManager);
|
||||
|
||||
if (!telemetryManager->isConnected()) {
|
||||
progressUpdate(BOOTING, QVariant());
|
||||
ResultEventLoop eventLoop;
|
||||
|
||||
connect(telemetryManager, SIGNAL(connected()), &eventLoop, SLOT(success()));
|
||||
|
||||
if (eventLoop.run(REBOOT_TIMEOUT) != 0) {
|
||||
emit progressUpdate(FAILURE, QVariant());
|
||||
return;
|
||||
}
|
||||
|
||||
disconnect(telemetryManager, SIGNAL(connected()), &eventLoop, SLOT(success()));
|
||||
}
|
||||
|
||||
emit progressUpdate(SUCCESS, QVariant());
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells the system to boot (from Bootloader state)
|
||||
@ -535,7 +609,6 @@ void UploaderGadgetWidget::commonSystemBoot(bool safeboot, bool erase)
|
||||
{
|
||||
clearLog();
|
||||
bootButtonsSetEnable(false);
|
||||
|
||||
// Suspend telemety & polling in case it is not done yet
|
||||
Core::ConnectionManager *cm = Core::ICore::instance()->connectionManager();
|
||||
cm->disconnectDevice();
|
||||
@ -559,6 +632,7 @@ void UploaderGadgetWidget::commonSystemBoot(bool safeboot, bool erase)
|
||||
dfu = NULL;
|
||||
bootButtonsSetEnable(true);
|
||||
m_config->rescueButton->setEnabled(true); // Boot not possible, maybe Rescue OK?
|
||||
emit bootFailed();
|
||||
return;
|
||||
}
|
||||
log("Booting system...");
|
||||
@ -586,6 +660,7 @@ void UploaderGadgetWidget::commonSystemBoot(bool safeboot, bool erase)
|
||||
currentStep = IAP_STATE_READY;
|
||||
log("You can now reconnect telemetry...");
|
||||
delete dfu; // Frees up the USB/Serial port too
|
||||
emit bootSuccess();
|
||||
dfu = NULL;
|
||||
}
|
||||
|
||||
@ -594,62 +669,76 @@ bool UploaderGadgetWidget::autoUpdateCapable()
|
||||
return QDir(":/firmware").exists();
|
||||
}
|
||||
|
||||
bool UploaderGadgetWidget::autoUpdate()
|
||||
bool UploaderGadgetWidget::autoUpdate(bool erase)
|
||||
{
|
||||
Core::ConnectionManager *cm = Core::ICore::instance()->connectionManager();
|
||||
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
|
||||
|
||||
Q_ASSERT(pluginManager);
|
||||
TelemetryManager *telemetryManager = pluginManager->getObject<TelemetryManager>();
|
||||
Q_ASSERT(telemetryManager);
|
||||
|
||||
if (USBMonitor::instance()->availableDevices(0x20a0, -1, -1, -1).length() > 0 &&
|
||||
telemetryManager->connectionState() != TelemetryManager::TELEMETRY_CONNECTED) {
|
||||
// Wait for the board to completely connect
|
||||
ResultEventLoop eventLoop;
|
||||
connect(telemetryManager, SIGNAL(connected()), &eventLoop, SLOT(success()));
|
||||
|
||||
if (telemetryManager->connectionState() != TelemetryManager::TELEMETRY_CONNECTED
|
||||
&& eventLoop.run(REBOOT_TIMEOUT) != 0) {
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Timed out while waiting for a board to be fully connected!")));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
}
|
||||
|
||||
disconnect(telemetryManager, SIGNAL(connected()), &eventLoop, SLOT(success()));
|
||||
}
|
||||
if (USBMonitor::instance()->availableDevices(0x20a0, -1, -1, -1).length() == 0) {
|
||||
ConnectionWaiter waiter(1, BOARD_EVENT_TIMEOUT);
|
||||
connect(&waiter, SIGNAL(timeChanged(int)), this, SLOT(autoUpdateConnectProgress(int)));
|
||||
if (waiter.exec() == ConnectionWaiter::TimedOut) {
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Timed out while waiting for a board to be connected!")));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
ResultEventLoop eventLoop;
|
||||
connect(this, SIGNAL(bootloaderSuccess()), &eventLoop, SLOT(success()));
|
||||
connect(this, SIGNAL(bootloaderFailed()), &eventLoop, SLOT(fail()));
|
||||
|
||||
goToBootloader();
|
||||
|
||||
if (eventLoop.run(BOOTLOADER_TIMEOUT) != 0) {
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Failed to enter bootloader mode.")));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
}
|
||||
|
||||
disconnect(this, SIGNAL(bootloaderSuccess()), &eventLoop, SLOT(success()));
|
||||
disconnect(this, SIGNAL(bootloaderFailed()), &eventLoop, SLOT(fail()));
|
||||
}
|
||||
|
||||
cm->disconnectDevice();
|
||||
cm->suspendPolling();
|
||||
if (dfu) {
|
||||
delete dfu;
|
||||
dfu = NULL;
|
||||
}
|
||||
|
||||
if (USBMonitor::instance()->availableDevices(0x20a0, -1, -1, -1).length() > 0) {
|
||||
// wait for all boards to be disconnected
|
||||
ConnectionWaiter waiter(0, BOARD_EVENT_TIMEOUT);
|
||||
connect(&waiter, SIGNAL(timeChanged(int)), this, SLOT(autoUpdateDisconnectProgress(int)));
|
||||
if (waiter.exec() == ConnectionWaiter::TimedOut) {
|
||||
emit autoUpdateSignal(FAILURE, QVariant(tr("Timed out while waiting for all boards to be disconnected!")));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// wait for a board to connect
|
||||
ConnectionWaiter waiter(1, BOARD_EVENT_TIMEOUT);
|
||||
connect(&waiter, SIGNAL(timeChanged(int)), this, SLOT(autoUpdateConnectProgress(int)));
|
||||
if (waiter.exec() == ConnectionWaiter::TimedOut) {
|
||||
emit autoUpdateSignal(FAILURE, QVariant(tr("Timed out while waiting for a board to be connected!")));
|
||||
return false;
|
||||
}
|
||||
|
||||
Core::ConnectionManager *connectionManager = Core::ICore::instance()->connectionManager();
|
||||
dfu = new DFUObject(DFU_DEBUG, false, QString());
|
||||
dfu->AbortOperation();
|
||||
emit autoUpdateSignal(JUMP_TO_BL, QVariant());
|
||||
if (!dfu->enterDFU(0)) {
|
||||
emit progressUpdate(JUMP_TO_BL, QVariant());
|
||||
|
||||
if (!dfu->enterDFU(0) || !dfu->findDevices() ||
|
||||
(dfu->numberOfDevices != 1) || dfu->numberOfDevices > 5) {
|
||||
delete dfu;
|
||||
dfu = NULL;
|
||||
cm->resumePolling();
|
||||
emit autoUpdateSignal(FAILURE, QVariant());
|
||||
return false;
|
||||
}
|
||||
if (!dfu->findDevices() || (dfu->numberOfDevices != 1)) {
|
||||
delete dfu;
|
||||
dfu = NULL;
|
||||
cm->resumePolling();
|
||||
emit autoUpdateSignal(FAILURE, QVariant());
|
||||
return false;
|
||||
}
|
||||
if (dfu->numberOfDevices > 5) {
|
||||
delete dfu;
|
||||
dfu = NULL;
|
||||
cm->resumePolling();
|
||||
emit autoUpdateSignal(FAILURE, QVariant());
|
||||
connectionManager->resumePolling();
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Failed to enter bootloader mode.")));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
}
|
||||
|
||||
QString filename;
|
||||
emit autoUpdateSignal(LOADING_FW, QVariant());
|
||||
emit progressUpdate(LOADING_FW, QVariant());
|
||||
switch (dfu->devices[0].ID) {
|
||||
case 0x301:
|
||||
filename = "fw_oplinkmini";
|
||||
@ -671,61 +760,84 @@ bool UploaderGadgetWidget::autoUpdate()
|
||||
filename = "fw_discoveryf4bare";
|
||||
break;
|
||||
default:
|
||||
emit autoUpdateSignal(FAILURE, QVariant());
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Unknown board id '0x%1'").arg(QString::number(dfu->devices[0].ID, 16))));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
|
||||
break;
|
||||
}
|
||||
filename = ":/firmware/" + filename + ".opfw";
|
||||
QByteArray firmware;
|
||||
if (!QFile::exists(filename)) {
|
||||
emit autoUpdateSignal(FAILURE, QVariant());
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Firmware image not found.")));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
}
|
||||
QFile file(filename);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
emit autoUpdateSignal(FAILURE, QVariant());
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Could not open firmware image for reading.")));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
}
|
||||
QEventLoop eventLoop;
|
||||
firmware = file.readAll();
|
||||
QEventLoop eventLoop2;
|
||||
connect(dfu, SIGNAL(progressUpdated(int)), this, SLOT(autoUpdateFlashProgress(int)));
|
||||
connect(dfu, SIGNAL(uploadFinished(OP_DFU::Status)), &eventLoop, SLOT(quit()));
|
||||
emit autoUpdateSignal(UPLOADING_FW, QVariant());
|
||||
connect(dfu, SIGNAL(uploadFinished(OP_DFU::Status)), &eventLoop2, SLOT(quit()));
|
||||
emit progressUpdate(UPLOADING_FW, QVariant());
|
||||
if (!dfu->enterDFU(0)) {
|
||||
emit autoUpdateSignal(FAILURE, QVariant());
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Could not enter direct firmware upload mode.")));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
}
|
||||
dfu->AbortOperation();
|
||||
if (!dfu->UploadFirmware(filename, false, 0)) {
|
||||
emit autoUpdateSignal(FAILURE, QVariant());
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Firmware upload failed.")));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
}
|
||||
eventLoop.exec();
|
||||
eventLoop2.exec();
|
||||
QByteArray desc = firmware.right(100);
|
||||
emit autoUpdateSignal(UPLOADING_DESC, QVariant());
|
||||
emit progressUpdate(UPLOADING_DESC, QVariant());
|
||||
if (dfu->UploadDescription(desc) != OP_DFU::Last_operation_Success) {
|
||||
emit autoUpdateSignal(FAILURE, QVariant());
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Failed to upload firmware description.")));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
}
|
||||
systemBoot();
|
||||
emit autoUpdateSignal(SUCCESS, QVariant());
|
||||
|
||||
commonSystemBoot(false, erase);
|
||||
|
||||
// Wait for board to connect to GCS again after boot and erase
|
||||
// For older board like CC3D this can take some time
|
||||
if (!telemetryManager->isConnected()) {
|
||||
progressUpdate(erase ? BOOTING_AND_ERASING : BOOTING, QVariant());
|
||||
ResultEventLoop eventLoop;
|
||||
connect(telemetryManager, SIGNAL(connected()), &eventLoop, SLOT(success()));
|
||||
|
||||
if (eventLoop.run(REBOOT_TIMEOUT + (erase ? ERASE_TIMEOUT : 0)) != 0) {
|
||||
emit progressUpdate(FAILURE, QVariant(tr("Timed out while booting.")));
|
||||
emit autoUpdateFailed();
|
||||
return false;
|
||||
}
|
||||
|
||||
disconnect(telemetryManager, SIGNAL(connected()), &eventLoop, SLOT(success()));
|
||||
}
|
||||
|
||||
emit progressUpdate(SUCCESS, QVariant());
|
||||
emit autoUpdateSuccess();
|
||||
return true;
|
||||
}
|
||||
|
||||
void UploaderGadgetWidget::autoUpdateDisconnectProgress(int value)
|
||||
{
|
||||
emit autoUpdateSignal(WAITING_DISCONNECT, value);
|
||||
emit progressUpdate(WAITING_DISCONNECT, value);
|
||||
}
|
||||
|
||||
void UploaderGadgetWidget::autoUpdateConnectProgress(int value)
|
||||
{
|
||||
emit autoUpdateSignal(WAITING_CONNECT, value);
|
||||
emit progressUpdate(WAITING_CONNECT, value);
|
||||
}
|
||||
|
||||
void UploaderGadgetWidget::autoUpdateFlashProgress(int value)
|
||||
{
|
||||
emit autoUpdateSignal(UPLOADING_FW, value);
|
||||
emit progressUpdate(UPLOADING_FW, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -880,18 +992,30 @@ void UploaderGadgetWidget::downloadEnded(bool succeed)
|
||||
|
||||
void UploaderGadgetWidget::startAutoUpdate()
|
||||
{
|
||||
startAutoUpdate(false);
|
||||
}
|
||||
|
||||
void UploaderGadgetWidget::startAutoUpdateErase()
|
||||
{
|
||||
startAutoUpdate(true);
|
||||
}
|
||||
|
||||
void UploaderGadgetWidget::startAutoUpdate(bool erase)
|
||||
{
|
||||
m_config->autoUpdateProgressBar->setValue(0);
|
||||
autoUpdateStatus(uploader::JUMP_TO_BL, QVariant());
|
||||
m_config->buttonFrame->setEnabled(false);
|
||||
m_config->splitter->setEnabled(false);
|
||||
m_config->autoUpdateGroupBox->setVisible(true);
|
||||
m_config->autoUpdateOkButton->setEnabled(false);
|
||||
|
||||
connect(this, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::AutoUpdateStep, QVariant)));
|
||||
autoUpdate();
|
||||
connect(this, SIGNAL(progressUpdate(uploader::ProgressStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::ProgressStep, QVariant)));
|
||||
autoUpdate(erase);
|
||||
}
|
||||
|
||||
void UploaderGadgetWidget::finishAutoUpdate()
|
||||
{
|
||||
disconnect(this, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::AutoUpdateStep, QVariant)));
|
||||
disconnect(this, SIGNAL(progressUpdate(uploader::ProgressStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::ProgressStep, QVariant)));
|
||||
m_config->autoUpdateOkButton->setEnabled(true);
|
||||
|
||||
// wait a bit and "close" auto update
|
||||
@ -905,7 +1029,7 @@ void UploaderGadgetWidget::closeAutoUpdate()
|
||||
m_config->splitter->setEnabled(true);
|
||||
}
|
||||
|
||||
void UploaderGadgetWidget::autoUpdateStatus(uploader::AutoUpdateStep status, QVariant value)
|
||||
void UploaderGadgetWidget::autoUpdateStatus(uploader::ProgressStep status, QVariant value)
|
||||
{
|
||||
QString msg;
|
||||
int remaining;
|
||||
@ -926,8 +1050,10 @@ void UploaderGadgetWidget::autoUpdateStatus(uploader::AutoUpdateStep status, QVa
|
||||
m_config->autoUpdateProgressBar->setFormat(tr("Timing out in %1 seconds").arg(remaining));
|
||||
break;
|
||||
case uploader::JUMP_TO_BL:
|
||||
m_config->autoUpdateProgressBar->setValue(0);
|
||||
m_config->autoUpdateLabel->setText(tr("Bringing the board into boot loader mode."));
|
||||
m_config->autoUpdateLabel->setText(tr("Bringing the board into boot loader mode. Please wait."));
|
||||
m_config->autoUpdateProgressBar->setFormat(tr("Step %1").arg(value.toInt()));
|
||||
m_config->autoUpdateProgressBar->setMaximum(5);
|
||||
m_config->autoUpdateProgressBar->setValue(value.toInt());
|
||||
break;
|
||||
case uploader::LOADING_FW:
|
||||
m_config->autoUpdateLabel->setText(tr("Preparing to upload firmware to the board."));
|
||||
@ -942,21 +1068,24 @@ void UploaderGadgetWidget::autoUpdateStatus(uploader::AutoUpdateStep status, QVa
|
||||
m_config->autoUpdateLabel->setText(tr("Uploading description of the new firmware to the board."));
|
||||
break;
|
||||
case uploader::BOOTING:
|
||||
m_config->autoUpdateLabel->setText(tr("Rebooting the board."));
|
||||
m_config->autoUpdateLabel->setText(tr("Rebooting the board. Please wait."));
|
||||
break;
|
||||
case uploader::BOOTING_AND_ERASING:
|
||||
m_config->autoUpdateLabel->setText(tr("Rebooting and erasing the board. Please wait."));
|
||||
break;
|
||||
case uploader::SUCCESS:
|
||||
m_config->autoUpdateProgressBar->setValue(m_config->autoUpdateProgressBar->maximum());
|
||||
msg = tr("Board was updated successfully.");
|
||||
msg += " " + tr("Press OK to finish.");
|
||||
msg = tr("Board was updated successfully. Press OK to finish.");
|
||||
m_config->autoUpdateLabel->setText(QString("<font color='green'>%1</font>").arg(msg));
|
||||
finishAutoUpdate();
|
||||
break;
|
||||
case uploader::FAILURE:
|
||||
msg = value.toString();
|
||||
if (msg.isEmpty()) {
|
||||
msg = tr("Something went wrong, you will have to manually upgrade the board.");
|
||||
msg = tr("Something went wrong.");
|
||||
}
|
||||
msg += " " + tr("Press OK to finish.");
|
||||
msg += tr(" Press OK to finish, you will have to manually upgrade the board.");
|
||||
|
||||
m_config->autoUpdateLabel->setText(QString("<font color='red'>%1</font>").arg(msg));
|
||||
finishAutoUpdate();
|
||||
break;
|
||||
@ -1030,3 +1159,22 @@ int UploaderGadgetWidget::cannotResetMessageBox()
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
return msgBox.exec();
|
||||
}
|
||||
|
||||
|
||||
int ResultEventLoop::run(int millisTimout)
|
||||
{
|
||||
m_timer.singleShot(millisTimout, this, SLOT(fail()));
|
||||
return exec();
|
||||
}
|
||||
|
||||
void ResultEventLoop::success()
|
||||
{
|
||||
m_timer.stop();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void ResultEventLoop::fail()
|
||||
{
|
||||
m_timer.stop();
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -91,6 +91,19 @@ private:
|
||||
int result;
|
||||
};
|
||||
|
||||
class ResultEventLoop : public QEventLoop {
|
||||
Q_OBJECT
|
||||
public:
|
||||
int run(int millisTimout);
|
||||
|
||||
public slots:
|
||||
void success();
|
||||
void fail();
|
||||
|
||||
private:
|
||||
QTimer m_timer;
|
||||
};
|
||||
|
||||
class UPLOADER_EXPORT UploaderGadgetWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
@ -100,6 +113,9 @@ public:
|
||||
|
||||
static const int BOARD_EVENT_TIMEOUT;
|
||||
static const int AUTOUPDATE_CLOSE_TIMEOUT;
|
||||
static const int REBOOT_TIMEOUT;
|
||||
static const int ERASE_TIMEOUT;
|
||||
static const int BOOTLOADER_TIMEOUT;
|
||||
|
||||
void log(QString str);
|
||||
bool autoUpdateCapable();
|
||||
@ -109,13 +125,18 @@ public slots:
|
||||
void onAutopilotDisconnect();
|
||||
void populate();
|
||||
void openHelp();
|
||||
bool autoUpdate();
|
||||
void autoUpdateDisconnectProgress(int);
|
||||
void autoUpdateConnectProgress(int);
|
||||
void autoUpdateFlashProgress(int);
|
||||
|
||||
signals:
|
||||
void autoUpdateSignal(uploader::AutoUpdateStep, QVariant);
|
||||
void progressUpdate(uploader::ProgressStep, QVariant);
|
||||
void bootloaderFailed();
|
||||
void bootloaderSuccess();
|
||||
void bootFailed();
|
||||
void bootSuccess();
|
||||
void autoUpdateFailed();
|
||||
void autoUpdateSuccess();
|
||||
|
||||
private:
|
||||
Ui_UploaderWidget *m_config;
|
||||
@ -131,6 +152,7 @@ private:
|
||||
int confirmEraseSettingsMessageBox();
|
||||
int cannotHaltMessageBox();
|
||||
int cannotResetMessageBox();
|
||||
void startAutoUpdate(bool erase);
|
||||
|
||||
private slots:
|
||||
void onPhysicalHWConnect();
|
||||
@ -140,6 +162,8 @@ private slots:
|
||||
void systemBoot();
|
||||
void systemSafeBoot();
|
||||
void systemEraseBoot();
|
||||
void rebootWithDialog();
|
||||
void systemReboot();
|
||||
void commonSystemBoot(bool safeboot = false, bool erase = false);
|
||||
void systemRescue();
|
||||
void getSerialPorts();
|
||||
@ -148,9 +172,11 @@ private slots:
|
||||
void downloadStarted();
|
||||
void downloadEnded(bool succeed);
|
||||
void startAutoUpdate();
|
||||
void startAutoUpdateErase();
|
||||
bool autoUpdate(bool erase);
|
||||
void finishAutoUpdate();
|
||||
void closeAutoUpdate();
|
||||
void autoUpdateStatus(uploader::AutoUpdateStep status, QVariant value);
|
||||
void autoUpdateStatus(uploader::ProgressStep status, QVariant value);
|
||||
};
|
||||
|
||||
#endif // UPLOADERGADGETWIDGET_H
|
||||
|
@ -1116,13 +1116,13 @@ stm32flash_clean:
|
||||
DFUUTIL_DIR := $(TOOLS_DIR)/dfu-util
|
||||
|
||||
.PHONY: dfuutil_install
|
||||
dfuutil_install: DFUUTIL_URL := http://dfu-util.gnumonks.org/releases/dfu-util-0.7.tar.gz
|
||||
dfuutil_install: DFUUTIL_URL := http://dfu-util.sourceforge.net/releases/dfu-util-0.8.tar.gz
|
||||
dfuutil_install: DFUUTIL_FILE := $(notdir $(DFUUTIL_URL))
|
||||
dfuutil_install: | $(DL_DIR) $(TOOLS_DIR)
|
||||
dfuutil_install: dfuutil_clean
|
||||
# download the source
|
||||
$(V0) @echo " DOWNLOAD $(DFUUTIL_URL)"
|
||||
$(V1) $(WGET) -N -P "$(DL_DIR)" "$(DFUUTIL_URL)"
|
||||
$(V1) $(CURL) $(CURL_OPTIONS) -o "$(DL_DIR)/$(DFUUTIL_FILE)" "$(DFUUTIL_URL)"
|
||||
|
||||
# extract the source
|
||||
$(V0) @echo " EXTRACT $(DFUUTIL_FILE)"
|
||||
@ -1134,7 +1134,7 @@ dfuutil_install: dfuutil_clean
|
||||
$(V0) @echo " BUILD $(DFUUTIL_DIR)"
|
||||
$(V1) mkdir -p "$(DFUUTIL_DIR)"
|
||||
$(V1) ( \
|
||||
cd $(DL_DIR)/dfuutil-build/dfu-util-0.7 ; \
|
||||
cd $(DL_DIR)/dfuutil-build/dfu-util-0.8 ; \
|
||||
./configure --prefix="$(DFUUTIL_DIR)" ; \
|
||||
$(MAKE) ; \
|
||||
$(MAKE) install ; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user