From 62b4fe2d8b7ada28c77882e7bea4535077fe249f Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Mon, 29 Jan 2018 08:39:59 -0500 Subject: [PATCH] Aircraft awareness graphics. Untested as I don't know how to test traffic monitoring. --- qgcresources.qrc | 1 + src/FlightMap/Images/AwarenessAircraft.svg | 20 ++++++++++++++++ src/FlightMap/MapItems/VehicleMapItem.qml | 27 ++++++++++++++++++---- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 src/FlightMap/Images/AwarenessAircraft.svg diff --git a/qgcresources.qrc b/qgcresources.qrc index 496b4e307..73fc128a1 100644 --- a/qgcresources.qrc +++ b/qgcresources.qrc @@ -172,6 +172,7 @@ src/FirmwarePlugin/APM/APMBrandImageSub.png src/FirmwarePlugin/PX4/PX4BrandImage.png src/FlightMap/Images/sub.png + src/FlightMap/Images/AwarenessAircraft.svg resources/action.svg diff --git a/src/FlightMap/Images/AwarenessAircraft.svg b/src/FlightMap/Images/AwarenessAircraft.svg new file mode 100644 index 000000000..509b5d55e --- /dev/null +++ b/src/FlightMap/Images/AwarenessAircraft.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + diff --git a/src/FlightMap/MapItems/VehicleMapItem.qml b/src/FlightMap/MapItems/VehicleMapItem.qml index b4c4d432a..28f7c11f2 100644 --- a/src/FlightMap/MapItems/VehicleMapItem.qml +++ b/src/FlightMap/MapItems/VehicleMapItem.qml @@ -7,9 +7,10 @@ * ****************************************************************************/ -import QtQuick 2.3 -import QtLocation 5.3 -import QtPositioning 5.3 +import QtQuick 2.3 +import QtLocation 5.3 +import QtPositioning 5.3 +import QtGraphicalEffects 1.0 import QGroundControl 1.0 import QGroundControl.ScreenTools 1.0 @@ -41,14 +42,30 @@ MapQuickItem { height: vehicleIcon.height opacity: vehicle ? (vehicle.active ? 1.0 : 0.5) : 1.0 + Rectangle { + id: vehicleShadow + anchors.fill: vehicleIcon + color: Qt.rgba(1,1,1,1) + radius: width * 0.5 + visible: false + } + DropShadow { + anchors.fill: arrowIconShadow + visible: vehicleIcon.visible + horizontalOffset: 4 + verticalOffset: 4 + radius: 32.0 + samples: 65 + color: Qt.rgba(0.94,0.91,0,0.5) + source: vehicleShadow + } Image { id: vehicleIcon - source: _adsbVehicle ? "/qmlimages/adsbVehicle.svg" : vehicle.vehicleImageOpaque + source: _adsbVehicle ? "/qmlimages/AwarenessAircraft.svg" : vehicle.vehicleImageOpaque mipmap: true width: size sourceSize.width: size fillMode: Image.PreserveAspectFit - transform: Rotation { origin.x: vehicleIcon.width / 2 origin.y: vehicleIcon.height / 2 -- 2.22.0