Commit 932109ea authored by Gus Grubba's avatar Gus Grubba

Merge pull request #2124 from dogmaphobic/flightViewContinue

Flight view continue
parents d44fcde4 f8a869f8
......@@ -56,8 +56,9 @@ Item {
readonly property string _mapName: "FlightDisplayView"
readonly property string _showMapBackgroundKey: "/showMapBackground"
readonly property string _mainIsMapKey: "MainFlyWindowIsMap"
property bool _mainIsMap: !_controller.hasVideo
property bool _mainIsMap: QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true)
property real _roll: _activeVehicle ? (isNaN(_activeVehicle.roll) ? _defaultRoll : _activeVehicle.roll) : _defaultRoll
property real _pitch: _activeVehicle ? (isNaN(_activeVehicle.pitch) ? _defaultPitch : _activeVehicle.pitch) : _defaultPitch
......@@ -158,6 +159,7 @@ Item {
_mainIsMap = !_mainIsMap
pip.visible = false
reloadContents();
QGroundControl.saveBoolGlobalSetting(_mainIsMapKey, _mainIsMap)
}
}
}
......
......@@ -76,16 +76,20 @@ Item {
//-- Instrument Pannel
QGCInstrumentWidget {
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.bottom: parent.bottom
anchors.right: parent.right
size: ScreenTools.defaultFontPixelSize * (9)
active: _activeVehicle != null
heading: _heading
rollAngle: _roll
pitchAngle: _pitch
isSatellite: _mainIsMap ? _flightMap ? _flightMap.isSatelliteMap : true : true
z: QGroundControl.zOrderWidgets
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
size: ScreenTools.defaultFontPixelSize * (9)
active: _activeVehicle != null
heading: _heading
rollAngle: _roll
pitchAngle: _pitch
altitude: _altitudeWGS84
groundSpeed: _groundSpeed
airSpeed: _airSpeed
climbRate: _climbRate
isSatellite: _mainIsMap ? _flightMap ? _flightMap.isSatelliteMap : true : true
z: QGroundControl.zOrderWidgets
}
//-- Vertical Tool Buttons
......@@ -93,7 +97,7 @@ Item {
id: toolColumn
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.left: parent.left
anchors.top: parent.top
anchors.verticalCenter: parent.verticalCenter
spacing: ScreenTools.defaultFontPixelHeight
//-- Map Center Control
......
......@@ -49,9 +49,7 @@ Item {
id: borderRect
anchors.fill: parent
radius: width / 2
color: "#202020"
border.color: "black"
border.width: 2
color: "black"
}
Item {
......
......@@ -39,7 +39,10 @@ Item {
property alias heading: compass.heading
property alias rollAngle: attitude.rollAngle
property alias pitchAngle: attitude.pitchAngle
property real altitude: 0
property real groundSpeed: 0
property real airSpeed: 0
property real climbRate: 0
property real size: ScreenTools.defaultFontPixelSize * (10)
property bool isSatellite: false
property bool active: false
......@@ -48,30 +51,144 @@ Item {
//-- Instrument Pannel
Rectangle {
id: instrumentPannel
anchors.right: parent.right
anchors.bottom: parent.bottom
height: root.size
width: instruments.width + ScreenTools.defaultFontPixelSize
radius: root.size / 2
visible: _isVisible
color: isSatellite ? Qt.rgba(1,1,1,0.5) : Qt.rgba(0,0,0,0.5)
Row {
id: instrumentPannel
height: instruments.height + ScreenTools.defaultFontPixelSize
width: root.size
radius: root.size / 2
visible: _isVisible
color: isSatellite ? Qt.rgba(1,1,1,0.75) : Qt.rgba(0,0,0,0.75)
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
Column {
id: instruments
height: parent.height
spacing: ScreenTools.defaultFontPixelSize / 2
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
spacing: ScreenTools.defaultFontPixelSize * 0.33
anchors.verticalCenter: parent.verticalCenter
//-- Attitude Indicator
QGCAttitudeWidget {
id: attitude
size: parent.height * 0.9
size: parent.width * 0.9
active: root.active
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
}
//-- Altitude
Rectangle {
height: 1
width: parent.width * 0.9
color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25)
anchors.horizontalCenter: parent.horizontalCenter
}
Row {
width: root.size * 0.8
anchors.horizontalCenter: parent.horizontalCenter
QGCLabel {
text: "H"
font.pixelSize: ScreenTools.defaultFontPixelSize * 1.25
width: parent.width * 0.45
color: isSatellite ? "black" : "white"
horizontalAlignment: TextEdit.AlignHCenter
}
QGCLabel {
text: altitude.toFixed(1)
font.pixelSize: ScreenTools.defaultFontPixelSize * 1.25
font.weight: Font.DemiBold
width: parent.width * 0.549
color: isSatellite ? "black" : "white"
horizontalAlignment: TextEdit.AlignHCenter
}
}
//-- Ground Speed
Rectangle {
height: 1
width: parent.width * 0.9
color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25)
anchors.horizontalCenter: parent.horizontalCenter
}
Row {
width: root.size * 0.8
anchors.horizontalCenter: parent.horizontalCenter
QGCLabel {
text: "GS"
font.pixelSize: ScreenTools.defaultFontPixelSize * 0.75
width: parent.width * 0.45
color: isSatellite ? "black" : "white"
horizontalAlignment: TextEdit.AlignHCenter
}
QGCLabel {
text: groundSpeed.toFixed(1)
font.pixelSize: ScreenTools.defaultFontPixelSize * 0.75
font.weight: Font.DemiBold
width: parent.width * 0.549
color: isSatellite ? "black" : "white"
horizontalAlignment: TextEdit.AlignHCenter
}
}
//-- Air Speed
Rectangle {
height: 1
width: parent.width * 0.9
color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25)
anchors.horizontalCenter: parent.horizontalCenter
visible: airSpeed > 0
}
Row {
width: root.size * 0.8
anchors.horizontalCenter: parent.horizontalCenter
visible: airSpeed > 0
QGCLabel {
text: "AS"
font.pixelSize: ScreenTools.defaultFontPixelSize * 0.75
width: parent.width * 0.45
color: isSatellite ? "black" : "white"
horizontalAlignment: TextEdit.AlignHCenter
}
QGCLabel {
text: airSpeed.toFixed(1)
font.pixelSize: ScreenTools.defaultFontPixelSize * 0.75
font.weight: Font.DemiBold
width: parent.width * 0.549
color: isSatellite ? "black" : "white"
horizontalAlignment: TextEdit.AlignHCenter
}
}
//-- Climb Rate
Rectangle {
height: 1
width: parent.width * 0.9
color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25)
anchors.horizontalCenter: parent.horizontalCenter
}
Row {
width: root.size * 0.8
anchors.horizontalCenter: parent.horizontalCenter
QGCLabel {
text: "VS"
font.pixelSize: ScreenTools.defaultFontPixelSize * 0.75
width: parent.width * 0.45
color: isSatellite ? "black" : "white"
horizontalAlignment: TextEdit.AlignHCenter
}
QGCLabel {
text: climbRate.toFixed(1)
font.pixelSize: ScreenTools.defaultFontPixelSize * 0.75
font.weight: Font.DemiBold
width: parent.width * 0.549
color: isSatellite ? "black" : "white"
horizontalAlignment: TextEdit.AlignHCenter
}
}
//-- Compass
Rectangle {
height: 1
width: parent.width * 0.9
color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25)
anchors.horizontalCenter: parent.horizontalCenter
}
QGCCompassWidget {
id: compass
size: parent.height * 0.9
size: parent.width * 0.9
active: root.active
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
}
}
MouseArea {
......@@ -84,14 +201,14 @@ Item {
//-- Show Instruments
Rectangle {
id: openButton
anchors.right: parent.right
anchors.bottom: parent.bottom
height: ScreenTools.defaultFontPixelSize * 2
width: ScreenTools.defaultFontPixelSize * 2
radius: ScreenTools.defaultFontPixelSize / 3
visible: !_isVisible
color: isSatellite ? Qt.rgba(1,1,1,0.5) : Qt.rgba(0,0,0,0.5)
id: openButton
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
height: ScreenTools.defaultFontPixelSize * 2
width: ScreenTools.defaultFontPixelSize * 2
radius: ScreenTools.defaultFontPixelSize / 3
visible: !_isVisible
color: isSatellite ? Qt.rgba(1,1,1,0.5) : Qt.rgba(0,0,0,0.5)
Image {
width: parent.width * 0.75
height: parent.height * 0.75
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 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
......@@ -26,6 +26,8 @@
#include "QGroundControlQmlGlobal.h"
static const char* kQmlGlobalKeyName = "QGCQml";
QGroundControlQmlGlobal::QGroundControlQmlGlobal(QObject* parent)
: QObject(parent)
, _homePositionManager(HomePositionManager::instance())
......@@ -38,3 +40,31 @@ QGroundControlQmlGlobal::~QGroundControlQmlGlobal()
{
}
void QGroundControlQmlGlobal::saveGlobalSetting (const QString& key, const QString& value)
{
QSettings settings;
settings.beginGroup(kQmlGlobalKeyName);
settings.setValue(key, value);
}
QString QGroundControlQmlGlobal::loadGlobalSetting (const QString& key, const QString& defaultValue)
{
QSettings settings;
settings.beginGroup(kQmlGlobalKeyName);
return settings.value(key, defaultValue).toString();
}
void QGroundControlQmlGlobal::saveBoolGlobalSetting (const QString& key, bool value)
{
QSettings settings;
settings.beginGroup(kQmlGlobalKeyName);
settings.setValue(key, value);
}
bool QGroundControlQmlGlobal::loadBoolGlobalSetting (const QString& key, bool defaultValue)
{
QSettings settings;
settings.beginGroup(kQmlGlobalKeyName);
return settings.value(key, defaultValue).toBool();
}
......@@ -47,6 +47,11 @@ public:
Q_PROPERTY(qreal zOrderWidgets READ zOrderWidgets CONSTANT) ///< z order value to widgets, for example: zoom controls, hud widgetss
Q_PROPERTY(qreal zOrderMapItems READ zOrderMapItems CONSTANT) ///< z order value for map items, for example: mission item indicators
Q_INVOKABLE void saveGlobalSetting (const QString& key, const QString& value);
Q_INVOKABLE QString loadGlobalSetting (const QString& key, const QString& defaultValue);
Q_INVOKABLE void saveBoolGlobalSetting (const QString& key, bool value);
Q_INVOKABLE bool loadBoolGlobalSetting (const QString& key, bool defaultValue);
// Property accesors
HomePositionManager* homePositionManager () { return _homePositionManager; }
......
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