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
f62c8640
Unverified
Commit
f62c8640
authored
Aug 07, 2020
by
Don Gagne
Committed by
GitHub
Aug 07, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8972 from DonLakeFlyer/MainStatus
Fly: Move flight mode, vtol mode, armed into main status
parents
3543cd37
863e2abe
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
196 additions
and
91 deletions
+196
-91
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+0
-3
FlightModeMenu.qml
src/QmlControls/FlightModeMenu.qml
+7
-4
QGCMenu.qml
src/QmlControls/QGCMenu.qml
+1
-1
TrajectoryPoints.cc
src/Vehicle/TrajectoryPoints.cc
+0
-1
MainRootWindow.qml
src/ui/MainRootWindow.qml
+15
-15
BatteryIndicator.qml
src/ui/toolbar/BatteryIndicator.qml
+1
-1
GPSIndicator.qml
src/ui/toolbar/GPSIndicator.qml
+1
-1
GPSRTKIndicator.qml
src/ui/toolbar/GPSRTKIndicator.qml
+1
-1
JoystickIndicator.qml
src/ui/toolbar/JoystickIndicator.qml
+1
-1
MainStatusIndicator.qml
src/ui/toolbar/MainStatusIndicator.qml
+160
-53
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+5
-6
RCRSSIIndicator.qml
src/ui/toolbar/RCRSSIIndicator.qml
+1
-1
ROIIndicator.qml
src/ui/toolbar/ROIIndicator.qml
+2
-2
TelemetryRSSIIndicator.qml
src/ui/toolbar/TelemetryRSSIIndicator.qml
+1
-1
No files found.
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
f62c8640
...
...
@@ -320,9 +320,6 @@ const QVariantList& FirmwarePlugin::modeIndicators(const Vehicle*)
if
(
_modeIndicatorList
.
size
()
==
0
)
{
_modeIndicatorList
=
QVariantList
({
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ROIIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ArmedIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ModeIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/VTOLModeIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MultiVehicleSelector.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/LinkIndicator.qml"
)),
});
...
...
src/QmlControls/FlightModeMenu.qml
View file @
f62c8640
...
...
@@ -19,7 +19,8 @@ QGCLabel {
id
:
flightModeMenuLabel
text
:
currentVehicle
?
currentVehicle
.
flightMode
:
qsTr
(
"
N/A
"
,
"
No data to display
"
)
property
var
currentVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
currentVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
real
mouseAreaLeftMargin
:
0
QGCMenu
{
id
:
flightModesMenu
...
...
@@ -60,8 +61,10 @@ QGCLabel {
}
MouseArea
{
visible
:
currentVehicle
&&
currentVehicle
.
flightModeSetAvailable
anchors.fill
:
parent
onClicked
:
flightModesMenu
.
popup
()
id
:
mouseArea
visible
:
currentVehicle
&&
currentVehicle
.
flightModeSetAvailable
anchors.leftMargin
:
mouseAreaLeftMargin
anchors.fill
:
parent
onClicked
:
flightModesMenu
.
popup
()
}
}
src/QmlControls/QGCMenu.qml
View file @
f62c8640
//
QtQuick.Control 1.x
Menu
//
Use old QtQuick.Control 1.x Menu to work around bug in new Qml
Menu
import
QtQuick
2.6
import
QtQuick
.
Controls
1.4
...
...
src/Vehicle/TrajectoryPoints.cc
View file @
f62c8640
...
...
@@ -59,7 +59,6 @@ void TrajectoryPoints::start(void)
void
TrajectoryPoints
::
stop
(
void
)
{
qDebug
()
<<
"Stop"
<<
_points
.
count
();
disconnect
(
_vehicle
,
&
Vehicle
::
coordinateChanged
,
this
,
&
TrajectoryPoints
::
_vehicleCoordinateChanged
);
}
...
...
src/ui/MainRootWindow.qml
View file @
f62c8640
...
...
@@ -758,20 +758,20 @@ ApplicationWindow {
//-------------------------------------------------------------------------
//-- Indicator Popups
function
show
PopU
p
(
item
,
dropItem
)
{
indicator
Dropdown
.
currentIndicator
=
dropItem
indicator
Dropdown
.
currentItem
=
item
indicator
Dropdown
.
open
()
function
show
IndicatorPopu
p
(
item
,
dropItem
)
{
indicator
Popup
.
currentIndicator
=
dropItem
indicator
Popup
.
currentItem
=
item
indicator
Popup
.
open
()
}
function
hide
PopU
p
()
{
indicator
Dropdown
.
close
()
indicator
Dropdown
.
currentItem
=
null
indicator
Dropdown
.
currentIndicator
=
null
function
hide
IndicatorPopu
p
()
{
indicator
Popup
.
close
()
indicator
Popup
.
currentItem
=
null
indicator
Popup
.
currentIndicator
=
null
}
Popup
{
id
:
indicator
Dropdown
id
:
indicator
Popup
padding
:
ScreenTools
.
defaultFontPixelWidth
*
0.75
modal
:
true
focus
:
true
...
...
@@ -786,19 +786,19 @@ ApplicationWindow {
Loader
{
id
:
loader
onLoaded
:
{
var
centerX
=
mainWindow
.
contentItem
.
mapFromItem
(
indicator
Dropdown
.
currentItem
,
0
,
0
).
x
-
(
loader
.
width
*
0.5
)
if
((
centerX
+
indicator
Dropdown
.
width
)
>
(
mainWindow
.
width
-
ScreenTools
.
defaultFontPixelWidth
))
{
centerX
=
mainWindow
.
width
-
indicator
Dropdown
.
width
-
ScreenTools
.
defaultFontPixelWidth
var
centerX
=
mainWindow
.
contentItem
.
mapFromItem
(
indicator
Popup
.
currentItem
,
0
,
0
).
x
-
(
loader
.
width
*
0.5
)
if
((
centerX
+
indicator
Popup
.
width
)
>
(
mainWindow
.
width
-
ScreenTools
.
defaultFontPixelWidth
))
{
centerX
=
mainWindow
.
width
-
indicator
Popup
.
width
-
ScreenTools
.
defaultFontPixelWidth
}
indicator
Dropdown
.
x
=
centerX
indicator
Popup
.
x
=
centerX
}
}
onOpened
:
{
loader
.
sourceComponent
=
indicator
Dropdown
.
currentIndicator
loader
.
sourceComponent
=
indicator
Popup
.
currentIndicator
}
onClosed
:
{
loader
.
sourceComponent
=
null
indicator
Dropdown
.
currentIndicator
=
null
indicator
Popup
.
currentIndicator
=
null
}
}
}
src/ui/toolbar/BatteryIndicator.qml
View file @
f62c8640
...
...
@@ -120,7 +120,7 @@ Item {
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
mainWindow
.
show
PopU
p
(
_root
,
batteryInfo
)
mainWindow
.
show
IndicatorPopu
p
(
_root
,
batteryInfo
)
}
}
}
src/ui/toolbar/GPSIndicator.qml
View file @
f62c8640
...
...
@@ -109,7 +109,7 @@ Item {
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
mainWindow
.
show
PopU
p
(
_root
,
gpsInfo
)
mainWindow
.
show
IndicatorPopu
p
(
_root
,
gpsInfo
)
}
}
}
src/ui/toolbar/GPSRTKIndicator.qml
View file @
f62c8640
...
...
@@ -109,7 +109,7 @@ Item {
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
mainWindow
.
show
PopU
p
(
_root
,
gpsInfo
)
mainWindow
.
show
IndicatorPopu
p
(
_root
,
gpsInfo
)
}
}
}
src/ui/toolbar/JoystickIndicator.qml
View file @
f62c8640
...
...
@@ -91,7 +91,7 @@ Item {
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
mainWindow
.
show
PopU
p
(
_root
,
joystickInfo
)
mainWindow
.
show
IndicatorPopu
p
(
_root
,
joystickInfo
)
}
}
}
src/ui/toolbar/MainStatusIndicator.qml
View file @
f62c8640
...
...
@@ -16,57 +16,21 @@ import QGroundControl.MultiVehicleManager 1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
Item
{
id
:
_root
Layout.preferredWidth
:
mainStatusLabel
.
contentWidth
+
ScreenTools
.
defaultFontPixelWidth
RowLayout
{
id
:
_root
spacing
:
0
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
Component
{
id
:
mainStatusInfo
Rectangle
{
width
:
mainLayout
.
width
+
(
_margins
*
2
)
height
:
mainLayout
.
height
+
(
_margins
*
2
)
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
color
:
qgcPal
.
window
border.color
:
qgcPal
.
text
GridLayout
{
id
:
mainLayout
anchors.margins
:
_margins
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
rowSpacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
columnSpacing
:
rowSpacing
rows
:
_activeVehicle
.
sysStatusSensorInfo
.
sensorNames
.
length
flow
:
GridLayout
.
TopToBottom
Repeater
{
model
:
_activeVehicle
.
sysStatusSensorInfo
.
sensorNames
QGCLabel
{
text
:
modelData
}
}
Repeater
{
model
:
_activeVehicle
.
sysStatusSensorInfo
.
sensorStatus
QGCLabel
{
text
:
modelData
}
}
}
}
}
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_vehicleInAir
:
_activeVehicle
?
_activeVehicle
.
flying
||
_activeVehicle
.
landing
:
false
property
bool
_vtolInFWDFlight
:
_activeVehicle
?
_activeVehicle
.
vtolInFwdFlight
:
false
property
bool
_armed
:
_activeVehicle
?
_activeVehicle
.
armed
:
false
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
property
real
_spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
QGCLabel
{
id
:
mainStatusLabel
text
:
mainStatusText
()
font.pointSize
:
ScreenTools
.
largeFontPointSize
anchors.verticalCenter
:
parent
.
verticalCenter
id
:
mainStatusLabel
text
:
mainStatusText
()
font.pointSize
:
_vehicleInAir
?
ScreenTools
.
defaultFontPointSize
:
ScreenTools
.
largeFontPointSize
property
string
_commLostText
:
qsTr
(
"
Communication Lost
"
)
property
string
_readyToFlyText
:
qsTr
(
"
Ready To Fly
"
)
...
...
@@ -117,13 +81,156 @@ Item {
return
mainStatusLabel
.
_disconnectedText
}
}
MouseArea
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
height
:
_root
.
height
enabled
:
_activeVehicle
onClicked
:
mainWindow
.
showIndicatorPopup
(
mainStatusLabel
,
sensorStatusInfoComponent
)
}
}
Item
{
width
:
ScreenTools
.
defaultFontPixelWidth
height
:
1
}
QGCColoredImage
{
id
:
flightModeIcon
width
:
height
height
:
ScreenTools
.
defaultFontPixelHeight
*
0.75
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
color
:
qgcPal
.
text
source
:
"
/qmlimages/FlightModesComponentIcon.png
"
visible
:
_activeVehicle
}
Item
{
Layout.preferredWidth
:
ScreenTools
.
defaultFontPixelWidth
*
(
_vehicleInAir
?
ScreenTools
.
largeFontPointRatio
:
1
)
/
3
height
:
1
visible
:
flightModeMenu
.
visible
}
FlightModeMenu
{
id
:
flightModeMenu
Layout.preferredHeight
:
_root
.
height
verticalAlignment
:
Text
.
AlignVCenter
font.pointSize
:
_vehicleInAir
?
ScreenTools
.
largeFontPointSize
:
ScreenTools
.
defaultFontPointSize
mouseAreaLeftMargin
:
-
(
flightModeMenu
.
x
-
flightModeIcon
.
x
)
visible
:
_activeVehicle
}
Item
{
Layout.preferredWidth
:
ScreenTools
.
defaultFontPixelWidth
*
ScreenTools
.
largeFontPointRatio
height
:
1
visible
:
vtolModeLabel
.
visible
}
MouseArea
{
anchors.fill
:
parent
enabled
:
_activeVehicle
onClicked
:
{
mainWindow
.
showPopUp
(
_root
,
mainStatusInfo
)
QGCLabel
{
id
:
vtolModeLabel
Layout.preferredHeight
:
_root
.
height
verticalAlignment
:
Text
.
AlignVCenter
text
:
_vtolInFWDFlight
?
qsTr
(
"
FW(vtol)
"
)
:
qsTr
(
"
MR(vtol)
"
)
font.pointSize
:
ScreenTools
.
largeFontPointSize
visible
:
_activeVehicle
?
_activeVehicle
.
vtol
&&
_vehicleInAir
:
false
QGCMouseArea
{
anchors.fill
:
parent
onClicked
:
mainWindow
.
showIndicatorPopup
(
vtolModeLabel
,
vtolTransitionComponent
)
}
}
Component
{
id
:
sensorStatusInfoComponent
Rectangle
{
width
:
mainLayout
.
width
+
(
_margins
*
2
)
height
:
mainLayout
.
height
+
(
_margins
*
2
)
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
color
:
qgcPal
.
window
border.color
:
qgcPal
.
text
ColumnLayout
{
id
:
mainLayout
anchors.margins
:
_margins
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
spacing
:
_spacing
QGCLabel
{
Layout.alignment
:
Qt
.
AlignHCenter
text
:
qsTr
(
"
Sensor Status
"
)
}
GridLayout
{
rowSpacing
:
_spacing
columnSpacing
:
_spacing
rows
:
_activeVehicle
.
sysStatusSensorInfo
.
sensorNames
.
length
flow
:
GridLayout
.
TopToBottom
Repeater
{
model
:
_activeVehicle
.
sysStatusSensorInfo
.
sensorNames
QGCLabel
{
text
:
modelData
}
}
Repeater
{
model
:
_activeVehicle
.
sysStatusSensorInfo
.
sensorStatus
QGCLabel
{
text
:
modelData
}
}
}
QGCButton
{
Layout.alignment
:
Qt
.
AlignHCenter
text
:
_armed
?
qsTr
(
"
Disarm
"
)
:
qsTr
(
"
Arm
"
)
onClicked
:
{
if
(
_armed
)
{
mainWindow
.
disarmVehicleRequest
()
}
else
{
mainWindow
.
armVehicleRequest
()
}
mainWindow
.
hideIndicatorPopup
()
}
}
}
}
}
Component
{
id
:
vtolTransitionComponent
Rectangle
{
width
:
mainLayout
.
width
+
(
_margins
*
2
)
height
:
mainLayout
.
height
+
(
_margins
*
2
)
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
color
:
qgcPal
.
window
border.color
:
qgcPal
.
text
QGCButton
{
id
:
mainLayout
anchors.margins
:
_margins
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
text
:
_vtolInFWDFlight
?
qsTr
(
"
Transition to Multi-Rotor
"
)
:
qsTr
(
"
Transition to Fixed Wing
"
)
onClicked
:
{
if
(
_vtolInFWDFlight
)
{
mainWindow
.
vtolTransitionToMRFlightRequest
()
}
else
{
mainWindow
.
vtolTransitionToFwdFlightRequest
()
}
mainWindow
.
hideIndicatorPopup
()
}
}
}
}
}
src/ui/toolbar/MainToolBar.qml
View file @
f62c8640
...
...
@@ -87,19 +87,18 @@ Rectangle {
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
QGCToolBarButton
{
id
:
currentButton
Layout.
fillHeight
:
true
onClicked
:
viewSelectDrawer
.
visible
=
true
id
:
currentButton
Layout.
preferredHeight
:
viewButtonRow
.
height
onClicked
:
viewSelectDrawer
.
visible
=
true
}
MainStatusIndicator
{
Layout.
fillHeight
:
true
visible
:
currentToolbar
===
flyViewToolbar
Layout.
preferredHeight
:
viewButtonRow
.
height
visible
:
currentToolbar
===
flyViewToolbar
}
QGCButton
{
id
:
disconnectButton
Layout.alignment
:
Qt
.
AlignVCenter
text
:
qsTr
(
"
Disconnect
"
)
onClicked
:
_activeVehicle
.
disconnectInactiveVehicle
()
visible
:
_activeVehicle
&&
_communicationLost
&&
currentToolbar
===
flyViewToolbar
...
...
src/ui/toolbar/RCRSSIIndicator.qml
View file @
f62c8640
...
...
@@ -95,7 +95,7 @@ Item {
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
mainWindow
.
show
PopU
p
(
_root
,
rcRSSIInfo
)
mainWindow
.
show
IndicatorPopu
p
(
_root
,
rcRSSIInfo
)
}
}
}
src/ui/toolbar/ROIIndicator.qml
View file @
f62c8640
...
...
@@ -61,7 +61,7 @@ Item {
onClicked
:
{
if
(
activeVehicle
)
activeVehicle
.
stopGuidedModeROI
()
mainWindow
.
hide
PopU
p
()
mainWindow
.
hide
IndicatorPopu
p
()
}
}
}
...
...
@@ -83,7 +83,7 @@ Item {
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
mainWindow
.
show
PopU
p
(
_root
,
roiInfo
)
mainWindow
.
show
IndicatorPopu
p
(
_root
,
roiInfo
)
}
}
}
src/ui/toolbar/TelemetryRSSIIndicator.qml
View file @
f62c8640
...
...
@@ -86,7 +86,7 @@ Item {
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
mainWindow
.
show
PopU
p
(
_root
,
telemRSSIInfo
)
mainWindow
.
show
IndicatorPopu
p
(
_root
,
telemRSSIInfo
)
}
}
}
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