1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

OP-1354 Updates battery values : Fixes blinking pfd

This commit is contained in:
Laurent Lalanne 2014-05-26 16:56:18 +02:00
parent 9dc02fde61
commit 6a9f588082

View File

@ -77,72 +77,52 @@ Item {
visible: rxNumberBar.rxRateNumber >= minRxRateNumber visible: rxNumberBar.rxRateNumber >= minRxRateNumber
} }
} }
Item {
id: battery_voltage
property variant scaledBounds: svgRenderer.scaledElementBounds("pfd.svg", "battery-volt-text") SvgElementPositionItem {
sceneSize: info.sceneSize
x: scaledBounds.x * sceneItem.width elementName: "battery-volt-text"
y: scaledBounds.y * sceneItem.height
width: scaledBounds.width * sceneItem.width
height: scaledBounds.height * sceneItem.height
visible: FlightBatteryState.Voltage > 0 visible: FlightBatteryState.Voltage > 0
Text { Text {
id: battery_volt text: FlightBatteryState.Voltage.toFixed(2)
text: FlightBatteryState.Voltage.toFixed(2) anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: "Arial"
pixelSize: parent.height * 1.2 pixelSize: parent.height * 1.3
} }
anchors.centerIn: parent
} }
} }
Item { SvgElementPositionItem {
id: battery_current sceneSize: info.sceneSize
elementName: "battery-amp-text"
property variant scaledBounds: svgRenderer.scaledElementBounds("pfd.svg", "battery-amp-text")
x: scaledBounds.x * sceneItem.width
y: scaledBounds.y * sceneItem.height
width: scaledBounds.width * sceneItem.width
height: scaledBounds.height * sceneItem.height
visible: FlightBatteryState.Current > 0 visible: FlightBatteryState.Current > 0
Text { Text {
id: battery_cur text: FlightBatteryState.Current.toFixed(2)
text: FlightBatteryState.Current.toFixed(2) anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: "Arial"
pixelSize: parent.height * 1.2 pixelSize: parent.height * 1.3
} }
anchors.centerIn: parent
} }
} }
Item { SvgElementPositionItem {
id: battery_consumed_energy sceneSize: info.sceneSize
elementName: "battery-milliamp-text"
property variant scaledBounds: svgRenderer.scaledElementBounds("pfd.svg", "battery-milliamp-text")
x: scaledBounds.x * sceneItem.width
y: scaledBounds.y * sceneItem.height
width: scaledBounds.width * sceneItem.width
height: scaledBounds.height * sceneItem.height
visible: FlightBatteryState.ConsumedEnergy > 0 visible: FlightBatteryState.ConsumedEnergy > 0
Text { Text {
id: battery_conso text: FlightBatteryState.ConsumedEnergy.toFixed()
text: FlightBatteryState.ConsumedEnergy.toFixed() anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: "Arial"
pixelSize: parent.height * 1.2 pixelSize: parent.height * 1.3
} }
anchors.centerIn: parent
} }
} }
@ -160,6 +140,8 @@ Item {
} }
} }
SvgElementImage { SvgElementImage {
id: mask_ThrottleBar id: mask_ThrottleBar
elementName: "throttle-mask" elementName: "throttle-mask"