Skip to content

Commit 89c232c

Browse files
DavidsastresasDonLakeFlyer
authored andcommitted
GCSControlIndicator.qml: adapt to new way of getting GCS systemID
1 parent 789cfcd commit 89c232c

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

src/UI/toolbar/GCSControlIndicator.qml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Item {
2222
property bool gcsControlStatusFlags_TakeoverAllowed: activeVehicle ? activeVehicle.gcsControlStatusFlags_TakeoverAllowed : false
2323
property Fact requestControlAllowTakeoverFact: QGroundControl.settingsManager.flyViewSettings.requestControlAllowTakeover
2424
property bool requestControlAllowTakeover: requestControlAllowTakeoverFact.rawValue
25-
property bool isThisGCSinControl: sysidInControl == QGroundControl.mavlinkSystemID
25+
property bool isThisGCSinControl: sysidInControl == QGroundControl.settingsManager.mavlinkSettings.gcsMavlinkSystemID.rawValue
2626
property bool sendControlRequestAllowed: activeVehicle ? activeVehicle.sendControlRequestAllowed : false
2727

2828
property var margins: ScreenTools.defaultFontPixelWidth
@@ -322,24 +322,12 @@ Item {
322322
color: qgcPal.windowShade
323323
height: outdoorPalette ? 1 : 2
324324
}
325-
QGCLabel {
326-
text: qsTr("This GCS Mavlink System ID: ")
327-
}
328-
QGCTextField {
329-
text: QGroundControl.mavlinkSystemID.toString()
330-
numericValuesOnly: true
331-
Layout.alignment: Qt.AlignRight
332-
Layout.preferredWidth: ScreenTools.defaultFontPixelWidth * 7
333-
horizontalAlignment: TextInput.AlignHCenter
334-
onEditingFinished: {
335-
if (parseInt(text) > 0 && parseInt(text) < 256) {
336-
QGroundControl.mavlinkSystemID = parseInt(text)
337-
} else {
338-
mainWindow.showMessageDialog(qsTr("Invalid System ID"), qsTr("System ID must be in the range of 1 - 255"))
339-
}
340-
}
325+
LabelledFactTextField {
326+
Layout.fillWidth: true
327+
Layout.columnSpan: 2
328+
label: qsTr("This GCS Mavlink System ID: ")
329+
fact: QGroundControl.settingsManager.mavlinkSettings.gcsMavlinkSystemID
341330
}
342-
343331
}
344332
}
345333
}

0 commit comments

Comments
 (0)