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
6e280eeb
Commit
6e280eeb
authored
Aug 06, 2020
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
View change done using Drawer
parent
d2f97086
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
201 additions
and
153 deletions
+201
-153
QGCControlDebug.qml
src/QmlControls/QGCControlDebug.qml
+3
-2
SubMenuButton.qml
src/QmlControls/SubMenuButton.qml
+2
-1
Vehicle.cc
src/Vehicle/Vehicle.cc
+31
-27
MainRootWindow.qml
src/ui/MainRootWindow.qml
+158
-0
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+7
-123
No files found.
src/QmlControls/QGCControlDebug.qml
View file @
6e280eeb
...
@@ -16,10 +16,11 @@ Rectangle {
...
@@ -16,10 +16,11 @@ Rectangle {
color
:
"
transparent
"
color
:
"
transparent
"
property
string
name
property
string
name
property
color
borderColor
property
color
borderColor
:
"
red
"
function
logEverything
()
{
function
logEverything
()
{
console
.
log
(
qsTr
(
"
%1 x:%2 y:%3 width:%4 height:%5 visible: %6 enabled: %7 z:%8 parent:%9 implicitWidth/Height:%10:%11
"
,
"
Do not translate
"
).
arg
(
name
).
arg
(
parent
.
x
).
arg
(
parent
.
y
).
arg
(
parent
.
width
).
arg
(
parent
.
height
).
arg
(
parent
.
visible
).
arg
(
parent
.
enabled
).
arg
(
parent
.
z
).
arg
(
parent
.
parent
))
console
.
log
(
qsTr
(
"
%1 x:%2 y:%3 width:%4 height:%5 visible:%6 enabled:%7 z:%8 parent:%9 implicitWidth/Height:%10:%11
"
,
"
Do not translate
"
)
.
arg
(
name
).
arg
(
parent
.
x
).
arg
(
parent
.
y
).
arg
(
parent
.
width
).
arg
(
parent
.
height
).
arg
(
parent
.
visible
).
arg
(
parent
.
enabled
).
arg
(
parent
.
z
).
arg
(
parent
.
parent
).
arg
(
implicitHeight
).
arg
(
implicitWidth
))
}
}
Component.onCompleted
:
logEverything
()
Component.onCompleted
:
logEverything
()
...
...
src/QmlControls/SubMenuButton.qml
View file @
6e280eeb
...
@@ -13,6 +13,7 @@ Button {
...
@@ -13,6 +13,7 @@ Button {
id
:
_rootButton
id
:
_rootButton
property
bool
setupComplete
:
true
///< true: setup complete indicator shows as completed
property
bool
setupComplete
:
true
///< true: setup complete indicator shows as completed
property
bool
setupIndicator
:
true
///< true: show setup complete indicator
property
bool
setupIndicator
:
true
///< true: show setup complete indicator
property
var
imageColor
:
undefined
property
string
imageResource
:
"
/qmlimages/subMenuButtonImage.png
"
///< Button image
property
string
imageResource
:
"
/qmlimages/subMenuButtonImage.png
"
///< Button image
property
size
sourceSize
:
Qt
.
size
(
ScreenTools
.
defaultFontPixelHeight
*
2
,
ScreenTools
.
defaultFontPixelHeight
*
2
)
property
size
sourceSize
:
Qt
.
size
(
ScreenTools
.
defaultFontPixelHeight
*
2
,
ScreenTools
.
defaultFontPixelHeight
*
2
)
...
@@ -49,7 +50,7 @@ Button {
...
@@ -49,7 +50,7 @@ Button {
height
:
ScreenTools
.
defaultFontPixelHeight
*
2
height
:
ScreenTools
.
defaultFontPixelHeight
*
2
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
mipmap
:
true
color
:
control
.
setupComplete
?
qgcPal
.
button
:
"
red
"
color
:
imageColor
?
imageColor
:
(
control
.
setupComplete
?
qgcPal
.
button
:
"
red
"
)
source
:
control
.
imageResource
source
:
control
.
imageResource
sourceSize
:
_rootButton
.
sourceSize
sourceSize
:
_rootButton
.
sourceSize
}
}
...
...
src/Vehicle/Vehicle.cc
View file @
6e280eeb
...
@@ -3584,36 +3584,40 @@ QStringList Vehicle::unhealthySensors() const
...
@@ -3584,36 +3584,40 @@ QStringList Vehicle::unhealthySensors() const
struct
sensorInfo_s
{
struct
sensorInfo_s
{
uint32_t
bit
;
uint32_t
bit
;
const
char
*
sensorName
;
QString
sensorName
;
};
};
static
const
sensorInfo_s
rgSensorInfo
[]
=
{
static
const
sensorInfo_s
rgSensorInfo
[]
=
{
{
MAV_SYS_STATUS_SENSOR_3D_GYRO
,
"Gyro"
},
{
MAV_SYS_STATUS_SENSOR_3D_GYRO
,
tr
(
"Gyro"
)
},
{
MAV_SYS_STATUS_SENSOR_3D_ACCEL
,
"Accelerometer"
},
{
MAV_SYS_STATUS_SENSOR_3D_ACCEL
,
tr
(
"Accelerometer"
)
},
{
MAV_SYS_STATUS_SENSOR_3D_MAG
,
"Magnetometer"
},
{
MAV_SYS_STATUS_SENSOR_3D_MAG
,
tr
(
"Magnetometer"
)
},
{
MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE
,
"Absolute pressure"
},
{
MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE
,
tr
(
"Absolute pressure"
)
},
{
MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE
,
"Differential pressure"
},
{
MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE
,
tr
(
"Differential pressure"
)
},
{
MAV_SYS_STATUS_SENSOR_GPS
,
"GPS"
},
{
MAV_SYS_STATUS_SENSOR_GPS
,
tr
(
"GPS"
)
},
{
MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW
,
"Optical flow"
},
{
MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW
,
tr
(
"Optical flow"
)
},
{
MAV_SYS_STATUS_SENSOR_VISION_POSITION
,
"Computer vision position"
},
{
MAV_SYS_STATUS_SENSOR_VISION_POSITION
,
tr
(
"Computer vision position"
)
},
{
MAV_SYS_STATUS_SENSOR_LASER_POSITION
,
"Laser based position"
},
{
MAV_SYS_STATUS_SENSOR_LASER_POSITION
,
tr
(
"Laser based position"
)
},
{
MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH
,
"External ground truth"
},
{
MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH
,
tr
(
"External ground truth"
)
},
{
MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL
,
"Angular rate control"
},
{
MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL
,
tr
(
"Angular rate control"
)
},
{
MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION
,
"Attitude stabilization"
},
{
MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION
,
tr
(
"Attitude stabilization"
)
},
{
MAV_SYS_STATUS_SENSOR_YAW_POSITION
,
"Yaw position"
},
{
MAV_SYS_STATUS_SENSOR_YAW_POSITION
,
tr
(
"Yaw position"
)
},
{
MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL
,
"Z/altitude control"
},
{
MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL
,
tr
(
"Z/altitude control"
)
},
{
MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL
,
"X/Y position control"
},
{
MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL
,
tr
(
"X/Y position control"
)
},
{
MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS
,
"Motor outputs / control"
},
{
MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS
,
tr
(
"Motor outputs / control"
)
},
{
MAV_SYS_STATUS_SENSOR_RC_RECEIVER
,
"RC receiver"
},
{
MAV_SYS_STATUS_SENSOR_RC_RECEIVER
,
tr
(
"RC receiver"
)
},
{
MAV_SYS_STATUS_SENSOR_3D_GYRO2
,
"Gyro 2"
},
{
MAV_SYS_STATUS_SENSOR_3D_GYRO2
,
tr
(
"Gyro 2"
)
},
{
MAV_SYS_STATUS_SENSOR_3D_ACCEL2
,
"Accelerometer 2"
},
{
MAV_SYS_STATUS_SENSOR_3D_ACCEL2
,
tr
(
"Accelerometer 2"
)
},
{
MAV_SYS_STATUS_SENSOR_3D_MAG2
,
"Magnetometer 2"
},
{
MAV_SYS_STATUS_SENSOR_3D_MAG2
,
tr
(
"Magnetometer 2"
)
},
{
MAV_SYS_STATUS_GEOFENCE
,
"GeoFence"
},
{
MAV_SYS_STATUS_GEOFENCE
,
tr
(
"GeoFence"
)
},
{
MAV_SYS_STATUS_AHRS
,
"AHRS"
},
{
MAV_SYS_STATUS_AHRS
,
tr
(
"AHRS"
)
},
{
MAV_SYS_STATUS_TERRAIN
,
"Terrain"
},
{
MAV_SYS_STATUS_TERRAIN
,
tr
(
"Terrain"
)
},
{
MAV_SYS_STATUS_REVERSE_MOTOR
,
"Motors reversed"
},
{
MAV_SYS_STATUS_REVERSE_MOTOR
,
tr
(
"Motors reversed"
)
},
{
MAV_SYS_STATUS_LOGGING
,
"Logging"
},
{
MAV_SYS_STATUS_LOGGING
,
tr
(
"Logging"
)
},
{
MAV_SYS_STATUS_SENSOR_BATTERY
,
"Battery"
},
{
MAV_SYS_STATUS_SENSOR_BATTERY
,
tr
(
"Battery"
)
},
{
MAV_SYS_STATUS_SENSOR_PROXIMITY
,
tr
(
"Proximity"
)
},
{
MAV_SYS_STATUS_SENSOR_SATCOM
,
tr
(
"Satellite Communication"
)
},
{
MAV_SYS_STATUS_PREARM_CHECK
,
tr
(
"Pre-Arm Check"
)
},
{
MAV_SYS_STATUS_OBSTACLE_AVOIDANCE
,
tr
(
"Avoidance/collision prevention"
)
},
};
};
for
(
size_t
i
=
0
;
i
<
sizeof
(
rgSensorInfo
)
/
sizeof
(
sensorInfo_s
);
i
++
)
{
for
(
size_t
i
=
0
;
i
<
sizeof
(
rgSensorInfo
)
/
sizeof
(
sensorInfo_s
);
i
++
)
{
...
...
src/ui/MainRootWindow.qml
View file @
6e280eeb
...
@@ -325,6 +325,164 @@ ApplicationWindow {
...
@@ -325,6 +325,164 @@ ApplicationWindow {
visible
:
QGroundControl
.
settingsManager
.
flyViewSettings
.
showLogReplayStatusBar
.
rawValue
visible
:
QGroundControl
.
settingsManager
.
flyViewSettings
.
showLogReplayStatusBar
.
rawValue
}
}
Drawer
{
id
:
viewSelectDrawer
height
:
mainWindow
.
height
edge
:
Qt
.
LeftEdge
interactive
:
true
dragMargin
:
0
visible
:
false
property
var
_mainWindow
:
mainWindow
property
real
_toolButtonHeight
:
ScreenTools
.
defaultFontPixelHeight
*
3
Rectangle
{
width
:
mainLayout
.
width
+
(
mainLayout
.
anchors
.
margins
*
2
)
height
:
parent
.
height
color
:
qgcPal
.
window
QGCFlickable
{
anchors.top
:
parent
.
top
anchors.bottom
:
qgcVersionLayout
.
top
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
contentHeight
:
mainLayout
.
height
+
(
mainLayout
.
anchors
.
margins
*
2
)
flickableDirection
:
QGCFlickable
.
VerticalFlick
ColumnLayout
{
id
:
mainLayout
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
spacing
:
ScreenTools
.
defaultFontPixelWidth
SubMenuButton
{
id
:
flyButton
height
:
viewSelectDrawer
.
_toolButtonHeight
Layout.fillWidth
:
true
text
:
qsTr
(
"
Fly View
"
)
imageResource
:
"
/qmlimages/PaperPlane.svg
"
imageColor
:
qgcPal
.
text
onClicked
:
{
if
(
toolbar
.
viewButtonClicked
(
this
))
{
mainWindow
.
showFlyView
()
}
}
}
SubMenuButton
{
id
:
planButton
height
:
viewSelectDrawer
.
_toolButtonHeight
Layout.fillWidth
:
true
text
:
qsTr
(
"
Plan View
"
)
imageResource
:
"
/qmlimages/Plan.svg
"
imageColor
:
qgcPal
.
text
onClicked
:
{
if
(
toolbar
.
viewButtonClicked
(
this
))
{
mainWindow
.
showPlanView
()
}
}
}
SubMenuButton
{
id
:
analyzeButton
height
:
viewSelectDrawer
.
_toolButtonHeight
Layout.fillWidth
:
true
text
:
qsTr
(
"
Analyze Tools
"
)
imageResource
:
"
/qmlimages/Analyze.svg
"
imageColor
:
qgcPal
.
text
visible
:
QGroundControl
.
corePlugin
.
showAdvancedUI
onClicked
:
{
if
(
toolbar
.
viewButtonClicked
(
this
))
{
mainWindow
.
showAnalyzeView
()
}
}
}
SubMenuButton
{
id
:
setupButton
height
:
viewSelectDrawer
.
_toolButtonHeight
Layout.fillWidth
:
true
text
:
qsTr
(
"
Vehicle Setup
"
)
imageColor
:
qgcPal
.
text
imageResource
:
"
/qmlimages/Gears.svg
"
onClicked
:
{
if
(
toolbar
.
viewButtonClicked
(
this
))
{
mainWindow
.
showSetupView
()
}
}
}
SubMenuButton
{
id
:
settingsButton
height
:
viewSelectDrawer
.
_toolButtonHeight
Layout.fillWidth
:
true
text
:
qsTr
(
"
Application Settings
"
)
imageResource
:
"
/res/QGCLogoFull
"
imageColor
:
"
transparent
"
visible
:
!
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
onClicked
:
{
if
(
toolbar
.
viewButtonClicked
(
this
))
{
mainWindow
.
showSettingsView
()
}
}
}
}
}
ColumnLayout
{
id
:
qgcVersionLayout
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
spacing
:
0
QGCLabel
{
text
:
qsTr
(
"
%1 Version
"
).
arg
(
QGroundControl
.
appName
)
font.pointSize
:
ScreenTools
.
smallFontPointSize
wrapMode
:
QGCLabel
.
WordWrap
Layout.maximumWidth
:
parent
.
width
Layout.alignment
:
Qt
.
AlignHCenter
}
QGCLabel
{
text
:
QGroundControl
.
qgcVersion
font.pointSize
:
ScreenTools
.
smallFontPointSize
wrapMode
:
QGCLabel
.
WrapAnywhere
Layout.maximumWidth
:
parent
.
width
Layout.alignment
:
Qt
.
AlignHCenter
}
}
QGCMouseArea
{
anchors.fill
:
qgcVersionLayout
onClicked
:
{
if
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
{
QGroundControl
.
corePlugin
.
showTouchAreas
=
!
QGroundControl
.
corePlugin
.
showTouchAreas
}
else
{
if
(
!
QGroundControl
.
corePlugin
.
showAdvancedUI
)
{
advancedModeConfirmation
.
open
()
}
else
{
QGroundControl
.
corePlugin
.
showAdvancedUI
=
false
}
}
}
MessageDialog
{
id
:
advancedModeConfirmation
title
:
qsTr
(
"
Advanced Mode
"
)
text
:
QGroundControl
.
corePlugin
.
showAdvancedUIMessage
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onYes
:
{
QGroundControl
.
corePlugin
.
showAdvancedUI
=
true
advancedModeConfirmation
.
close
()
}
}
}
}
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
/// Fly View
/// Fly View
FlyView
{
FlyView
{
...
...
src/ui/toolbar/MainToolBar.qml
View file @
6e280eeb
...
@@ -32,16 +32,15 @@ Rectangle {
...
@@ -32,16 +32,15 @@ Rectangle {
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_communicationLost
:
_activeVehicle
?
_activeVehicle
.
connectionLost
:
false
property
bool
_communicationLost
:
_activeVehicle
?
_activeVehicle
.
connectionLost
:
false
Component.onCompleted
:
_
viewButtonClicked
(
flyButton
)
Component.onCompleted
:
toolbar
.
viewButtonClicked
(
flyButton
)
function
_
viewButtonClicked
(
button
)
{
function
viewButtonClicked
(
button
)
{
if
(
mainWindow
.
preventViewSwitch
())
{
if
(
mainWindow
.
preventViewSwitch
())
{
return
false
return
false
}
}
viewButtonSelectRow
.
visible
=
false
viewSelectDrawer
.
visible
=
false
buttonSelectHideTimer
.
stop
()
currentButton
.
icon
.
source
=
button
.
imageResource
currentButton
.
icon
.
source
=
button
.
icon
.
source
currentButton
.
logo
=
button
.
imageColor
==
"
transparent
"
currentButton
.
logo
=
button
.
logo
return
true
return
true
}
}
...
@@ -50,7 +49,7 @@ Rectangle {
...
@@ -50,7 +49,7 @@ Rectangle {
target
:
setupWindow
target
:
setupWindow
onVisibleChanged
:
{
onVisibleChanged
:
{
if
(
setupWindow
.
visible
)
{
if
(
setupWindow
.
visible
)
{
_
viewButtonClicked
(
setupButton
)
toolbar
.
viewButtonClicked
(
setupButton
)
}
}
}
}
}
}
...
@@ -77,122 +76,7 @@ Rectangle {
...
@@ -77,122 +76,7 @@ Rectangle {
QGCToolBarButton
{
QGCToolBarButton
{
id
:
currentButton
id
:
currentButton
Layout.fillHeight
:
true
Layout.fillHeight
:
true
visible
:
!
viewButtonSelectRow
.
visible
onClicked
:
viewSelectDrawer
.
visible
=
true
onClicked
:
{
viewButtonSelectRow
.
visible
=
!
viewButtonSelectRow
.
visible
if
(
viewButtonSelectRow
.
visible
)
{
buttonSelectHideTimer
.
start
()
}
else
{
buttonSelectHideTimer
.
stop
()
}
}
}
//---------------------------------------------
// Toolbar Row
RowLayout
{
id
:
viewButtonSelectRow
Layout.fillHeight
:
true
spacing
:
0
visible
:
false
Timer
{
id
:
buttonSelectHideTimer
interval
:
5000
repeat
:
false
onTriggered
:
viewButtonSelectRow
.
visible
=
false
}
QGCToolBarButton
{
id
:
settingsButton
Layout.fillHeight
:
true
icon.source
:
"
/res/QGCLogoFull
"
logo
:
true
visible
:
!
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showSettingsView
()
}
}
}
QGCToolBarButton
{
id
:
setupButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Gears.svg
"
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showSetupView
()
}
}
}
QGCToolBarButton
{
id
:
planButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Plan.svg
"
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showPlanView
()
}
}
}
QGCToolBarButton
{
id
:
flyButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/PaperPlane.svg
"
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showFlyView
()
// Easter Egg mechanism
_clickCount
++
eggTimer
.
restart
()
if
(
_clickCount
==
5
)
{
if
(
!
QGroundControl
.
corePlugin
.
showAdvancedUI
)
{
advancedModeConfirmation
.
open
()
}
else
{
QGroundControl
.
corePlugin
.
showAdvancedUI
=
false
}
}
else
if
(
_clickCount
==
7
)
{
QGroundControl
.
corePlugin
.
showTouchAreas
=
!
QGroundControl
.
corePlugin
.
showTouchAreas
}
}
}
property
int
_clickCount
:
0
Timer
{
id
:
eggTimer
interval
:
1000
repeat
:
false
onTriggered
:
parent
.
_clickCount
=
0
}
MessageDialog
{
id
:
advancedModeConfirmation
title
:
qsTr
(
"
Advanced Mode
"
)
text
:
QGroundControl
.
corePlugin
.
showAdvancedUIMessage
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onYes
:
{
QGroundControl
.
corePlugin
.
showAdvancedUI
=
true
advancedModeConfirmation
.
close
()
}
}
}
QGCToolBarButton
{
id
:
analyzeButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Analyze.svg
"
visible
:
QGroundControl
.
corePlugin
.
showAdvancedUI
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showAnalyzeView
()
}
}
}
}
}
}
}
...
...
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