Commit 9e7b1830 authored by dogmaphobic's avatar dogmaphobic

Merge remote-tracking branch 'mavlink/master' into removeJunk

* mavlink/master:
  Making Altitude text Larger than the rest.
  Saving and Restoring "Map Is Main"
  Controls work better aesthetically when centered on the screen.
  More work on the Fly View
parents a27c1b57 932109ea
......@@ -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)
}
}
}
......
......@@ -77,13 +77,17 @@ Item {
//-- Instrument Pannel
QGCInstrumentWidget {
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.bottom: parent.bottom
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
}
......@@ -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
......@@ -49,29 +52,143 @@ Item {
//-- Instrument Pannel
Rectangle {
id: instrumentPannel
anchors.right: parent.right
anchors.bottom: parent.bottom
height: root.size
width: instruments.width + ScreenTools.defaultFontPixelSize
height: instruments.height + ScreenTools.defaultFontPixelSize
width: root.size
radius: root.size / 2
visible: _isVisible
color: isSatellite ? Qt.rgba(1,1,1,0.5) : Qt.rgba(0,0,0,0.5)
Row {
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 {
......@@ -86,7 +203,7 @@ Item {
Rectangle {
id: openButton
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.verticalCenter: parent.verticalCenter
height: ScreenTools.defaultFontPixelSize * 2
width: ScreenTools.defaultFontPixelSize * 2
radius: ScreenTools.defaultFontPixelSize / 3
......
......@@ -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