From 1c9e50647e88674f8bf7f23a36ade1b6c9465c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 8 May 2017 00:28:41 -0300 Subject: [PATCH] Add windguru arrow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- qgcresources.qrc | 1 + resources/wind-guru.svg | 35 +++++++++++++++++++++++++++++++ src/PlanView/SurveyItemEditor.qml | 23 +++++++++++++++++--- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 resources/wind-guru.svg diff --git a/qgcresources.qrc b/qgcresources.qrc index a5ec42a9d..ac1fbe767 100644 --- a/qgcresources.qrc +++ b/qgcresources.qrc @@ -193,6 +193,7 @@ resources/takeoff.svg resources/TrashDelete.svg resources/waves.svg + resources/wind-guru.svg resources/wind-rose.svg resources/wind-rose-arrow.svg resources/XDelete.svg diff --git a/resources/wind-guru.svg b/resources/wind-guru.svg new file mode 100644 index 000000000..f232bff5a --- /dev/null +++ b/resources/wind-guru.svg @@ -0,0 +1,35 @@ + + + + + + + image/svg+xml + + + + + + + + + diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index fdca2efb1..3191b1b40 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -559,9 +559,26 @@ Rectangle { origin.y: windRoseArrow.height / 2 axis { x: 0; y: 0; z: 1 } angle: windRosePie.angle } - x: windRosePie.x + Math.sin(- windRosePie.angle*Math.PI/180 - Math.PI/2)*(windRosePie.width/2 - windRoseArrow.width/2) + windRosePie.width / 2 - windRoseArrow.width / 2 - y: windRosePie.y + Math.cos(- windRosePie.angle*Math.PI/180 - Math.PI/2)*(windRosePie.height/2 - windRoseArrow.width/2) + windRosePie.height / 2 - windRoseArrow.height / 2 - z: windRosePie.z + x: windRosePie.x + Math.sin(- windRosePie.angle*Math.PI/180 - Math.PI/2)*(windRosePie.width/2 - windRoseArrow.width/2) + windRosePie.width / 2 - windRoseArrow.width / 2 + y: windRosePie.y + Math.cos(- windRosePie.angle*Math.PI/180 - Math.PI/2)*(windRosePie.width/2 - windRoseArrow.width/2) + windRosePie.height / 2 - windRoseArrow.height / 2 + z: windRosePie.z + } + + Image { + id: windGuru + source: "/res/wind-guru.svg" + visible: windRosePie.visible + width: windRosePie.width / 3 + height: width * 4.28e-1 + smooth: true + transform: Rotation { + origin.x: windGuru.width / 2 + origin.y: windGuru.height / 2 + axis { x: 0; y: 0; z: 1 } angle: windRosePie.angle + 180 + } + x: windRosePie.x + Math.sin(- windRosePie.angle*Math.PI/180 - 3*Math.PI/2)*(windRosePie.width/2/* - windGuru.height/2*/) + windRosePie.width / 2 - windGuru.width / 2 + y: windRosePie.y + Math.cos(- windRosePie.angle*Math.PI/180 - 3*Math.PI/2)*(windRosePie.height/2/* - windGuru.height/2*/) + windRosePie.height / 2 - windGuru.height / 2 + z: windRosePie.z } Item { -- 2.22.0