FlightDisplayViewVideo.qml 2.89 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
9 10


11 12
import QtQuick                      2.3
import QtQuick.Controls             1.2
13 14 15 16 17 18 19 20 21 22 23

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


dogmaphobic's avatar
dogmaphobic committed
24 25
Item {
    id: root
26 27 28
    property double _ar:        QGroundControl.settingsManager.videoSettings.aspectRatio.rawValue
    property bool _showGrid:    QGroundControl.settingsManager.videoSettings.gridLines.rawValue > 0

dogmaphobic's avatar
dogmaphobic committed
29 30 31
    Rectangle {
        id:             noVideo
        anchors.fill:   parent
dogmaphobic's avatar
dogmaphobic committed
32
        color:          Qt.rgba(0,0,0,0.75)
33
        visible:        !QGroundControl.videoManager.videoRunning
dogmaphobic's avatar
dogmaphobic committed
34
        QGCLabel {
35
            text:               qsTr("WAITING FOR VIDEO")
36
            font.family:        ScreenTools.demiboldFontFamily
dogmaphobic's avatar
dogmaphobic committed
37
            color:              "white"
dogmaphobic's avatar
dogmaphobic committed
38
            font.pointSize:     _mainIsMap ? ScreenTools.smallFontPointSize : ScreenTools.largeFontPointSize
dogmaphobic's avatar
dogmaphobic committed
39 40 41
            anchors.centerIn:   parent
        }
    }
42
    Rectangle {
dogmaphobic's avatar
dogmaphobic committed
43
        anchors.fill:   parent
44
        color:          "black"
45
        visible:        QGroundControl.videoManager.videoRunning
46 47 48 49 50 51 52
        QGCVideoBackground {
            height:         parent.height
            width:          _ar != 0.0 ? height * _ar : parent.width
            anchors.centerIn: parent
            display:        QGroundControl.videoManager.videoSurface
            receiver:       QGroundControl.videoManager.videoReceiver
            visible:        QGroundControl.videoManager.videoRunning
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
            Rectangle {
                color:  Qt.rgba(1,1,1,0.5)
                height: parent.height
                width:  1
                x:      parent.width * 0.33
                visible: _showGrid
            }
            Rectangle {
                color:  Qt.rgba(1,1,1,0.5)
                height: parent.height
                width:  1
                x:      parent.width * 0.66
                visible: _showGrid
            }
            Rectangle {
                color:  Qt.rgba(1,1,1,0.5)
                width:  parent.width
                height: 1
                y:      parent.height * 0.33
                visible: _showGrid
            }
            Rectangle {
                color:  Qt.rgba(1,1,1,0.5)
                width:  parent.width
                height: 1
                y:      parent.height * 0.66
                visible: _showGrid
            }
dogmaphobic's avatar
dogmaphobic committed
81
        }
82 83
    }
}