Commit 55bf2f59 authored by Gus Grubba's avatar Gus Grubba

Added flight info and flight brief UI. It's not yet wired to live, real data.

parent a6ea3d79
......@@ -37,8 +37,8 @@ AirMapManager::AirMapManager(QGCApplication* app, QGCToolbox* toolbox)
{
_logger = std::make_shared<qt::Logger>();
qt::register_types(); // TODO: still needed?
_logger->logging_category().setEnabled(QtDebugMsg, true);
_logger->logging_category().setEnabled(QtInfoMsg, true);
_logger->logging_category().setEnabled(QtDebugMsg, false);
_logger->logging_category().setEnabled(QtInfoMsg, false);
_logger->logging_category().setEnabled(QtWarningMsg, true);
_dispatchingLogger = std::make_shared<qt::DispatchingLogger>(_logger);
connect(&_shared, &AirMapSharedState::error, this, &AirMapManager::_error);
......
This diff is collapsed.
......@@ -31,6 +31,7 @@ Item {
source: _valid ? QGroundControl.airspaceManager.weatherInfo.icon : ""
color: contentColor
visible: _valid
fillMode: Image.PreserveAspectFit
anchors.verticalCenter: parent.verticalCenter
}
QGCLabel {
......
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2
import QtQml 2.2
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Airmap 1.0
import QGroundControl.SettingsManager 1.0
Item {
id: _root
height: ScreenTools.defaultFontPixelHeight * 2
property alias text: title.text
readonly property color _colorOrange: "#d75e0d"
readonly property color _colorYellow: "#d7c61d"
readonly property color _colorRed: "#aa1200"
readonly property color _colorGreen: "#125f00"
QGCPalette {
id: qgcPal
colorGroupEnabled: enabled
}
Rectangle {
anchors.fill: parent
color: qgcPal.windowShade
}
Row {
spacing: ScreenTools.defaultFontPixelWidth * 2
anchors.verticalCenter: parent.verticalCenter
Rectangle {
height: _root.height
width: ScreenTools.defaultFontPixelWidth * 0.75
color: _colorGreen
}
QGCLabel {
id: title
anchors.verticalCenter: parent.verticalCenter
}
}
QGCColoredImage {
source: "qrc:/airmap/expand.svg"
height: ScreenTools.defaultFontPixelHeight
width: height
color: qgcPal.text
fillMode: Image.PreserveAspectFit
sourceSize.height: height
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.verticalCenter: parent.verticalCenter
}
}
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2
import QtQml 2.2
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Airmap 1.0
import QGroundControl.SettingsManager 1.0
Rectangle {
id: _root
height: questionCol.height + (ScreenTools.defaultFontPixelHeight * 1.25)
color: qgcPal.windowShade
QGCPalette {
id: qgcPal
colorGroupEnabled: enabled
}
Column {
id: questionCol
spacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.centerIn: parent
QGCLabel {
text: "Question?"
anchors.left: questionText.left
}
QGCTextField {
id: questionText
width: _root.width - (ScreenTools.defaultFontPixelWidth * 2)
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
......@@ -3,4 +3,6 @@ Module QGroundControl.Airmap
AirspaceControl 1.0 AirspaceControl.qml
AirspaceRegulation 1.0 AirspaceRegulation.qml
AirspaceWeather 1.0 AirspaceWeather.qml
RuleSelector 1.0 RuleSelector.qml
\ No newline at end of file
ComplianceRules 1.0 ComplianceRules.qml
FlightFeature 1.0 FlightFeature.qml
RuleSelector 1.0 RuleSelector.qml
......@@ -4,6 +4,8 @@
<file alias="QGroundControl/Airmap/AirspaceControl.qml">AirspaceControl.qml</file>
<file alias="QGroundControl/Airmap/AirspaceRegulation.qml">AirspaceRegulation.qml</file>
<file alias="QGroundControl/Airmap/AirspaceWeather.qml">AirspaceWeather.qml</file>
<file alias="QGroundControl/Airmap/ComplianceRules.qml">ComplianceRules.qml</file>
<file alias="QGroundControl/Airmap/FlightFeature.qml">FlightFeature.qml</file>
<file alias="QGroundControl/Airmap/qmldir">QGroundControl.Airmap.qmldir</file>
<file alias="QGroundControl/Airmap/RuleSelector.qml">RuleSelector.qml</file>
</qresource>
......
......@@ -9,6 +9,7 @@ Button {
property bool primary: false ///< primary button for a group of buttons
property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text
property bool showBorder: _qgcPal.globalTheme === QGCPalette.Light
property bool iconLeft: false
property real backRadius: 0
property real heightFactor: 0.5
......@@ -73,31 +74,35 @@ Button {
/*! This defines the label of the button. */
label: Item {
implicitWidth: row.implicitWidth
implicitHeight: row.implicitHeight
baselineOffset: row.y + text.y + text.baselineOffset
implicitWidth: text.implicitWidth + icon.width
implicitHeight: text.implicitHeight
baselineOffset: text.y + text.baselineOffset
Row {
id: row
anchors.centerIn: parent
spacing: ScreenTools.defaultFontPixelWidth * 0.25
Image {
source: control.iconSource
anchors.verticalCenter: parent.verticalCenter
}
QGCColoredImage {
id: icon
source: control.iconSource
height: source === "" ? 0 : text.height
width: height
color: text.color
fillMode: Image.PreserveAspectFit
sourceSize.height: height
anchors.left: control.iconLeft ? parent.left : undefined
anchors.leftMargin: control.iconLeft ? ScreenTools.defaultFontPixelWidth : undefined
anchors.right: !control.iconLeft ? parent.right : undefined
anchors.rightMargin: !control.iconLeft ? ScreenTools.defaultFontPixelWidth : undefined
anchors.verticalCenter: parent.verticalCenter
}
Text {
id: text
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
text: control.text
font.pointSize: pointSize
font.family: ScreenTools.normalFontFamily
color: _showHighlight ?
control._qgcPal.buttonHighlightText :
(primary ? control._qgcPal.primaryButtonText : control._qgcPal.buttonText)
}
Text {
id: text
anchors.centerIn: parent
antialiasing: true
text: control.text
font.pointSize: pointSize
font.family: ScreenTools.normalFontFamily
color: _showHighlight ?
control._qgcPal.buttonHighlightText :
(primary ? control._qgcPal.primaryButtonText : control._qgcPal.buttonText)
}
}
}
......
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