Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
5b117db4
Commit
5b117db4
authored
Oct 31, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify board is unplugged
parent
d553dc67
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
12 deletions
+24
-12
PX4FirmwareUpgrade.cc
src/ui/px4_configuration/PX4FirmwareUpgrade.cc
+12
-5
PX4FirmwareUpgrade.h
src/ui/px4_configuration/PX4FirmwareUpgrade.h
+1
-1
PX4FirmwareUpgradeThread.cc
src/ui/px4_configuration/PX4FirmwareUpgradeThread.cc
+6
-3
PX4FirmwareUpgradeThread.h
src/ui/px4_configuration/PX4FirmwareUpgradeThread.h
+5
-3
No files found.
src/ui/px4_configuration/PX4FirmwareUpgrade.cc
View file @
5b117db4
...
...
@@ -35,6 +35,7 @@
#include <QDir>
#include <QFileDialog>
#include <QDebug>
#include <QMessageBox>
/// @Brief Constructs a new PX4FirmwareUpgrade Widget. This widget is used within the PX4VehicleConfig set of screens.
PX4FirmwareUpgrade
::
PX4FirmwareUpgrade
(
QWidget
*
parent
)
:
...
...
@@ -287,12 +288,18 @@ void PX4FirmwareUpgrade::_findBoard(void)
}
/// @brief Called when board has been found by the findBoard process
void
PX4FirmwareUpgrade
::
_foundBoard
(
const
QString
portName
,
QString
portDescription
)
void
PX4FirmwareUpgrade
::
_foundBoard
(
bool
firstTry
,
const
QString
portName
,
QString
portDescription
)
{
if
(
firstTry
)
{
// Board is still plugged
QMessageBox
::
critical
(
this
,
tr
(
"Firmware Upgrade"
),
tr
(
"You must unplug you board before beginning the Firmware Upgrade process."
));
_cancel
();
}
else
{
_portName
=
portName
;
_portDescription
=
portDescription
;
_setupState
(
upgradeStateBootloaderSearch
);
_findBootloader
();
}
}
/// @brief Begins the findBootloader process to connect to the bootloader
...
...
src/ui/px4_configuration/PX4FirmwareUpgrade.h
View file @
5b117db4
...
...
@@ -61,7 +61,7 @@ private slots:
void
_downloadProgress
(
qint64
curr
,
qint64
total
);
void
_downloadFinished
(
void
);
void
_downloadError
(
QNetworkReply
::
NetworkError
code
);
void
_foundBoard
(
const
QString
portname
,
QString
portDescription
);
void
_foundBoard
(
bool
firstTry
,
const
QString
portname
,
QString
portDescription
);
void
_foundBootloader
(
int
bootloaderVersion
,
int
boardID
,
int
flashSize
);
void
_error
(
const
int
command
,
const
QString
errorString
);
void
_bootloaderSyncFailed
(
void
);
...
...
src/ui/px4_configuration/PX4FirmwareUpgradeThread.cc
View file @
5b117db4
...
...
@@ -75,6 +75,7 @@ void PX4FirmwareUpgradeThreadWorker::init(void)
void
PX4FirmwareUpgradeThreadWorker
::
findBoard
(
int
msecTimeout
)
{
_findBoardFirstAttempt
=
true
;
connect
(
_timerRetry
,
&
QTimer
::
timeout
,
this
,
&
PX4FirmwareUpgradeThreadWorker
::
_findBoardOnce
);
_timerTimeout
->
start
(
msecTimeout
);
_elapsed
.
start
();
...
...
@@ -107,11 +108,13 @@ void PX4FirmwareUpgradeThreadWorker::_findBoardOnce(void)
#endif
_closeFind
();
emit
foundBoard
(
portName
,
portDescription
);
emit
foundBoard
(
_findBoardFirstAttempt
,
portName
,
portDescription
);
return
;
}
}
_findBoardFirstAttempt
=
false
;
emit
updateProgress
(
_elapsed
.
elapsed
(),
_timerTimeout
->
interval
());
_timerRetry
->
start
();
}
...
...
@@ -285,9 +288,9 @@ void PX4FirmwareUpgradeThreadController::findBootloader(const QString& portName,
emit
_findBootloaderOnThread
(
portName
,
msecTimeout
);
}
void
PX4FirmwareUpgradeThreadController
::
_foundBoard
(
const
QString
portName
,
QString
portDescription
)
void
PX4FirmwareUpgradeThreadController
::
_foundBoard
(
bool
firstTry
,
const
QString
portName
,
QString
portDescription
)
{
emit
foundBoard
(
portName
,
portDescription
);
emit
foundBoard
(
firstTry
,
portName
,
portDescription
);
}
void
PX4FirmwareUpgradeThreadController
::
_foundBootloader
(
int
bootloaderVersion
,
int
boardID
,
int
flashSize
)
...
...
src/ui/px4_configuration/PX4FirmwareUpgradeThread.h
View file @
5b117db4
...
...
@@ -69,7 +69,7 @@ public slots:
void
erase
(
void
);
signals:
void
foundBoard
(
const
QString
portname
,
QString
portDescription
);
void
foundBoard
(
bool
firstTry
,
const
QString
portname
,
QString
portDescription
);
void
foundBootloader
(
int
bootloaderVersion
,
int
boardID
,
int
flashSize
);
void
bootloaderSyncFailed
(
void
);
void
error
(
const
int
command
,
const
QString
errorString
);
...
...
@@ -91,6 +91,7 @@ private:
QTime
_elapsed
;
QString
_portName
;
static
const
int
_retryTimeout
=
1000
;
bool
_findBoardFirstAttempt
;
};
/// @brief Provides methods to interact with the bootloader. The commands themselves are signalled
...
...
@@ -129,9 +130,10 @@ public:
signals:
/// @brief Emitted by the findBoard process when it finds the board.
/// @param firstTry true: board found on first attempt
/// @param portName Port that board is on
/// @param portDescription User friendly port description
void
foundBoard
(
const
QString
portname
,
QString
portDescription
);
void
foundBoard
(
bool
firstTry
,
const
QString
portname
,
QString
portDescription
);
/// @brief Emitted by the findBootloader process when has a connection to the bootloader
void
foundBootloader
(
int
bootloaderVersion
,
int
boardID
,
int
flashSize
);
...
...
@@ -164,7 +166,7 @@ signals:
void
_cancelFindOnThread
(
void
);
private
slots
:
void
_foundBoard
(
const
QString
portname
,
QString
portDescription
);
void
_foundBoard
(
bool
firstTry
,
const
QString
portname
,
QString
portDescription
);
void
_foundBootloader
(
int
bootloaderVersion
,
int
boardID
,
int
flashSize
);
void
_bootloaderSyncFailed
(
void
);
void
_error
(
const
int
errorCommand
,
const
QString
errorString
)
{
emit
error
(
errorCommand
,
errorString
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment