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
5211a7a9
Commit
5211a7a9
authored
Jun 14, 2017
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First stab at GPS RTK indicator
parent
d67b1830
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
125 additions
and
0 deletions
+125
-0
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+1
-0
GPSProvider.cc
src/GPS/GPSProvider.cc
+1
-0
GPSProvider.h
src/GPS/GPSProvider.h
+1
-0
GPSRTKIndicator.qml
src/ui/toolbar/GPSRTKIndicator.qml
+122
-0
No files found.
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
5211a7a9
...
...
@@ -334,6 +334,7 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/BatteryIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ModeIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ArmedIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/GPSRTKIndicator.qml"
)));
}
return
_toolBarIndicatorList
;
}
...
...
src/GPS/GPSProvider.cc
View file @
5211a7a9
...
...
@@ -172,6 +172,7 @@ int GPSProvider::callback(GPSCallbackType type, void *data1, int data2)
{
SurveyInStatus
*
status
=
(
SurveyInStatus
*
)
data1
;
qCDebug
(
RTKGPSLog
)
<<
QString
(
"Survey-in status: %1s cur accuracy: %2mm valid: %3 active: %4"
).
arg
(
status
->
duration
).
arg
(
status
->
mean_accuracy
).
arg
((
int
)(
status
->
flags
&
1
)).
arg
((
int
)((
status
->
flags
>>
1
)
&
1
));
emit
rtkStatus
(
status
->
duration
,
status
->
mean_accuracy
,
(
int
)(
status
->
flags
&
1
),
(
int
)((
status
->
flags
>>
1
)
&
1
));
}
break
;
...
...
src/GPS/GPSProvider.h
View file @
5211a7a9
...
...
@@ -40,6 +40,7 @@ signals:
void
positionUpdate
(
GPSPositionMessage
message
);
void
satelliteInfoUpdate
(
GPSSatelliteMessage
message
);
void
RTCMDataUpdate
(
QByteArray
message
);
void
rtkStatus
(
float
duration
,
float
accuracyMM
,
bool
valid
,
bool
active
);
protected:
void
run
();
...
...
src/ui/toolbar/GPSRTKIndicator.qml
0 → 100644
View file @
5211a7a9
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Layouts
1.2
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
MultiVehicleManager
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
//-------------------------------------------------------------------------
//-- GPS Indicator
Item
{
id
:
satelitte
width
:
(
gpsValuesColumn
.
x
+
gpsValuesColumn
.
width
)
*
1.1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
Component
{
id
:
gpsInfo
Rectangle
{
width
:
gpsCol
.
width
+
ScreenTools
.
defaultFontPixelWidth
*
3
height
:
gpsCol
.
height
+
ScreenTools
.
defaultFontPixelHeight
*
2
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
color
:
qgcPal
.
window
border.color
:
qgcPal
.
text
Column
{
id
:
gpsCol
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
width
:
Math
.
max
(
gpsGrid
.
width
,
gpsLabel
.
width
)
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.centerIn
:
parent
QGCLabel
{
id
:
gpsLabel
text
:
(
activeVehicle
&&
activeVehicle
.
gps
.
count
.
value
>=
0
)
?
qsTr
(
"
GPS Status
"
)
:
qsTr
(
"
GPS Data Unavailable
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
GridLayout
{
id
:
gpsGrid
visible
:
(
activeVehicle
&&
activeVehicle
.
gps
.
count
.
value
>=
0
)
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
columns
:
2
QGCLabel
{
text
:
qsTr
(
"
GPS Count:
"
)
}
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
gps
.
count
.
valueString
:
qsTr
(
"
N/A
"
,
"
No data to display
"
)
}
QGCLabel
{
text
:
qsTr
(
"
GPS Lock:
"
)
}
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
gps
.
lock
.
enumStringValue
:
qsTr
(
"
N/A
"
,
"
No data to display
"
)
}
QGCLabel
{
text
:
qsTr
(
"
HDOP:
"
)
}
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
gps
.
hdop
.
valueString
:
qsTr
(
"
--.--
"
,
"
No data to display
"
)
}
QGCLabel
{
text
:
qsTr
(
"
VDOP:
"
)
}
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
gps
.
vdop
.
valueString
:
qsTr
(
"
--.--
"
,
"
No data to display
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Course Over Ground:
"
)
}
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
gps
.
courseOverGround
.
valueString
:
qsTr
(
"
--.--
"
,
"
No data to display
"
)
}
}
}
Component.onCompleted
:
{
var
pos
=
mapFromItem
(
toolBar
,
centerX
-
(
width
/
2
),
toolBar
.
height
)
x
=
pos
.
x
y
=
pos
.
y
+
ScreenTools
.
defaultFontPixelHeight
}
}
}
QGCColoredImage
{
id
:
gpsIcon
width
:
height
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
source
:
"
/qmlimages/Gps.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
opacity
:
(
activeVehicle
&&
activeVehicle
.
gps
.
count
.
value
>=
0
)
?
1
:
0.5
color
:
qgcPal
.
buttonText
}
Column
{
id
:
gpsValuesColumn
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
anchors.left
:
gpsIcon
.
right
QGCLabel
{
anchors.horizontalCenter
:
hdopValue
.
horizontalCenter
visible
:
activeVehicle
&&
!
isNaN
(
activeVehicle
.
gps
.
hdop
.
value
)
color
:
qgcPal
.
buttonText
text
:
activeVehicle
?
activeVehicle
.
gps
.
count
.
valueString
:
""
}
QGCLabel
{
id
:
hdopValue
visible
:
activeVehicle
&&
!
isNaN
(
activeVehicle
.
gps
.
hdop
.
value
)
color
:
qgcPal
.
buttonText
text
:
activeVehicle
?
activeVehicle
.
gps
.
hdop
.
value
.
toFixed
(
1
)
:
""
}
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
var
centerX
=
mapToItem
(
toolBar
,
x
,
y
).
x
+
(
width
/
2
)
mainWindow
.
showPopUp
(
gpsInfo
,
centerX
)
}
}
}
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