/**************************************************************************** * * (c) 2009-2016 QGROUNDCONTROL PROJECT * * QGroundControl is licensed according to the terms in the file * COPYING.md in the root of the source code directory. * ****************************************************************************/ import QtQuick 2.3 import QtQuick.Controls 1.2 import QGroundControl 1.0 import QGroundControl.FlightDisplay 1.0 import QGroundControl.FlightMap 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Controls 1.0 import QGroundControl.Palette 1.0 import QGroundControl.Vehicle 1.0 import QGroundControl.Controllers 1.0 Item { id: root property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property double _ar: QGroundControl.settingsManager.videoSettings.aspectRatio.rawValue property bool _showGrid: QGroundControl.settingsManager.videoSettings.gridLines.rawValue > 0 property var _dynamicCameras: _activeVehicle ? _activeVehicle.dynamicCameras : null property bool _connected: _activeVehicle ? !_activeVehicle.connectionLost : false Rectangle { id: noVideo anchors.fill: parent color: Qt.rgba(0,0,0,0.75) visible: !QGroundControl.videoManager.videoReceiver.videoRunning QGCLabel { text: qsTr("WAITING FOR VIDEO") font.family: ScreenTools.demiboldFontFamily color: "white" font.pointSize: _mainIsMap ? ScreenTools.smallFontPointSize : ScreenTools.largeFontPointSize anchors.centerIn: parent } MouseArea { anchors.fill: parent onDoubleClicked: { QGroundControl.videoManager.fullScreen = !QGroundControl.videoManager.fullScreen } } } Rectangle { anchors.fill: parent color: "black" visible: QGroundControl.videoManager.videoReceiver.videoRunning QGCVideoBackground { id: videoContent height: parent.height width: _ar != 0.0 ? height * _ar : parent.width anchors.centerIn: parent receiver: QGroundControl.videoManager.videoReceiver display: QGroundControl.videoManager.videoReceiver.videoSurface visible: QGroundControl.videoManager.videoReceiver.videoRunning Connections { target: QGroundControl.videoManager.videoReceiver onImageFileChanged: { videoContent.grabToImage(function(result) { if (!result.saveToFile(QGroundControl.videoManager.videoReceiver.imageFile)) { console.error('Error capturing video frame'); } }); } } Rectangle { color: Qt.rgba(1,1,1,0.5) height: parent.height width: 1 x: parent.width * 0.33 visible: _showGrid && !QGroundControl.videoManager.fullScreen } Rectangle { color: Qt.rgba(1,1,1,0.5) height: parent.height width: 1 x: parent.width * 0.66 visible: _showGrid && !QGroundControl.videoManager.fullScreen } Rectangle { color: Qt.rgba(1,1,1,0.5) width: parent.width height: 1 y: parent.height * 0.33 visible: _showGrid && !QGroundControl.videoManager.fullScreen } Rectangle { color: Qt.rgba(1,1,1,0.5) width: parent.width height: 1 y: parent.height * 0.66 visible: _showGrid && !QGroundControl.videoManager.fullScreen } } MouseArea { anchors.fill: parent onDoubleClicked: { QGroundControl.videoManager.fullScreen = !QGroundControl.videoManager.fullScreen } } } //-- Camera Controller Loader { source: QGroundControl.videoManager.fullScreen ? "" : (_dynamicCameras ? _dynamicCameras.controllerSource : "") visible: !_mainIsMap && _dynamicCameras && _dynamicCameras.cameras.count && _connected && !QGroundControl.videoManager.fullScreen anchors.right: parent.right anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.bottom: parent.bottom anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 2 } }