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
42bbf119
Commit
42bbf119
authored
May 15, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/mavlink/qgroundcontrol
into qgc4
parents
ca8ee3ad
49ef8c14
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
2 deletions
+33
-2
FirmwareUpgrade.qml
src/VehicleSetup/FirmwareUpgrade.qml
+7
-0
FirmwareUpgradeController.cc
src/VehicleSetup/FirmwareUpgradeController.cc
+17
-0
FirmwareUpgradeController.h
src/VehicleSetup/FirmwareUpgradeController.h
+7
-0
QGCSerialPortInfo.cc
src/comm/QGCSerialPortInfo.cc
+1
-1
QGCSerialPortInfo.h
src/comm/QGCSerialPortInfo.h
+1
-1
No files found.
src/VehicleSetup/FirmwareUpgrade.qml
View file @
42bbf119
...
...
@@ -111,6 +111,13 @@ SetupPage {
// Board was found right away, so something is already plugged in before we've started upgrade
statusTextArea
.
append
(
qgcUnplugText1
)
statusTextArea
.
append
(
qgcUnplugText2
)
var
availableDevices
=
controller
.
availableBoardsName
()
if
(
availableDevices
.
length
>
1
)
{
statusTextArea
.
append
(
highlightPrefix
+
qsTr
(
"
Multiple devices detected! Remove all detected devices to perform the firmware upgrade.
"
))
statusTextArea
.
append
(
qsTr
(
"
Detected [%1]:
"
).
arg
(
availableDevices
.
length
)
+
availableDevices
.
join
(
"
,
"
))
}
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autoDisconnect
=
true
}
else
{
// We end up here when we detect a board plugged in after we've started upgrade
...
...
src/VehicleSetup/FirmwareUpgradeController.cc
View file @
42bbf119
...
...
@@ -166,6 +166,23 @@ void FirmwareUpgradeController::cancel(void)
_threadController
->
cancel
();
}
QStringList
FirmwareUpgradeController
::
availableBoardsName
(
void
)
{
QGCSerialPortInfo
::
BoardType_t
boardType
;
QString
boardName
;
QStringList
names
;
auto
ports
=
QGCSerialPortInfo
::
availablePorts
();
for
(
const
auto
info
:
ports
)
{
if
(
info
.
canFlash
())
{
info
.
getBoardInfo
(
boardType
,
boardName
);
names
.
append
(
boardName
);
}
}
return
names
;
}
void
FirmwareUpgradeController
::
_foundBoard
(
bool
firstAttempt
,
const
QSerialPortInfo
&
info
,
int
boardType
,
QString
boardName
)
{
_foundBoardInfo
=
info
;
...
...
src/VehicleSetup/FirmwareUpgradeController.h
View file @
42bbf119
...
...
@@ -146,6 +146,13 @@ public:
bool
pixhawkBoard
(
void
)
const
{
return
_foundBoardType
==
QGCSerialPortInfo
::
BoardTypePixhawk
;
}
bool
px4FlowBoard
(
void
)
const
{
return
_foundBoardType
==
QGCSerialPortInfo
::
BoardTypePX4Flow
;
}
/**
* @brief Return a human friendly string of available boards
*
* @return availableBoardNames
*/
Q_INVOKABLE
QStringList
availableBoardsName
(
void
);
signals:
void
boardFound
(
void
);
void
noBoardFound
(
void
);
...
...
src/comm/QGCSerialPortInfo.cc
View file @
42bbf119
...
...
@@ -340,7 +340,7 @@ bool QGCSerialPortInfo::isSystemPort(QSerialPortInfo* port)
return
false
;
}
bool
QGCSerialPortInfo
::
canFlash
(
void
)
bool
QGCSerialPortInfo
::
canFlash
(
void
)
const
{
BoardType_t
boardType
;
QString
name
;
...
...
src/comm/QGCSerialPortInfo.h
View file @
42bbf119
...
...
@@ -43,7 +43,7 @@ public:
bool
getBoardInfo
(
BoardType_t
&
boardType
,
QString
&
name
)
const
;
/// @return true: we can flash this board type
bool
canFlash
(
void
);
bool
canFlash
(
void
)
const
;
/// @return true: Board is currently in bootloader
bool
isBootloader
(
void
)
const
;
...
...
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