Commit b0a1524d authored by Don Gagne's avatar Don Gagne

parent fdfb7f03
import QtQuick 2.3
import QGroundControl 1.0 import QGroundControl 1.0
import QGroundControl.FactSystem 1.0 import QGroundControl.FactSystem 1.0
FactTextField { FactTextField {
unitsLabel: fact ? fact.units + _altitudeModeExtraUnits : "" unitsLabel: fact ? fact.units : ""
showUnits: true extraUnitsLabel: fact ? _altitudeModeExtraUnits : ""
showHelp: true showUnits: true
showHelp: true
property int altitudeMode: QGroundControl.AltitudeModeNone property int altitudeMode: QGroundControl.AltitudeModeNone
readonly property string _altModeNoneExtraUnits: "" readonly property string _altModeNoneExtraUnits: ""
readonly property string _altModeRelativeExtraUnits: qsTr(" (Rel)") readonly property string _altModeRelativeExtraUnits: qsTr("(Rel)")
readonly property string _altModeAbsoluteExtraUnits: qsTr(" (AMSL)") readonly property string _altModeAbsoluteExtraUnits: qsTr("(AMSL)")
readonly property string _altModeAboveTerrainExtraUnits: qsTr(" (Abv Terr)") readonly property string _altModeAboveTerrainExtraUnits: qsTr("(Abv Terr)")
readonly property string _altModeTerrainFrameExtraUnits: qsTr(" (TerrF)") readonly property string _altModeTerrainFrameExtraUnits: qsTr("(TerrF)")
property string _altitudeModeExtraUnits: _altModeRelativeExtraUnits property string _altitudeModeExtraUnits: _altModeNoneExtraUnits
onAltitudeModeChanged: updateAltitudeModeExtraUnits()
function updateAltitudeModeExtraUnits() { function updateAltitudeModeExtraUnits() {
if (altitudeMode === QGroundControl.AltitudeModeNone) { if (altitudeMode === QGroundControl.AltitudeModeNone) {
...@@ -32,6 +36,4 @@ FactTextField { ...@@ -32,6 +36,4 @@ FactTextField {
_altitudeModeExtraUnits = "" _altitudeModeExtraUnits = ""
} }
} }
onAltitudeModeChanged: updateAltitudeModeExtraUnits()
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment