Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
42bbf119
Commit
42bbf119
authored
May 15, 2019
by
Gus Grubba
Browse files
Merge branch 'master' of
https://github.com/mavlink/qgroundcontrol
into qgc4
parents
ca8ee3ad
49ef8c14
Changes
5
Show whitespace changes
Inline
Side-by-side
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
Supports
Markdown
0%
Try again
or
attach a new 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