|
|
|
@ -369,8 +369,8 @@ SetupPage {
@@ -369,8 +369,8 @@ SetupPage {
|
|
|
|
|
|
|
|
|
|
QGCCheckBox { |
|
|
|
|
id: enabledCheckBox |
|
|
|
|
enabled: _activeJoystick.calibrated |
|
|
|
|
text: _activeJoystick.calibrated ? qsTr("Enable joystick input") : qsTr("Enable not allowed (Calibrate First)") |
|
|
|
|
enabled: _activeJoystick ? _activeJoystick.calibrated : false |
|
|
|
|
text: _activeJoystick ? _activeJoystick.calibrated ? qsTr("Enable joystick input") : qsTr("Enable not allowed (Calibrate First)") : "" |
|
|
|
|
checked: _activeVehicle.joystickEnabled |
|
|
|
|
|
|
|
|
|
onClicked: _activeVehicle.joystickEnabled = checked |
|
|
|
@ -379,7 +379,9 @@ SetupPage {
@@ -379,7 +379,9 @@ SetupPage {
|
|
|
|
|
target: joystickManager |
|
|
|
|
|
|
|
|
|
onActiveJoystickChanged: { |
|
|
|
|
if(_activeJoystick) { |
|
|
|
|
enabledCheckBox.checked = Qt.binding(function() { return _activeJoystick.calibrated && _activeVehicle.joystickEnabled }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -414,9 +416,7 @@ SetupPage {
@@ -414,9 +416,7 @@ SetupPage {
|
|
|
|
|
target: joystickManager |
|
|
|
|
onAvailableJoysticksChanged: { |
|
|
|
|
var index = joystickCombo.find(joystickManager.activeJoystickName) |
|
|
|
|
if (index == -1) { |
|
|
|
|
console.warn(qsTr("Active joystick name not in combo"), joystickManager.activeJoystickName) |
|
|
|
|
} else { |
|
|
|
|
if (index >= 0) { |
|
|
|
|
joystickCombo.currentIndex = index |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -433,7 +433,7 @@ SetupPage {
@@ -433,7 +433,7 @@ SetupPage {
|
|
|
|
|
QGCRadioButton { |
|
|
|
|
exclusiveGroup: throttleModeExclusiveGroup |
|
|
|
|
text: qsTr("Center stick is zero throttle") |
|
|
|
|
checked: _activeJoystick.throttleMode == 0 |
|
|
|
|
checked: _activeJoystick ? _activeJoystick.throttleMode == 0 : false |
|
|
|
|
|
|
|
|
|
onClicked: _activeJoystick.throttleMode = 0 |
|
|
|
|
} |
|
|
|
@ -442,11 +442,11 @@ SetupPage {
@@ -442,11 +442,11 @@ SetupPage {
|
|
|
|
|
x: 20 |
|
|
|
|
width: parent.width |
|
|
|
|
spacing: ScreenTools.defaultFontPixelWidth |
|
|
|
|
visible: _activeJoystick.throttleMode == 0 |
|
|
|
|
visible: _activeJoystick ? _activeJoystick.throttleMode == 0 : false |
|
|
|
|
|
|
|
|
|
QGCCheckBox { |
|
|
|
|
id: accumulator |
|
|
|
|
checked: _activeJoystick.accumulator |
|
|
|
|
checked: _activeJoystick ? _activeJoystick.accumulator : false |
|
|
|
|
text: qsTr("Spring loaded throttle smoothing") |
|
|
|
|
|
|
|
|
|
onClicked: _activeJoystick.accumulator = checked |
|
|
|
@ -456,7 +456,7 @@ SetupPage {
@@ -456,7 +456,7 @@ SetupPage {
|
|
|
|
|
QGCRadioButton { |
|
|
|
|
exclusiveGroup: throttleModeExclusiveGroup |
|
|
|
|
text: qsTr("Full down stick is zero throttle") |
|
|
|
|
checked: _activeJoystick.throttleMode == 1 |
|
|
|
|
checked: _activeJoystick ? _activeJoystick.throttleMode == 1 : false |
|
|
|
|
|
|
|
|
|
onClicked: _activeJoystick.throttleMode = 1 |
|
|
|
|
} |
|
|
|
@ -467,7 +467,7 @@ SetupPage {
@@ -467,7 +467,7 @@ SetupPage {
|
|
|
|
|
|
|
|
|
|
QGCCheckBox { |
|
|
|
|
id: exponential |
|
|
|
|
checked: _activeJoystick.exponential |
|
|
|
|
checked: _activeJoystick ? _activeJoystick.exponential : false |
|
|
|
|
text: qsTr("Use exponential curve on roll, pitch, yaw") |
|
|
|
|
|
|
|
|
|
onClicked: _activeJoystick.exponential = checked |
|
|
|
@ -556,7 +556,7 @@ SetupPage {
@@ -556,7 +556,7 @@ SetupPage {
|
|
|
|
|
|
|
|
|
|
Repeater { |
|
|
|
|
id: buttonActionRepeater |
|
|
|
|
model: _activeJoystick.totalButtonCount |
|
|
|
|
model: _activeJoystick ? _activeJoystick.totalButtonCount : 0 |
|
|
|
|
|
|
|
|
|
Row { |
|
|
|
|
spacing: ScreenTools.defaultFontPixelWidth |
|
|
|
@ -566,7 +566,7 @@ SetupPage {
@@ -566,7 +566,7 @@ SetupPage {
|
|
|
|
|
|
|
|
|
|
QGCCheckBox { |
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
checked: _activeJoystick.buttonActions[modelData] != "" |
|
|
|
|
checked: _activeJoystick ? _activeJoystick.buttonActions[modelData] != "" : false |
|
|
|
|
|
|
|
|
|
onClicked: _activeJoystick.setButtonAction(modelData, checked ? buttonActionCombo.textAt(buttonActionCombo.currentIndex) : "") |
|
|
|
|
} |
|
|
|
@ -592,7 +592,7 @@ SetupPage {
@@ -592,7 +592,7 @@ SetupPage {
|
|
|
|
|
QGCComboBox { |
|
|
|
|
id: buttonActionCombo |
|
|
|
|
width: ScreenTools.defaultFontPixelWidth * 20 |
|
|
|
|
model: _activeJoystick.actions |
|
|
|
|
model: _activeJoystick ? _activeJoystick.actions : 0 |
|
|
|
|
|
|
|
|
|
onActivated: _activeJoystick.setButtonAction(modelData, textAt(index)) |
|
|
|
|
Component.onCompleted: currentIndex = find(_activeJoystick.buttonActions[modelData]) |
|
|
|
@ -623,7 +623,7 @@ SetupPage {
@@ -623,7 +623,7 @@ SetupPage {
|
|
|
|
|
|
|
|
|
|
Repeater { |
|
|
|
|
id: jsButtonActionRepeater |
|
|
|
|
model: _activeJoystick.totalButtonCount |
|
|
|
|
model: _activeJoystick ? _activeJoystick.totalButtonCount : 0 |
|
|
|
|
|
|
|
|
|
Row { |
|
|
|
|
spacing: ScreenTools.defaultFontPixelWidth |
|
|
|
@ -704,7 +704,7 @@ SetupPage {
@@ -704,7 +704,7 @@ SetupPage {
|
|
|
|
|
|
|
|
|
|
Repeater { |
|
|
|
|
id: axisMonitorRepeater |
|
|
|
|
model: _activeJoystick.axisCount |
|
|
|
|
model: _activeJoystick ? _activeJoystick.axisCount : 0 |
|
|
|
|
width: parent.width |
|
|
|
|
|
|
|
|
|
Row { |
|
|
|
@ -756,7 +756,7 @@ SetupPage {
@@ -756,7 +756,7 @@ SetupPage {
|
|
|
|
|
|
|
|
|
|
Repeater { |
|
|
|
|
id: buttonMonitorRepeater |
|
|
|
|
model: _activeJoystick.totalButtonCount |
|
|
|
|
model: _activeJoystick ? _activeJoystick.totalButtonCount : 0 |
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
|
width: ScreenTools.defaultFontPixelHeight * 1.2 |
|
|
|
|