1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Merge branch 'rel-13.06.01'

This commit is contained in:
Alessio Morale 2013-06-27 16:52:14 +02:00
commit 3035e9d5b2
16 changed files with 251 additions and 179 deletions

View File

@ -26,10 +26,11 @@ Joe Hlebasko
Andy Honecker Andy Honecker
Ryan Hunt Ryan Hunt
Mark James Mark James
Sami Korhonen
Thorsten Klose
Ricky King Ricky King
Thorsten Klose
Sami Korhonen
Hallvard Kristiansen Hallvard Kristiansen
Alan Krum
Edouard Lafargue Edouard Lafargue
Mike Labranche Mike Labranche
Fredrik Larsson Fredrik Larsson

View File

@ -1,4 +1,18 @@
--- RELEASE-13.06 --- Italian Stallion Release --- --- RELEASE-13.06.01 --- Italian Stallion Release ---
It applies the following changes to previously not released to public RELEASE-13.06
- Temporary disabled AltitudeHold and AltitudeVario flight modes. They were not
officially supported. But since people expected well-known production quality
behavior, it is better to make them final, then reenable
- Fix windows hid connection failure if board was already connected and gcs started;
- Fixed a bug that lead to disabled controls with some settings combination in CC/CC3D hardware page
- Fixed a bug that prevent to correct saving stabilization settings for CC/CC3D
- Fixes Uploader GUI and automatically close AutoUpdate panel after 7s
JIRA issues addressed in this release:
OP-1028 OP-1020 OP-1024
--- RELEASE-13.06 ---
This is the first official OpenPilot Revolution software release. This version This is the first official OpenPilot Revolution software release. This version
also supports the CopterControl, CC3D, OPLinkMini and the upcoming OP OSD. also supports the CopterControl, CC3D, OPLinkMini and the upcoming OP OSD.
@ -133,14 +147,14 @@ KNOWN ISSUES:
enabled, but you should properly calibrate them first. That's the reason enabled, but you should properly calibrate them first. That's the reason
why they are disabled by default. why they are disabled by default.
- AltitudeHold mode is enabled, but it is not officially supported. Do - AltitudeHold/Vario modes are enabled but not officially supported. Do
not expect it to work perfectly and be considered production quality. not expect it to work perfectly and be considered production quality.
You may play with it and report your issues and suggestions at your own You may play with it and report your issues and suggestions at your own
risk. If you are not using a case for your Revo, we strongly recommend risk. If you are not using a case for your Revo, we strongly recommend
covering the barometer sensor with some foam to shield the sensor from covering the barometer sensor with some foam to shield the sensor from
wind and light. wind and light.
- Note that throttle stick in AltitudeHold mode is used to control vertical - Note that throttle stick in AltitudeVario mode is used to control vertical
velocity, sometimes called vario altitude in other platforms, centre stick velocity, sometimes called vario altitude in other platforms, centre stick
means hold altitude and there is a dead band around centre stick. means hold altitude and there is a dead band around centre stick.
@ -175,17 +189,17 @@ Due to major rework of all code and integration of Revo code into mainline
list above. Some of them can be found using this link: list above. Some of them can be found using this link:
http://progress.openpilot.org/issues/?filter=10860 http://progress.openpilot.org/issues/?filter=10860
OP-678, OP-693, OP-719, OP-726, OP-727, OP-747, OP-761, OP-769, OP-770, OP-678, OP-682, OP-693, OP-719, OP-726, OP-727, OP-747, OP-761, OP-769,
OP-772, OP-784, OP-792, OP-804, OP-807, OP-812, OP-816, OP-817, OP-820, OP-770, OP-772, OP-781, OP-784, OP-792, OP-804, OP-807, OP-812, OP-816,
OP-821, OP-843, OP-846, OP-854, OP-855, OP-856, OP-861, OP-864, OP-867, OP-817, OP-820, OP-821, OP-834, OP-843, OP-846, OP-854, OP-855, OP-856,
OP-871, OP-873, OP-874, OP-875, OP-879, OP-885, OP-886, OP-888, OP-889, OP-861, OP-864, OP-867, OP-871, OP-873, OP-874, OP-875, OP-879, OP-885,
OP-890, OP-891, OP-892, OP-893, OP-894, OP-895, OP-896, OP-897, OP-898, OP-886, OP-888, OP-889, OP-890, OP-891, OP-892, OP-893, OP-894, OP-895,
OP-899, OP-900, OP-903, OP-905, OP-906, OP-907, OP-910, OP-912, OP-917, OP-896, OP-897, OP-898, OP-899, OP-900, OP-903, OP-905, OP-906, OP-907,
OP-920, OP-925, OP-926, OP-928, OP-935, OP-936, OP-939, OP-952, OP-955, OP-910, OP-912, OP-917, OP-920, OP-925, OP-926, OP-928, OP-935, OP-936,
OP-957, OP-958, OP-965, OP-968, OP-969, OP-970, OP-977, OP-979, OP-980, OP-939, OP-952, OP-955, OP-957, OP-958, OP-965, OP-968, OP-969, OP-970,
OP-981, OP-982, OP-983, OP-988, OP-989, OP-990, OP-991, OP-993, OP-997, OP-977, OP-979, OP-980, OP-981, OP-982, OP-983, OP-988, OP-989, OP-990,
OP-998, OP-999, OP-1000, OP-1002, OP-1005, OP-1007, OP-1008, OP-1009, OP-1010, OP-991, OP-993, OP-997, OP-998, OP-999, OP-1000, OP-1002, OP-1005, OP-1007,
OP-1011, OP-1012, OP-1013, OP-1015, OP-1016, OP-1021 OP-1008, OP-1009, OP-1010, OP-1011, OP-1012, OP-1013, OP-1015, OP-1016, OP-1021
Short summary of changes. For a complete list see the git log. Short summary of changes. For a complete list see the git log.
@ -214,7 +228,7 @@ Flight code changes:
- added visualisation of errors in bootloader updater; - added visualisation of errors in bootloader updater;
- added numerous sanity checks to the flight code to prevent unsafe arming; - added numerous sanity checks to the flight code to prevent unsafe arming;
- new flash file system, much faster and higly optimised; - new flash file system, much faster and higly optimised;
- Revo settings are now stored in embedded MCU flash freeing up external one for flight logs; - Revo data flash is splitted into two partitions, one for settings, another for user data (logs, etc);
- OPLinkMini now stores settings in the MCU flash using FlashFS too; - OPLinkMini now stores settings in the MCU flash using FlashFS too;
- a catalog of known flash types is used to support different flash types by the same firmware; - a catalog of known flash types is used to support different flash types by the same firmware;
- fixed broken overo submodule remote repository link; - fixed broken overo submodule remote repository link;

