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
Hide 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
...
@@ -9,6 +9,7 @@ FactSliderPanel 1.0 FactSliderPanel.qml
IndicatorButton 1.0 IndicatorButton.qml
IndicatorButton 1.0 IndicatorButton.qml
JoystickThumbPad 1.0 JoystickThumbPad.qml
JoystickThumbPad 1.0 JoystickThumbPad.qml
MainToolBar 1.0 MainToolBar.qml
MainToolBar 1.0 MainToolBar.qml
MainToolBarIndicators 1.0 MainToolBarIndicators.qml
MissionCommandDialog 1.0 MissionCommandDialog.qml
MissionCommandDialog 1.0 MissionCommandDialog.qml
MissionItemEditor 1.0 MissionItemEditor.qml
MissionItemEditor 1.0 MissionItemEditor.qml
MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml
MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml
...
...
src/ui/toolbar/MainToolBar.qml
View file @
1c7174f2
...
@@ -7,17 +7,9 @@
...
@@ -7,17 +7,9 @@
*
*
****************************************************************************/
****************************************************************************/
import
QtQuick
2.5
/**
import
QtQuick
.
Layouts
1.2
* @file
import
QtQuick
.
Controls
1.2
* @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
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
...
@@ -316,123 +308,136 @@ Rectangle {
...
@@ -316,123 +308,136 @@ Rectangle {
visible
:
qgcPal
.
globalTheme
==
QGCPalette
.
Light
visible
:
qgcPal
.
globalTheme
==
QGCPalette
.
Light
}
}
//---------------------------------------------
RowLayout
{
// Toolbar Row
Row
{
id
:
viewRow
height
:
mainWindow
.
tbCellHeight
spacing
:
mainWindow
.
tbSpacing
anchors.left
:
parent
.
left
anchors.bottomMargin
:
1
anchors.bottomMargin
:
1
anchors.top
:
parent
.
top
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
anchors.bottom
:
parent
.
bottom
anchors.fill
:
parent
spacing
:
mainWindow
.
tbSpacing
*
2
ExclusiveGroup
{
id
:
mainActionGroup
}
//---------------------------------------------
QGCToolBarButton
{
// Toolbar Row
id
:
settingsButton
Row
{
width
:
mainWindow
.
tbButtonWidth
id
:
viewRow
anchors.top
:
parent
.
top
height
:
mainWindow
.
tbCellHeight
anchors.bottom
:
parent
.
bottom
spacing
:
mainWindow
.
tbSpacing
exclusiveGroup
:
mainActionGroup
anchors.top
:
parent
.
top
source
:
"
/res/QGCLogoWhite
"
anchors.bottom
:
parent
.
bottom
logo
:
true
onClicked
:
toolBar
.
showSettingsView
()
ExclusiveGroup
{
id
:
mainActionGroup
}
visible
:
!
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
}
QGCToolBarButton
{
id
:
settingsButton
width
:
mainWindow
.
tbButtonWidth
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
source
:
"
/res/QGCLogoWhite
"
logo
:
true
onClicked
:
toolBar
.
showSettingsView
()
visible
:
!
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
}
QGCToolBarButton
{
QGCToolBarButton
{
id
:
setupButton
id
:
setupButton
width
:
mainWindow
.
tbButtonWidth
width
:
mainWindow
.
tbButtonWidth
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
exclusiveGroup
:
mainActionGroup
source
:
"
/qmlimages/Gears.svg
"
source
:
"
/qmlimages/Gears.svg
"
onClicked
:
toolBar
.
showSetupView
()
onClicked
:
toolBar
.
showSetupView
()
}
}
QGCToolBarButton
{
QGCToolBarButton
{
id
:
planButton
id
:
planButton
width
:
mainWindow
.
tbButtonWidth
width
:
mainWindow
.
tbButtonWidth
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
exclusiveGroup
:
mainActionGroup
source
:
"
/qmlimages/Plan.svg
"
source
:
"
/qmlimages/Plan.svg
"
onClicked
:
toolBar
.
showPlanView
()
onClicked
:
toolBar
.
showPlanView
()
}
}
QGCToolBarButton
{
QGCToolBarButton
{
id
:
flyButton
id
:
flyButton
width
:
mainWindow
.
tbButtonWidth
width
:
mainWindow
.
tbButtonWidth
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
exclusiveGroup
:
mainActionGroup
source
:
"
/qmlimages/PaperPlane.svg
"
source
:
"
/qmlimages/PaperPlane.svg
"
onClicked
:
toolBar
.
showFlyView
()
onClicked
:
toolBar
.
showFlyView
()
}
}
QGCToolBarButton
{
QGCToolBarButton
{
id
:
analyzeButton
id
:
analyzeButton
width
:
mainWindow
.
tbButtonWidth
width
:
mainWindow
.
tbButtonWidth
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
exclusiveGroup
:
mainActionGroup
source
:
"
/qmlimages/Analyze.svg
"
source
:
"
/qmlimages/Analyze.svg
"
visible
:
!
ScreenTools
.
isMobile
visible
:
!
ScreenTools
.
isMobile
onClicked
:
toolBar
.
showAnalyzeView
()
onClicked
:
toolBar
.
showAnalyzeView
()
}
}
}
}
Item
{
//-------------------------------------------------------------------------
id
:
vehicleIndicators
//-- Vehicle Selector
height
:
mainWindow
.
tbCellHeight
QGCButton
{
anchors.leftMargin
:
mainWindow
.
tbSpacing
*
2
id
:
vehicleSelectorButton
anchors.left
:
viewRow
.
right
width
:
ScreenTools
.
defaultFontPixelHeight
*
8
anchors.right
:
parent
.
right
text
:
"
Vehicle
"
+
(
activeVehicle
?
activeVehicle
.
id
:
"
None
"
)
anchors.verticalCenter
:
parent
.
verticalCenter
visible
:
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
>
1
anchors.verticalCenter
:
parent
.
verticalCenter
property
bool
vehicleConnectionLost
:
activeVehicle
?
activeVehicle
.
connectionLost
:
false
menu
:
vehicleMenu
Loader
{
Menu
{
id
:
indicatorLoader
id
:
vehicleMenu
source
:
activeVehicle
&&
!
parent
.
vehicleConnectionLost
?
"
MainToolBarIndicators.qml
"
:
""
}
anchors.left
:
parent
.
left
anchors.verticalCenter
:
parent
.
verticalCenter
}
QGCLabel
{
Component
{
id
:
connectionLost
id
:
vehicleMenuItemComponent
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
}
QGCButton
{
MenuItem
{
id
:
disconnectButton
checkable
:
true
anchors.rightMargin
:
mainWindow
.
tbSpacing
*
2
onTriggered
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
=
vehicle
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
property
int
vehicleId
:
Number
(
text
.
split
(
"
"
)[
1
])
text
:
qsTr
(
"
Disconnect
"
)
property
var
vehicle
:
QGroundControl
.
multiVehicleManager
.
getVehicleById
(
vehicleId
)
visible
:
parent
.
vehicleConnectionLost
}
primary
:
true
}
onClicked
:
activeVehicle
.
disconnectInactiveVehicle
()
}
property
var
vehicleMenuItems
:
[]
Image
{
function
updateVehicleMenu
()
{
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
// Remove old menu items
anchors.right
:
parent
.
right
for
(
var
i
=
0
;
i
<
vehicleMenuItems
.
length
;
i
++
)
{
anchors.top
:
parent
.
top
vehicleMenu
.
removeItem
(
vehicleMenuItems
[
i
])
anchors.bottom
:
parent
.
bottom
}
visible
:
x
>
indicatorLoader
.
x
+
indicatorLoader
.
width
&&
!
disconnectButton
.
visible
&&
source
!=
""
vehicleMenuItems
.
length
=
0
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
// Progress bar
...
...
src/ui/toolbar/MainToolBarIndicators.qml
View file @
1c7174f2
...
@@ -10,30 +10,26 @@
...
@@ -10,30 +10,26 @@
import
QtQuick
2.5
import
QtQuick
2.5
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
1.2
import
QtGraphicalEffects
1.0
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Dialogs
1.1
import
QGroundControl
1.0
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
MultiVehicleManager
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
Row
{
Item
{
spacing
:
tbSpacing
*
2
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_communicationLost
:
_activeVehicle
?
_activeVehicle
.
connectionLost
:
false
QGCPalette
{
id
:
qgcPal
}
//-------------------------------------------------------------------------
function
getMessageColor
()
{
function
getMessageColor
()
{
if
(
activeVehicle
)
{
if
(
_
activeVehicle
)
{
if
(
activeVehicle
.
messageTypeNone
)
if
(
_
activeVehicle
.
messageTypeNone
)
return
colorGrey
return
colorGrey
if
(
activeVehicle
.
messageTypeNormal
)
if
(
_
activeVehicle
.
messageTypeNormal
)
return
colorBlue
;
return
colorBlue
;
if
(
activeVehicle
.
messageTypeWarning
)
if
(
_
activeVehicle
.
messageTypeWarning
)
return
colorOrange
;
return
colorOrange
;
if
(
activeVehicle
.
messageTypeError
)
if
(
_
activeVehicle
.
messageTypeError
)
return
colorRed
;
return
colorRed
;
// Cannot be so make make it obnoxious to show error
// Cannot be so make make it obnoxious to show error
console
.
log
(
"
Invalid vehicle message type
"
)
console
.
log
(
"
Invalid vehicle message type
"
)
...
@@ -43,350 +39,312 @@ Row {
...
@@ -43,350 +39,312 @@ Row {
return
"
white
"
;
return
"
white
"
;
}
}
//-------------------------------------------------------------------------
function
getBatteryVoltageText
()
{
function
getBatteryVoltageText
()
{
if
(
activeVehicle
.
battery
.
voltage
.
value
>=
0
)
{
if
(
_
activeVehicle
.
battery
.
voltage
.
value
>=
0
)
{
return
activeVehicle
.
battery
.
voltage
.
valueString
+
activeVehicle
.
battery
.
voltage
.
units
return
_activeVehicle
.
battery
.
voltage
.
valueString
+
_
activeVehicle
.
battery
.
voltage
.
units
}
}
return
'
N/A
'
;
return
'
N/A
'
;
}
}
//-------------------------------------------------------------------------
function
getBatteryPercentageText
()
{
function
getBatteryPercentageText
()
{
if
(
activeVehicle
)
{
if
(
_
activeVehicle
)
{
if
(
activeVehicle
.
battery
.
percentRemaining
.
value
>
98.9
)
{
if
(
_
activeVehicle
.
battery
.
percentRemaining
.
value
>
98.9
)
{
return
"
100%
"
return
"
100%
"
}
}
if
(
activeVehicle
.
battery
.
percentRemaining
.
value
>
0.1
)
{
if
(
_
activeVehicle
.
battery
.
percentRemaining
.
value
>
0.1
)
{
return
activeVehicle
.
battery
.
percentRemaining
.
valueString
+
activeVehicle
.
battery
.
percentRemaining
.
units
return
_activeVehicle
.
battery
.
percentRemaining
.
valueString
+
_
activeVehicle
.
battery
.
percentRemaining
.
units
}
}
if
(
activeVehicle
.
battery
.
voltage
.
value
>=
0
)
{
if
(
_
activeVehicle
.
battery
.
voltage
.
value
>=
0
)
{
return
activeVehicle
.
battery
.
voltage
.
valueString
+
activeVehicle
.
battery
.
voltage
.
units
return
_activeVehicle
.
battery
.
voltage
.
valueString
+
_
activeVehicle
.
battery
.
voltage
.
units
}
}
}
}
return
"
N/A
"
return
"
N/A
"
}
}
//-------------------------------------------------------------------------
Row
{
//-- Message Indicator
id
:
indicatorRow
Item
{
anchors.top
:
parent
.
top
id
:
messages
anchors.bottom
:
parent
.
bottom
width
:
mainWindow
.
tbCellHeight
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
1.5
height
:
mainWindow
.
tbCellHeight
visible
:
!
_communicationLost
visible
:
activeVehicle
&&
activeVehicle
.
messageCount
anchors.verticalCenter
:
parent
.
verticalCenter
Item
{
id
:
criticalMessage
anchors.fill
:
parent
visible
:
activeVehicle
&&
activeVehicle
.
messageCount
>
0
&&
isMessageImportant
Image
{
source
:
"
/qmlimages/Yield.svg
"
height
:
mainWindow
.
tbCellHeight
*
0.75
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
cache
:
false
visible
:
isMessageImportant
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
Item
{
anchors.fill
:
parent
visible
:
!
criticalMessage
.
visible
QGCColoredImage
{
id
:
messageIcon
source
:
"
/qmlimages/Megaphone.svg
"
height
:
mainWindow
.
tbCellHeight
*
0.5
width
:
height
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
color
:
getMessageColor
()
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
mainWindow
.
showMessageArea
()
}
}
}
//-------------------------------------------------------------------------
QGCPalette
{
id
:
qgcPal
}
//-- GPS Indicator
Item
{
id
:
satelitte
width
:
(
gpsValuesColumn
.
x
+
gpsValuesColumn
.
width
)
*
1.1
height
:
mainWindow
.
tbCellHeight
QGCColoredImage
{
id
:
gpsIcon
source
:
"
/qmlimages/Gps.svg
"
fillMode
:
Image
.
PreserveAspectFit
width
:
mainWindow
.
tbCellHeight
*
0.65
height
:
mainWindow
.
tbCellHeight
*
0.5
sourceSize.height
:
height
opacity
:
(
activeVehicle
&&
activeVehicle
.
gps
.
count
.
value
>=
0
)
?
1
:
0.5
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
}
Column
{
//-------------------------------------------------------------------------
id
:
gpsValuesColumn
//-- Message Indicator
Item
{
id
:
messages
width
:
mainWindow
.
tbCellHeight
height
:
mainWindow
.
tbCellHeight
visible
:
_activeVehicle
&&
_activeVehicle
.
messageCount
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
Item
{
anchors.left
:
gpsIcon
.
right
id
:
criticalMessage
anchors.fill
:
parent
QGCLabel
{
visible
:
_activeVehicle
&&
_activeVehicle
.
messageCount
>
0
&&
isMessageImportant
anchors.horizontalCenter
:
hdopValue
.
horizontalCenter
Image
{
visible
:
activeVehicle
&&
!
isNaN
(
activeVehicle
.
gps
.
hdop
.
value
)
source
:
"
/qmlimages/Yield.svg
"
color
:
qgcPal
.
buttonText
height
:
mainWindow
.
tbCellHeight
*
0.75
text
:
activeVehicle
?
activeVehicle
.
gps
.
count
.
valueString
:
""
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
cache
:
false
visible
:
isMessageImportant
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
}
Item
{
QGCLabel
{
anchors.fill
:
parent
id
:
hdopValue
visible
:
!
criticalMessage
.
visible
visible
:
activeVehicle
&&
!
isNaN
(
activeVehicle
.
gps
.
hdop
.
value
)
QGCColoredImage
{
color
:
qgcPal
.
buttonText
id
:
messageIcon
text
:
activeVehicle
?
activeVehicle
.
gps
.
hdop
.
value
.
toFixed
(
1
)
:
""
source
:
"
/qmlimages/Megaphone.svg
"
height
:
mainWindow
.
tbCellHeight
*
0.5
width
:
height
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
color
:
getMessageColor
()
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
}
}
// Column
MouseArea
{
anchors.fill
:
parent
MouseArea
{
onClicked
:
{
anchors.fill
:
parent
mainWindow
.
showMessageArea
()
onClicked
:
{
}
var
centerX
=
mapToItem
(
toolBar
,
x
,
y
).
x
+
(
width
/
2
)
mainWindow
.
showPopUp
(
gpsInfo
,
centerX
)
}
}
}
}
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-- RC RSSI
//-- GPS Indicator
Item
{
Item
{
id
:
rcRssi
id
:
satelitte
width
:
rssiRow
.
width
*
1.1
width
:
(
gpsValuesColumn
.
x
+
gpsValuesColumn
.
width
)
*
1.1
height
:
mainWindow
.
tbCellHeight
height
:
mainWindow
.
tbCellHeight
visible
:
activeVehicle
?
activeVehicle
.
supportsRadio
:
true
Row
{
id
:
rssiRow
height
:
parent
.
height
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCColoredImage
{
QGCColoredImage
{
id
:
gpsIcon
source
:
"
/qmlimages/Gps.svg
"
fillMode
:
Image
.
PreserveAspectFit
width
:
mainWindow
.
tbCellHeight
*
0.65
width
:
mainWindow
.
tbCellHeight
*
0.65
height
:
width
height
:
mainWindow
.
tbCellHeight
*
0.5
sourceSize.height
:
height
sourceSize.height
:
height
source
:
"
/qmlimages/RC.svg
"
opacity
:
(
_activeVehicle
&&
_activeVehicle
.
gps
.
count
.
value
>=
0
)
?
1
:
0.5
fillMode
:
Image
.
PreserveAspectFit
opacity
:
activeVehicle
?
(((
activeVehicle
.
rcRSSI
<
0
)
||
(
activeVehicle
.
rcRSSI
>
100
))
?
0.5
:
1
)
:
0.5
color
:
qgcPal
.
buttonText
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
SignalStrength
{
size
:
mainWindow
.
tbCellHeight
*
0.5
Column
{
percent
:
activeVehicle
?
((
activeVehicle
.
rcRSSI
>
100
)
?
0
:
activeVehicle
.
rcRSSI
)
:
0
id
:
gpsValuesColumn
anchors.verticalCenter
:
parent
.
verticalCenter
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
)
:
""
}
}
// Column
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
var
centerX
=
mapToItem
(
toolBar
,
x
,
y
).
x
+
(
width
/
2
)
mainWindow
.
showPopUp
(
gpsInfo
,
centerX
)
}
}
}
}
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
var
centerX
=
mapToItem
(
toolBar
,
x
,
y
).
x
+
(
width
/
2
)
mainWindow
.
showPopUp
(
rcRSSIInfo
,
centerX
)
}
}
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-- Telemetry RSSI
//-- RC RSSI
Item
{
Item
{
id
:
telemRssi
id
:
rcRssi
width
:
telemIcon
.
width
width
:
rssiRow
.
width
*
1.1
height
:
mainWindow
.
tbCellHeight
height
:
mainWindow
.
tbCellHeight
visible
:
_controller
.
telemetryLRSSI
<
0
visible
:
_activeVehicle
?
_activeVehicle
.
supportsRadio
:
true
QGCColoredImage
{
Row
{
id
:
telemIcon
id
:
rssiRow
height
:
parent
.
height
*
0.5
height
:
parent
.
height
sourceSize.height
:
height
spacing
:
ScreenTools
.
defaultFontPixelWidth
width
:
height
*
1.5
QGCColoredImage
{
source
:
"
/qmlimages/TelemRSSI.svg
"
width
:
mainWindow
.
tbCellHeight
*
0.65
fillMode
:
Image
.
PreserveAspectFit
height
:
width
color
:
qgcPal
.
buttonText
sourceSize.height
:
height
anchors.verticalCenter
:
parent
.
verticalCenter
source
:
"
/qmlimages/RC.svg
"
}
fillMode
:
Image
.
PreserveAspectFit
MouseArea
{
opacity
:
_activeVehicle
?
(((
_activeVehicle
.
rcRSSI
<
0
)
||
(
_activeVehicle
.
rcRSSI
>
100
))
?
0.5
:
1
)
:
0.5
anchors.fill
:
parent
color
:
qgcPal
.
buttonText
onClicked
:
{
anchors.verticalCenter
:
parent
.
verticalCenter
var
centerX
=
mapToItem
(
toolBar
,
x
,
y
).
x
+
(
width
/
2
)
}
mainWindow
.
showPopUp
(
telemRSSIInfo
,
centerX
)
SignalStrength
{
size
:
mainWindow
.
tbCellHeight
*
0.5
percent
:
_activeVehicle
?
((
_activeVehicle
.
rcRSSI
>
100
)
?
0
:
_activeVehicle
.
rcRSSI
)
:
0
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
var
centerX
=
mapToItem
(
toolBar
,
x
,
y
).
x
+
(
width
/
2
)
mainWindow
.
showPopUp
(
rcRSSIInfo
,
centerX
)
}
}
}
}
}
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-- Battery Indicator
//-- Telemetry RSSI
Item
{
Item
{
id
:
batteryStatus
id
:
telemRssi
width
:
battRow
.
width
*
1.1
width
:
telemIcon
.
width
height
:
mainWindow
.
tbCellHeight
height
:
mainWindow
.
tbCellHeight
opacity
:
(
activeVehicle
&&
activeVehicle
.
battery
.
voltage
.
value
>=
0
)
?
1
:
0.5
visible
:
_controller
.
telemetryLRSSI
<
0
Row
{
id
:
battRow
height
:
mainWindow
.
tbCellHeight
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCColoredImage
{
QGCColoredImage
{
height
:
mainWindow
.
tbCellHeight
*
0.65
id
:
telemIcon
width
:
height
height
:
parent
.
height
*
0.5
sourceSize.width
:
width
sourceSize.height
:
height
source
:
"
/qmlimages/Battery.svg
"
width
:
height
*
1.5
source
:
"
/qmlimages/TelemRSSI.svg
"
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
color
:
qgcPal
.
text
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
}
QGCLabel
{
text
:
getBatteryPercentageText
()
font.pointSize
:
ScreenTools
.
mediumFontPointSize
color
:
getBatteryColor
()
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
}
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
if
(
activeVehicle
)
{
var
centerX
=
mapToItem
(
toolBar
,
x
,
y
).
x
+
(
width
/
2
)
var
centerX
=
mapToItem
(
toolBar
,
x
,
y
).
x
+
(
width
/
2
)
mainWindow
.
showPopUp
(
battery
Info
,
centerX
)
mainWindow
.
showPopUp
(
telemRSSI
Info
,
centerX
)
}
}
}
}
}
}
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-- Vehicle Selector
//-- Battery Indicator
QGCButton
{
Item
{
id
:
vehicleSelectorButton
id
:
batteryStatus
width
:
ScreenTools
.
defaultFontPixelHeight
*
8
width
:
battRow
.
width
*
1.1
text
:
"
Vehicle
"
+
(
activeVehicle
?
activeVehicle
.
id
:
"
None
"
)
height
:
mainWindow
.
tbCellHeight
visible
:
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
>
1
opacity
:
(
_activeVehicle
&&
_activeVehicle
.
battery
.
voltage
.
value
>=
0
)
?
1
:
0.5
anchors.verticalCenter
:
parent
.
verticalCenter
Row
{
id
:
battRow
menu
:
vehicleMenu
height
:
mainWindow
.
tbCellHeight
anchors.horizontalCenter
:
parent
.
horizontalCenter
Menu
{
QGCColoredImage
{
id
:
vehicleMenu
height
:
mainWindow
.
tbCellHeight
*
0.65
}
width
:
height
sourceSize.width
:
width
Component
{
source
:
"
/qmlimages/Battery.svg
"
id
:
vehicleMenuItemComponent
fillMode
:
Image
.
PreserveAspectFit
color
:
qgcPal
.
text
MenuItem
{
anchors.verticalCenter
:
parent
.
verticalCenter
checkable
:
true
}
onTriggered
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
=
vehicle
QGCLabel
{
text
:
getBatteryPercentageText
()
property
int
vehicleId
:
Number
(
text
.
split
(
"
"
)[
1
])
font.pointSize
:
ScreenTools
.
mediumFontPointSize
property
var
vehicle
:
QGroundControl
.
multiVehicleManager
.
getVehicleById
(
vehicleId
)
color
:
getBatteryColor
()
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
}
}
property
var
vehicleMenuItems
:
[]
function
updateVehicleMenu
()
{
MouseArea
{
// Remove old menu items
anchors.fill
:
parent
for
(
var
i
=
0
;
i
<
vehicleMenuItems
.
length
;
i
++
)
{
onClicked
:
mainWindow
.
showPopUp
(
batteryInfo
,
mapToItem
(
toolBar
,
x
,
y
).
x
+
(
width
/
2
))
vehicleMenu
.
removeItem
(
vehicleMenuItems
[
i
])
}
vehicleMenuItems
.
length
=
0
// 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
()
//-------------------------------------------------------------------------
//-- Mode Selector
Connections
{
QGCLabel
{
target
:
QGroundControl
.
multiVehicleManager
.
vehicles
id
:
flightModeSelector
onCountChanged
:
vehicleSelectorButton
.
updateVehicleMenu
()
text
:
_activeVehicle
?
_activeVehicle
.
flightMode
:
qsTr
(
"
N/A
"
,
"
No data to display
"
)
}
font.pointSize
:
ScreenTools
.
mediumFontPointSize
}
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
//-------------------------------------------------------------------------
//-- Mode Selector
Item
{
id
:
flightModeSelector
width
:
selectorRow
.
width
*
1.1
height
:
mainWindow
.
tbCellHeight
anchors.verticalCenter
:
parent
.
verticalCenter
Row
{
id
:
selectorRow
spacing
:
tbSpacing
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCLabel
{
Menu
{
text
:
activeVehicle
?
activeVehicle
.
flightMode
:
qsTr
(
"
N/A
"
,
"
No data to display
"
)
id
:
flightModesMenu
font.pointSize
:
ScreenTools
.
mediumFontPointSize
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
}
Menu
{
id
:
flightModesMenu
}
Component
{
Component
{
id
:
flightModeMenuItemComponent
id
:
flightModeMenuItemComponent
MenuItem
{
MenuItem
{
onTriggered
:
{
onTriggered
:
_activeVehicle
.
flightMode
=
text
if
(
activeVehicle
)
{
activeVehicle
.
flightMode
=
text
}
}
}
}
}
}
property
var
flightModesMenuItems
:
[]
property
var
flightModesMenuItems
:
[]
function
updateFlightModesMenu
()
{
function
updateFlightModesMenu
()
{
if
(
activeVehicle
.
flightModeSetAvailable
)
{
if
(
_activeVehicle
&&
_activeVehicle
.
flightModeSetAvailable
)
{
// Remove old menu items
// Remove old menu items
for
(
var
i
=
0
;
i
<
flightModesMenuItems
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
flightModesMenuItems
.
length
;
i
++
)
{
flightModesMenu
.
removeItem
(
flightModesMenuItems
[
i
])
flightModesMenu
.
removeItem
(
flightModesMenuItems
[
i
])
}
}
flightModesMenuItems
.
length
=
0
flightModesMenuItems
.
length
=
0
// Add new items
// Add new items
for
(
var
i
=
0
;
i
<
activeVehicle
.
flightModes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
_activeVehicle
.
flightModes
.
length
;
i
++
)
{
var
menuItem
=
flightModeMenuItemComponent
.
createObject
(
null
,
{
"
text
"
:
activeVehicle
.
flightModes
[
i
]
})
var
menuItem
=
flightModeMenuItemComponent
.
createObject
(
null
,
{
"
text
"
:
_activeVehicle
.
flightModes
[
i
]
})
flightModesMenuItems
.
push
(
menuItem
)
flightModesMenuItems
.
push
(
menuItem
)
flightModesMenu
.
insertItem
(
i
,
menuItem
)
flightModesMenu
.
insertItem
(
i
,
menuItem
)
}
}
}
}
}
}
Component
.
onCompleted
:
updateFlightModesMenu
()
Component.onCompleted
:
flightModeSelector
.
updateFlightModesMenu
()
Connections
{
Connections
{
target
:
QGroundControl
.
multiVehicleManager
target
:
QGroundControl
.
multiVehicleManager
onActiveVehicleChanged
:
flightModeSelector
.
updateFlightModesMenu
onActiveVehicleChanged
:
flightModeSelector
.
updateFlightModesMenu
()
}
}
MouseArea
{
MouseArea
{
visible
:
activeVehicle
?
activeVehicle
.
flightModeSetAvailable
:
false
visible
:
_activeVehicle
&&
_activeVehicle
.
flightModeSetAvailable
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
flightModesMenu
.
popup
()
flightModesMenu
.
popup
()
}
}
}
}
// QGCLabel - Flight mode selector
}
// Row - Vehicle indicators
Image
{
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
visible
:
x
>
indicatorRow
.
width
&&
!
_communicationLost
fillMode
:
Image
.
PreserveAspectFit
source
:
_activeVehicle
?
_activeVehicle
.
brandImage
:
""
}
}
}
Row
{
anchors.fill
:
parent
layoutDirection
:
Qt
.
RightToLeft
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_communicationLost
QGCButton
{
id
:
disconnectButton
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
qsTr
(
"
Disconnect
"
)
primary
:
true
onClicked
:
_activeVehicle
.
disconnectInactiveVehicle
()
}
QGCLabel
{
id
:
connectionLost
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
qsTr
(
"
COMMUNICATION LOST
"
)
font.pointSize
:
ScreenTools
.
largeFontPointSize
font.family
:
ScreenTools
.
demiboldFontFamily
color
:
colorRed
}
}
// Row - Communication lost
}
// Item
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