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
0e4d256c
Commit
0e4d256c
authored
Apr 13, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle multi vehicles
parent
a1ed12ee
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
66 deletions
+92
-66
qgroundcontrol.qrc
qgroundcontrol.qrc
+5
-4
CameraComponentSummary.qml
src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
+0
-1
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+1
-0
MultiVehicleList.qml
src/FlightDisplay/MultiVehicleList.qml
+3
-3
MainQmlWindow.qml
src/ui/MainQmlWindow.qml
+4
-3
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+0
-55
MultiVehicleSelector.qml
src/ui/toolbar/MultiVehicleSelector.qml
+79
-0
No files found.
qgroundcontrol.qrc
View file @
0e4d256c
...
...
@@ -3,18 +3,19 @@
<file alias="FactSystemTest.qml">src/FactSystem/FactSystemTest.qml</file>
</qresource>
<qresource prefix="/toolbar">
<file alias="MainToolBarIndicators.qml">src/ui/toolbar/MainToolBarIndicators.qml</file>
<file alias="ArmedIndicator.qml">src/ui/toolbar/ArmedIndicator.qml</file>
<file alias="BatteryIndicator.qml">src/ui/toolbar/BatteryIndicator.qml</file>
<file alias="GPSIndicator.qml">src/ui/toolbar/GPSIndicator.qml</file>
<file alias="GPSRTKIndicator.qml">src/ui/toolbar/GPSRTKIndicator.qml</file>
<file alias="JoystickIndicator.qml">src/ui/toolbar/JoystickIndicator.qml</file>
<file alias="LinkIndicator.qml">src/ui/toolbar/LinkIndicator.qml</file>
<file alias="MainToolBarIndicators.qml">src/ui/toolbar/MainToolBarIndicators.qml</file>
<file alias="MessageIndicator.qml">src/ui/toolbar/MessageIndicator.qml</file>
<file alias="ModeIndicator.qml">src/ui/toolbar/ModeIndicator.qml</file>
<file alias="
VTOLModeIndicator.qml">src/ui/toolbar/VTOLModeIndica
tor.qml</file>
<file alias="
MultiVehicleSelector.qml">src/ui/toolbar/MultiVehicleSelec
tor.qml</file>
<file alias="RCRSSIIndicator.qml">src/ui/toolbar/RCRSSIIndicator.qml</file>
<file alias="TelemetryRSSIIndicator.qml">src/ui/toolbar/TelemetryRSSIIndicator.qml</file>
<file alias="JoystickIndicator.qml">src/ui/toolbar/JoystickIndicator.qml</file>
<file alias="LinkIndicator.qml">src/ui/toolbar/LinkIndicator.qml</file>
<file alias="VTOLModeIndicator.qml">src/ui/toolbar/VTOLModeIndicator.qml</file>
</qresource>
<qresource prefix="/qml">
<file alias="CorridorScanEditor.qml">src/PlanView/CorridorScanEditor.qml</file>
...
...
src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
View file @
0e4d256c
...
...
@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0
Item
{
anchors.fill
:
parent
color
:
qgcPal
.
windowShadeDark
FactPanelController
{
id
:
controller
;
}
...
...
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
0e4d256c
...
...
@@ -321,6 +321,7 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
Q_UNUSED
(
vehicle
);
//-- Default list of indicators for all vehicles.
if
(
_toolBarIndicatorList
.
size
()
==
0
)
{
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MultiVehicleSelector.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MessageIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/GPSIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/TelemetryRSSIIndicator.qml"
)));
...
...
src/FlightDisplay/MultiVehicleList.qml
View file @
0e4d256c
...
...
@@ -19,7 +19,7 @@ import QGroundControl.Vehicle 1.0
import
QGroundControl
.
FlightMap
1.0
Item
{
property
var
guidedActionsController
property
var
guidedActionsController
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_widgetHeight
:
ScreenTools
.
defaultFontPixelHeight
*
3
...
...
@@ -111,7 +111,7 @@ Item {
QGCLabel
{
Layout.alignment
:
Qt
.
AlignTop
text
:
_vehicle
.
id
text
:
_vehicle
?
_vehicle
.
id
:
""
color
:
_textColor
}
...
...
@@ -128,7 +128,7 @@ Item {
QGCLabel
{
Layout.alignment
:
Qt
.
AlignHCenter
text
:
_vehicle
.
armed
?
qsTr
(
"
Armed
"
)
:
qsTr
(
"
Disarmed
"
)
text
:
_vehicle
&&
_vehicle
.
armed
?
qsTr
(
"
Armed
"
)
:
qsTr
(
"
Disarmed
"
)
color
:
_textColor
}
}
...
...
src/ui/MainQmlWindow.qml
View file @
0e4d256c
...
...
@@ -591,7 +591,7 @@ ApplicationWindow {
//-- System Messages
property
var
_messageQueue
:
[]
property
string
_systemMessage
:
""
property
string
_systemMessage
:
""
function
showMessage
(
message
)
{
vehicleMessageArea
.
close
()
...
...
@@ -616,7 +616,7 @@ ApplicationWindow {
y
:
ScreenTools
.
defaultFontPixelHeight
x
:
Math
.
round
((
mainWindow
.
width
-
width
)
*
0.5
)
width
:
mainWindow
.
width
*
0.55
height
:
ScreenTools
.
defaultFontPixelHeight
*
4
height
:
ScreenTools
.
defaultFontPixelHeight
*
6
modal
:
false
focus
:
true
closePolicy
:
Popup
.
CloseOnEscape
...
...
@@ -640,7 +640,8 @@ ApplicationWindow {
//-- Show all messages in queue
for
(
var
i
=
0
;
i
<
mainWindow
.
_messageQueue
.
length
;
i
++
)
{
var
text
=
mainWindow
.
_messageQueue
[
i
]
mainWindow
.
_systemMessage
.
append
(
text
)
if
(
i
)
mainWindow
.
_systemMessage
+=
"
<br>
"
mainWindow
.
_systemMessage
+=
text
}
//-- Clear it
mainWindow
.
_messageQueue
=
[]
...
...
src/ui/toolbar/MainToolBarIndicators.qml
View file @
0e4d256c
...
...
@@ -81,61 +81,6 @@ Item {
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
*
2
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
1.5
visible
:
activeVehicle
&&
!
communicationLost
//---------------------------------------------------------------------
//-- Vehicle Selector
QGCButton
{
id
:
vehicleSelectorButton
width
:
visible
?
0
:
ScreenTools
.
defaultFontPixelHeight
*
8
text
:
"
Vehicle
"
+
(
activeVehicle
?
activeVehicle
.
id
:
"
None
"
)
visible
:
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
>
1
Layout.alignment
:
Qt
.
AlignVCenter
onClicked
:
{
vehicleMenu
.
popup
()
}
Menu
{
id
:
vehicleMenu
}
Component
{
id
:
vehicleMenuItemComponent
MenuItem
{
onTriggered
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
=
vehicle
property
int
vehicleId
:
Number
(
text
.
split
(
"
"
)[
1
])
property
var
vehicle
:
QGroundControl
.
multiVehicleManager
.
getVehicleById
(
vehicleId
)
}
}
property
var
vehicleMenuItems
:
[]
function
updateVehicleMenu
()
{
var
i
;
// Remove old menu items
for
(
i
=
0
;
i
<
vehicleMenuItems
.
length
;
i
++
)
{
vehicleMenu
.
removeItem
(
vehicleMenuItems
[
i
])
}
vehicleMenuItems
.
length
=
0
// Add new items
for
(
i
=
0
;
i
<
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
;
i
++
)
{
var
vehicle
=
QGroundControl
.
multiVehicleManager
.
vehicles
.
get
(
i
)
var
menuItem
=
vehicleMenuItemComponent
.
createObject
(
null
,
{
"
text
"
:
"
Vehicle
"
+
vehicle
.
id
})
vehicleMenuItems
.
push
(
menuItem
)
vehicleMenu
.
insertItem
(
i
,
menuItem
)
}
}
Component.onCompleted
:
updateVehicleMenu
()
Connections
{
target
:
QGroundControl
.
multiVehicleManager
.
vehicles
onCountChanged
:
vehicleSelectorButton
.
updateVehicleMenu
()
}
}
//---------------------------------------------------------------------
//-- Indicators
Repeater
{
model
:
activeVehicle
?
activeVehicle
.
toolBarIndicators
:
[]
Loader
{
...
...
src/ui/toolbar/MultiVehicleSelector.qml
0 → 100644
View file @
0e4d256c
/****************************************************************************
*
* (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
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
MultiVehicleManager
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
//-------------------------------------------------------------------------
//-- Mode Indicator
Item
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
visible
:
_multiVehicles
width
:
_multiVehicles
?
multiVehicleSelector
.
width
:
0
property
bool
_multiVehicles
:
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
>
1
:
false
Connections
{
target
:
QGroundControl
.
multiVehicleManager
.
vehicles
onCountChanged
:
multiVehicleSelector
.
updatemultiVehiclesMenu
()
}
QGCLabel
{
id
:
multiVehicleSelector
text
:
"
Vehicle
"
+
(
activeVehicle
?
activeVehicle
.
id
:
"
None
"
)
font.pointSize
:
ScreenTools
.
mediumFontPointSize
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
Menu
{
id
:
multiVehiclesMenu
}
Component
{
id
:
multiVehicleMenuItemComponent
MenuItem
{
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
)
console
.
log
(
"
Vehicle
"
+
vehicle
.
id
)
}
}
}
Component.onCompleted
:
{
multiVehicleSelector
.
updatemultiVehiclesMenu
()
}
}
MouseArea
{
visible
:
_multiVehicles
anchors.fill
:
parent
onClicked
:
multiVehiclesMenu
.
popup
()
}
}
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