View File

@ -683,7 +683,7 @@ static const struct flashfs_logfs_cfg flashfs_external_user_cfg = {
.arena_size = 0x00010000, /* 256 * slot size */ .arena_size = 0x00010000, /* 256 * slot size */
.slot_size = 0x00000100, /* 256 bytes */ .slot_size = 0x00000100, /* 256 bytes */
.start_offset = 0x40000, /* start at the beginning of the chip */ .start_offset = 0x40000, /* start offset */
.sector_size = 0x00010000, /* 64K bytes */ .sector_size = 0x00010000, /* 64K bytes */
.page_size = 0x00000100, /* 256 bytes */ .page_size = 0x00000100, /* 256 bytes */
}; };

View File

@ -84,7 +84,7 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
addUAVObjectToWidgetRelation("HwSettings", "GPSSpeed", m_telemetry->gpsSpeed); addUAVObjectToWidgetRelation("HwSettings", "GPSSpeed", m_telemetry->gpsSpeed);
addUAVObjectToWidgetRelation("HwSettings", "ComUsbBridgeSpeed", m_telemetry->comUsbBridgeSpeed); addUAVObjectToWidgetRelation("HwSettings", "ComUsbBridgeSpeed", m_telemetry->comUsbBridgeSpeed);
connect(m_telemetry->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp())); connect(m_telemetry->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
enableControls(false); enableSaveButtons(false);
populateWidgets(); populateWidgets();
refreshWidgetsValues(); refreshWidgetsValues();
forceConnectedState(); forceConnectedState();
@ -108,26 +108,32 @@ void ConfigCCHWWidget::widgetsContentsChanged()
(m_telemetry->cbUsbVcp->currentIndex() == HwSettings::USB_VCPPORT_DEBUGCONSOLE)) || (m_telemetry->cbUsbVcp->currentIndex() == HwSettings::USB_VCPPORT_DEBUGCONSOLE)) ||
((m_telemetry->cbUsbVcp->currentIndex() == HwSettings::USB_VCPPORT_DEBUGCONSOLE) && ((m_telemetry->cbUsbVcp->currentIndex() == HwSettings::USB_VCPPORT_DEBUGCONSOLE) &&
(m_telemetry->cbTele->currentIndex() == HwSettings::CC_MAINPORT_DEBUGCONSOLE))) { (m_telemetry->cbTele->currentIndex() == HwSettings::CC_MAINPORT_DEBUGCONSOLE))) {
enableControls(false); enableSaveButtons(false);
m_telemetry->problems->setText(tr("Warning: you have configured more than one DebugConsole, this currently is not supported")); m_telemetry->problems->setText(tr("Warning: you have configured more than one DebugConsole, this currently is not supported"));
} else if (((m_telemetry->cbTele->currentIndex() == HwSettings::CC_MAINPORT_TELEMETRY) && (m_telemetry->cbFlexi->currentIndex() == HwSettings::CC_FLEXIPORT_TELEMETRY)) || } else if (((m_telemetry->cbTele->currentIndex() == HwSettings::CC_MAINPORT_TELEMETRY) && (m_telemetry->cbFlexi->currentIndex() == HwSettings::CC_FLEXIPORT_TELEMETRY)) ||
((m_telemetry->cbTele->currentIndex() == HwSettings::CC_MAINPORT_GPS) && (m_telemetry->cbFlexi->currentIndex() == HwSettings::CC_FLEXIPORT_GPS)) || ((m_telemetry->cbTele->currentIndex() == HwSettings::CC_MAINPORT_GPS) && (m_telemetry->cbFlexi->currentIndex() == HwSettings::CC_FLEXIPORT_GPS)) ||
((m_telemetry->cbTele->currentIndex() == HwSettings::CC_MAINPORT_DEBUGCONSOLE) && (m_telemetry->cbFlexi->currentIndex() == HwSettings::CC_FLEXIPORT_DEBUGCONSOLE)) || ((m_telemetry->cbTele->currentIndex() == HwSettings::CC_MAINPORT_DEBUGCONSOLE) && (m_telemetry->cbFlexi->currentIndex() == HwSettings::CC_FLEXIPORT_DEBUGCONSOLE)) ||
((m_telemetry->cbTele->currentIndex() == HwSettings::CC_MAINPORT_COMBRIDGE) && (m_telemetry->cbFlexi->currentIndex() == HwSettings::CC_FLEXIPORT_COMBRIDGE))) { ((m_telemetry->cbTele->currentIndex() == HwSettings::CC_MAINPORT_COMBRIDGE) && (m_telemetry->cbFlexi->currentIndex() == HwSettings::CC_FLEXIPORT_COMBRIDGE))) {
enableControls(false); enableSaveButtons(false);
m_telemetry->problems->setText(tr("Warning: you have configured both MainPort and FlexiPort for the same function, this currently is not supported")); m_telemetry->problems->setText(tr("Warning: you have configured both MainPort and FlexiPort for the same function, this currently is not supported"));
} else if ((m_telemetry->cbUsbHid->currentIndex() == HwSettings::USB_HIDPORT_USBTELEMETRY) && (m_telemetry->cbUsbVcp->currentIndex() == HwSettings::USB_VCPPORT_USBTELEMETRY)) { } else if ((m_telemetry->cbUsbHid->currentIndex() == HwSettings::USB_HIDPORT_USBTELEMETRY) && (m_telemetry->cbUsbVcp->currentIndex() == HwSettings::USB_VCPPORT_USBTELEMETRY)) {
enableControls(false); enableSaveButtons(false);
m_telemetry->problems->setText(tr("Warning: you have configured both USB HID Port and USB VCP Port for the same function, this currently is not supported")); m_telemetry->problems->setText(tr("Warning: you have configured both USB HID Port and USB VCP Port for the same function, this currently is not supported"));
} else if ((m_telemetry->cbUsbHid->currentIndex() != HwSettings::USB_HIDPORT_USBTELEMETRY) && (m_telemetry->cbUsbVcp->currentIndex() != HwSettings::USB_VCPPORT_USBTELEMETRY)) { } else if ((m_telemetry->cbUsbHid->currentIndex() != HwSettings::USB_HIDPORT_USBTELEMETRY) && (m_telemetry->cbUsbVcp->currentIndex() != HwSettings::USB_VCPPORT_USBTELEMETRY)) {
enableControls(false); enableSaveButtons(false);
m_telemetry->problems->setText(tr("Warning: you have disabled USB Telemetry on both USB HID Port and USB VCP Port, this currently is not supported")); m_telemetry->problems->setText(tr("Warning: you have disabled USB Telemetry on both USB HID Port and USB VCP Port, this currently is not supported"));
} else { } else {
m_telemetry->problems->setText(""); m_telemetry->problems->setText("");
enableControls(true); enableSaveButtons(true);
} }
} }
void ConfigCCHWWidget::enableSaveButtons(bool enable)
{
m_telemetry->saveTelemetryToRAM->setEnabled(enable);
m_telemetry->saveTelemetryToSD->setEnabled(enable);
}
void ConfigCCHWWidget::openHelp() void ConfigCCHWWidget::openHelp()
{ {
QDesktopServices::openUrl(QUrl("http://wiki.openpilot.org/x/D4AUAQ", QUrl::StrictMode)); QDesktopServices::openUrl(QUrl("http://wiki.openpilot.org/x/D4AUAQ", QUrl::StrictMode));

View File

@ -46,6 +46,7 @@ private slots:
void openHelp(); void openHelp();
void refreshValues(); void refreshValues();
void widgetsContentsChanged(); void widgetsContentsChanged();
void enableSaveButtons(bool enable);
private: private:
Ui_CC_HW_Widget *m_telemetry; Ui_CC_HW_Widget *m_telemetry;

View File

@ -38,8 +38,10 @@
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <coreplugin/generalsettings.h> #include <coreplugin/generalsettings.h>
#include "altitudeholdsettings.h"
ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent) ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent),
boardModel(0)
{ {
ui = new Ui_StabilizationWidget(); ui = new Ui_StabilizationWidget();
ui->setupUi(this); ui->setupUi(this);
@ -198,7 +200,17 @@ void ConfigStabilizationWidget::onBoardConnected()
UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>(); UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
Q_ASSERT(utilMngr); Q_ASSERT(utilMngr);
boardModel = utilMngr->getBoardModel();
// If Revolution board enable misc tab, otherwise disable it // If Revolution board enable misc tab, otherwise disable it
ui->AltitudeHold->setEnabled((utilMngr->getBoardModel() & 0xff00) == 0x0900); ui->AltitudeHold->setEnabled((boardModel & 0xff00) == 0x0900);
}
bool ConfigStabilizationWidget::shouldObjectBeSaved(UAVObject *object)
{
// AltitudeHoldSettings should only be saved for Revolution board to avoid error.
if ((boardModel & 0xff00) != 0x0900) {
return dynamic_cast<AltitudeHoldSettings *>(object) == 0;
} else {
return true;
}
} }

