Commit a27c1b57 authored by dogmaphobic's avatar dogmaphobic

Removing unused Main Flight Display widget.

parent d44fcde4
......@@ -218,7 +218,6 @@ HEADERS += \
src/comm/QGCMAVLink.h \
src/comm/TCPLink.h \
src/comm/UDPLink.h \
src/FlightDisplay/FlightDisplayWidget.h \
src/FlightDisplay/FlightDisplayViewController.h \
src/FlightMap/FlightMapSettings.h \
src/GAudioOutput.h \
......@@ -336,7 +335,6 @@ SOURCES += \
src/comm/MockLinkMissionItemHandler.cc \
src/comm/TCPLink.cc \
src/comm/UDPLink.cc \
src/FlightDisplay/FlightDisplayWidget.cc \
src/FlightDisplay/FlightDisplayViewController.cc \
src/FlightMap/FlightMapSettings.cc \
src/GAudioOutput.cc \
......
......@@ -47,10 +47,8 @@
<file alias="buttonLeft.svg">src/FlightMap/Images/buttonLeft.svg</file>
<file alias="buttonMore.svg">src/FlightMap/Images/buttonMore.svg</file>
<file alias="buttonRight.svg">src/FlightMap/Images/buttonRight.svg</file>
<file alias="compass.svg">src/FlightMap/Images/compass.svg</file>
<file alias="compassInstrumentAirplane.svg">src/FlightMap/Images/compassInstrumentAirplane.svg</file>
<file alias="compassInstrumentDial.svg">src/FlightMap/Images/compassInstrumentDial.svg</file>
<file alias="compassNeedle.svg">src/FlightMap/Images/compassNeedle.svg</file>
<file alias="crossHair.svg">src/FlightMap/Images/crossHair.svg</file>
<file alias="rollDialWhite.svg">src/FlightMap/Images/rollDialWhite.svg</file>
<file alias="rollPointerWhite.svg">src/FlightMap/Images/rollPointerWhite.svg</file>
......
......@@ -75,7 +75,6 @@
<file alias="AirframeComponent.qml">src/AutoPilotPlugins/PX4/AirframeComponent.qml</file>
<file alias="MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file>
<file alias="FlightDisplayView.qml">src/FlightDisplay/FlightDisplayView.qml</file>
<file alias="FlightDisplayWidget.qml">src/FlightDisplay/FlightDisplayWidget.qml</file>
<file alias="MissionEditor.qml">src/MissionEditor/MissionEditor.qml</file>
<file alias="MissionEditorHelp.qml">src/MissionEditor/MissionEditorHelp.qml</file>
......@@ -90,18 +89,13 @@
<file alias="QGroundControl/FlightMap/qmldir">src/FlightMap/qmldir</file>
<file alias="QGroundControl/FlightMap/FlightMap.qml">src/FlightMap/FlightMap.qml</file>
<file alias="QGroundControl/FlightMap/QGCVideoBackground.qml">src/FlightMap/QGCVideoBackground.qml</file>
<file alias="QGroundControl/FlightMap/QGCAltitudeWidget.qml">src/FlightMap/Widgets/QGCAltitudeWidget.qml</file>
<file alias="QGroundControl/FlightMap/QGCArtificialHorizon.qml">src/FlightMap/Widgets/QGCArtificialHorizon.qml</file>
<file alias="QGroundControl/FlightMap/QGCAttitudeWidget.qml">src/FlightMap/Widgets/QGCAttitudeWidget.qml</file>
<file alias="QGroundControl/FlightMap/QGCAttitudeHUD.qml">src/FlightMap/Widgets/QGCAttitudeHUD.qml</file>
<file alias="QGroundControl/FlightMap/QGCCompassWidget.qml">src/FlightMap/Widgets/QGCCompassWidget.qml</file>
<file alias="QGroundControl/FlightMap/QGCCompassHUD.qml">src/FlightMap/Widgets/QGCCompassHUD.qml</file>
<file alias="QGroundControl/FlightMap/QGCCurrentAltitude.qml">src/FlightMap/Widgets/QGCCurrentAltitude.qml</file>
<file alias="QGroundControl/FlightMap/QGCCurrentSpeed.qml">src/FlightMap/Widgets/QGCCurrentSpeed.qml</file>
<file alias="QGroundControl/FlightMap/QGCInstrumentWidget.qml">src/FlightMap/Widgets/QGCInstrumentWidget.qml</file>
<file alias="QGroundControl/FlightMap/QGCPitchIndicator.qml">src/FlightMap/Widgets/QGCPitchIndicator.qml</file>
<file alias="QGroundControl/FlightMap/QGCSlider.qml">src/FlightMap/Widgets/QGCSlider.qml</file>
<file alias="QGroundControl/FlightMap/QGCSpeedWidget.qml">src/FlightMap/Widgets/QGCSpeedWidget.qml</file>
<file alias="QGroundControl/FlightMap/MissionItemIndicator.qml">src/FlightMap/MapItems/MissionItemIndicator.qml</file>
<file alias="QGroundControl/FlightMap/VehicleMapItem.qml">src/FlightMap/MapItems/VehicleMapItem.qml</file>
<file alias="QGroundControl/FlightMap/MissionItemView.qml">src/FlightMap/MapItems/MissionItemView.qml</file>
......
/*=====================================================================
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/>.
======================================================================*/
#include <QQmlContext>
#include <QQmlEngine>
#include <QSettings>
#include <VideoItem.h>
#include <VideoSurface.h>
#include "VideoReceiver.h"
#include "ScreenToolsController.h"
#include "FlightDisplayWidget.h"
const char* kMainFlightDisplayWidgetGroup = "FlightDisplayWidget";
FlightDisplayWidget::FlightDisplayWidget(const QString& title, QAction* action, QWidget *parent)
: QGCQmlWidgetHolder(title, action, parent)
{
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
setObjectName("FlightDisplayWidget");
// Get rid of layout default margins
QLayout* pl = layout();
if(pl) {
pl->setContentsMargins(0,0,0,0);
}
setMinimumWidth(300);
setMinimumHeight(300);
setContextPropertyObject("flightDisplay", this);
/*
* This is the receiving end of an UDP RTP stream. The sender can be setup with this command:
*
* gst-launch-1.0 uvch264src initial-bitrate=1000000 average-bitrate=1000000 iframe-period=1000 name=src auto-start=true src.vidsrc ! \
* video/x-h264,width=1280,height=720,framerate=24/1 ! h264parse ! rtph264pay ! udpsink host=192.168.1.9 port=5000
*
* Where the main parameters are:
*
* uvch264src: Your h264 video source (the example above uses a Logitech C920 on an Raspberry PI 2+ or Odroid C1
* host=192.168.1.9 This is the IP address of QGC. You can use Avahi/Zeroconf to find QGC using the "_qgroundcontrol._udp" service.
*
* Advanced settings (you should probably read the gstreamer documentation before changing these):
*
* initial-bitrate=1000000 average-bitrate=1000000
* The bit rate to use. The greater, the better quality at the cost of higher bandwidth.
*
* width=1280,height=720,framerate=24/1
* The video resolution and frame rate. This depends on the camera used.
*
* iframe-period=1000
* Interval between iFrames. The greater the interval the lesser bandwidth at the cost of a longer time to recover from lost packets.
*
* Do not change anything else unless you know what you are doing. Any other change will require a matching change on the receiving end.
*
*/
VideoSurface* pSurface = new VideoSurface;
setContextPropertyObject("videoDisplay", pSurface);
VideoReceiver* pReceiver = new VideoReceiver(this);
pReceiver->setUri(QLatin1Literal("udp://0.0.0.0:5000"));
#if defined(QGC_GST_STREAMING)
pReceiver->setVideoSink(pSurface->videoSink());
#endif
setContextPropertyObject("videoReceiver", pReceiver);
setSource(QUrl::fromUserInput("qrc:/qml/FlightDisplayWidget.qml"));
setVisible(true);
loadSettings();
}
FlightDisplayWidget::~FlightDisplayWidget()
{
}
void FlightDisplayWidget::saveSetting(const QString &name, const QString& value)
{
QSettings settings;
QString key(kMainFlightDisplayWidgetGroup);
key += "/" + name;
settings.setValue(key, value);
}
QString FlightDisplayWidget::loadSetting(const QString &name, const QString& defaultValue)
{
QSettings settings;
QString key(kMainFlightDisplayWidgetGroup);
key += "/" + name;
return settings.value(key, defaultValue).toString();
}
/*=====================================================================
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/>.
======================================================================*/
#ifndef FlightDisplayWidget_H
#define FlightDisplayWidget_H
#include "QGCQmlWidgetHolder.h"
class FlightDisplayWidget : public QGCQmlWidgetHolder
{
Q_OBJECT
public:
FlightDisplayWidget(const QString& title, QAction* action, QWidget* parent = NULL);
~FlightDisplayWidget();
/// @brief Invokes the Flight Display Options menu
void showOptionsMenu() { emit showOptionsMenuChanged(); }
Q_PROPERTY(bool hasVideo READ hasVideo CONSTANT)
Q_INVOKABLE void saveSetting (const QString &key, const QString& value);
Q_INVOKABLE QString loadSetting (const QString &key, const QString& defaultValue);
#if defined(QGC_GST_STREAMING)
bool hasVideo () { return true; }
#else
bool hasVideo () { return false; }
#endif
signals:
void showOptionsMenuChanged ();
};
#endif
/*=====================================================================
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 QGroundControl.FlightMap 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
/// Flight Display Widget
Item {
id: root
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property var activeVehicle: multiVehicleManager.activeVehicle
readonly property real defaultLatitude: 37.803784
readonly property real defaultLongitude: -122.462276
readonly property real defaultRoll: 0
readonly property real defaultPitch: 0
readonly property real defaultHeading: 0
readonly property real defaultAltitudeWGS84: 0
readonly property real defaultGroundSpeed: 0
readonly property real defaultAirSpeed: 0
readonly property real defaultClimbRate: 0
property real roll: activeVehicle ? (isNaN(activeVehicle.roll) ? defaultRoll : activeVehicle.roll) : defaultRoll
property real pitch: activeVehicle ? (isNaN(activeVehicle.pitch) ? defaultPitch : activeVehicle.pitch) : defaultPitch
property real latitude: activeVehicle ? ((activeVehicle.latitude === 0) ? defaultLatitude : activeVehicle.latitude) : defaultLatitude
property real longitude: activeVehicle ? ((activeVehicle.longitude === 0) ? defaultLongitude : activeVehicle.longitude) : defaultLongitude
property real heading: activeVehicle ? (isNaN(activeVehicle.heading) ? defaultHeading : activeVehicle.heading) : defaultHeading
property real altitudeWGS84: activeVehicle ? activeVehicle.altitudeWGS84 : defaultAltitudeWGS84
property real groundSpeed: activeVehicle ? activeVehicle.groundSpeed : defaultGroundSpeed
property real airSpeed: activeVehicle ? activeVehicle.airSpeed : defaultAirSpeed
property real climbRate: activeVehicle ? activeVehicle.climbRate : defaultClimbRate
property bool showPitchIndicator: true
function getBool(value) {
return value === '0' ? false : true;
}
function setBool(value) {
return value ? "1" : "0";
}
function enforceExclusiveOption(setWidget, alternateWidget, defaultSetting, alternateSetting) {
setWidget.visible = !setWidget.visible;
flightDisplay.saveSetting(defaultSetting, setBool(setWidget.visible));
alternateWidget.visible = setWidget.visible ? false : alternateWidget.visible;
flightDisplay.saveSetting(alternateSetting, setBool(alternateWidget.visible));
}
Connections {
target: flightDisplay
onShowOptionsMenuChanged: {
contextMenu.popup();
}
}
Component.onCompleted:
{
videoBackground.visible = getBool(flightDisplay.loadSetting("showVideoBackground", "0"));
// Disable video if we don't have support for it
if(!flightDisplay.hasVideo) {
videoBackground.visible = false;
flightDisplay.saveSetting("showVideoBackground", setBool(videoBackground.visible));
}
// Enable/Disable menu accordingly
videoMenu.enabled = flightDisplay.hasVideo;
}
Menu {
id: contextMenu
MenuItem {
id: videoMenu
text: "Video Background"
checkable: true
checked: videoBackground.visible
onToggled: videoBackground.visible = checked
}
}
// Video and Map backgrounds are exclusive. If one is enabled the other is disabled.
QGCVideoBackground {
id: videoBackground
anchors.fill: parent
display: videoDisplay
receiver: videoReceiver
z: 10
}
// HUD (lower middle) Compass
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: root.heading
active: multiVehicleManager.activeVehicleAvailable
z: 70
}
// Sky/Ground background (visible when no Map or Video is enabled)
QGCArtificialHorizon {
id: artificialHoriz
anchors.fill: parent
rollAngle: roll
pitchAngle: pitch
visible: !videoBackground.visible
}
// HUD (center) Attitude Indicator
QGCAttitudeHUD {
id: attitudeHUD
rollAngle: roll
pitchAngle: pitch
showPitch: showPitchIndicator
width: ScreenTools.defaultFontPixelSize * (30)
height: ScreenTools.defaultFontPixelSize * (30)
active: multiVehicleManager.activeVehicleAvailable
z: 20
}
QGCAltitudeWidget {
id: altitudeWidget
anchors.right: parent.right
width: ScreenTools.defaultFontPixelSize * (5)
height: parent.height * 0.65 > ScreenTools.defaultFontPixelSize * (23.4) ? ScreenTools.defaultFontPixelSize * (23.4) : parent.height * 0.65
altitude: root.altitudeWGS84
z: 30
}
QGCSpeedWidget {
id: speedWidget
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: root.groundSpeed
z: 40
}
QGCCurrentSpeed {
id: currentSpeed
anchors.left: parent.left
width: ScreenTools.defaultFontPixelSize * (6.25)
airspeed: root.airSpeed
groundspeed: root.groundSpeed
active: multiVehicleManager.activeVehicleAvailable
showAirSpeed: true
showGroundSpeed: true
visible: (currentSpeed.showGroundSpeed || currentSpeed.showAirSpeed)
z: 50
}
QGCCurrentAltitude {
id: currentAltitude
anchors.right: parent.right
width: ScreenTools.defaultFontPixelSize * (6.25)
altitude: root.altitudeWGS84
vertZ: root.climbRate
showAltitude: true
showClimbRate: true
active: multiVehicleManager.activeVehicleAvailable
visible: (currentAltitude.showAltitude || currentAltitude.showClimbRate)
z: 60
}
QGCButton {
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.right: parent.right
anchors.bottom: parent.bottom
text: "Options"
menu: contextMenu
}
}
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 288 158.4" enable-background="new 0 0 288 158.4" xml:space="preserve">
<polygon points="279,7.2 144,151.2 9,7.2 "/>
</svg>
/*=====================================================================
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/>.
======================================================================*/
/**
* @file
* @brief QGC Altitude Indicator
* @author Gus Grubba <mavlink@grubba.com>
*/
import QtQuick 2.4
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
Rectangle {
id: root
property real altitude: 50
property real _reticleSpacing: ScreenTools.defaultFontPixelSize * (1.33)
property real _reticleHeight: ScreenTools.defaultFontPixelSize * (0.166)
property real _reticleSlot: _reticleSpacing + _reticleHeight
property var _speedArray: []
property int _currentCenter: 0
property int _currentStart: -100
function updateArray() {
var tmpArray = [];
_currentCenter = Math.floor(altitude / 5) * 5;
_currentStart = _currentCenter + 100;
for(var i = 0; i < 40; i++) {
tmpArray[i] = _currentStart - (i * 5);
}
_speedArray = tmpArray;
}
Component.onCompleted:
{
updateArray() ;
}
onAltitudeChanged: {
if(Math.abs(_currentCenter - altitude) > 50) {
updateArray() ;
}
}
anchors.verticalCenter: parent.verticalCenter
smooth: true
radius: ScreenTools.defaultFontPixelSize * (0.42)
border.color: Qt.rgba(1,1,1,0.25)
gradient: Gradient {
GradientStop { position: 0.0; color: Qt.rgba(0,0,0,0.65) }
GradientStop { position: 0.5; color: Qt.rgba(0,0,0,0.25) }
GradientStop { position: 1.0; color: Qt.rgba(0,0,0,0.65) }
}
Rectangle {
id: clipRect
height: parent.height - ScreenTools.defaultFontPixelSize * (0.42)
width: parent.width
clip: true
color: Qt.rgba(0,0,0,0);
anchors.verticalCenter: parent.verticalCenter
Column{
id: col
width: parent.width
anchors.verticalCenter: parent.verticalCenter
spacing: _reticleSpacing
Repeater {
model: _speedArray
anchors.left: parent.left
Rectangle {
property int _alt: modelData
width: (_alt % 10 === 0) ? ScreenTools.defaultFontPixelSize * (0.83) : ScreenTools.defaultFontPixelSize * (1.25)
height: _reticleHeight
color: Qt.rgba(1,1,1,0.35)
QGCLabel {
visible: (_alt % 10 === 0)
x: ScreenTools.defaultFontPixelSize * (1.66)
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
font.weight: Font.DemiBold
text: _alt
color: _alt < 0 ? "#f8983a" : "white"
style: Text.Outline
styleColor: Qt.rgba(0,0,0,0.25)
}
}
}
transform: Translate {
y: ((altitude - _currentCenter) * _reticleSlot / 5) - (_reticleSlot / 2)
}
}
}
}
/*=====================================================================
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/>.
======================================================================*/
/**
* @file
* @brief QGC Compass HUD
* @author Gus Grubba <mavlink@grubba.com>
*/
import QtQuick 2.4
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
Item {
id: root
property bool active: false ///< true: actively connected to data provider, false: show inactive control
property real heading: _defaultHeading
readonly property real _defaultHeading: 0
property real _heading: active ? heading : _defaultHeading
Image {
id: compass
anchors.centerIn: parent
source: "/qmlimages/compass.svg"
mipmap: true
width: root.width
fillMode: Image.PreserveAspectFit
transform: Rotation {
origin.x: compass.width / 2
origin.y: compass.height / 2
angle: -_heading
}
}
Image {
id: pointer
anchors.bottom: compass.top
anchors.horizontalCenter: root.horizontalCenter
source: "/qmlimages/compassNeedle.svg"
smooth: true
width: compass.width * 0.1
fillMode: Image.PreserveAspectFit
}
Rectangle {
anchors.centerIn: compass
width: ScreenTools.defaultFontPixelSize * (3.33)
height: ScreenTools.defaultFontPixelSize * (2.08)
border.color: Qt.rgba(1,1,1,0.15)
color: Qt.rgba(0,0,0,0.25)
QGCLabel {
text: _heading.toFixed(0)
font.weight: Font.DemiBold
color: "white"
anchors.centerIn: parent
visible: active
}
}
}
/*=====================================================================
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/>.
======================================================================*/
/**
* @file
* @brief QGC Current Altitude Indicator
* @author Gus Grubba <mavlink@grubba.com>
*/
import QtQuick 2.1
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
Rectangle {
id: root
property bool active: false ///< true: actively connected to data provider, false: show inactive control
property real altitude: 0
property real vertZ: 0
property bool showAltitude: true
property bool showClimbRate: true
anchors.verticalCenter: parent.verticalCenter
width: parent.width
height: (showAltitude && showClimbRate) ? ScreenTools.defaultFontPixelSize * (4.16) : ScreenTools.defaultFontPixelSize * (2.08)
color: "black"
border.color: Qt.rgba(1,1,1,0.25)
opacity: 1.0
Column{
anchors.centerIn: parent
spacing: ScreenTools.defaultFontPixelSize * (0.33)
QGCLabel {
text: 'h: ' + (active ? altitude.toFixed(0) : "")
font.weight: Font.DemiBold
color: "white"
anchors.right: parent.right
visible: showAltitude
}
QGCLabel {
text: 'vZ: ' + (active ? vertZ.toFixed(0) : "")
color: "white"
font.weight: showAltitude ? Font.Normal : Font.DemiBold
anchors.right: parent.right
visible: showClimbRate
}
}
}
/*=====================================================================
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