5import QGroundControl.Controls
8 implicitWidth: mainLayout.width + (_margins * 2)
9 implicitHeight: mainLayout.height + (_margins * 2)
11 radius: ScreenTools.defaultBorderRadius
14 property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
15 property real _margins: ScreenTools.defaultFontPixelWidth / 2
16 property real _totalBlocks: _activeVehicle ? _activeVehicle.terrain.blocksPending.rawValue + _activeVehicle.terrain.blocksLoaded.rawValue : 0
17 property real _blocksLoaded: _activeVehicle ? _activeVehicle.terrain.blocksLoaded.rawValue : 0
18 property real _blocksPending: _activeVehicle ? _activeVehicle.terrain.blocksPending.rawValue : 0
19 property real _pctComplete: _activeVehicle && _totalBlocks ? _blocksLoaded / _totalBlocks : 0
21 on_BlocksPendingChanged: {
22 if (_blocksPending == 0) {
23 // UI doesn't go away immediately
24 visibilityTimer.restart()
27 visibilityTimer.stop()
31 on_BlocksLoadedChanged: {
32 if (_blocksLoaded != 0) {
33 // This causes the progress indicator to display even if it starts out as complete
35 if (_blocksPending == 0) {
36 visibilityTimer.restart()
44 onTriggered: parent.visible = false
47 QGCPalette { id: qgcPal }
51 anchors.margins: _margins
52 anchors.top: parent.top
53 anchors.left: parent.left
57 Layout.alignment: Qt.AlignHCenter
58 text: qsTr("Terrain Load Progress")
59 font.pointSize: ScreenTools.smallFontPointSize
63 Layout.fillWidth: true
64 height: ScreenTools.defaultFontPixelHeight
69 anchors.top: parent.top
70 anchors.bottom: parent.bottom
72 width: parent.width * _pctComplete
75 anchors.centerIn: parent
77 visible: _blocksPending == 0