2 * Copyright (C) 2016 The LibrePilot Project
3 * Contact: http://www.librepilot.org
5 * This file is part of LibrePilot GCS.
7 * LibrePilot GCS is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * LibrePilot GCS is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with LibrePilot GCS. If not, see <http://www.gnu.org/licenses/>.
22 import "../js/uav.js" as UAV
26 property variant sceneSize
27 property real vert_velocity
30 interval: 100; running: true; repeat: true
31 onTriggered: vert_velocity = (0.9 * vert_velocity) + (0.1 * UAV.velocityStateDown())
36 elementName: "vsi-waypoint"
37 sceneSize: sceneItem.sceneSize
39 width: scaledBounds.width * sceneItem.width
40 height: scaledBounds.height * sceneItem.height
42 x: scaledBounds.x * sceneItem.width
43 y: scaledBounds.y * sceneItem.height
46 visible: (UAV.isFlightModeAssisted() && (UAV.velocityDesiredDown() != 0.0))
48 // rotate it around the center
50 angle: -UAV.velocityDesiredDown() * 5
51 origin.y : vsi_waypoint.height / 2
52 origin.x : vsi_waypoint.width * 33
59 visible: (pfdContext.altitudeUnit == "m")
60 elementName: "vsi-scale-meter"
61 sceneSize: sceneItem.sceneSize
63 x: Math.floor(scaledBounds.x * sceneItem.width)
64 y: Math.floor(scaledBounds.y * sceneItem.height)
71 visible: (pfdContext.altitudeUnit == "ft")
72 elementName: "vsi-scale-ft"
73 sceneSize: sceneItem.sceneSize
75 x: Math.floor(scaledBounds.x * sceneItem.width)
76 y: Math.floor(scaledBounds.y * sceneItem.height)
82 elementName: "vsi-arrow"
83 sceneSize: sceneItem.sceneSize
85 width: scaledBounds.width * sceneItem.width
86 height: scaledBounds.height * sceneItem.height
88 x: scaledBounds.x * sceneItem.width
89 y: scaledBounds.y * sceneItem.height
93 // rotate it around the center, limit value to +/-6m/s
95 angle: (vert_velocity > 6) ? -30 : (vert_velocity < -6) ? 30 : -vert_velocity * 5
96 origin.y : vsi_arrow.height / 2
97 origin.x : vsi_arrow.width * 3.15
101 SvgElementPositionItem {
103 elementName: "vsi-unit-text"
104 sceneSize: sceneItem.sceneSize
107 text: (pfdContext.altitudeUnit == "m") ? "m/s" : "ft/s"
111 pixelSize: parent.height * 1.7
112 weight: Font.DemiBold
114 anchors.centerIn: parent