Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added CMakeSettings.json
Empty file.
6 changes: 6 additions & 0 deletions qgcimages.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,11 @@
<file alias="ZoomMinus.svg">src/FlightMap/Images/ZoomMinus.svg</file>
<file alias="ZoomPlus.svg">src/FlightMap/Images/ZoomPlus.svg</file>
<file alias="Viewer3D/City3DMapIcon.svg">src/Viewer3D/Images/city_3d_map_icon.svg</file>
<file alias="EcamIcon.svg">resources/EcamIcon.svg</file>
<file alias="EngineIcon.svg">src/Engine/images/EngineIcon.svg</file>
<file alias="ElectronicIcon.svg">src/Engine/images/ElectronicIcon.svg</file>
<file alias="FuelIcon.svg">src/Engine/images/FuelIcon.svg</file>
<file alias="FctlIcon.svg">src/Engine/images/FctlIcon.svg</file>
<file alias="CursieIcon.svg">src/Engine/images/CursieIcon.svg</file>
</qresource>
</RCC>
2 changes: 2 additions & 0 deletions qgroundcontrol.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@
<file alias="DebugWindow.qml">src/UI/preferences/DebugWindow.qml</file>
<file alias="MockLink.qml">src/UI/preferences/MockLink.qml</file>
<file alias="MockLinkSettings.qml">src/UI/preferences/MockLinkSettings.qml</file>
<file>src/Engine/EngineStatus.qml</file>
<file alias="EngineSummary.qml">src/Engine/EngineSummary.qml</file>
</qresource>
<qresource prefix="/FirstRunPromptDialogs">
<file alias="UnitsFirstRunPrompt.qml">src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml</file>
Expand Down
3 changes: 3 additions & 0 deletions resources/EcamIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions src/API/QGCCorePlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,34 @@ const QVariantList &QGCCorePlugin::analyzePages()
return analyzeList;
}

//Create ECAM Pages List
const QVariantList &QGCCorePlugin::ecamPages()
{
static const QVariantList ecamList = {
QVariant::fromValue(new QmlComponentInfo(
tr("Engine"),
QUrl::fromUserInput(QStringLiteral("qrc:/qml/EngineSummary.qml")),
QUrl::fromUserInput(QStringLiteral("qrc:/qmlimages/EngineIcon.svg")))),
QVariant::fromValue(new QmlComponentInfo(
tr("Electronic"),
QUrl::fromUserInput(QStringLiteral("qrc:/qml/LogDownloadPage.qml")),
QUrl::fromUserInput(QStringLiteral("qrc:/qmlimages/ElectronicIcon.svg")))),
QVariant::fromValue(new QmlComponentInfo(
tr("Fuel"),
QUrl::fromUserInput(QStringLiteral("qrc:/qml/LogDownloadPage.qml")),
QUrl::fromUserInput(QStringLiteral("qrc:/qmlimages/FuelIcon.svg")))),
QVariant::fromValue(new QmlComponentInfo
(tr("F/Ctl"),
QUrl::fromUserInput(QStringLiteral("qrc:/qml/LogDownloadPage.qml")),
QUrl::fromUserInput(QStringLiteral("qrc:/qmlimages/FctlIcon.svg")))),
QVariant::fromValue(new QmlComponentInfo
(tr("Crusie"),
QUrl::fromUserInput(QStringLiteral("qrc:/qml/LogDownloadPage.qml")),
QUrl::fromUserInput(QStringLiteral("qrc:/qmlimages/CursieIcon.svg")))),
};
return ecamList;
}

