Commit 00e9317b authored by Gus Grubba's avatar Gus Grubba

Resources and indicator

parent 41d827f9
......@@ -146,6 +146,7 @@
<file alias="RCLossLight.svg">src/AutoPilotPlugins/PX4/Images/RCLossLight.svg</file>
<file alias="ReturnToHomeAltitude.svg">src/AutoPilotPlugins/PX4/Images/ReturnToHomeAltitude.svg</file>
<file alias="ReturnToHomeAltitudeCopter.svg">src/AutoPilotPlugins/PX4/Images/ReturnToHomeAltitudeCopter.svg</file>
<file alias="roi.svg">src/ui/toolbar/Images/roi.svg</file>
<file alias="rollDialWhite.svg">src/FlightMap/Images/rollDialWhite.svg</file>
<file alias="rollPointerWhite.svg">src/FlightMap/Images/rollPointerWhite.svg</file>
<file alias="RTK.svg">src/ui/toolbar/Images/RTK.svg</file>
......
......@@ -15,6 +15,7 @@
<file alias="ModeIndicator.qml">src/ui/toolbar/ModeIndicator.qml</file>
<file alias="MultiVehicleSelector.qml">src/ui/toolbar/MultiVehicleSelector.qml</file>
<file alias="RCRSSIIndicator.qml">src/ui/toolbar/RCRSSIIndicator.qml</file>
<file alias="ROIIndicator.qml">src/ui/toolbar/ROIIndicator.qml</file>
<file alias="TelemetryRSSIIndicator.qml">src/ui/toolbar/TelemetryRSSIIndicator.qml</file>
<file alias="VTOLModeIndicator.qml">src/ui/toolbar/VTOLModeIndicator.qml</file>
</qresource>
......
......@@ -319,7 +319,6 @@ QString FirmwarePlugin::vehicleImageCompass(const Vehicle* vehicle) const
const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
{
Q_UNUSED(vehicle);
//-- Default list of indicators for all vehicles.
if(_toolBarIndicatorList.size() == 0) {
_toolBarIndicatorList = QVariantList({
......@@ -335,14 +334,15 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MultiVehicleSelector.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/LinkIndicator.qml")),
});
if(vehicle->roiModeSupported()) {
_toolBarIndicatorList.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/ROIIndicator.qml")));
}
}
return _toolBarIndicatorList;
}
const QVariantList& FirmwarePlugin::cameraList(const Vehicle* vehicle)
const QVariantList& FirmwarePlugin::cameraList(const Vehicle*)
{
Q_UNUSED(vehicle);
if (_cameraList.size() == 0) {
CameraMetaData* metaData;
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 288 288" style="enable-background:new 0 0 288 288;" xml:space="preserve">
<path d="M188.3,144c0,24.5-19.8,44.3-44.3,44.3S99.7,168.5,99.7,144s19.8-44.3,44.3-44.3S188.3,119.5,188.3,144z M288,144
c0,6.1-5,11.1-11.1,11.1h-28.3c-5.2,49.2-44.4,88.4-93.6,93.6v28.3c0,6.1-5,11.1-11.1,11.1s-11.1-5-11.1-11.1v-28.3
c-49.2-5.2-88.4-44.4-93.6-93.6H11.1C5,155.1,0,150.1,0,144s5-11.1,11.1-11.1h28.3c5.2-49.2,44.4-88.4,93.6-93.6V11.1
C132.9,5,137.9,0,144,0s11.1,5,11.1,11.1v28.3c49.2,5.2,88.4,44.4,93.6,93.6h28.3C283,132.9,288,137.9,288,144z M227.1,144
c0-45.8-37.3-83.1-83.1-83.1S60.9,98.2,60.9,144s37.3,83.1,83.1,83.1S227.1,189.8,227.1,144z"/>
</svg>
/****************************************************************************
*
* (c) 2009-2019 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.
*
* @file
* @author Gus Grubba <gus@auterion.com>
*/
import QtQuick 2.11
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.11
import QGroundControl 1.0
import QGroundControl.Controls 1.0
import QGroundControl.MultiVehicleManager 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0
//-------------------------------------------------------------------------
//-- ROI Indicator
Item {
id: _root
width: showIndicator ? roiIcon.width : 0
visible: showIndicator
anchors.top: parent.top
anchors.bottom: parent.bottom
property bool showIndicator: activeVehicle && activeVehicle.roiModeSupported
Component {
id: roiInfo
Rectangle {
width: roiCol.width + ScreenTools.defaultFontPixelWidth * 6
height: roiCol.height + ScreenTools.defaultFontPixelHeight * 2
radius: ScreenTools.defaultFontPixelHeight * 0.5
color: qgcPal.window
Column {
id: roiCol
spacing: ScreenTools.defaultFontPixelHeight * 0.5
width: Math.max(roiButton.width, roiLabel.width)
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.centerIn: parent
QGCLabel {
id: roiLabel
text: qsTr("ROI Disabled")
font.family: ScreenTools.demiboldFontFamily
visible: !roiButton.visible
anchors.horizontalCenter: parent.horizontalCenter
}
QGCButton {
id: roiButton
visible: activeVehicle && activeVehicle.isROIEnabled
text: qsTr("Disable ROI")
onClicked: {
if(activeVehicle)
activeVehicle.stopGuidedModeROI()
mainWindow.hidePopUp()
}
}
}
}
}
QGCColoredImage {
id: roiIcon
width: height
anchors.top: parent.top
anchors.bottom: parent.bottom
sourceSize.height: height
source: "/qmlimages/roi.svg"
color: activeVehicle && activeVehicle.isROIEnabled ? qgcPal.colorGreen : qgcPal.text
fillMode: Image.PreserveAspectFit
opacity: activeVehicle && activeVehicle.isROIEnabled ? 1 : 0.5
}
MouseArea {
anchors.fill: parent
onClicked: {
mainWindow.showPopUp(_root, roiInfo)
}
}
}
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