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
fb48b351
Commit
fb48b351
authored
Sep 26, 2015
by
Pritam Ghanghas
Browse files
some cosmetic changes, rename variables
parent
bee962ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/VehicleSetup/FirmwareUpgradeController.cc
View file @
fb48b351
...
...
@@ -38,11 +38,11 @@ struct FirmwareToUrlElement_t {
QString
url
;
};
uint
qHash
(
const
FirmwareUpgradeController
::
FirmwareIdentifier
&
firmwareI
DTrinity
)
uint
qHash
(
const
FirmwareUpgradeController
::
FirmwareIdentifier
&
firmwareI
d
)
{
return
(
firmwareI
DTrinity
.
autopilotStackType
|
(
firmwareI
DTrinity
.
firmwareType
<<
8
)
|
(
firmwareI
DTrinity
.
firmwareVehicleType
<<
16
)
);
return
(
firmwareI
d
.
autopilotStackType
|
(
firmwareI
d
.
firmwareType
<<
8
)
|
(
firmwareI
d
.
firmwareVehicleType
<<
16
)
);
}
/// @Brief Constructs a new FirmwareUpgradeController Widget. This widget is used within the PX4VehicleConfig set of screens.
...
...
@@ -308,7 +308,7 @@ void FirmwareUpgradeController::_bootloaderSyncFailed(void)
}
/// @brief Prompts the user to select a firmware file if needed and moves the state machine to the next state.
void
FirmwareUpgradeController
::
_getFirmwareFile
(
FirmwareIdentifier
firmwareI
DTrinity
)
void
FirmwareUpgradeController
::
_getFirmwareFile
(
FirmwareIdentifier
firmwareI
d
)
{
// make sure the firmware hashes are populated
_initFirmwareHash
();
...
...
@@ -342,20 +342,20 @@ void FirmwareUpgradeController::_getFirmwareFile(FirmwareIdentifier firmwareIDTr
break
;
}
if
(
prgFirmware
.
isEmpty
()
&&
firmwareI
DTrinity
.
firmwareType
!=
CustomFirmware
)
{
if
(
prgFirmware
.
isEmpty
()
&&
firmwareI
d
.
firmwareType
!=
CustomFirmware
)
{
_errorCancel
(
"Attempting to flash an unknown board type, you must select 'Custom firmware file'"
);
return
;
}
if
(
firmwareI
DTrinity
.
firmwareType
==
CustomFirmware
)
{
if
(
firmwareI
d
.
firmwareType
==
CustomFirmware
)
{
_firmwareFilename
=
QGCFileDialog
::
getOpenFileName
(
NULL
,
// Parent to main window
"Select Firmware File"
,
// Dialog Caption
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DocumentsLocation
),
// Initial directory
"Firmware Files (*.px4 *.bin *.ihx)"
);
// File filter
}
else
{
if
(
prgFirmware
.
contains
(
firmwareI
DTrinity
))
{
_firmwareFilename
=
prgFirmware
.
value
(
firmwareI
DTrinity
);
if
(
prgFirmware
.
contains
(
firmwareI
d
))
{
_firmwareFilename
=
prgFirmware
.
value
(
firmwareI
d
);
}
else
{
_errorCancel
(
"Unable to find specified firmware download location"
);
return
;
...
...
src/VehicleSetup/FirmwareUpgradeController.h
View file @
fb48b351
...
...
@@ -90,11 +90,11 @@ public:
FirmwareVehicleType_t
vehicle
=
DefaultVehicleFirmware
)
:
autopilotStackType
(
stack
),
firmwareType
(
firmware
),
firmwareVehicleType
(
vehicle
)
{}
bool
operator
==
(
const
FirmwareIdentifier
&
firmwareI
DTrinity
)
const
bool
operator
==
(
const
FirmwareIdentifier
&
firmwareI
d
)
const
{
return
(
firmwareI
DTrinity
.
autopilotStackType
==
autopilotStackType
&&
firmwareI
DTrinity
.
firmwareType
==
firmwareType
&&
firmwareI
DTrinity
.
firmwareVehicleType
==
firmwareVehicleType
);
return
(
firmwareI
d
.
autopilotStackType
==
autopilotStackType
&&
firmwareI
d
.
firmwareType
==
firmwareType
&&
firmwareI
d
.
firmwareVehicleType
==
firmwareVehicleType
);
}
// members
...
...
@@ -173,7 +173,7 @@ private slots:
void
_linkDisconnected
(
LinkInterface
*
link
);
private:
void
_getFirmwareFile
(
FirmwareIdentifier
firmwareI
DTrinity
);
void
_getFirmwareFile
(
FirmwareIdentifier
firmwareI
d
);
void
_initFirmwareHash
();
void
_downloadFirmware
(
void
);
void
_appendStatusLog
(
const
QString
&
text
,
bool
critical
=
false
);
...
...
@@ -228,6 +228,6 @@ private:
};
// global hashing function
uint
qHash
(
const
FirmwareUpgradeController
::
FirmwareIdentifier
&
firmwareI
DTrinity
);
uint
qHash
(
const
FirmwareUpgradeController
::
FirmwareIdentifier
&
firmwareI
d
);
#endif
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