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 { ...@@ -56,8 +56,9 @@ Item {
readonly property string _mapName: "FlightDisplayView" readonly property string _mapName: "FlightDisplayView"
readonly property string _showMapBackgroundKey: "/showMapBackground" 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 _roll: _activeVehicle ? (isNaN(_activeVehicle.roll) ? _defaultRoll : _activeVehicle.roll) : _defaultRoll
property real _pitch: _activeVehicle ? (isNaN(_activeVehicle.pitch) ? _defaultPitch : _activeVehicle.pitch) : _defaultPitch property real _pitch: _activeVehicle ? (isNaN(_activeVehicle.pitch) ? _defaultPitch : _activeVehicle.pitch) : _defaultPitch
...@@ -158,6 +159,7 @@ Item { ...@@ -158,6 +159,7 @@ Item {
_mainIsMap = !_mainIsMap _mainIsMap = !_mainIsMap
pip.visible = false pip.visible = false
reloadContents(); reloadContents();
QGroundControl.saveBoolGlobalSetting(_mainIsMapKey, _mainIsMap)
} }
} }
} }
......
...@@ -77,13 +77,17 @@ Item { ...@@ -77,13 +77,17 @@ Item {
//-- Instrument Pannel //-- Instrument Pannel
QGCInstrumentWidget { QGCInstrumentWidget {
anchors.margins: ScreenTools.defaultFontPixelHeight anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
size: ScreenTools.defaultFontPixelSize * (9) size: ScreenTools.defaultFontPixelSize * (9)
active: _activeVehicle != null active: _activeVehicle != null
heading: _heading heading: _heading
rollAngle: _roll rollAngle: _roll
pitchAngle: _pitch pitchAngle: _pitch
altitude: _altitudeWGS84
groundSpeed: _groundSpeed
airSpeed: _airSpeed
climbRate: _climbRate
isSatellite: _mainIsMap ? _flightMap ? _flightMap.isSatelliteMap : true : true isSatellite: _mainIsMap ? _flightMap ? _flightMap.isSatelliteMap : true : true
z: QGroundControl.zOrderWidgets z: QGroundControl.zOrderWidgets
} }
...@@ -93,7 +97,7 @@ Item { ...@@ -93,7 +97,7 @@ Item {
id: toolColumn id: toolColumn
anchors.margins: ScreenTools.defaultFontPixelHeight anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.verticalCenter: parent.verticalCenter
spacing: ScreenTools.defaultFontPixelHeight spacing: ScreenTools.defaultFontPixelHeight
//-- Map Center Control //-- Map Center Control
......
...@@ -49,9 +49,7 @@ Item { ...@@ -49,9 +49,7 @@ Item {
id: borderRect id: borderRect
anchors.fill: parent anchors.fill: parent
radius: width / 2 radius: width / 2
color: "#202020" color: "black"
border.color: "black"
border.width: 2
} }
Item { Item {
......
...@@ -39,7 +39,10 @@ Item { ...@@ -39,7 +39,10 @@ Item {
property alias heading: compass.heading property alias heading: compass.heading
property alias rollAngle: attitude.rollAngle property alias rollAngle: attitude.rollAngle
property alias pitchAngle: attitude.pitchAngle 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 real size: ScreenTools.defaultFontPixelSize * (10)
property bool isSatellite: false property bool isSatellite: false
property bool active: false property bool active: false
...@@ -49,29 +52,143 @@ Item { ...@@ -49,29 +52,143 @@ Item {
//-- Instrument Pannel //-- Instrument Pannel
Rectangle { Rectangle {
id: instrumentPannel id: instrumentPannel
anchors.right: parent.right height: instruments.height + ScreenTools.defaultFontPixelSize
anchors.bottom: parent.bottom width: root.size
height: root.size
width: instruments.width + ScreenTools.defaultFontPixelSize
radius: root.size / 2 radius: root.size / 2
visible: _isVisible visible: _isVisible
color: isSatellite ? Qt.rgba(1,1,1,0.5) : Qt.rgba(0,0,0,0.5) color: isSatellite ? Qt.rgba(1,1,1,0.75) : Qt.rgba(0,0,0,0.75)
Row { anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
Column {
id: instruments id: instruments
height: parent.height width: parent.width
spacing: ScreenTools.defaultFontPixelSize / 2 spacing: ScreenTools.defaultFontPixelSize * 0.33
anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter
//-- Attitude Indicator
QGCAttitudeWidget { QGCAttitudeWidget {
id: attitude id: attitude
size: parent.height * 0.9 size: parent.width * 0.9
active: root.active 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 { QGCCompassWidget {
id: compass id: compass
size: parent.height * 0.9 size: parent.width * 0.9
active: root.active active: root.active
anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
} }
MouseArea { MouseArea {
...@@ -86,7 +203,7 @@ Item { ...@@ -86,7 +203,7 @@ Item {
Rectangle { Rectangle {
id: openButton id: openButton
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.verticalCenter: parent.verticalCenter
height: ScreenTools.defaultFontPixelSize * 2 height: ScreenTools.defaultFontPixelSize * 2
width: ScreenTools.defaultFontPixelSize * 2 width: ScreenTools.defaultFontPixelSize * 2
radius: ScreenTools.defaultFontPixelSize / 3 radius: ScreenTools.defaultFontPixelSize / 3
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include "QGroundControlQmlGlobal.h" #include "QGroundControlQmlGlobal.h"
static const char* kQmlGlobalKeyName = "QGCQml";
QGroundControlQmlGlobal::QGroundControlQmlGlobal(QObject* parent) QGroundControlQmlGlobal::QGroundControlQmlGlobal(QObject* parent)
: QObject(parent) : QObject(parent)
, _homePositionManager(HomePositionManager::instance()) , _homePositionManager(HomePositionManager::instance())
...@@ -38,3 +40,31 @@ QGroundControlQmlGlobal::~QGroundControlQmlGlobal() ...@@ -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: ...@@ -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 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_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 // Property accesors
HomePositionManager* homePositionManager () { return _homePositionManager; } 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