View File

@ -43,6 +43,7 @@ class ConfigStabilizationWidget : public ConfigTaskWidget {
public: public:
ConfigStabilizationWidget(QWidget *parent = 0); ConfigStabilizationWidget(QWidget *parent = 0);
~ConfigStabilizationWidget(); ~ConfigStabilizationWidget();
bool shouldObjectBeSaved(UAVObject *object);
private: private:
Ui_StabilizationWidget *ui; Ui_StabilizationWidget *ui;
@ -51,6 +52,8 @@ private:
// Milliseconds between automatic 'Instant Updates' // Milliseconds between automatic 'Instant Updates'
static const int AUTOMATIC_UPDATE_RATE = 500; static const int AUTOMATIC_UPDATE_RATE = 500;
int boardModel;
protected slots: protected slots:
void refreshWidgetsValues(UAVObject *o = NULL); void refreshWidgetsValues(UAVObject *o = NULL);

View File

@ -219,9 +219,7 @@ static HANDLE open_device(const char *path, BOOL enumerate)
{ {
HANDLE handle; HANDLE handle;
DWORD desired_access = (enumerate)? 0: (GENERIC_WRITE | GENERIC_READ); DWORD desired_access = (enumerate)? 0: (GENERIC_WRITE | GENERIC_READ);
DWORD share_mode = (enumerate)? DWORD share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE;
FILE_SHARE_READ|FILE_SHARE_WRITE:
FILE_SHARE_READ;
handle = CreateFileA(path, handle = CreateFileA(path,
desired_access, desired_access,
@ -230,7 +228,7 @@ static HANDLE open_device(const char *path, BOOL enumerate)
OPEN_EXISTING, OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,/*FILE_ATTRIBUTE_NORMAL,*/ FILE_FLAG_OVERLAPPED,/*FILE_ATTRIBUTE_NORMAL,*/
0); 0);
DWORD error = GetLastError();
return handle; return handle;
} }

View File

@ -413,7 +413,7 @@ void ConfigTaskWidget::helpButtonPressed()
void ConfigTaskWidget::addApplySaveButtons(QPushButton *update, QPushButton *save) void ConfigTaskWidget::addApplySaveButtons(QPushButton *update, QPushButton *save)
{ {
if (!smartsave) { if (!smartsave) {
smartsave = new smartSaveButton(); smartsave = new smartSaveButton(this);
connect(smartsave, SIGNAL(preProcessOperations()), this, SLOT(updateObjectsFromWidgets())); connect(smartsave, SIGNAL(preProcessOperations()), this, SLOT(updateObjectsFromWidgets()));
connect(smartsave, SIGNAL(saveSuccessfull()), this, SLOT(clearDirty())); connect(smartsave, SIGNAL(saveSuccessfull()), this, SLOT(clearDirty()));
connect(smartsave, SIGNAL(beginOp()), this, SLOT(disableObjUpdates())); connect(smartsave, SIGNAL(beginOp()), this, SLOT(disableObjUpdates()));
@ -459,6 +459,12 @@ void ConfigTaskWidget::enableControls(bool enable)
} }
} }
bool ConfigTaskWidget::shouldObjectBeSaved(UAVObject *object)
{
Q_UNUSED(object);
return true;
}
/** /**
* SLOT function called when on of the widgets contents added to the framework changes * SLOT function called when on of the widgets contents added to the framework changes
*/ */

View File

@ -144,6 +144,7 @@ public:
void addHelpButton(QPushButton *button, QString url); void addHelpButton(QPushButton *button, QString url);
void forceShadowUpdates(); void forceShadowUpdates();
void forceConnectedState(); void forceConnectedState();
virtual bool shouldObjectBeSaved(UAVObject *object);
public slots: public slots:
void onAutopilotDisconnect(); void onAutopilotDisconnect();
void onAutopilotConnect(); void onAutopilotConnect();
@ -204,8 +205,10 @@ protected slots:
virtual void refreshWidgetsValues(UAVObject *obj = NULL); virtual void refreshWidgetsValues(UAVObject *obj = NULL);
virtual void updateObjectsFromWidgets(); virtual void updateObjectsFromWidgets();
virtual void helpButtonPressed(); virtual void helpButtonPressed();
protected: protected:
virtual void enableControls(bool enable); virtual void enableControls(bool enable);
void checkWidgetsLimits(QWidget *widget, UAVObjectField *field, int index, bool hasLimits, QVariant value, double scale); void checkWidgetsLimits(QWidget *widget, UAVObjectField *field, int index, bool hasLimits, QVariant value, double scale);
void updateEnableControls(); void updateEnableControls();
}; };

