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
214529d9
Unverified
Commit
214529d9
authored
Oct 09, 2019
by
Don Gagne
Committed by
GitHub
Oct 09, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7896 from DonLakeFlyer/Toolbar
Toolbar changes plus other stuff
parents
eb6f92d6
a5a2e831
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
57 deletions
+40
-57
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+2
-2
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+5
-10
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+1
-1
MultiVehicleSelector.qml
src/ui/toolbar/MultiVehicleSelector.qml
+32
-44
No files found.
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
214529d9
...
...
@@ -323,16 +323,16 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
//-- Default list of indicators for all vehicles.
if
(
_toolBarIndicatorList
.
size
()
==
0
)
{
_toolBarIndicatorList
=
QVariantList
({
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MultiVehicleSelector.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MessageIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/GPSIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/TelemetryRSSIIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/RCRSSIIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/BatteryIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/GPSRTKIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ModeIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/VTOLModeIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ArmedIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/
GPSRTKIndica
tor.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/
MultiVehicleSelec
tor.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/LinkIndicator.qml"
)),
});
}
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
214529d9
...
...
@@ -31,11 +31,6 @@ FlightMap {
allowVehicleLocationCenter
:
!
_keepVehicleCentered
planView
:
false
onVisibleChanged
:
{
// I don't know what is causing this to become invisible when a connection is dropped
if
(
!
visible
)
visible
=
true
}
property
alias
scaleState
:
mapScale
.
state
// The following properties must be set by the consumer
...
...
@@ -190,7 +185,7 @@ FlightMap {
line.width
:
3
line.color
:
"
red
"
z
:
QGroundControl
.
zOrderTrajectoryLines
visible
:
true
//
mainIsMap
visible
:
mainIsMap
Connections
{
target
:
QGroundControl
.
multiVehicleManager
...
...
@@ -320,9 +315,9 @@ FlightMap {
property
bool
inGotoFlightMode
:
activeVehicle
?
activeVehicle
.
flightMode
===
activeVehicle
.
gotoFlightMode
:
false
onInGotoFlightModeChanged
:
{
if
(
!
inGotoFlightMode
&&
visible
)
{
if
(
!
inGotoFlightMode
&&
gotoLocationItem
.
visible
)
{
// Hide goto indicator when vehicle falls out of guided mode
visible
=
false
gotoLocationItem
.
visible
=
false
}
}
...
...
@@ -330,7 +325,7 @@ FlightMap {
target
:
mainWindow
onActiveVehicleChanged
:
{
if
(
!
activeVehicle
)
{
visible
=
false
gotoLocationItem
.
visible
=
false
}
}
}
...
...
@@ -368,7 +363,7 @@ FlightMap {
target
:
mainWindow
onActiveVehicleChanged
:
{
if
(
!
activeVehicle
)
{
visible
=
false
orbitMapCircle
.
visible
=
false
}
}
}
...
...
src/ui/toolbar/MainToolBar.qml
View file @
214529d9
...
...
@@ -50,7 +50,7 @@ Item {
anchors.bottomMargin
:
1
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
anchors.fill
:
parent
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
2
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
ButtonGroup
{
buttons
:
viewRow
.
children
...
...
src/ui/toolbar/MultiVehicleSelector.qml
View file @
214529d9
...
...
@@ -18,61 +18,49 @@ import QGroundControl.ScreenTools 1.0
import
QGroundControl
.
Palette
1.0
//-------------------------------------------------------------------------
//-- M
ode Indica
tor
Item
{
//-- M
ultiple Vehicle Selec
tor
QGCComboBox
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
visible
:
_multiVehicles
width
:
_multiVehicles
?
multiVehicleSelector
.
width
:
0
font.pointSize
:
ScreenTools
.
mediumFontPointSize
currentIndex
:
-
1
sizeToContents
:
true
model
:
_vehicleModel
visible
:
_multipleVehicles
property
bool
_multiVehicles
:
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
>
1
:
false
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_multipleVehicles
:
_activeVehicle
?
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
>
1
:
false
property
var
_vehicleModel
:
[
]
Connections
{
target
:
QGroundControl
.
multiVehicleManager
.
vehicles
onCountChanged
:
multiVehicleSelector
.
updatemultiVehiclesMenu
()
onCountChanged
:
_updateVehicleModel
()
}
QGCLabel
{
id
:
multiVehicleSelector
text
:
"
Vehicle
"
+
(
activeVehicle
?
activeVehicle
.
id
:
"
None
"
)
font.pointSize
:
ScreenTools
.
mediumFontPointSize
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
QGCMenu
{
id
:
multiVehiclesMenu
}
Component
{
id
:
multiVehicleMenuItemComponent
QGCMenuItem
{
onTriggered
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
=
vehicle
property
int
vehicleId
:
Number
(
text
.
split
(
"
"
)[
1
])
property
var
vehicle
:
QGroundControl
.
multiVehicleManager
.
getVehicleById
(
vehicleId
)
}
}
property
var
multiVehiclesMenuItems
:
[]
function
updatemultiVehiclesMenu
()
{
if
(
_multiVehicles
)
{
// Remove old menu items
for
(
var
i
=
0
;
i
<
multiVehiclesMenuItems
.
length
;
i
++
)
{
multiVehiclesMenu
.
removeItem
(
multiVehiclesMenuItems
[
i
])
}
multiVehiclesMenuItems
.
length
=
0
// Add new items
for
(
i
=
0
;
i
<
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
;
i
++
)
{
var
vehicle
=
QGroundControl
.
multiVehicleManager
.
vehicles
.
get
(
i
)
var
menuItem
=
multiVehicleMenuItemComponent
.
createObject
(
null
,
{
"
text
"
:
"
Vehicle
"
+
vehicle
.
id
})
multiVehiclesMenuItems
.
push
(
menuItem
)
multiVehiclesMenu
.
insertItem
(
i
,
menuItem
)
Component.onCompleted
:
_updateVehicleModel
()
function
_updateVehicleModel
()
{
var
newCurrentIndex
=
-
1
var
newModel
=
[
]
if
(
_multipleVehicles
)
{
for
(
var
i
=
0
;
i
<
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
;
i
++
)
{
var
vehicle
=
QGroundControl
.
multiVehicleManager
.
vehicles
.
get
(
i
)
newModel
.
push
(
qsTr
(
"
Vehicle
"
)
+
"
"
+
vehicle
.
id
)
if
(
vehicle
.
id
===
_activeVehicle
.
id
)
{
newCurrentIndex
=
i
}
}
}
Component.onCompleted
:
{
multiVehicleSelector
.
updatemultiVehiclesMenu
()
}
currentIndex
=
-
1
_vehicleModel
=
newModel
currentIndex
=
newCurrentIndex
}
MouseArea
{
visible
:
_multiVehicles
anchors.fill
:
parent
onClicked
:
multiVehiclesMenu
.
popup
()
onActivated
:
{
var
vehicleId
=
textAt
(
index
).
split
(
"
"
)[
1
]
var
vehicle
=
QGroundControl
.
multiVehicleManager
.
getVehicleById
(
vehicleId
)
QGroundControl
.
multiVehicleManager
.
activeVehicle
=
vehicle
}
}
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