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) ...@@ -37,8 +37,8 @@ AirMapManager::AirMapManager(QGCApplication* app, QGCToolbox* toolbox)
{ {
_logger = std::make_shared<qt::Logger>(); _logger = std::make_shared<qt::Logger>();
qt::register_types(); // TODO: still needed? qt::register_types(); // TODO: still needed?
_logger->logging_category().setEnabled(QtDebugMsg, true); _logger->logging_category().setEnabled(QtDebugMsg, false);
_logger->logging_category().setEnabled(QtInfoMsg, true); _logger->logging_category().setEnabled(QtInfoMsg, false);
_logger->logging_category().setEnabled(QtWarningMsg, true); _logger->logging_category().setEnabled(QtWarningMsg, true);
_dispatchingLogger = std::make_shared<qt::DispatchingLogger>(_logger); _dispatchingLogger = std::make_shared<qt::DispatchingLogger>(_logger);
connect(&_shared, &AirMapSharedState::error, this, &AirMapManager::_error); connect(&_shared, &AirMapSharedState::error, this, &AirMapManager::_error);
......
This diff is collapsed.
...@@ -31,6 +31,7 @@ Item { ...@@ -31,6 +31,7 @@ Item {
source: _valid ? QGroundControl.airspaceManager.weatherInfo.icon : "" source: _valid ? QGroundControl.airspaceManager.weatherInfo.icon : ""
color: contentColor color: contentColor
visible: _valid visible: _valid
fillMode: Image.PreserveAspectFit
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
QGCLabel { 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 ...@@ -3,4 +3,6 @@ Module QGroundControl.Airmap
AirspaceControl 1.0 AirspaceControl.qml AirspaceControl 1.0 AirspaceControl.qml
AirspaceRegulation 1.0 AirspaceRegulation.qml AirspaceRegulation 1.0 AirspaceRegulation.qml
AirspaceWeather 1.0 AirspaceWeather.qml AirspaceWeather 1.0 AirspaceWeather.qml
RuleSelector 1.0 RuleSelector.qml ComplianceRules 1.0 ComplianceRules.qml
\ No newline at end of file FlightFeature 1.0 FlightFeature.qml
RuleSelector 1.0 RuleSelector.qml
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
<file alias="QGroundControl/Airmap/AirspaceControl.qml">AirspaceControl.qml</file> <file alias="QGroundControl/Airmap/AirspaceControl.qml">AirspaceControl.qml</file>
<file alias="QGroundControl/Airmap/AirspaceRegulation.qml">AirspaceRegulation.qml</file> <file alias="QGroundControl/Airmap/AirspaceRegulation.qml">AirspaceRegulation.qml</file>
<file alias="QGroundControl/Airmap/AirspaceWeather.qml">AirspaceWeather.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/qmldir">QGroundControl.Airmap.qmldir</file>
<file alias="QGroundControl/Airmap/RuleSelector.qml">RuleSelector.qml</file> <file alias="QGroundControl/Airmap/RuleSelector.qml">RuleSelector.qml</file>
</qresource> </qresource>
......
...@@ -9,6 +9,7 @@ Button { ...@@ -9,6 +9,7 @@ Button {
property bool primary: false ///< primary button for a group of buttons property bool primary: false ///< primary button for a group of buttons
property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text
property bool showBorder: _qgcPal.globalTheme === QGCPalette.Light property bool showBorder: _qgcPal.globalTheme === QGCPalette.Light
property bool iconLeft: false
property real backRadius: 0 property real backRadius: 0
property real heightFactor: 0.5 property real heightFactor: 0.5
...@@ -73,31 +74,35 @@ Button { ...@@ -73,31 +74,35 @@ Button {
/*! This defines the label of the button. */ /*! This defines the label of the button. */
label: Item { label: Item {
implicitWidth: row.implicitWidth implicitWidth: text.implicitWidth + icon.width
implicitHeight: row.implicitHeight implicitHeight: text.implicitHeight
baselineOffset: row.y + text.y + text.baselineOffset baselineOffset: text.y + text.baselineOffset
Row { QGCColoredImage {
id: row id: icon
anchors.centerIn: parent source: control.iconSource
spacing: ScreenTools.defaultFontPixelWidth * 0.25 height: source === "" ? 0 : text.height
width: height
Image { color: text.color
source: control.iconSource fillMode: Image.PreserveAspectFit
anchors.verticalCenter: parent.verticalCenter 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 { Text {
id: text id: text
anchors.verticalCenter: parent.verticalCenter anchors.centerIn: parent
antialiasing: true antialiasing: true
text: control.text text: control.text
font.pointSize: pointSize font.pointSize: pointSize
font.family: ScreenTools.normalFontFamily font.family: ScreenTools.normalFontFamily
color: _showHighlight ? color: _showHighlight ?
control._qgcPal.buttonHighlightText : control._qgcPal.buttonHighlightText :
(primary ? control._qgcPal.primaryButtonText : control._qgcPal.buttonText) (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