View File

@ -25,8 +25,9 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "smartsavebutton.h" #include "smartsavebutton.h"
#include "configtaskwidget.h"
smartSaveButton::smartSaveButton() smartSaveButton::smartSaveButton(ConfigTaskWidget *configTaskWidget) : configWidget(configTaskWidget)
{} {}
void smartSaveButton::addButtons(QPushButton *save, QPushButton *apply) void smartSaveButton::addButtons(QPushButton *save, QPushButton *apply)
@ -77,60 +78,65 @@ void smartSaveButton::processOperation(QPushButton *button, bool save)
foreach(UAVDataObject * obj, objects) { foreach(UAVDataObject * obj, objects) {
UAVObject::Metadata mdata = obj->getMetadata(); UAVObject::Metadata mdata = obj->getMetadata();
if (UAVObject::GetGcsAccess(mdata) == UAVObject::ACCESS_READONLY) { // Should we really save this object to the board?
if (!configWidget->shouldObjectBeSaved(obj) || UAVObject::GetGcsAccess(mdata) == UAVObject::ACCESS_READONLY) {
qDebug() << obj->getName() << "was skipped.";
continue; continue;
} }
up_result = false; up_result = false;
current_object = obj; current_object = obj;
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 3; ++i) {
qDebug() << "SMARTSAVEBUTTON" << "Upload try number" << i << "Object" << obj->getName(); qDebug() << "Uploading" << obj->getName() << "to board.";
connect(obj, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(transaction_finished(UAVObject *, bool))); connect(obj, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(transaction_finished(UAVObject *, bool)));
connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
obj->updated(); obj->updated();
timer.start(3000); timer.start(3000);
// qDebug()<<"begin loop";
loop.exec(); loop.exec();
if (timer.isActive()) { if (!timer.isActive()) {
qDebug() << "SMARTSAVEBUTTON" << "Upload did not timeout" << i << "Object" << obj->getName(); qDebug() << "Upload of" << obj->getName() << "timed out.";
} else {
qDebug() << "SMARTSAVEBUTTON" << "Upload TIMEOUT" << i << "Object" << obj->getName();
} }
timer.stop(); timer.stop();
disconnect(obj, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(transaction_finished(UAVObject *, bool))); disconnect(obj, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(transaction_finished(UAVObject *, bool)));
disconnect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); disconnect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
if (up_result) { if (up_result) {
qDebug() << "Upload of" << obj->getName() << "successful.";
break; break;
} }
} }
if (up_result == false) { if (up_result == false) {
qDebug() << "SMARTSAVEBUTTON" << "Object upload error:" << obj->getName(); qDebug() << "Upload of" << obj->getName() << "failed after 3 tries.";
error = true; error = true;
continue; continue;
} }
sv_result = false; sv_result = false;
current_objectID = obj->getObjID(); current_objectID = obj->getObjID();
if (save && (obj->isSettings())) { if (save && (obj->isSettings())) {
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 3; ++i) {
qDebug() << "SMARTSAVEBUTTON" << "Save try number" << i << "Object" << obj->getName(); qDebug() << "Saving" << obj->getName() << "to board.";
connect(utilMngr, SIGNAL(saveCompleted(int, bool)), this, SLOT(saving_finished(int, bool))); connect(utilMngr, SIGNAL(saveCompleted(int, bool)), this, SLOT(saving_finished(int, bool)));
connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
utilMngr->saveObjectToSD(obj); utilMngr->saveObjectToSD(obj);
timer.start(3000); timer.start(3000);
loop.exec(); loop.exec();
if (timer.isActive()) { if (!timer.isActive()) {
qDebug() << "SMARTSAVEBUTTON" << "Saving did not timeout" << i << "Object" << obj->getName(); qDebug() << "Saving of" << obj->getName() << "timed out.";
} else {
qDebug() << "SMARTSAVEBUTTON" << "Saving TIMEOUT" << i << "Object" << obj->getName();
} }
timer.stop(); timer.stop();
disconnect(utilMngr, SIGNAL(saveCompleted(int, bool)), this, SLOT(saving_finished(int, bool))); disconnect(utilMngr, SIGNAL(saveCompleted(int, bool)), this, SLOT(saving_finished(int, bool)));
disconnect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); disconnect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
if (sv_result) { if (sv_result) {
qDebug() << "Saving of" << obj->getName() << "successful.";
break; break;
} }
} }
if (sv_result == false) { if (sv_result == false) {
qDebug() << "SMARTSAVEBUTTON" << "failed to save:" << obj->getName(); qDebug() << "Saving of" << obj->getName() << "failed after 3 tries.";
error = true; error = true;
} }
} }
@ -189,7 +195,6 @@ void smartSaveButton::saving_finished(int id, bool result)
{ {
if (id == current_objectID) { if (id == current_objectID) {
sv_result = result; sv_result = result;
// qDebug()<<"saving_finished result="<<result;
loop.quit(); loop.quit();
} }
} }

