Browse Source

Hide APM Mock Links if APM is not built.

Fix Mocklink UI
QGC4.4
Gus Grubba 6 years ago
parent
commit
54b3055b23
  1. 25
      src/ui/preferences/MockLink.qml

25
src/ui/preferences/MockLink.qml

@ -8,7 +8,9 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.3 import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.11
import QGroundControl 1.0 import QGroundControl 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
@ -29,43 +31,54 @@ Rectangle {
contentHeight: column.height + (_margins * 2) contentHeight: column.height + (_margins * 2)
clip: true clip: true
Column { ColumnLayout {
id: column id: column
anchors.margins: _margins anchors.margins: _margins
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelHeight spacing: ScreenTools.defaultFontPixelHeight
QGCCheckBox {
id: sendStatusText
text: qsTr("Send status text + voice")
}
QGCButton { QGCButton {
text: qsTr("PX4 Vehicle") text: qsTr("PX4 Vehicle")
Layout.fillWidth: true
onClicked: QGroundControl.startPX4MockLink(sendStatusText.checked) onClicked: QGroundControl.startPX4MockLink(sendStatusText.checked)
} }
QGCButton { QGCButton {
text: qsTr("APM ArduCopter Vehicle") text: qsTr("APM ArduCopter Vehicle")
visible: QGroundControl.hasAPMSupport
Layout.fillWidth: true
onClicked: QGroundControl.startAPMArduCopterMockLink(sendStatusText.checked) onClicked: QGroundControl.startAPMArduCopterMockLink(sendStatusText.checked)
} }
QGCButton { QGCButton {
text: qsTr("APM ArduPlane Vehicle") text: qsTr("APM ArduPlane Vehicle")
visible: QGroundControl.hasAPMSupport
Layout.fillWidth: true
onClicked: QGroundControl.startAPMArduPlaneMockLink(sendStatusText.checked) onClicked: QGroundControl.startAPMArduPlaneMockLink(sendStatusText.checked)
} }
QGCButton { QGCButton {
text: qsTr("APM ArduSub Vehicle") text: qsTr("APM ArduSub Vehicle")
visible: QGroundControl.hasAPMSupport
Layout.fillWidth: true
onClicked: QGroundControl.startAPMArduSubMockLink(sendStatusText.checked) onClicked: QGroundControl.startAPMArduSubMockLink(sendStatusText.checked)
} }
QGCButton { QGCButton {
text: qsTr("APM ArduRover Vehicle") text: qsTr("APM ArduRover Vehicle")
visible: QGroundControl.hasAPMSupport
Layout.fillWidth: true
onClicked: QGroundControl.startAPMArduRoverMockLink(sendStatusText.checked) onClicked: QGroundControl.startAPMArduRoverMockLink(sendStatusText.checked)
} }
QGCButton { QGCButton {
text: qsTr("Generic Vehicle") text: qsTr("Generic Vehicle")
Layout.fillWidth: true
onClicked: QGroundControl.startGenericMockLink(sendStatusText.checked) onClicked: QGroundControl.startGenericMockLink(sendStatusText.checked)
} }
QGCCheckBox {
id: sendStatusText
text: qsTr("Send status text + voice")
}
QGCButton { QGCButton {
text: qsTr("Stop One MockLink") text: qsTr("Stop One MockLink")
Layout.fillWidth: true
onClicked: QGroundControl.stopOneMockLink() onClicked: QGroundControl.stopOneMockLink()
} }
} }

Loading…
Cancel
Save