Browse Source

Change jscript usage to make Qml compiler happy

QGC4.4
Don Gagne 6 years ago
parent
commit
6b6aa978d5
  1. 12
      src/AutoPilotPlugins/APM/APMAirframeComponent.qml

12
src/AutoPilotPlugins/APM/APMAirframeComponent.qml

@ -178,8 +178,12 @@ SetupPage { @@ -178,8 +178,12 @@ SetupPage {
property bool valid: true
function selectFrameType(frameType) {
var index = object.frameTypeEnumValues.findIndex(v => v==frameType)
function checkFrameType(value) {
return value == _frameType.rawValue
}
function selectFrameType() {
var index = object.frameTypeEnumValues.findIndex(checkFrameType)
if (index == -1 && combo.visible) {
// Frame Class/Type is set to an invalid combination
combo.valid = false
@ -189,12 +193,12 @@ SetupPage { @@ -189,12 +193,12 @@ SetupPage {
}
}
Component.onCompleted: selectFrameType(_frameType.rawValue)
Component.onCompleted: selectFrameType()
Connections {
target: _frameTypeAvailable ? _frameType : null
ignoreUnknownSignals: true
onRawValueChanged: combo.selectFrameType(value)
onRawValueChanged: combo.selectFrameType()
}
}
}

Loading…
Cancel
Save