View File

@ -38,13 +38,15 @@
#include <QObject> #include <QObject>
#include <QDebug> #include <QDebug>
class ConfigTaskWidget;
class smartSaveButton : public QObject { class smartSaveButton : public QObject {
enum buttonTypeEnum { save_button, apply_button }; enum buttonTypeEnum { save_button, apply_button };
public: public:
Q_OBJECT Q_OBJECT
public: public:
smartSaveButton(); smartSaveButton(ConfigTaskWidget *configTaskWidget);
void addButtons(QPushButton *save, QPushButton *apply); void addButtons(QPushButton *save, QPushButton *apply);
void setObjects(QList<UAVDataObject *>); void setObjects(QList<UAVDataObject *>);
void addObject(UAVDataObject *); void addObject(UAVDataObject *);
@ -79,6 +81,7 @@ private:
QEventLoop loop; QEventLoop loop;
QList<UAVDataObject *> objects; QList<UAVDataObject *> objects;
QMap<QPushButton *, buttonTypeEnum> buttonList; QMap<QPushButton *, buttonTypeEnum> buttonList;
ConfigTaskWidget *configWidget;
public slots: public slots:
void enableControls(bool value); void enableControls(bool value);

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>822</width> <width>812</width>
<height>523</height> <height>523</height>
</rect> </rect>
</property> </property>
@ -27,7 +27,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>804</width> <width>794</width>
<height>505</height> <height>505</height>
</rect> </rect>
</property> </property>
@ -51,55 +51,20 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QGridLayout" name="gridLayout">
<item> <property name="leftMargin">
<widget class="QPushButton" name="autoUpdateButton"> <number>0</number>
<property name="enabled"> </property>
<bool>false</bool> <property name="topMargin">
</property> <number>0</number>
<property name="toolTip"> </property>
<string>Start a guided procedure to manually <property name="rightMargin">
recover a system which does not boot. <number>0</number>
</property>
Rescue is possible in USB mode only.</string> <property name="horizontalSpacing">
</property> <number>6</number>
<property name="text"> </property>
<string>Auto Update</string> <item row="0" column="3" colspan="2">
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="haltButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Tells the mainboard to go down
to bootloader mode.
(Only enabled if telemetry link is established, either
through serial or USB)</string>
</property>
<property name="text">
<string>Halt</string>
</property>
</widget>
</item>
<item>
<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>
<widget class="QPushButton" name="bootButton"> <widget class="QPushButton" name="bootButton">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
@ -117,7 +82,33 @@ menu on the right.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="5" colspan="3">
<widget class="QPushButton" name="eraseBootButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Reboot the board and clear its settings memory.&lt;/p&gt;&lt;p&gt; Useful if the board cannot boot properly.&lt;/p&gt;&lt;p&gt; Blue led starts blinking quick for 20-30 seconds than the board will start normally&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If telemetry is not running, select the link using the dropdown&lt;/p&gt;&lt;p&gt;menu on the right.&lt;/p&gt;&lt;p&gt;PLEASE NOTE: Supported with bootloader versions 4.0 and earlier&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Erase settings</string>
</property>
</widget>
</item>
<item row="0" column="5" colspan="3">
<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="1" column="3" colspan="2">
<widget class="QPushButton" name="safeBootButton"> <widget class="QPushButton" name="safeBootButton">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
@ -135,53 +126,8 @@ menu on the right.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="9">
<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>
<widget class="QPushButton" name="eraseBootButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Reboot the board and clear its settings memory.&lt;/p&gt;&lt;p&gt; Useful if the board cannot boot properly.&lt;/p&gt;&lt;p&gt; Blue led starts blinking quick for 20-30 seconds than the board will start normally&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If telemetry is not running, select the link using the dropdown&lt;/p&gt;&lt;p&gt;menu on the right.&lt;/p&gt;&lt;p&gt;PLEASE NOTE: Supported with bootloader versions 4.0 and earlier&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Erase settings</string>
</property>
</widget>
</item>
<item>
<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>
<widget class="QComboBox" name="telemetryLink"> <widget class="QComboBox" name="telemetryLink">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>When telemetry is not connected, select the communication <string>When telemetry is not connected, select the communication
method using this combo box. method using this combo box.
@ -192,8 +138,14 @@ halting a running board.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="10">
<widget class="QToolButton" name="refreshPorts"> <widget class="QToolButton" name="refreshPorts">
<property name="minimumSize">
<size>
<width>0</width>
<height>23</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Refresh the list of serial ports</string> <string>Refresh the list of serial ports</string>
</property> </property>
@ -202,7 +154,43 @@ halting a running board.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="2">
<widget class="QPushButton" name="haltButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Tells the mainboard to go down
to bootloader mode.
(Only enabled if telemetry link is established, either
through serial or USB)</string>
</property>
<property name="text">
<string>Halt</string>
</property>
</widget>
</item>
<item row="0" column="12">
<widget class="QPushButton" name="pbHelp">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../coreplugin/core.qrc">
<normaloff>:/core/images/helpicon.svg</normaloff>:/core/images/helpicon.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>18</width>
<height>18</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="11">
<widget class="QLabel" name="boardStatus"> <widget class="QLabel" name="boardStatus">
<property name="font"> <property name="font">
<font> <font>
@ -215,26 +203,56 @@ halting a running board.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="2">
<widget class="QPushButton" name="pbHelp"> <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"> <property name="text">
<string/> <string>Reset</string>
</property>
<property name="icon">
<iconset resource="../coreplugin/core.qrc">
<normaloff>:/core/images/helpicon.svg</normaloff>:/core/images/helpicon.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </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> </layout>
</item> </item>
</layout> </layout>

View File

@ -32,6 +32,8 @@
#define DFU_DEBUG true #define DFU_DEBUG true
const int UploaderGadgetWidget::AUTOUPDATE_CLOSE_TIMEOUT = 7000;
UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent) UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent)
{ {
m_config = new Ui_UploaderWidget(); m_config = new Ui_UploaderWidget();
@ -358,16 +360,10 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
dw->populate(); dw->populate();
m_config->systemElements->addTab(dw, QString("Device") + QString::number(i)); m_config->systemElements->addTab(dw, QString("Device") + QString::number(i));
} }
/*
m_config->haltButton->setEnabled(false);
m_config->resetButton->setEnabled(false);
*/
// Need to re-enable in case we were not connected // Need to re-enable in case we were not connected
bootButtonsSetEnable(true); bootButtonsSetEnable(true);
/*
m_config->telemetryLink->setEnabled(false);
m_config->rescueButton->setEnabled(false);
*/
if (resetOnly) { if (resetOnly) {
resetOnly = false; resetOnly = false;
delay::msleep(3500); delay::msleep(3500);
@ -835,10 +831,14 @@ void UploaderGadgetWidget::finishAutoUpdate()
{ {
disconnect(this, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::AutoUpdateStep, QVariant))); disconnect(this, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::AutoUpdateStep, QVariant)));
m_config->autoUpdateOkButton->setEnabled(true); m_config->autoUpdateOkButton->setEnabled(true);
connect(&autoUpdateCloseTimer, SIGNAL(timeout()), this, SLOT(closeAutoUpdate()));
autoUpdateCloseTimer.start(AUTOUPDATE_CLOSE_TIMEOUT);
} }
void UploaderGadgetWidget::closeAutoUpdate() void UploaderGadgetWidget::closeAutoUpdate()
{ {
autoUpdateCloseTimer.stop();
disconnect(&autoUpdateCloseTimer, SIGNAL(timeout()), this, SLOT(closeAutoUpdate()));
m_config->autoUpdateGroupBox->setVisible(false); m_config->autoUpdateGroupBox->setVisible(false);
m_config->buttonFrame->setEnabled(true); m_config->buttonFrame->setEnabled(true);
m_config->splitter->setEnabled(true); m_config->splitter->setEnabled(true);

View File

@ -97,6 +97,8 @@ private:
int autoUpdateConnectTimeout; int autoUpdateConnectTimeout;
FlightStatus *getFlightStatus(); FlightStatus *getFlightStatus();
void bootButtonsSetEnable(bool enabled); void bootButtonsSetEnable(bool enabled);
static const int AUTOUPDATE_CLOSE_TIMEOUT;
QTimer autoUpdateCloseTimer;
private slots: private slots:
void onPhisicalHWConnect(); void onPhisicalHWConnect();
void versionMatchCheck(); void versionMatchCheck();

View File

@ -48,27 +48,27 @@
limits="\ limits="\
%0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0903NE:Autotune:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI;\ %0903NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI;\
\ \
%0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0903NE:Autotune:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI;\ %0903NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI;\
\ \
%0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0903NE:Autotune:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI;\ %0903NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI;\
\ \
%0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0903NE:Autotune:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI;\ %0903NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI;\
\ \
%0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0903NE:Autotune:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI;\ %0903NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI;\
\ \
%0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0401NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\ %0402NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI,\
%0903NE:Autotune:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI"/> %0903NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI"/>
<field name="ArmedTimeout" units="ms" type="uint16" elements="1" defaultvalue="30000"/> <field name="ArmedTimeout" units="ms" type="uint16" elements="1" defaultvalue="30000"/>
<field name="FailsafeBehavior" units="" type="enum" elements="1" options="None" defaultvalue="None"/> <field name="FailsafeBehavior" units="" type="enum" elements="1" options="None" defaultvalue="None"/>