diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml index b25596def..57afeb56a 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml @@ -32,13 +32,13 @@ Rectangle { source: "image://svg/pfd.svg!rollscale" sourceSize: background.sourceSize smooth: true - anchors.centerIn: parent - //rotate it around the center of scene - transform: Rotation { - angle: -AttitudeActual.Roll - origin.x : sceneItem.width/2 - x - origin.y : sceneItem.height/2 - y - } + anchors.centerIn: parent + //rotate it around the center of scene + transform: Rotation { + angle: -AttitudeActual.Roll + origin.x : sceneItem.width/2 - x + origin.y : sceneItem.height/2 - y + } } Image { @@ -78,6 +78,11 @@ Rectangle { sourceSize: background.sourceSize } + VsiScale { + anchors.fill: parent + sourceSize: background.sourceSize + } + PfdIndicators { anchors.fill: parent sourceSize: background.sourceSize diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/VsiScale.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/VsiScale.qml new file mode 100644 index 000000000..455104462 --- /dev/null +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/VsiScale.qml @@ -0,0 +1,85 @@ +import Qt 4.7 + +Item { + id: sceneItem + property variant sourceSize + + Image { + id: vsi_bg + source: "image://svg/pfd.svg!vsi-bg" + sourceSize: sceneItem.sourceSize + clip: true + + property variant scaledBounds: svgRenderer.scaledElementBounds("pfd.svg", "vsi-bg") + + x: scaledBounds.x * sceneItem.width + y: scaledBounds.y * sceneItem.height + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + + Image { + id: vsi_bar + + source: "image://svg/pfd.svg!vsi-bar" + sourceSize: sceneItem.sourceSize + + //the scale in 1000 ft/min with height == 5200 ft/min + height: (-VelocityActual.Down*3.28*60/1000)*(vsi_scale.height/5.2) + + + anchors.bottom: parent.verticalCenter + anchors.left: parent.left + } + + Image { + id: vsi_scale + + source: "image://svg/pfd.svg!vsi-scale" + sourceSize: sceneItem.sourceSize + + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + + //Text labels + Column { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.right + + Repeater { + model: [2, 1, 0, 1, 2] + Item { + height: vsi_scale.height / 5.2 //the scale height is 5200 + width: vsi_bg.width - vsi_scale.width //fill area right to scale + + Text { + text: modelData + visible: modelData !== 0 //hide "0" label + color: "white" + font.pixelSize: parent.height / 4 + font.family: "Arial" + + anchors.centerIn: parent + } + } + } + } + } + } + + + Image { + id: vsi_window + clip: true + smooth: true + + source: "image://svg/pfd.svg!vsi-window" + sourceSize: sceneItem.sourceSize + + property variant scaledBounds: svgRenderer.scaledElementBounds("pfd.svg", "vsi-window") + + x: scaledBounds.x * sceneItem.width + y: scaledBounds.y * sceneItem.height + width: scaledBounds.width * sceneItem.width + height: scaledBounds.height * sceneItem.height + } +} diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg index 95724c8b8..94fa89f92 100755 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg @@ -15,11 +15,11 @@ id="svg2" version="1.1" inkscape:version="0.48.3.1 r9886" - sodipodi:docname="pfd.svg" + sodipodi:docname="pfd-4.svg" style="display:inline" - inkscape:export-filename="H:\Documents\Hobbies\OpenPilot\SVN\artwork\PFD-2.png" - inkscape:export-xdpi="269.53" - inkscape:export-ydpi="269.53"> + inkscape:export-filename="C:\Users\Nuno\Desktop\OpenPilot\PFD\PFD-4.png" + inkscape:export-xdpi="71.993568" + inkscape:export-ydpi="71.993568"> + + + + + + + + @@ -1689,14 +1721,14 @@ image/svg+xml - + + + transform="translate(230.4171,-2.5493479)" + sodipodi:insensitive="true"> @@ -2097,13 +2545,13 @@ id="speed-bg" width="110.05586" height="450" - x="-209.23766" + x="-147.23766" y="131.33096" /> @@ -2280,11 +2728,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + 1 + 2 + 1 + + + + + + -