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
b1686c1f
Commit
b1686c1f
authored
Feb 25, 2017
by
Don Gagne
Committed by
GitHub
Feb 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4621 from bluerobotics/git-hash
Extract git hash from AUTOPILOT_VERSION message
parents
9dbcf365
70bd3c71
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
APMSubFrameComponentSummary.qml
src/AutoPilotPlugins/APM/APMSubFrameComponentSummary.qml
+5
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+7
-0
Vehicle.h
src/Vehicle/Vehicle.h
+7
-0
No files found.
src/AutoPilotPlugins/APM/APMSubFrameComponentSummary.qml
View file @
b1686c1f
...
...
@@ -53,5 +53,10 @@ FactPanel {
labelText
:
qsTr
(
"
Firmware Version:
"
)
valueText
:
activeVehicle
.
firmwareMajorVersion
==
-
1
?
qsTr
(
"
Unknown
"
)
:
activeVehicle
.
firmwareMajorVersion
+
"
.
"
+
activeVehicle
.
firmwareMinorVersion
+
"
.
"
+
activeVehicle
.
firmwarePatchVersion
+
"
-
"
+
activeVehicle
.
firmwareVersionTypeString
}
VehicleSummaryRow
{
labelText
:
qsTr
(
"
Git Revision:
"
)
valueText
:
activeVehicle
.
gitHash
==
-
1
?
qsTr
(
"
Unknown
"
)
:
activeVehicle
.
gitHash
}
}
}
src/Vehicle/Vehicle.cc
View file @
b1686c1f
...
...
@@ -290,6 +290,7 @@ Vehicle::Vehicle(MAV_AUTOPILOT firmwareType,
,
_firmwareMajorVersion
(
versionNotSetValue
)
,
_firmwareMinorVersion
(
versionNotSetValue
)
,
_firmwarePatchVersion
(
versionNotSetValue
)
,
_gitHash
(
versionNotSetValue
)
,
_rollFact
(
0
,
_rollFactName
,
FactMetaData
::
valueTypeDouble
)
,
_pitchFact
(
0
,
_pitchFactName
,
FactMetaData
::
valueTypeDouble
)
,
_headingFact
(
0
,
_headingFactName
,
FactMetaData
::
valueTypeDouble
)
...
...
@@ -671,6 +672,12 @@ void Vehicle::_handleAutopilotVersion(LinkInterface *link, mavlink_message_t& me
versionType
=
(
FIRMWARE_VERSION_TYPE
)((
autopilotVersion
.
flight_sw_version
>>
(
8
*
0
))
&
0xFF
);
setFirmwareVersion
(
majorVersion
,
minorVersion
,
patchVersion
,
versionType
);
}
// Git hash
if
(
autopilotVersion
.
flight_custom_version
[
0
]
!=
0
)
{
_gitHash
=
QString
::
fromUtf8
((
char
*
)
autopilotVersion
.
flight_custom_version
,
8
);
emit
gitHashChanged
(
_gitHash
);
}
}
void
Vehicle
::
_handleHilActuatorControls
(
mavlink_message_t
&
message
)
...
...
src/Vehicle/Vehicle.h
View file @
b1686c1f
...
...
@@ -347,6 +347,7 @@ public:
Q_PROPERTY
(
int
firmwarePatchVersion
READ
firmwarePatchVersion
NOTIFY
firmwarePatchVersionChanged
)
Q_PROPERTY
(
int
firmwareVersionType
READ
firmwareVersionType
NOTIFY
firmwareVersionTypeChanged
)
Q_PROPERTY
(
QString
firmwareVersionTypeString
READ
firmwareVersionTypeString
NOTIFY
firmwareVersionTypeChanged
)
Q_PROPERTY
(
QString
gitHash
READ
gitHash
NOTIFY
gitHashChanged
)
/// Resets link status counters
Q_INVOKABLE
void
resetCounters
();
...
...
@@ -618,6 +619,8 @@ public:
void
setFirmwareVersion
(
int
majorVersion
,
int
minorVersion
,
int
patchVersion
,
FIRMWARE_VERSION_TYPE
versionType
=
FIRMWARE_VERSION_TYPE_OFFICIAL
);
static
const
int
versionNotSetValue
=
-
1
;
QString
gitHash
(
void
)
const
{
return
_gitHash
;
}
bool
soloFirmware
(
void
)
const
{
return
_soloFirmware
;
}
void
setSoloFirmware
(
bool
soloFirmware
);
...
...
@@ -711,6 +714,8 @@ signals:
void
firmwarePatchVersionChanged
(
int
patch
);
void
firmwareVersionTypeChanged
(
int
type
);
void
gitHashChanged
(
QString
hash
);
/// New RC channel values
/// @param channelCount Number of available channels, cMaxRcChannels max
/// @param pwmValues -1 signals channel not available
...
...
@@ -943,6 +948,8 @@ private:
int
_firmwarePatchVersion
;
FIRMWARE_VERSION_TYPE
_firmwareVersionType
;
QString
_gitHash
;
static
const
int
_lowBatteryAnnounceRepeatMSecs
;
// Amount of time in between each low battery announcement
QElapsedTimer
_lowBatteryAnnounceTimer
;
...
...
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