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
1c7174f2
Commit
1c7174f2
authored
Nov 30, 2016
by
Don Gagne
Committed by
GitHub
Nov 30, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4265 from DonLakeFlyer/TBMultiVehicleFixes
Toolbar multi vehicle fixes
parents
63e27884
7602c276
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
376 additions
and
412 deletions
+376
-412
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+1
-0
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+119
-114
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+256
-298
No files found.
src/QmlControls/QGroundControl.Controls.qmldir
View file @
1c7174f2
...
...
@@ -9,6 +9,7 @@ FactSliderPanel 1.0 FactSliderPanel.qml
IndicatorButton 1.0 IndicatorButton.qml
JoystickThumbPad 1.0 JoystickThumbPad.qml
MainToolBar 1.0 MainToolBar.qml
MainToolBarIndicators 1.0 MainToolBarIndicators.qml
MissionCommandDialog 1.0 MissionCommandDialog.qml
MissionItemEditor 1.0 MissionItemEditor.qml
MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml
...
...
src/ui/toolbar/MainToolBar.qml
View file @
1c7174f2
...
...
@@ -7,17 +7,9 @@
*
****************************************************************************/
/**
* @file
* @brief QGC Main Tool Bar
* @author Gus Grubba <mavlink@grubba.com>
*/
import
QtQuick
2.5
import
QtQuick
.
Layouts
1.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
...
...
@@ -316,14 +308,18 @@ Rectangle {
visible
:
qgcPal
.
globalTheme
==
QGCPalette
.
Light
}
RowLayout
{
anchors.bottomMargin
:
1
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
anchors.fill
:
parent
spacing
:
mainWindow
.
tbSpacing
*
2
//---------------------------------------------
// Toolbar Row
Row
{
id
:
viewRow
height
:
mainWindow
.
tbCellHeight
spacing
:
mainWindow
.
tbSpacing
anchors.left
:
parent
.
left
anchors.bottomMargin
:
1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
...
...
@@ -383,56 +379,65 @@ Rectangle {
}
}
Item
{
id
:
vehicleIndicators
height
:
mainWindow
.
tbCellHeight
anchors.leftMargin
:
mainWindow
.
tbSpacing
*
2
anchors.left
:
viewRow
.
right
anchors.right
:
parent
.
right
//-------------------------------------------------------------------------
//-- Vehicle Selector
QGCButton
{
id
:
vehicleSelectorButton
width
:
ScreenTools
.
defaultFontPixelHeight
*
8
text
:
"
Vehicle
"
+
(
activeVehicle
?
activeVehicle
.
id
:
"
None
"
)
visible
:
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
>
1
anchors.verticalCenter
:
parent
.
verticalCenter
property
bool
vehicleConnectionLost
:
activeVehicle
?
activeVehicle
.
connectionLost
:
false
menu
:
vehicleMenu
Loader
{
id
:
indicatorLoader
source
:
activeVehicle
&&
!
parent
.
vehicleConnectionLost
?
"
MainToolBarIndicators.qml
"
:
""
anchors.left
:
parent
.
left
anchors.verticalCenter
:
parent
.
verticalCenter
Menu
{
id
:
vehicleMenu
}
QGCLabel
{
id
:
connectionLos
t
text
:
qsTr
(
"
COMMUNICATION LOST
"
)
font.pointSize
:
ScreenTools
.
largeFontPointSize
font.family
:
ScreenTools
.
demiboldFontFamily
color
:
colorRed
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
disconnectButton
.
left
anchors.verticalCenter
:
parent
.
verticalCenter
visible
:
parent
.
vehicleConnectionLost
Component
{
id
:
vehicleMenuItemComponen
t
MenuItem
{
checkable
:
true
onTriggered
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
=
vehicle
property
int
vehicleId
:
Number
(
text
.
split
(
"
"
)[
1
])
property
var
vehicle
:
QGroundControl
.
multiVehicleManager
.
getVehicleById
(
vehicleId
)
}
}
QGCButton
{
id
:
disconnectButton
anchors.rightMargin
:
mainWindow
.
tbSpacing
*
2
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
qsTr
(
"
Disconnect
"
)
visible
:
parent
.
vehicleConnectionLost
primary
:
true
onClicked
:
activeVehicle
.
disconnectInactiveVehicle
()
property
var
vehicleMenuItems
:
[]
function
updateVehicleMenu
()
{
// Remove old menu items
for
(
var
i
=
0
;
i
<
vehicleMenuItems
.
length
;
i
++
)
{
vehicleMenu
.
removeItem
(
vehicleMenuItems
[
i
])
}
vehicleMenuItems
.
length
=
0
Image
{
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
visible
:
x
>
indicatorLoader
.
x
+
indicatorLoader
.
width
&&
!
disconnectButton
.
visible
&&
source
!=
""
fillMode
:
Image
.
PreserveAspectFit
source
:
activeVehicle
?
activeVehicle
.
brandImage
:
""
// Add new items
for
(
var
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
()
}
}
MainToolBarIndicators
{
height
:
mainWindow
.
tbCellHeight
Layout.fillWidth
:
true
anchors.verticalCenter
:
parent
.
verticalCenter
visible
:
activeVehicle
}
}
// Progress bar
...
...
src/ui/toolbar/MainToolBarIndicators.qml
View file @
1c7174f2
This diff is collapsed.
Click to expand it.
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