From 1921f929f38237b88b489857c66d75b9ee2b618f Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Fri, 20 Jun 2014 18:26:31 +0200 Subject: [PATCH] OP-1354 Fixed pitch0 line, some centering. Added Home info : distance/bearing to home --- .../share/openpilotgcs/pfd/default/Info.qml | 49 ++++++++ .../share/openpilotgcs/pfd/default/Pfd.qml | 2 +- .../openpilotgcs/pfd/default/PfdWorldView.qml | 10 ++ .../openpilotgcs/pfd/default/Warnings.qml | 1 + .../share/openpilotgcs/pfd/default/pfd.svg | 113 ++++++++---------- 5 files changed, 114 insertions(+), 61 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index d7cafba26..0addbb094 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -4,6 +4,12 @@ Item { id: info property variant sceneSize + property real home_heading: 180/3.1415 * Math.atan2(TakeOffLocation.East - PositionState.East, + TakeOffLocation.North - PositionState.North) + + property real home_distance: Math.sqrt((TakeOffLocation.East - PositionState.East)*(TakeOffLocation.East - PositionState.East) + + (TakeOffLocation.North - PositionState.North)*(TakeOffLocation.North - PositionState.North)) + SvgElementImage { id: info_bg sceneSize: info.sceneSize @@ -183,6 +189,49 @@ Item { sceneSize: info.sceneSize } + SvgElementImage { + id: home_bg + elementName: "home-bg" + sceneSize: info.sceneSize + + visible: TakeOffLocation.Status == 0 + } + + SvgElementPositionItem { + sceneSize: info.sceneSize + elementName: "home-heading-text" + + visible: TakeOffLocation.Status == 0 + + Text { + text: home_heading.toFixed(1)+"°" + anchors.fill: parent + color: "cyan" + font { + family: "Arial" + pixelSize: Math.floor(parent.height * 1.2) + } + } + } + + SvgElementPositionItem { + sceneSize: info.sceneSize + elementName: "home-distance-text" + + visible: TakeOffLocation.Status == 0 + + Text { + text: home_distance.toFixed(0)+" m" + anchors.fill: parent + color: "cyan" + font { + family: "Arial" + pixelSize: Math.floor(parent.height * 1.2) + } + } + } + + SvgElementImage { id: info_border elementName: "info-border" diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml index c8c85c035..5ad121d9a 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml @@ -32,7 +32,7 @@ Rectangle { anchors.centerIn: parent clip: true - //onWidthChanged:console.log("Width/Height : "+width+" "+ height+" scale : "+width/height+" border : "+parent.paintedHeight * 0.006 ) + onWidthChanged:console.log("Width/Height : "+width+" "+ height+" scale : "+width/height+" border : "+parent.paintedHeight * 0.006+" TakeOffLocation.Status" + TakeOffLocation.Status) Loader { id: worldLoader diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml index 5c8baa1ca..b2b1d2e6a 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml @@ -49,6 +49,16 @@ Item { border: 1 smooth: true } + + SvgElementImage { + id: pitch_0 + elementName: "pitch0" + + sceneSize: background.sceneSize + anchors.centerIn: parent + border: 1 + smooth: true + } } Item { diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml index 8e2fc89d1..82030e16b 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml @@ -111,6 +111,7 @@ Item { id: warning_attitude elementName: "warning-attitude" sceneSize: warnings.sceneSize + anchors.centerIn: background.centerIn visible: SystemAlarms.Alarm_Attitude > 1 } } diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg index c121f3c80..aca54ae7a 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg @@ -50,11 +50,11 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1.3234375" - inkscape:cx="320" - inkscape:cy="240" + inkscape:zoom="9.3092382" + inkscape:cx="599.99681" + inkscape:cy="46" inkscape:document-units="px" - inkscape:current-layer="layer8" + inkscape:current-layer="layer2" showgrid="false" fit-margin-top="0" fit-margin-left="0" @@ -124,8 +124,7 @@ id="layer2" inkscape:label="horizon" style="display:inline" - transform="translate(0,-4)" - sodipodi:insensitive="true"> + transform="translate(0,-4)"> + transform="translate(0,-4)"> + style="display:inline"> + style="display:inline"> + style="display:inline"> - + + inkscape:connector-curvature="0" + sodipodi:nodetypes="scccss" /> + id="home-eta-label" + transform="translate(0,-1.6584)"> + id="home-distance-label" + transform="translate(0,-1.6584)"> + id="home-heading-label" + transform="translate(0,-1.6584)"> + style="display:inline"> + id="home-eta-text" + transform="translate(0,-1.5)"> + style="display:inline"> + id="home-distance-text" + transform="translate(0,-1.5)"> + style="display:inline"> + id="home-heading-text" + transform="translate(0,-1.5)"> + style="display:inline"> + inkscape:label="waypoint-eta-text"> + inkscape:label="waypoint-distance-text"> + inkscape:label="waypoint-heading-text"> + inkscape:label="waypoint-mode-text"> + style="display:inline"> + style="display:inline"> + style="display:inline"> + transform="translate(0,1.5)"> @@ -2455,7 +2445,7 @@ inkscape:connector-curvature="0" /> @@ -2467,20 +2457,20 @@ sodipodi:nodetypes="cc" /> @@ -4685,7 +4675,8 @@ inkscape:groupmode="layer" id="layer67" inkscape:label="warnings" - style="display:none"> + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> @@ -4868,7 +4860,8 @@ inkscape:groupmode="layer" id="layer33" inkscape:label="warning-rc-input" - style="display:inline"> + style="display:inline" + sodipodi:insensitive="true">