Commit 5efd09f9 authored by Don Gagne's avatar Don Gagne

Boot performance

Mostly accomplished by delay loading Qml elements
parent 9417909f
...@@ -64,9 +64,11 @@ DEFINES += NOMINMAX ...@@ -64,9 +64,11 @@ DEFINES += NOMINMAX
# #
# [REQUIRED] QWT plotting library dependency. Provides plotting capabilities. # [REQUIRED] QWT plotting library dependency. Provides plotting capabilities.
# #
!MobileBuild {
include(libs/qwt.pri) include(libs/qwt.pri)
DEPENDPATH += libs/qwt DEPENDPATH += libs/qwt
INCLUDEPATH += libs/qwt INCLUDEPATH += libs/qwt
}
# #
# [OPTIONAL] XBee wireless support. This is not necessary for basic serial/UART communications. # [OPTIONAL] XBee wireless support. This is not necessary for basic serial/UART communications.
......
...@@ -123,8 +123,9 @@ ...@@ -123,8 +123,9 @@
<!-- Main Window --> <!-- Main Window -->
<file alias="MainWindow.qml">src/ui/MainWindow.qml</file> <file alias="MainWindow.qml">src/ui/MainWindow.qml</file>
<file alias="MainWindowDelayLoad.qml">src/ui/MainWindowDelayLoad.qml</file>
<file alias="QGroundControl/Controls/MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file> <file alias="QGroundControl/Controls/MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file>
<file alias="QGroundControl/Controls/FlightDisplayView.qml">src/FlightDisplay/FlightDisplayView.qml</file> <file alias="MainToolBarActiveVehicleComponent.qml">src/ui/toolbar/MainToolBarActiveVehicleComponent.qml</file>
<!-- Vehicle Setup --> <!-- Vehicle Setup -->
<file alias="SetupView.qml">src/VehicleSetup/SetupView.qml</file> <file alias="SetupView.qml">src/VehicleSetup/SetupView.qml</file>
...@@ -152,6 +153,13 @@ ...@@ -152,6 +153,13 @@
<file alias="FlightDisplayWidget.qml">src/FlightDisplay/FlightDisplayWidget.qml</file> <file alias="FlightDisplayWidget.qml">src/FlightDisplay/FlightDisplayWidget.qml</file>
<file alias="MissionEditor.qml">src/MissionEditor/MissionEditor.qml</file> <file alias="MissionEditor.qml">src/MissionEditor/MissionEditor.qml</file>
<!-- FlightDisplay module -->
<file alias="QGroundControl/FlightDisplay/qmldir">src/FlightDisplay/qmldir</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayView.qml">src/FlightDisplay/FlightDisplayView.qml</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayViewDelayLoadInner.qml">src/FlightDisplay/FlightDisplayViewDelayLoadInner.qml</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayViewDelayLoadOuter.qml">src/FlightDisplay/FlightDisplayViewDelayLoadOuter.qml</file>
<!-- FlightMap module --> <!-- FlightMap module -->
<file alias="QGroundControl/FlightMap/qmldir">src/FlightMap/qmldir</file> <file alias="QGroundControl/FlightMap/qmldir">src/FlightMap/qmldir</file>
<file alias="QGroundControl/FlightMap/FlightMap.qml">src/FlightMap/FlightMap.qml</file> <file alias="QGroundControl/FlightMap/FlightMap.qml">src/FlightMap/FlightMap.qml</file>
......
This diff is collapsed.
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.2
import QtQuick.Dialogs 1.2
import QtLocation 5.3
import QtPositioning 5.2
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0
import QGroundControl.FlightMap 1.0
/// This component is used to delay load the controls which are children of the inner FlightMap
/// control of FlightDisplayView.
// Vehicle GPS lock display
Item {
Column {
id: gpsLockColumn
y: (parent.height - height) / 2
width: parent.width
Repeater {
model: multiVehicleManager.vehicles
delegate:
QGCLabel {
width: gpsLockColumn.width
horizontalAlignment: Text.AlignHCenter
visible: object.satelliteLock < 2
text: "No GPS Lock for Vehicle #" + object.id
z: flightMap.zOrderMapItems - 2
}
}
}
QGCCompassWidget {
anchors.leftMargin: ScreenTools.defaultFontPixelHeight
anchors.topMargin: topMargin
anchors.left: parent.left
anchors.top: parent.top
size: ScreenTools.defaultFontPixelSize * (13.3)
heading: _heading
active: multiVehicleManager.activeVehicleAvailable
z: flightMap.zOrderWidgets
}
QGCAttitudeWidget {
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.left: parent.left
anchors.bottom: parent.bottom
size: ScreenTools.defaultFontPixelSize * (13.3)
rollAngle: _roll
pitchAngle: _pitch
active: multiVehicleManager.activeVehicleAvailable
z: flightMap.zOrderWidgets
}
DropButton {
id: centerMapDropButton
anchors.rightMargin: ScreenTools.defaultFontPixelHeight
anchors.right: mapTypeButton.left
anchors.top: mapTypeButton.top
dropDirection: dropDown
buttonImage: "/qmlimages/MapCenter.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup
z: flightMap.zOrderWidgets
dropDownComponent: Component {
Row {
spacing: ScreenTools.defaultFontPixelWidth
QGCCheckBox {
id: followVehicleCheckBox
text: "Follow Vehicle"
checked: flightMap._followVehicle
anchors.baseline: centerMapButton.baseline
onClicked: {
centerMapDropButton.hideDropDown()
flightMap._followVehicle = !flightMap._followVehicle
}
}
QGCButton {
id: centerMapButton
text: "Center map on Vehicle"
enabled: _activeVehicle && !followVehicleCheckBox.checked
property var activeVehicle: multiVehicleManager.activeVehicle
onClicked: {
centerMapDropButton.hideDropDown()
flightMap.latitude = activeVehicle.latitude
flightMap.longitude = activeVehicle.longitude
}
}
}
}
}
DropButton {
id: mapTypeButton
anchors.topMargin: topMargin
anchors.rightMargin: ScreenTools.defaultFontPixelHeight
anchors.top: parent.top
anchors.right: parent.right
dropDirection: dropDown
buttonImage: "/qmlimages/MapType.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup
z: flightMap.zOrderWidgets
dropDownComponent: Component {
Row {
spacing: ScreenTools.defaultFontPixelWidth
Repeater {
model: QGroundControl.flightMapSettings.mapTypes
QGCButton {
checkable: true
checked: flightMap.mapType == text
text: modelData
onClicked: {
flightMap.mapType = text
mapTypeButton.hideDropDown()
}
}
}
}
}
}
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.2
import QtQuick.Dialogs 1.2
import QtLocation 5.3
import QtPositioning 5.2
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0
import QGroundControl.FlightMap 1.0
/// This component is used to delay load the items which are direct children of the
/// FlightDisplayViewControl.
Item {
QGCVideoBackground {
anchors.fill: parent
display: _controller.videoSurface
receiver: _controller.videoReceiver
visible: !_showMap
QGCCompassHUD {
id: compassHUD
y: root.height * 0.7
x: root.width * 0.5 - ScreenTools.defaultFontPixelSize * (5)
width: ScreenTools.defaultFontPixelSize * (10)
height: ScreenTools.defaultFontPixelSize * (10)
heading: _heading
active: multiVehicleManager.activeVehicleAvailable
z: _flightMap.zOrderWidgets
}
QGCAttitudeHUD {
id: attitudeHUD
rollAngle: _roll
pitchAngle: _pitch
width: ScreenTools.defaultFontPixelSize * (30)
height: ScreenTools.defaultFontPixelSize * (30)
active: multiVehicleManager.activeVehicleAvailable
z: _flightMap.zOrderWidgets
}
}
QGCAltitudeWidget {
anchors.right: parent.right
height: parent.height * 0.65 > ScreenTools.defaultFontPixelSize * (23.4) ? ScreenTools.defaultFontPixelSize * (23.4) : parent.height * 0.65
width: ScreenTools.defaultFontPixelSize * (5)
altitude: _altitudeWGS84
z: _flightMap.zOrderWidgets
visible: !hideWidgets
}
QGCSpeedWidget {
anchors.left: parent.left
width: ScreenTools.defaultFontPixelSize * (5)
height: parent.height * 0.65 > ScreenTools.defaultFontPixelSize * (23.4) ? ScreenTools.defaultFontPixelSize * (23.4) : parent.height * 0.65
speed: _groundSpeed
z: _flightMap.zOrderWidgets
visible: !hideWidgets
}
QGCCurrentSpeed {
anchors.left: parent.left
width: ScreenTools.defaultFontPixelSize * (6.25)
airspeed: _airSpeed
groundspeed: _groundSpeed
active: multiVehicleManager.activeVehicleAvailable
z: _flightMap.zOrderWidgets
visible: !hideWidgets
}
QGCCurrentAltitude {
anchors.right: parent.right
width: ScreenTools.defaultFontPixelSize * (6.25)
altitude: _altitudeWGS84
vertZ: _climbRate
active: multiVehicleManager.activeVehicleAvailable
z: _flightMap.zOrderWidgets
visible: !hideWidgets
}
QGCButton {
id: optionsButton
x: _flightMap.mapWidgets.x
y: _flightMap.mapWidgets.y - height - (ScreenTools.defaultFontPixelHeight / 2)
z: _flightMap.zOrderWidgets
width: _flightMap.mapWidgets.width
text: "Options"
menu: optionsMenu
visible: _controller.hasVideo && !hideWidgets
ExclusiveGroup {
id: backgroundTypeGroup
}
Menu {
id: optionsMenu
MenuItem {
id: mapBackgroundMenuItem
exclusiveGroup: backgroundTypeGroup
checkable: true
checked: _showMap
text: "Show map as background"
onTriggered: _setShowMap(true)
}
MenuItem {
id: videoBackgroundMenuItem
exclusiveGroup: backgroundTypeGroup
checkable: true
checked: !_showMap
text: "Show video as background"
onTriggered: _setShowMap(false)
}
}
}
}
Module QGroundControl.FlightDisplay
FlightDisplayView 1.0 FlightDisplayView.qml
FlightDisplayViewDelayLoadInner 1.0 FlightDisplayViewDelayLoadInner.qml
FlightDisplayViewDelayLoadOuter 1.0 FlightDisplayViewDelayLoadOuter.qml
...@@ -34,6 +34,4 @@ MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml ...@@ -34,6 +34,4 @@ MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml
MissionItemSummary 1.0 MissionItemSummary.qml MissionItemSummary 1.0 MissionItemSummary.qml
MissionItemEditor 1.0 MissionItemEditor.qml MissionItemEditor 1.0 MissionItemEditor.qml
MainToolBar 1.0 MainToolBar.qml MainToolBar 1.0 MainToolBar.qml
FlightDisplayView 1.0 FlightDisplayView.qml
...@@ -26,14 +26,16 @@ import QtQuick.Controls 1.2 ...@@ -26,14 +26,16 @@ import QtQuick.Controls 1.2
import QtPositioning 5.2 import QtPositioning 5.2
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.FlightMap 1.0 import QGroundControl.FlightDisplay 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
/// Qml for MainWindow /// Qml for MainWindow
FlightDisplayView { FlightDisplayView {
id: _root id: _root
// sets the top margin soo map widgets are not under toolbar
topMargin: toolbar.height + ScreenTools.defaultFontPixelWidth topMargin: toolbarLoader.height
property var _toolbar: toolbarLoader.item
readonly property string _planViewSource: "MissionEditor.qml" readonly property string _planViewSource: "MissionEditor.qml"
readonly property string _setupViewSource: "SetupView.qml" readonly property string _setupViewSource: "SetupView.qml"
...@@ -65,7 +67,7 @@ FlightDisplayView { ...@@ -65,7 +67,7 @@ FlightDisplayView {
_root.hideWidgets = true _root.hideWidgets = true
} }
onShowToolbarMessage: toolbar.showToolbarMessage(message) onShowToolbarMessage: _toolbar.showToolbarMessage(message)
// The following are use for unit testing only // The following are use for unit testing only
...@@ -75,9 +77,15 @@ FlightDisplayView { ...@@ -75,9 +77,15 @@ FlightDisplayView {
onShowSetupVehicleComponent: setupViewLoader.item.showVehicleComponentPanel(vehicleComponent) onShowSetupVehicleComponent: setupViewLoader.item.showVehicleComponentPanel(vehicleComponent)
} }
MainToolBar { // We delay load the following control to improve boot time
id: toolbar Component.onCompleted: {
toolbarLoader.source = "MainToolBar.qml"
}
Loader {
id: toolbarLoader
width: parent.width width: parent.width
height: item ? item.height : 0
z: _root.zOrderTopMost z: _root.zOrderTopMost
} }
...@@ -85,7 +93,7 @@ FlightDisplayView { ...@@ -85,7 +93,7 @@ FlightDisplayView {
id: planViewLoader id: planViewLoader
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: toolbar.bottom anchors.top: toolbarLoader.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: false visible: false
...@@ -97,7 +105,7 @@ FlightDisplayView { ...@@ -97,7 +105,7 @@ FlightDisplayView {
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: toolbar.bottom anchors.top: toolbarLoader.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: false visible: false
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtPositioning 5.2
import QGroundControl.Controls 1.0
import QGroundControl.FlightDisplay 1.0
import QGroundControl.ScreenTools 1.0
/// Qml for MainWindow
FlightDisplayView {
id: _root
topMargin: toolbarLoader.height
property var _toolbar: toolbarLoader.item
readonly property string _planViewSource: "MissionEditor.qml"
readonly property string _setupViewSource: "SetupView.qml"
Connections {
target: controller
onShowFlyView: {
setupViewLoader.visible = false
planViewLoader.visible = false
_root.hideWidgets = false
}
onShowPlanView: {
if (planViewLoader.source != _planViewSource) {
planViewLoader.source = _planViewSource
}
setupViewLoader.visible = false
planViewLoader.visible = true
_root.hideWidgets = true
}
onShowSetupView: {
if (setupViewLoader.source != _setupViewSource) {
setupViewLoader.source = _setupViewSource
}
setupViewLoader.visible = true
planViewLoader.visible = false
_root.hideWidgets = true
}
onShowToolbarMessage: _toolbar.showToolbarMessage(message)
// The following are use for unit testing only
onShowSetupFirmware: setupViewLoader.item.showFirmwarePanel()
onShowSetupParameters: setupViewLoader.item.showParametersPanel()
onShowSetupSummary: setupViewLoader.item.showSummaryPanel()
onShowSetupVehicleComponent: setupViewLoader.item.showVehicleComponentPanel(vehicleComponent)
}
// We delay load the following control to improve boot time
Component.onCompleted: {
toolbarLoader.source = "MainToolBar.qml"
}
Loader {
id: toolbarLoader
width: parent.width
height: item ? item.height : 0
z: _root.zOrderTopMost
}
Loader {
id: planViewLoader
anchors.left: parent.left
anchors.right: parent.right
anchors.top: toolbarLoader.bottom
anchors.bottom: parent.bottom
visible: false
property real zOrder: _root.zOrderTopMost
}
Loader {
id: setupViewLoader
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.right: parent.right
anchors.top: toolbarLoader.bottom
anchors.bottom: parent.bottom
visible: false
property real zOrder: _root.zOrderTopMost
}
}
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment