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
98d8c478
Commit
98d8c478
authored
Nov 28, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added GPS extended info.
And other toolbar fixes...
parent
951a46c1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
7 deletions
+90
-7
MainWindow.qml
src/ui/MainWindow.qml
+9
-0
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+74
-7
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+7
-0
No files found.
src/ui/MainWindow.qml
View file @
98d8c478
...
...
@@ -61,12 +61,18 @@ Item {
target
:
controller
onShowFlyView
:
{
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
flightView
.
visible
=
true
setupViewLoader
.
visible
=
false
planViewLoader
.
visible
=
false
}
onShowPlanView
:
{
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
if
(
planViewLoader
.
source
!=
_planViewSource
)
{
planViewLoader
.
source
=
_planViewSource
}
...
...
@@ -76,6 +82,9 @@ Item {
}
onShowSetupView
:
{
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
if
(
setupViewLoader
.
source
!=
_setupViewSource
)
{
setupViewLoader
.
source
=
_setupViewSource
}
...
...
src/ui/toolbar/MainToolBar.qml
View file @
98d8c478
...
...
@@ -41,7 +41,7 @@ import QGroundControl.Controllers 1.0
Rectangle
{
id
:
toolBar
color
:
opaqueBackground
?
"
#404040
"
:
(
isBackgroundDark
?
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
:
Qt
.
rgba
(
0
,
0
,
0
,
0.5
)
)
color
:
opaqueBackground
?
"
#404040
"
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
...
...
@@ -181,6 +181,22 @@ Rectangle {
return
colorRed
;
}
function
getGpsLockStatus
()
{
if
(
activeVehicle
)
{
if
(
activeVehicle
.
satelliteLock
==
0
)
{
return
"
No Satellite Link
"
}
if
(
activeVehicle
.
satelliteLock
==
1
)
{
return
"
No GPS Lock
"
}
if
(
activeVehicle
.
satelliteLock
==
2
)
{
return
"
2D Lock
"
}
return
"
3D Lock
"
}
return
"
N/A
"
}
Component.onCompleted
:
{
//-- TODO: Get this from the actual state
flyButton
.
checked
=
true
...
...
@@ -193,6 +209,56 @@ Rectangle {
onShowSetupView
:{
setupButton
.
checked
=
true
}
}
//---------------------------------------------
// GPS Info
Component
{
id
:
gpsInfo
Rectangle
{
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
width
:
gpsCol
.
width
+
ScreenTools
.
defaultFontPixelWidth
*
3
height
:
gpsCol
.
height
+
ScreenTools
.
defaultFontPixelHeight
*
2
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
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
.
satelliteCount
>
0
))
?
"
GPS Status
"
:
"
GPS Data Unavailable
"
font.weight
:
Font
.
DemiBold
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
GridLayout
{
id
:
gpsGrid
visible
:
(
activeVehicle
&&
(
activeVehicle
.
satelliteCount
>
0
))
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
columns
:
2
QGCLabel
{
text
:
"
GPS Count:
"
}
QGCLabel
{
text
:
activeVehicle
?
(
activeVehicle
.
satelliteCount
)
:
"
N/A
"
}
QGCLabel
{
text
:
"
GPS Lock:
"
}
QGCLabel
{
text
:
getGpsLockStatus
()
}
}
}
Component.onCompleted
:
{
var
pos
=
mapFromItem
(
toolBar
,
centerX
-
(
width
/
2
),
toolBar
.
height
)
x
=
pos
.
x
y
=
pos
.
y
+
ScreenTools
.
defaultFontPixelHeight
}
}
}
//---------------------------------------------
// Battery Info
Component
{
...
...
@@ -261,23 +327,24 @@ Rectangle {
id
:
rcRSSIInfo
Rectangle
{
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
width
:
batt
Col
.
width
+
ScreenTools
.
defaultFontPixelWidth
*
3
height
:
batt
Col
.
height
+
ScreenTools
.
defaultFontPixelHeight
*
2
width
:
rcrssi
Col
.
width
+
ScreenTools
.
defaultFontPixelWidth
*
3
height
:
rcrssi
Col
.
height
+
ScreenTools
.
defaultFontPixelHeight
*
2
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
Column
{
id
:
batt
Col
id
:
rcrssi
Col
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
width
:
Math
.
max
(
batt
Grid
.
width
,
rssiLabel
.
width
)
width
:
Math
.
max
(
rcrssi
Grid
.
width
,
rssiLabel
.
width
)
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.centerIn
:
parent
QGCLabel
{
id
:
rssiLabel
text
:
"
RC RSSI Status
"
text
:
activeVehicle
?
(
activeVehicle
.
rcRSSI
>
0
?
"
RC RSSI Status
"
:
"
RC RSSI Data Unavailable
"
)
:
"
N/A
"
font.weight
:
Font
.
DemiBold
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
GridLayout
{
id
:
battGrid
id
:
rcrssiGrid
visible
:
activeVehicle
&&
activeVehicle
.
rcRSSI
>
0
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
...
src/ui/toolbar/MainToolBarIndicators.qml
View file @
98d8c478
...
...
@@ -191,6 +191,13 @@ Row {
anchors.leftMargin
:
gpsIcon
.
width
anchors.left
:
parent
.
left
}
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