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
29db9519
Commit
29db9519
authored
Oct 23, 2018
by
Patrick José Pereira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VehicleSetup: Change from foreach to c++11 for
Signed-off-by:
Patrick José Pereira
<
patrickelectric@gmail.com
>
parent
dce90f44
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
FirmwareUpgradeController.cc
src/VehicleSetup/FirmwareUpgradeController.cc
+8
-8
PX4FirmwareUpgradeThread.cc
src/VehicleSetup/PX4FirmwareUpgradeThread.cc
+1
-1
VehicleComponent.cc
src/VehicleSetup/VehicleComponent.cc
+1
-1
No files found.
src/VehicleSetup/FirmwareUpgradeController.cc
View file @
29db9519
...
...
@@ -354,7 +354,7 @@ void FirmwareUpgradeController::_initFirmwareHash()
#endif
// PX4 Firmwares
for
each
(
const
FirmwareType_t
&
firmwareType
,
px4MapFirmwareTypeToDir
.
keys
())
{
for
(
const
FirmwareType_t
&
firmwareType
:
px4MapFirmwareTypeToDir
.
keys
())
{
QString
dir
=
px4MapFirmwareTypeToDir
[
firmwareType
];
_rgPX4FMUV5Firmware
.
insert
(
FirmwareIdentifier
(
AutoPilotStackPX4
,
firmwareType
,
DefaultVehicleFirmware
),
px4Url
.
arg
(
dir
).
arg
(
"v5"
));
_rgPX4FMUV4PROFirmware
.
insert
(
FirmwareIdentifier
(
AutoPilotStackPX4
,
firmwareType
,
DefaultVehicleFirmware
),
px4Url
.
arg
(
dir
).
arg
(
"v4pro"
));
...
...
@@ -365,9 +365,9 @@ void FirmwareUpgradeController::_initFirmwareHash()
#if !defined(NO_ARDUPILOT_DIALECT)
// ArduPilot Firmwares
for
each
(
const
FirmwareType_t
&
firmwareType
,
apmMapFirmwareTypeToDir
.
keys
())
{
for
(
const
FirmwareType_t
&
firmwareType
:
apmMapFirmwareTypeToDir
.
keys
())
{
QString
firmwareTypeDir
=
apmMapFirmwareTypeToDir
[
firmwareType
];
for
each
(
const
FirmwareVehicleType_t
&
vehicleType
,
apmMapVehicleTypeToDir
.
keys
())
{
for
(
const
FirmwareVehicleType_t
&
vehicleType
:
apmMapVehicleTypeToDir
.
keys
())
{
QString
vehicleTypeDir
=
apmMapVehicleTypeToDir
[
vehicleType
];
QString
px4Dir
=
apmMapVehicleTypeToPX4Dir
[
vehicleType
];
QString
filename
=
apmMapVehicleTypeToFilename
[
vehicleType
];
...
...
@@ -382,9 +382,9 @@ void FirmwareUpgradeController::_initFirmwareHash()
#if !defined(NO_ARDUPILOT_DIALECT)
// ArduPilot ChibiOS Firmwares
for
each
(
const
FirmwareType_t
&
firmwareType
,
apmMapFirmwareTypeToDir
.
keys
())
{
for
(
const
FirmwareType_t
&
firmwareType
:
apmMapFirmwareTypeToDir
.
keys
())
{
QString
firmwareTypeDir
=
apmMapFirmwareTypeToDir
[
firmwareType
];
for
each
(
const
FirmwareVehicleType_t
&
vehicleType
,
apmChibiOSMapVehicleTypeToDir
.
keys
())
{
for
(
const
FirmwareVehicleType_t
&
vehicleType
:
apmChibiOSMapVehicleTypeToDir
.
keys
())
{
QString
vehicleTypeDir
=
apmChibiOSMapVehicleTypeToDir
[
vehicleType
];
QString
fmuDir
=
apmChibiOSMapVehicleTypeToFmuDir
[
vehicleType
];
QString
filename
=
apmChibiOSMapVehicleTypeToFilename
[
vehicleType
];
...
...
@@ -692,7 +692,7 @@ void FirmwareUpgradeController::_loadAPMVersions(uint32_t bootloaderBoardID)
QHash
<
FirmwareIdentifier
,
QString
>*
prgFirmware
=
_firmwareHashForBoardId
(
static_cast
<
int
>
(
bootloaderBoardID
));
for
each
(
FirmwareIdentifier
firmwareId
,
prgFirmware
->
keys
())
{
for
(
FirmwareIdentifier
firmwareId
:
prgFirmware
->
keys
())
{
if
(
firmwareId
.
autopilotStackType
==
AutoPilotStackAPM
)
{
QString
versionFile
=
QFileInfo
(
prgFirmware
->
value
(
firmwareId
)).
path
()
+
"/git-version.txt"
;
...
...
@@ -733,7 +733,7 @@ void FirmwareUpgradeController::_apmVersionDownloadFinished(QString remoteFile,
QHash
<
FirmwareIdentifier
,
QString
>*
prgFirmware
=
_firmwareHashForBoardId
(
static_cast
<
int
>
(
_bootloaderBoardID
));
QString
remotePath
=
QFileInfo
(
remoteFile
).
path
();
for
each
(
FirmwareIdentifier
firmwareId
,
prgFirmware
->
keys
())
{
for
(
FirmwareIdentifier
firmwareId
:
prgFirmware
->
keys
())
{
if
(
remotePath
==
QFileInfo
((
*
prgFirmware
)[
firmwareId
]).
path
())
{
qCDebug
(
FirmwareUpgradeLog
)
<<
"Adding version to map, version:firwmareType:vehicleType"
<<
version
<<
firmwareId
.
firmwareType
<<
firmwareId
.
firmwareVehicleType
;
_apmVersionMap
[
firmwareId
.
firmwareType
][
firmwareId
.
firmwareVehicleType
]
=
version
;
...
...
@@ -761,7 +761,7 @@ QStringList FirmwareUpgradeController::apmAvailableVersions(void)
_apmVehicleTypeFromCurrentVersionList
.
clear
();
for
each
(
FirmwareVehicleType_t
vehicleType
,
vehicleTypes
)
{
for
(
FirmwareVehicleType_t
vehicleType
:
vehicleTypes
)
{
if
(
_apmVersionMap
[
_selectedFirmwareType
].
contains
(
vehicleType
))
{
QString
version
;
...
...
src/VehicleSetup/PX4FirmwareUpgradeThread.cc
View file @
29db9519
...
...
@@ -119,7 +119,7 @@ void PX4FirmwareUpgradeThreadWorker::_findBoardOnce(void)
bool
PX4FirmwareUpgradeThreadWorker
::
_findBoardFromPorts
(
QGCSerialPortInfo
&
portInfo
,
QGCSerialPortInfo
::
BoardType_t
&
boardType
,
QString
&
boardName
)
{
for
each
(
QGCSerialPortInfo
info
,
QGCSerialPortInfo
::
availablePorts
())
{
for
(
QGCSerialPortInfo
info
:
QGCSerialPortInfo
::
availablePorts
())
{
info
.
getBoardInfo
(
boardType
,
boardName
);
qCDebug
(
FirmwareUpgradeVerboseLog
)
<<
"Serial Port --------------"
;
...
...
src/VehicleSetup/VehicleComponent.cc
View file @
29db9519
...
...
@@ -54,7 +54,7 @@ void VehicleComponent::addSummaryQmlComponent(QQmlContext* context, QQuickItem*
void
VehicleComponent
::
setupTriggerSignals
(
void
)
{
// Watch for changed on trigger list params
for
each
(
const
QString
&
paramName
,
setupCompleteChangedTriggerList
())
{
for
(
const
QString
&
paramName
:
setupCompleteChangedTriggerList
())
{
if
(
_vehicle
->
parameterManager
()
->
parameterExists
(
FactSystem
::
defaultComponentId
,
paramName
))
{
Fact
*
fact
=
_vehicle
->
parameterManager
()
->
getParameter
(
FactSystem
::
defaultComponentId
,
paramName
);
connect
(
fact
,
&
Fact
::
valueChanged
,
this
,
&
VehicleComponent
::
_triggerUpdated
);
...
...
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