QGCOptions *QGCCorePlugin::options()
{
return _defaultOptions;
Expand Down
6 changes: 6 additions & 0 deletions src/API/QGCCorePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class QGCCorePlugin : public QObject
Q_PROPERTY(QString showAdvancedUIMessage READ showAdvancedUIMessage CONSTANT)
Q_PROPERTY(QVariantList analyzePages READ analyzePages CONSTANT)
Q_PROPERTY(QVariantList toolBarIndicators READ toolBarIndicators CONSTANT)
//Register of ECAM Page List
Q_PROPERTY(QVariantList ecamPages READ ecamPages CONSTANT)

public:
explicit QGCCorePlugin(QObject *parent = nullptr);
Expand All @@ -63,6 +65,10 @@ class QGCCorePlugin : public QObject
/// @return A list of QmlPageInfo
virtual const QVariantList &analyzePages();

///The list of pages/buttons under the ECAM Menu
///@return A list of QmlPageInfo
virtual const QVariantList &ecamPages();

/// The default settings panel to show
/// @return The settings index
virtual int defaultSettings() { return 0; }
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ add_subdirectory(UTMSP)
add_subdirectory(Vehicle)
add_subdirectory(VideoManager)
add_subdirectory(Viewer3D)
add_subdirectory(Engine)

add_subdirectory(QtLocationPlugin)
21 changes: 21 additions & 0 deletions src/Engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ===================================================================
# Engine Status Subsystem
# ===================================================================
target_sources(${CMAKE_PROJECT_NAME}
PRIVATE
Engine.cc
Engine.h
)
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

QT_ADD_LIBRARY(EngineStatusModule STATIC)

QT_ADD_QML_MODULE(EngineStatusModule
URI QGroundControl.EngineStatus
VERSION 1.0
RESOURCE_PREFIX /qml
QML_FILES
EngineStatus.qml
EngineSummary.qml
NO_PLUGIN
)
1 change: 1 addition & 0 deletions src/Engine/Engine.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "Engine.h"
1 change: 1 addition & 0 deletions src/Engine/Engine.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#pragma once
127 changes: 127 additions & 0 deletions src/Engine/EngineStatus.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/

import QtQuick
import QtQuick.Window
import QtQuick.Controls

import QGroundControl
import QGroundControl.Palette
import QGroundControl.Controls
import QGroundControl.Controllers
import QGroundControl.ScreenTools

Rectangle {
id: _root
color: qgcPal.window
z: QGroundControl.zOrderTopMost

signal popout()

readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight
readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth
readonly property real _horizontalMargin: _defaultTextWidth / 2
readonly property real _verticalMargin: _defaultTextHeight / 2
readonly property real _buttonWidth: _defaultTextWidth * 18

GeoTagController {
id: geoController
}

QGCFlickable {
id: buttonScroll
width: buttonColumn.width
anchors.topMargin: _defaultTextHeight / 2
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.leftMargin: _horizontalMargin
anchors.left: parent.left
contentHeight: buttonColumn.height
flickableDirection: Flickable.VerticalFlick
clip: true

Column {
id: buttonColumn
width: _maxButtonWidth
spacing: _defaultTextHeight / 2

property real _maxButtonWidth: 0

Component.onCompleted: reflowWidths()

// I don't know why this does not work
Connections {
target: QGroundControl.settingsManager.appSettings.appFontPointSize
onValueChanged: buttonColumn.reflowWidths()
}

function reflowWidths() {
buttonColumn._maxButtonWidth = 0
for (var i = 0; i < children.length; i++) {
buttonColumn._maxButtonWidth = Math.max(buttonColumn._maxButtonWidth, children[i].width)
}
for (var j = 0; j < children.length; j++) {
children[j].width = buttonColumn._maxButtonWidth
}
}

Repeater {
id: buttonRepeater
model: QGroundControl.corePlugin ? QGroundControl.corePlugin.ecamPages : []

Component.onCompleted: itemAt(0).checked = true

SubMenuButton {
id: subMenu
imageResource: modelData.icon
autoExclusive: true
text: modelData.title

onClicked: {
panelLoader.source = modelData.url
panelLoader.title = modelData.title
checked = true
}
}
}
}
}

Rectangle {
id: divider
anchors.topMargin: _verticalMargin
anchors.bottomMargin: _verticalMargin
anchors.leftMargin: _horizontalMargin
anchors.left: buttonScroll.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 1
color: qgcPal.windowShade
}

Loader {
id: panelLoader
anchors.topMargin: _verticalMargin
anchors.bottomMargin: _verticalMargin
anchors.leftMargin: _horizontalMargin
anchors.rightMargin: _horizontalMargin
anchors.left: divider.right
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
source: "qrc:/qml/EngineSummary.qml"

property string title

Connections {
target: panelLoader.item
onPopout: mainWindow.createrWindowedAnalyzePage(panelLoader.title, panelLoader.source)
}
}
}
Loading
Loading