From 8988e4901b715d5bb8c674ce8fff74a4ede9dcac Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Tue, 17 Jun 2014 14:29:24 +0200 Subject: [PATCH 01/13] OP-1354 Current_voltage_fixes_and_more_in_PFD : Solid border with round corners, better resizing --- .../share/openpilotgcs/pfd/default/Info.qml | 27 +- .../share/openpilotgcs/pfd/default/Pfd.qml | 20 +- .../openpilotgcs/pfd/default/Warnings.qml | 8 +- .../share/openpilotgcs/pfd/default/pfd.svg | 296 +++++++++--------- 4 files changed, 187 insertions(+), 164 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index 9dedc4365..346ce891b 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -6,8 +6,10 @@ Item { SvgElementImage { id: info_bg - elementName: "info-bg" sceneSize: info.sceneSize + elementName: "info-bg" + width: parent.width + anchors.fill: parent.top } SvgElementImage { @@ -25,11 +27,6 @@ Item { } } - SvgElementImage { - id: energy_label - elementName: "battery-milliamp-label" - sceneSize: info.sceneSize - } Repeater { id: satNumberBar @@ -53,7 +50,7 @@ Item { Text { text: ["No GPS", "No Fix", "Fix2D", "Fix3D"][GPSPositionSensor.Status] anchors.centerIn: parent - font.pixelSize: parent.height*1.2 + font.pixelSize: Math.floor(parent.height*1.2) color: "white" } } @@ -66,7 +63,7 @@ Item { text: ["Disconnected","HandshakeReq","HandshakeAck","Connected"][GCSTelemetryStats.Status] anchors.centerIn: parent - font.pixelSize: parent.height*1.2 + font.pixelSize: Math.floor(parent.height*1.2) color: "white" } } @@ -110,7 +107,7 @@ Item { color: "white" font { family: "Arial" - pixelSize: parent.height * 1.3 + pixelSize: Math.floor(parent.height * 1.2) } } } @@ -126,7 +123,7 @@ Item { color: "white" font { family: "Arial" - pixelSize: parent.height * 1.3 + pixelSize: Math.floor(parent.height * 1.2) } } } @@ -142,7 +139,7 @@ Item { color: "white" font { family: "Arial" - pixelSize: parent.height * 1.3 + pixelSize: Math.floor(parent.height * 1.2) } } } @@ -184,4 +181,12 @@ Item { elementName: "rx-mask" sceneSize: info.sceneSize } + + SvgElementImage { + id: info_border + elementName: "info-border" + sceneSize: info.sceneSize + width: Math.floor(parent.width * 1.01) + anchors.fill: parent.top + } } diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml index cca29f743..46eb673b6 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml @@ -8,18 +8,32 @@ Rectangle { elementName: "pfd-window" fillMode: Image.PreserveAspectFit anchors.fill: parent - sceneSize: Qt.size(width, height) + + Rectangle { + width: Math.floor(parent.paintedHeight * 1.32) + height: Math.floor(parent.paintedHeight - parent.paintedHeight * 0.008) + + color: "transparent" + border.color: "white" + border.width: Math.floor(parent.paintedHeight * 0.008) + radius: Math.floor(parent.paintedHeight * 0.01) + anchors.centerIn: parent + } Item { id: sceneItem + + + width: Math.floor((parent.paintedHeight * 1.32) - (parent.paintedHeight * 0.015)) + height: Math.floor(parent.paintedHeight - parent.paintedHeight * 0.02) property variant viewportSize : Qt.size(width, height) - width: parent.paintedWidth - height: parent.paintedHeight anchors.centerIn: parent clip: true + //onWidthChanged:console.log("Width/Height : "+width+" "+ height+" scale : "+width/height+" border : "+parent.paintedHeight * 0.006 ) + Loader { id: worldLoader anchors.fill: parent diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml index 0f86755e0..50ac85398 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml @@ -10,6 +10,8 @@ Item { id: warning_bg elementName: "warnings-bg" sceneSize: warnings.sceneSize + width: parent.width + 4 + anchors.fill: parent.bottom } SvgElementPositionItem { @@ -26,7 +28,7 @@ Item { text: "RC INPUT" font { family: "Arial" - pixelSize: parent.height * 0.8 + pixelSize: Math.floor(parent.height * 0.8) weight: Font.DemiBold } } @@ -53,7 +55,7 @@ Item { text: "MASTER CAUTION" font { family: "Arial" - pixelSize: parent.height * 0.8 + pixelSize: Math.floor(parent.height * 0.8) weight: Font.DemiBold } } @@ -74,7 +76,7 @@ Item { text: "AUTOPILOT" font { family: "Arial" - pixelSize: parent.height * 0.8 + pixelSize: Math.floor(parent.height * 0.8) weight: Font.DemiBold } } diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg index ca9d72433..233d90cf8 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg @@ -42,14 +42,6 @@ offset="1" id="stop5010" /> - - - image/svg+xml - + @@ -1136,57 +1128,48 @@ id="layer3" inkscape:label="info" style="display:inline" - transform="translate(0,-4)" - sodipodi:insensitive="true"> + transform="translate(0,-4)"> + transform="translate(0,4)"> - + + + + + - - - - - + x="-0.5" + y="-0.5" /> - - - - - - - - - - - + transform="matrix(1,0,0,1.0375459,-5.79738,-3.7697649)"> - + transform="matrix(1,0,0,1.0375459,0,-3.0939387)"> - + style="display:inline"> + style="display:inline"> + transform="translate(0,16.75)"> + style="display:inline"> + transform="translate(0,-1.231522)"> + + + + + + + + + + + + + + + + + + + style="display:inline"> + style="display:inline"> + style="display:none"> - + style="display:inline"> + + + + + style="display:inline"> @@ -4858,8 +4861,7 @@ inkscape:groupmode="layer" id="layer33" inkscape:label="warning-rc-input" - style="display:inline" - sodipodi:insensitive="true"> + style="display:inline"> @@ -5075,12 +5077,12 @@ transform="translate(0,-4)" sodipodi:insensitive="true"> From 98af0a544ff543b0ebe90d6557bcfec45b970177 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Tue, 17 Jun 2014 19:37:09 +0200 Subject: [PATCH 02/13] OP-1354 Current_voltage_fixes_and_more_in_PFD : Minor changes to remove some glitches --- .../openpilotgcs/share/openpilotgcs/pfd/default/Info.qml | 6 +++--- ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml | 4 ++-- .../share/openpilotgcs/pfd/default/Warnings.qml | 7 +++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index 346ce891b..d7cafba26 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -9,7 +9,7 @@ Item { sceneSize: info.sceneSize elementName: "info-bg" width: parent.width - anchors.fill: parent.top + //anchors.top: parent.top } SvgElementImage { @@ -154,6 +154,7 @@ Item { property int minThrottleNumber : index+1 elementName: "eng" + minThrottleNumber sceneSize: info.sceneSize + visible: throttleNumberBar.throttleNumber >= minThrottleNumber } } @@ -186,7 +187,6 @@ Item { id: info_border elementName: "info-border" sceneSize: info.sceneSize - width: Math.floor(parent.width * 1.01) - anchors.fill: parent.top + width: Math.floor(parent.width * 1.009) } } diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml index 46eb673b6..851070e5f 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml @@ -11,7 +11,7 @@ Rectangle { sceneSize: Qt.size(width, height) Rectangle { - width: Math.floor(parent.paintedHeight * 1.32) + width: Math.floor(parent.paintedHeight * 1.319) height: Math.floor(parent.paintedHeight - parent.paintedHeight * 0.008) color: "transparent" @@ -25,7 +25,7 @@ Rectangle { id: sceneItem - width: Math.floor((parent.paintedHeight * 1.32) - (parent.paintedHeight * 0.015)) + width: Math.floor((parent.paintedHeight * 1.32) - (parent.paintedHeight * 0.013)) height: Math.floor(parent.paintedHeight - parent.paintedHeight * 0.02) property variant viewportSize : Qt.size(width, height) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml index 50ac85398..8e2fc89d1 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml @@ -10,8 +10,8 @@ Item { id: warning_bg elementName: "warnings-bg" sceneSize: warnings.sceneSize - width: parent.width + 4 - anchors.fill: parent.bottom + width: background.width + anchors.bottom: parent.bottom } SvgElementPositionItem { @@ -103,7 +103,7 @@ Item { id: warning_battery elementName: "warning-battery" sceneSize: warnings.sceneSize - + anchors.right: parent.right visible: SystemAlarms.Alarm_Battery > 1 } @@ -111,7 +111,6 @@ Item { id: warning_attitude elementName: "warning-attitude" sceneSize: warnings.sceneSize - visible: SystemAlarms.Alarm_Attitude > 1 } } From 29d0d31e0948a22fe17c7ae988d259642e7096c7 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Thu, 19 Jun 2014 00:49:45 +0200 Subject: [PATCH 03/13] OP-1354 PFD fixes : World size (grey background appears when board is tilted) + Removed empty foreground item (add flickering on render) --- .../openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml | 8 -------- .../share/openpilotgcs/pfd/default/PfdWorldView.qml | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml index 851070e5f..3e0e7be5c 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml @@ -53,14 +53,6 @@ Rectangle { anchors.fill: parent } - SvgElementImage { - id: foreground - elementName: "foreground" - sceneSize: sceneItem.viewportSize - - anchors.centerIn: parent - } - SvgElementImage { id: side_slip_fixed elementName: "sideslip-fixed" diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml index eddc2f49f..5c8baa1ca 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml @@ -12,7 +12,7 @@ Item { property variant scaledBounds: svgRenderer.scaledElementBounds("pfd.svg", "horizon") width: Math.round(sceneItem.width*scaledBounds.width/2)*2 - height: Math.round(sceneItem.height*scaledBounds.height/2)*2 + height: Math.round(sceneItem.height*scaledBounds.height/2)*3 property double pitch1DegScaledHeight: (svgRenderer.scaledElementBounds("pfd.svg", "pitch-90").y - svgRenderer.scaledElementBounds("pfd.svg", "pitch90").y)/180.0 From 5dc0cb7d8e749e15f67d7792159361b95ced0b58 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Thu, 19 Jun 2014 20:50:47 +0200 Subject: [PATCH 04/13] OP-1354 Fixes center-arrows position on resize, disable sideslip moving (flicker issue on SmoothedAnimation) --- .../share/openpilotgcs/pfd/default/HorizontCenter.qml | 6 ++++++ ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml | 5 ++++- .../share/openpilotgcs/pfd/default/RollScale.qml | 7 +++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/HorizontCenter.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/HorizontCenter.qml index c5f7c36f1..6dee7b633 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/HorizontCenter.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/HorizontCenter.qml @@ -10,6 +10,9 @@ Item { elementName: "center-arrows" sceneSize: background.sceneSize + width: Math.floor(scaledBounds.width * sceneItem.width) + height: Math.floor(scaledBounds.height * sceneItem.height) + x: Math.floor(scaledBounds.x * sceneItem.width) y: Math.floor(scaledBounds.y * sceneItem.height) } @@ -19,6 +22,9 @@ Item { elementName: "center-plane" sceneSize: background.sceneSize + width: Math.floor(scaledBounds.width * sceneItem.width) + height: Math.floor(scaledBounds.height * sceneItem.height) + x: Math.floor(scaledBounds.x * sceneItem.width) y: Math.floor(scaledBounds.y * sceneItem.height) } diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml index 3e0e7be5c..c8c85c035 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml @@ -61,6 +61,8 @@ Rectangle { x: scaledBounds.x * sceneItem.width } +// Disable Side_slip moving because flickering issue on whole Pfd. +/* SvgElementImage { id: side_slip elementName: "sideslip-moving" @@ -77,11 +79,12 @@ Rectangle { } } - anchors.horizontalCenter: foreground.horizontalCenter + anchors.horizontalCenter: horizontCenterItem.horizontalCenter //0.5 coefficient is empirical to limit indicator movement anchors.horizontalCenterOffset: sideSlip*width*0.1 //was 0.5 y: scaledBounds.y * sceneItem.height } +*/ Compass { anchors.fill: parent diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/RollScale.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/RollScale.qml index d02023e3b..f5ab5df1a 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/RollScale.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/RollScale.qml @@ -13,8 +13,11 @@ Item { elementName: "roll-scale" sceneSize: sceneItem.sceneSize - x: Math.floor(scaledBounds.x * sceneItem.width) - y: Math.floor(scaledBounds.y * sceneItem.height) + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + + x: scaledBounds.x * sceneItem.width + y: scaledBounds.y * sceneItem.height smooth: true From 8e2efe0c5fc3193be0d25d080bd6650123e4adf6 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Fri, 20 Jun 2014 00:50:44 +0200 Subject: [PATCH 05/13] OP-1354 Added compass-home (Enabled if TakeOffLocation.Status is Valid) and compass-waypoint (Currently disabled) --- .../openpilotgcs/pfd/default/Compass.qml | 36 +++++++++++ .../share/openpilotgcs/pfd/default/pfd.svg | 59 +++++++++++-------- .../src/plugins/pfdqml/pfdqmlgadgetwidget.cpp | 3 +- 3 files changed, 71 insertions(+), 27 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml index 198b9502c..e8dfa9248 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml @@ -37,6 +37,42 @@ Item { smooth: true } + SvgElementImage { + id: compass_home + elementName: "compass-home" // Cyan point + sceneSize: sceneItem.sceneSize + smooth: true + + x: Math.floor(scaledBounds.x * sceneItem.width) + y: Math.floor(scaledBounds.y * sceneItem.height) + + property real home_degrees: 180/3.1415 * Math.atan2(TakeOffLocation.East - PositionState.East, TakeOffLocation.North - PositionState.North) + + rotation: -AttitudeState.Yaw + home_degrees + transformOrigin: Item.Bottom + visible: TakeOffLocation.Status == 0 + + } + + SvgElementImage { + id: compass_waypoint // Double Purple arrow + elementName: "compass-waypoint" + sceneSize: sceneItem.sceneSize + + x: Math.floor(scaledBounds.x * sceneItem.width) + y: Math.floor(scaledBounds.y * sceneItem.height) + + property real course_degrees: 180/3.1415 * Math.atan2(PathDesired.End_East - PositionState.East, PathDesired.End_North - PositionState.North) + + rotation: -AttitudeState.Yaw + course_degrees + transformOrigin: Item.Center + + smooth: true + visible: false + } + + + Item { id: compass_text_box diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg index 233d90cf8..c121f3c80 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="3.7432465" - inkscape:cx="152.24569" - inkscape:cy="438.16076" + inkscape:zoom="1.3234375" + inkscape:cx="320" + inkscape:cy="240" inkscape:document-units="px" - inkscape:current-layer="layer71" + inkscape:current-layer="layer8" showgrid="false" fit-margin-top="0" fit-margin-left="0" @@ -76,7 +76,9 @@ inkscape:snap-to-guides="true" inkscape:snap-nodes="true" inkscape:bbox-paths="false" - inkscape:snap-global="true"> + inkscape:snap-global="true" + inkscape:snap-intersection-paths="false" + inkscape:snap-object-midpoints="true"> image/svg+xml - + @@ -2821,14 +2823,12 @@ id="layer7" inkscape:label="compass" style="display:inline" - transform="translate(0,-4)" - sodipodi:insensitive="true"> + transform="translate(0,-4)"> + style="display:inline"> - + - + + + + getObject(); From 1921f929f38237b88b489857c66d75b9ee2b618f Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Fri, 20 Jun 2014 18:26:31 +0200 Subject: [PATCH 06/13] 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"> From 21fcbf024d825db03e2fa64dda19199cd00f7c15 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Fri, 20 Jun 2014 20:33:43 +0200 Subject: [PATCH 07/13] OP-1354 ETA for home based on current velocity and distance, time conversions/formating --- .../share/openpilotgcs/pfd/default/Info.qml | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index 0addbb094..241a991a9 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -7,9 +7,25 @@ Item { 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)) + property real home_distance: Math.sqrt(Math.pow(TakeOffLocation.East - PositionState.East,2) + + Math.pow(TakeOffLocation.North - PositionState.North,2)) + property real current_velocity: Math.sqrt(Math.pow(VelocityState.North,2)+Math.pow(VelocityState.East,2)) + + property real home_eta: Math.round(home_distance/current_velocity) + property real home_eta_h: Math.floor(home_eta / 3600) + property real home_eta_m: Math.floor((home_eta - home_eta_h*3600)/60) + property real home_eta_s: Math.floor(home_eta - home_eta_h*3600 - home_eta_m*60) + + function formatTime(time) { + if (time === 0) + return "00" + if (time < 10) + return "0" + time; + else + return time.toString(); + } + SvgElementImage { id: info_bg sceneSize: info.sceneSize @@ -231,6 +247,23 @@ Item { } } + SvgElementPositionItem { + sceneSize: info.sceneSize + elementName: "home-eta-text" + + visible: TakeOffLocation.Status == 0 + + Text { + text: formatTime(home_eta_h) + ":" + formatTime(home_eta_m) + ":" + formatTime(home_eta_s) + anchors.fill: parent + color: "cyan" + font { + family: "Arial" + pixelSize: Math.floor(parent.height * 1.2) + } + } + } + SvgElementImage { id: info_border From ae0e92b9a0f28733609682a6c1cd8172fea59e66 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sat, 21 Jun 2014 01:31:50 +0200 Subject: [PATCH 08/13] OP-1354 Compass-waypoint visibility, Home info animation. --- .../openpilotgcs/pfd/default/Compass.qml | 2 +- .../share/openpilotgcs/pfd/default/Info.qml | 88 +++++++++++++++---- .../share/openpilotgcs/pfd/default/Pfd.qml | 2 +- .../share/openpilotgcs/pfd/default/pfd.svg | 32 ++++--- 4 files changed, 87 insertions(+), 37 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml index e8dfa9248..2fb92cc19 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml @@ -68,7 +68,7 @@ Item { transformOrigin: Item.Center smooth: true - visible: false + visible: PathDesired.End_East !== 0.0 && PathDesired.End_East !== 0.0 } diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index 241a991a9..c11784949 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -7,15 +7,15 @@ Item { property real home_heading: 180/3.1415 * Math.atan2(TakeOffLocation.East - PositionState.East, TakeOffLocation.North - PositionState.North) - property real home_distance: Math.sqrt(Math.pow(TakeOffLocation.East - PositionState.East,2) + - Math.pow(TakeOffLocation.North - PositionState.North,2)) + property real home_distance: Math.sqrt(Math.pow((TakeOffLocation.East - PositionState.East),2) + + Math.pow((TakeOffLocation.North - PositionState.North),2)) property real current_velocity: Math.sqrt(Math.pow(VelocityState.North,2)+Math.pow(VelocityState.East,2)) - property real home_eta: Math.round(home_distance/current_velocity) - property real home_eta_h: Math.floor(home_eta / 3600) - property real home_eta_m: Math.floor((home_eta - home_eta_h*3600)/60) - property real home_eta_s: Math.floor(home_eta - home_eta_h*3600 - home_eta_m*60) + property real home_eta: (home_distance > 0 && current_velocity > 0 ? Math.round(home_distance/current_velocity) : 0) + property real home_eta_h: (home_eta > 0 ? Math.floor(home_eta / 3600) : 0 ) + property real home_eta_m: (home_eta > 0 ? Math.floor((home_eta - home_eta_h*3600)/60) : 0) + property real home_eta_s: (home_eta > 0 ? Math.floor(home_eta - home_eta_h*3600 - home_eta_m*60) : 0) function formatTime(time) { if (time === 0) @@ -209,57 +209,109 @@ Item { id: home_bg elementName: "home-bg" sceneSize: info.sceneSize + y: Math.floor(scaledBounds.y * sceneItem.height) - visible: TakeOffLocation.Status == 0 + states: State { + name: "fading" + when: TakeOffLocation.Status !== 0 + PropertyChanges { target: home_bg; x: Math.floor(scaledBounds.x * sceneItem.width) + home_bg.width; } + } + + transitions: Transition { + SequentialAnimation { + PropertyAnimation { property: "x"; duration: 800 } + } + } } SvgElementPositionItem { sceneSize: info.sceneSize + id: home_heading_text elementName: "home-heading-text" + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + y: Math.floor(scaledBounds.y * sceneItem.height) - visible: TakeOffLocation.Status == 0 - + states: State { + name: "fading_heading" + when: TakeOffLocation.Status !== 0 + PropertyChanges { target: home_heading_text; x: Math.floor(scaledBounds.x * sceneItem.width) + home_bg.width } + } + + transitions: Transition { + SequentialAnimation { + PropertyAnimation { property: "x"; duration: 800 } + } + } Text { - text: home_heading.toFixed(1)+"°" - anchors.fill: parent + text: " "+home_heading.toFixed(1)+"°" + anchors.centerIn: parent color: "cyan" font { family: "Arial" - pixelSize: Math.floor(parent.height * 1.2) + pixelSize: parent.height * 1.2 } } } SvgElementPositionItem { sceneSize: info.sceneSize + id: home_distance_text elementName: "home-distance-text" + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + y: Math.floor(scaledBounds.y * sceneItem.height) - visible: TakeOffLocation.Status == 0 + states: State { + name: "fading_distance" + when: TakeOffLocation.Status !== 0 + PropertyChanges { target: home_distance_text; x: Math.floor(scaledBounds.x * sceneItem.width) + home_bg.width; } + } + + transitions: Transition { + SequentialAnimation { + PropertyAnimation { property: "x"; duration: 800 } + } + } Text { text: home_distance.toFixed(0)+" m" - anchors.fill: parent + anchors.centerIn: parent color: "cyan" font { family: "Arial" - pixelSize: Math.floor(parent.height * 1.2) + pixelSize: parent.height * 1.2 } } } SvgElementPositionItem { sceneSize: info.sceneSize + id: home_eta_text elementName: "home-eta-text" + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + y: Math.floor(scaledBounds.y * sceneItem.height) - visible: TakeOffLocation.Status == 0 + states: State { + name: "fading_distance" + when: TakeOffLocation.Status !== 0 + PropertyChanges { target: home_eta_text; x: Math.floor(scaledBounds.x * sceneItem.width) + home_bg.width; } + } + + transitions: Transition { + SequentialAnimation { + PropertyAnimation { property: "x"; duration: 800 } + } + } Text { text: formatTime(home_eta_h) + ":" + formatTime(home_eta_m) + ":" + formatTime(home_eta_s) - anchors.fill: parent + anchors.centerIn: parent color: "cyan" font { family: "Arial" - pixelSize: Math.floor(parent.height * 1.2) + pixelSize: parent.height * 1.2 } } } diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml index 5ad121d9a..0c4afe9b9 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+" TakeOffLocation.Status" + TakeOffLocation.Status) + //onWidthChanged:console.log("TakeOffLocation.Status " + TakeOffLocation.Status) Loader { id: worldLoader diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg index aca54ae7a..bca747fc0 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg @@ -50,12 +50,12 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="9.3092382" - inkscape:cx="599.99681" - inkscape:cy="46" + inkscape:zoom="9.9282028" + inkscape:cx="593.25555" + inkscape:cy="43.480232" inkscape:document-units="px" - inkscape:current-layer="layer2" - showgrid="false" + inkscape:current-layer="layer25" + showgrid="true" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" @@ -906,7 +906,7 @@ + transform="matrix(1,0,0,1.0973877,0,-46.442937)"> + transform="matrix(1,0,0,1.0577142,0,-27.456636)"> + transform="matrix(1,0,0,1.0577142,0,-26.706351)"> + transform="matrix(1,0,0,0.99160769,0,2.0646588)"> + transform="matrix(1,0,0,0.99160769,0,2.0975587)"> + transform="matrix(1,0,0,0.99160769,15.28151,1.9884587)"> + inkscape:groupmode="layer"> + style="display:inline"> Date: Sat, 21 Jun 2014 13:09:23 +0200 Subject: [PATCH 09/13] OP-1354 Added waypoint info : wp# / wp count and mode --- .../share/openpilotgcs/pfd/default/Info.qml | 37 +++++++++ .../share/openpilotgcs/pfd/default/pfd.svg | 78 ++++++++++++------- .../src/plugins/pfdqml/pfdqmlgadgetwidget.cpp | 3 +- 3 files changed, 87 insertions(+), 31 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index c11784949..95b198cef 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -118,6 +118,43 @@ Item { } } + SvgElementPositionItem { + sceneSize: info.sceneSize + elementName: "waypoint-description-text" + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + y: Math.floor(scaledBounds.y * sceneItem.height) + visible: SystemAlarms.Alarm_PathPlan == 1 + + Text { + text: WaypointActive.Index+" / "+PathPlan.WaypointCount+" " + + anchors.centerIn: parent + font.pixelSize: parent.height*1.1 + color: "magenta" + } + } + + SvgElementPositionItem { + sceneSize: info.sceneSize + elementName: "waypoint-mode-text" + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + y: Math.floor(scaledBounds.y * sceneItem.height) + visible: SystemAlarms.Alarm_PathPlan == 1 + + Text { + text: ["Fly End Point","Fly Vector","Fly Circle Right","Fly Circle Left","Drive End Point","Drive Vector","Drive Circle Right", + "Drive Circle Left","Fixed Attitude","Set Accessory","Land","Disarm Alarm"][PathDesired.Mode] + + anchors.centerIn: parent + font.pixelSize: parent.height*1.1 + color: "magenta" + } + } + + + SvgElementPositionItem { sceneSize: info.sceneSize elementName: "battery-volt-text" diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg index bca747fc0..c55acfb1e 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="9.9282028" - inkscape:cx="593.25555" - inkscape:cy="43.480232" + inkscape:zoom="3.3787325" + inkscape:cx="305.54267" + inkscape:cy="416.93352" inkscape:document-units="px" - inkscape:current-layer="layer25" + inkscape:current-layer="layer18" showgrid="true" fit-margin-top="0" fit-margin-left="0" @@ -115,7 +115,7 @@ image/svg+xml - + @@ -124,7 +124,8 @@ id="layer2" inkscape:label="horizon" style="display:inline" - transform="translate(0,-4)"> + transform="translate(0,-4)" + sodipodi:insensitive="true"> + transform="translate(0,-4)" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + id="waypoint-label" + transform="matrix(1.0375459,0,0,1.0375459,-7.161678,-3.5667345)"> + id="waypoint-heading-label" + transform="translate(0,-3.00017)"> + id="waypoint-distance-label" + transform="translate(0,-3.00017)"> + id="waypoint-mode-label" + transform="translate(0,-3.113201)"> + id="waypoint-eta-label" + transform="matrix(1.0375459,0,0,1.0375459,-14.202279,-4.0166731)"> + transform="translate(0,0.595158)"> + transform="translate(0,0.595158)"> + transform="translate(0,0.595158)"> + transform="translate(0,0.595158)"> @@ -1845,7 +1859,7 @@ + transform="translate(0,0.595158)"> @@ -2813,7 +2827,8 @@ id="layer7" inkscape:label="compass" style="display:inline" - transform="translate(0,-4)"> + transform="translate(0,-4)" + sodipodi:insensitive="true"> + inkscape:groupmode="layer" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> getObject(); From 56e3b43e9fc4ca90ac9cb4eea2d1fbd3d46289ec Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sat, 21 Jun 2014 13:20:09 +0200 Subject: [PATCH 10/13] OP-1354 Missing WaypointActive --- ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp index a95ae10e9..e1978108d 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp @@ -65,7 +65,8 @@ PfdQmlGadgetWidget::PfdQmlGadgetWidget(QWindow *parent) : "FlightBatteryState" << "ActuatorDesired" << "TakeOffLocation" << - "PathPlan"; + "PathPlan" << + "WaypointActive"; ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); From 6bdb2fe0b306677b7a06f71eabf65fb48d81cab4 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sat, 21 Jun 2014 21:19:21 +0200 Subject: [PATCH 11/13] OP-1354 Waypoint heading/distance info, basic distance counter. --- .../share/openpilotgcs/pfd/default/Info.qml | 111 ++++++++++++++++- .../share/openpilotgcs/pfd/default/pfd.svg | 115 +++++++++++++++--- 2 files changed, 205 insertions(+), 21 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index 95b198cef..c9ab07ab5 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -10,6 +10,12 @@ Item { property real home_distance: Math.sqrt(Math.pow((TakeOffLocation.East - PositionState.East),2) + Math.pow((TakeOffLocation.North - PositionState.North),2)) + property real wp_heading: 180/3.1415 * Math.atan2(PathDesired.End_East - PositionState.East, + PathDesired.End_North - PositionState.North) + + property real wp_distance: Math.sqrt(Math.pow((PathDesired.End_East - PositionState.East),2) + + Math.pow(( PathDesired.End_North - PositionState.North),2)) + property real current_velocity: Math.sqrt(Math.pow(VelocityState.North,2)+Math.pow(VelocityState.East,2)) property real home_eta: (home_distance > 0 && current_velocity > 0 ? Math.round(home_distance/current_velocity) : 0) @@ -17,7 +23,28 @@ Item { property real home_eta_m: (home_eta > 0 ? Math.floor((home_eta - home_eta_h*3600)/60) : 0) property real home_eta_s: (home_eta > 0 ? Math.floor(home_eta - home_eta_h*3600 - home_eta_m*60) : 0) - function formatTime(time) { + property real wp_eta: (wp_distance > 0 && current_velocity > 0 ? Math.round(wp_distance/current_velocity) : 0) + property real wp_eta_h: (wp_eta > 0 ? Math.floor(wp_eta / 3600) : 0 ) + property real wp_eta_m: (wp_eta > 0 ? Math.floor((wp_eta - wp_eta_h*3600)/60) : 0) + property real wp_eta_s: (wp_eta > 0 ? Math.floor(wp_eta - wp_eta_h*3600 - wp_eta_m*60) : 0) + + property real posEast_old + property real posNorth_old + property real total_distance + property bool init_dist: false + + function compute_distance(posEast,posNorth) { + if (total_distance == 0 && !init_dist){init_dist = "true"; posEast_old = posEast; posNorth_old = posNorth;} + if (posEast > posEast_old+3 || posEast < posEast_old-3 || posNorth > posNorth_old+3 || posNorth < posNorth_old-3) { + total_distance += Math.sqrt(Math.pow((posEast - posEast_old ),2) + Math.pow((posNorth - posNorth_old),2)); + + posEast_old = posEast; + posNorth_old = posNorth; + return total_distance; + } + } + + function formatTime(time) { if (time === 0) return "00" if (time < 10) @@ -120,14 +147,90 @@ Item { SvgElementPositionItem { sceneSize: info.sceneSize - elementName: "waypoint-description-text" + elementName: "waypoint-heading-text" width: scaledBounds.width * sceneItem.width height: scaledBounds.height * sceneItem.height y: Math.floor(scaledBounds.y * sceneItem.height) visible: SystemAlarms.Alarm_PathPlan == 1 Text { - text: WaypointActive.Index+" / "+PathPlan.WaypointCount+" " + text: " "+wp_heading.toFixed(1)+"°" + + anchors.centerIn: parent + font.pixelSize: parent.height*1.1 + color: "magenta" + } + } + + SvgElementPositionItem { + sceneSize: info.sceneSize + elementName: "waypoint-distance-text" + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + y: Math.floor(scaledBounds.y * sceneItem.height) + visible: SystemAlarms.Alarm_PathPlan == 1 + + Text { + text: " "+wp_distance.toFixed(0)+" m" + + anchors.centerIn: parent + font.pixelSize: parent.height*1.1 + color: "magenta" + } + } + + SvgElementPositionItem { + sceneSize: info.sceneSize + elementName: "waypoint-total-distance-text" + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + y: Math.floor(scaledBounds.y * sceneItem.height) + visible: true //total_distance > 5 + + property real total_distance: 0 + + Text { + text: " "+total_distance.toFixed(0)+" m" + + anchors.centerIn: parent + font.pixelSize: parent.height*1.1 + color: "magenta" + } + + Timer { + interval: 1000; running: true; repeat: true; + onTriggered: {if (GPSPositionSensor.Status == 3) compute_distance(PositionState.East,PositionState.North)} + } + + } + + SvgElementPositionItem { + sceneSize: info.sceneSize + elementName: "waypoint-eta-text" + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + y: Math.floor(scaledBounds.y * sceneItem.height) + visible: SystemAlarms.Alarm_PathPlan == 1 + + Text { + text: formatTime(wp_eta_h) + ":" + formatTime(wp_eta_m) + ":" + formatTime(wp_eta_s) + + anchors.centerIn: parent + font.pixelSize: parent.height*1.1 + color: "magenta" + } + } + + SvgElementPositionItem { + sceneSize: info.sceneSize + elementName: "waypoint-number-text" + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + y: Math.floor(scaledBounds.y * sceneItem.height) + visible: SystemAlarms.Alarm_PathPlan == 1 + + Text { + text: (WaypointActive.Index+1)+" / "+PathPlan.WaypointCount anchors.centerIn: parent font.pixelSize: parent.height*1.1 @@ -153,8 +256,6 @@ Item { } } - - SvgElementPositionItem { sceneSize: info.sceneSize elementName: "battery-volt-text" diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg index c55acfb1e..eddbc6a21 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="3.3787325" - inkscape:cx="305.54267" - inkscape:cy="416.93352" + inkscape:zoom="5.9383334" + inkscape:cx="248.68909" + inkscape:cy="451.58086" inkscape:document-units="px" - inkscape:current-layer="layer18" + inkscape:current-layer="layer60" showgrid="true" fit-margin-top="0" fit-margin-left="0" @@ -1378,11 +1378,48 @@ style="font-size:8px;fill:#ffffff" id="path6377" inkscape:connector-curvature="0" /> + + + + + + + + + + transform="translate(2,0.595158)"> + transform="translate(30,0.595158)"> + + + d="m 309.28568,10.810623 -1.70508,0 -0.49219,1.957031 1.7168,0 0.48047,-1.957031 m -0.87891,-3.3339842 -0.60938,2.4316406 1.71094,0 0.61524,-2.4316406 0.9375,0 -0.60352,2.4316406 1.82813,0 0,0.9023436 -2.05665,0 -0.48046,1.957031 1.86328,0 0,0.896485 -2.0918,0 -0.60937,2.425781 -0.9375,0 0.60351,-2.425781 -1.7168,0 -0.60351,2.425781 -0.94336,0 0.60937,-2.425781 -1.8457,0 0,-0.896485 2.0625,0 0.49219,-1.957031 -1.88672,0 0,-0.9023436 2.11523,0 0.59766,-2.4316406 0.94922,0" /> + + + + + d="m 303.29349,23.12117 c -0.60938,8e-6 -1.06836,0.300789 -1.37696,0.902344 -0.30469,0.597663 -0.45703,1.498052 -0.45703,2.701172 0,1.199222 0.15234,2.099611 0.45703,2.701172 0.3086,0.597657 0.76758,0.896485 1.37696,0.896484 0.61327,1e-6 1.07226,-0.298827 1.37695,-0.896484 0.30859,-0.601561 0.46289,-1.50195 0.46289,-2.701172 0,-1.20312 -0.1543,-2.103509 -0.46289,-2.701172 -0.30469,-0.601555 -0.76368,-0.902336 -1.37695,-0.902344 m 0,-0.9375 c 0.98046,9e-6 1.72851,0.38868 2.24414,1.166016 0.51952,0.773444 0.77929,1.898443 0.7793,3.375 -1e-5,1.472659 -0.25978,2.597658 -0.7793,3.375 -0.51563,0.773437 -1.26368,1.160156 -2.24414,1.160156 -0.98047,0 -1.73047,-0.386719 -2.25,-1.160156 -0.51563,-0.777342 -0.77344,-1.902341 -0.77344,-3.375 0,-1.476557 0.25781,-2.601556 0.77344,-3.375 0.51953,-0.777336 1.26953,-1.166007 2.25,-1.166016" /> + d="m 310.93411,23.12117 c -0.60938,8e-6 -1.06836,0.300789 -1.37695,0.902344 -0.30469,0.597663 -0.45703,1.498052 -0.45703,2.701172 0,1.199222 0.15234,2.099611 0.45703,2.701172 0.30859,0.597657 0.76757,0.896485 1.37695,0.896484 0.61328,1e-6 1.07226,-0.298827 1.37696,-0.896484 0.30858,-0.601561 0.46288,-1.50195 0.46289,-2.701172 -10e-6,-1.20312 -0.15431,-2.103509 -0.46289,-2.701172 -0.3047,-0.601555 -0.76368,-0.902336 -1.37696,-0.902344 m 0,-0.9375 c 0.98047,9e-6 1.72851,0.38868 2.24414,1.166016 0.51953,0.773444 0.77929,1.898443 0.7793,3.375 -1e-5,1.472659 -0.25977,2.597658 -0.7793,3.375 -0.51563,0.773437 -1.26367,1.160156 -2.24414,1.160156 -0.98047,0 -1.73047,-0.386719 -2.25,-1.160156 -0.51562,-0.777342 -0.77344,-1.902341 -0.77343,-3.375 -1e-5,-1.476557 0.25781,-2.601556 0.77343,-3.375 0.51953,-0.777336 1.26953,-1.166007 2.25,-1.166016" /> + + + + + + @@ -2855,7 +2938,7 @@ transform="translate(0,78)"> Date: Sun, 22 Jun 2014 17:06:09 +0200 Subject: [PATCH 12/13] OP-1354 Sumdist reset --- .../share/openpilotgcs/pfd/default/Info.qml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index c9ab07ab5..d30167330 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -33,6 +33,10 @@ Item { property real total_distance property bool init_dist: false + function reset_distance(){ + total_distance = 0; + } + function compute_distance(posEast,posNorth) { if (total_distance == 0 && !init_dist){init_dist = "true"; posEast_old = posEast; posNorth_old = posNorth;} if (posEast > posEast_old+3 || posEast < posEast_old-3 || posNorth > posNorth_old+3 || posNorth < posNorth_old-3) { @@ -187,7 +191,7 @@ Item { y: Math.floor(scaledBounds.y * sceneItem.height) visible: true //total_distance > 5 - property real total_distance: 0 + MouseArea { id: total_dist_mouseArea; anchors.fill: parent; onClicked: reset_distance()} Text { text: " "+total_distance.toFixed(0)+" m" @@ -197,11 +201,10 @@ Item { color: "magenta" } - Timer { - interval: 1000; running: true; repeat: true; - onTriggered: {if (GPSPositionSensor.Status == 3) compute_distance(PositionState.East,PositionState.North)} - } - + Timer { + interval: 1000; running: true; repeat: true; + onTriggered: {if (GPSPositionSensor.Status == 3) compute_distance(PositionState.East,PositionState.North)} + } } SvgElementPositionItem { From c6245260ec19210b756a122dcc0f7695710cadd1 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 22 Jun 2014 20:37:22 +0200 Subject: [PATCH 13/13] OP-1354 Removed commented code --- .../share/openpilotgcs/pfd/default/Info.qml | 3 +- .../share/openpilotgcs/pfd/default/Pfd.qml | 30 +------------------ 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index d30167330..699e0b2f0 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -62,7 +62,6 @@ Item { sceneSize: info.sceneSize elementName: "info-bg" width: parent.width - //anchors.top: parent.top } SvgElementImage { @@ -189,7 +188,7 @@ Item { width: scaledBounds.width * sceneItem.width height: scaledBounds.height * sceneItem.height y: Math.floor(scaledBounds.y * sceneItem.height) - visible: true //total_distance > 5 + visible: true MouseArea { id: total_dist_mouseArea; anchors.fill: parent; onClicked: reset_distance()} diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml index 0c4afe9b9..336a0617a 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml @@ -23,7 +23,6 @@ Rectangle { Item { id: sceneItem - width: Math.floor((parent.paintedHeight * 1.32) - (parent.paintedHeight * 0.013)) height: Math.floor(parent.paintedHeight - parent.paintedHeight * 0.02) @@ -31,9 +30,7 @@ Rectangle { anchors.centerIn: parent clip: true - - //onWidthChanged:console.log("TakeOffLocation.Status " + TakeOffLocation.Status) - + Loader { id: worldLoader anchors.fill: parent @@ -61,31 +58,6 @@ Rectangle { x: scaledBounds.x * sceneItem.width } -// Disable Side_slip moving because flickering issue on whole Pfd. -/* - SvgElementImage { - id: side_slip - elementName: "sideslip-moving" - sceneSize: sceneItem.viewportSize - smooth: true - - property real sideSlip: AccelState.y - //smooth side slip changes, a low pass filter replacement - //accels are updated once per second - Behavior on sideSlip { - SmoothedAnimation { - duration: 1000 - velocity: -1 - } - } - - anchors.horizontalCenter: horizontCenterItem.horizontalCenter - //0.5 coefficient is empirical to limit indicator movement - anchors.horizontalCenterOffset: sideSlip*width*0.1 //was 0.5 - y: scaledBounds.y * sceneItem.height - } -*/ - Compass { anchors.fill: parent sceneSize: sceneItem.viewportSize