|
|
@ -28,6 +28,7 @@ SetupPage { |
|
|
|
pageDescription: qsTr("Joystick Setup is used to configure a calibrate joysticks.") |
|
|
|
pageDescription: qsTr("Joystick Setup is used to configure a calibrate joysticks.") |
|
|
|
|
|
|
|
|
|
|
|
readonly property real _maxButtons: 64 |
|
|
|
readonly property real _maxButtons: 64 |
|
|
|
|
|
|
|
readonly property real _attitudeLabelWidth: ScreenTools.defaultFontPixelWidth * 12 |
|
|
|
|
|
|
|
|
|
|
|
Connections { |
|
|
|
Connections { |
|
|
|
target: joystickManager |
|
|
|
target: joystickManager |
|
|
@ -157,7 +158,7 @@ SetupPage { |
|
|
|
anchors.rightMargin: ScreenTools.defaultFontPixelWidth |
|
|
|
anchors.rightMargin: ScreenTools.defaultFontPixelWidth |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.right: rightColumn.left |
|
|
|
anchors.right: rightColumn.left |
|
|
|
spacing: 10 |
|
|
|
spacing: ScreenTools.defaultFontPixelHeight |
|
|
|
|
|
|
|
|
|
|
|
// Attitude Controls |
|
|
|
// Attitude Controls |
|
|
|
Column { |
|
|
|
Column { |
|
|
@ -172,7 +173,7 @@ SetupPage { |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
id: rollLabel |
|
|
|
id: rollLabel |
|
|
|
width: ScreenTools.defaultFontPixelWidth * 10 |
|
|
|
width: _attitudeLabelWidth |
|
|
|
text: activeVehicle.sub ? qsTr("Lateral") : qsTr("Roll") |
|
|
|
text: activeVehicle.sub ? qsTr("Lateral") : qsTr("Roll") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -199,7 +200,7 @@ SetupPage { |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
id: pitchLabel |
|
|
|
id: pitchLabel |
|
|
|
width: ScreenTools.defaultFontPixelWidth * 10 |
|
|
|
width: _attitudeLabelWidth |
|
|
|
text: activeVehicle.sub ? qsTr("Forward") : qsTr("Pitch") |
|
|
|
text: activeVehicle.sub ? qsTr("Forward") : qsTr("Pitch") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -226,7 +227,7 @@ SetupPage { |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
id: yawLabel |
|
|
|
id: yawLabel |
|
|
|
width: ScreenTools.defaultFontPixelWidth * 10 |
|
|
|
width: _attitudeLabelWidth |
|
|
|
text: qsTr("Yaw") |
|
|
|
text: qsTr("Yaw") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -253,7 +254,7 @@ SetupPage { |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
id: throttleLabel |
|
|
|
id: throttleLabel |
|
|
|
width: ScreenTools.defaultFontPixelWidth * 10 |
|
|
|
width: _attitudeLabelWidth |
|
|
|
text: qsTr("Throttle") |
|
|
|
text: qsTr("Throttle") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -280,7 +281,7 @@ SetupPage { |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
id: gimbalPitchLabel |
|
|
|
id: gimbalPitchLabel |
|
|
|
width: ScreenTools.defaultFontPixelWidth * 10 |
|
|
|
width: _attitudeLabelWidth |
|
|
|
text: qsTr("Gimbal Pitch") |
|
|
|
text: qsTr("Gimbal Pitch") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -307,7 +308,7 @@ SetupPage { |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
id: gimbalYawLabel |
|
|
|
id: gimbalYawLabel |
|
|
|
width: ScreenTools.defaultFontPixelWidth * 10 |
|
|
|
width: _attitudeLabelWidth |
|
|
|
text: qsTr("Gimbal Yaw") |
|
|
|
text: qsTr("Gimbal Yaw") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -334,26 +335,24 @@ SetupPage { |
|
|
|
Row { |
|
|
|
Row { |
|
|
|
spacing: 10 |
|
|
|
spacing: 10 |
|
|
|
visible: _activeJoystick.requiresCalibration |
|
|
|
visible: _activeJoystick.requiresCalibration |
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
QGCButton { |
|
|
|
QGCButton { |
|
|
|
id: skipButton |
|
|
|
id: skipButton |
|
|
|
text: qsTr("Skip") |
|
|
|
text: qsTr("Skip") |
|
|
|
onClicked: controller.skipButtonClicked() |
|
|
|
onClicked: controller.skipButtonClicked() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCButton { |
|
|
|
QGCButton { |
|
|
|
id: cancelButton |
|
|
|
id: cancelButton |
|
|
|
text: qsTr("Cancel") |
|
|
|
text: qsTr("Cancel") |
|
|
|
onClicked: controller.cancelButtonClicked() |
|
|
|
onClicked: controller.cancelButtonClicked() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCButton { |
|
|
|
QGCButton { |
|
|
|
id: nextButton |
|
|
|
id: nextButton |
|
|
|
primary: true |
|
|
|
primary: true |
|
|
|
text: qsTr("Calibrate") |
|
|
|
text: qsTr("Calibrate") |
|
|
|
onClicked: controller.nextButtonClicked() |
|
|
|
onClicked: controller.nextButtonClicked() |
|
|
|
} |
|
|
|
} |
|
|
|
} // Row - Buttons |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Status Text |
|
|
|
// Status Text |
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
@ -412,19 +411,13 @@ SetupPage { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Row { |
|
|
|
|
|
|
|
width: parent.width |
|
|
|
|
|
|
|
spacing: ScreenTools.defaultFontPixelWidth |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
id: activeJoystickLabel |
|
|
|
|
|
|
|
anchors.baseline: joystickCombo.baseline |
|
|
|
|
|
|
|
text: qsTr("Active joystick:") |
|
|
|
text: qsTr("Active joystick:") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCComboBox { |
|
|
|
QGCComboBox { |
|
|
|
id: joystickCombo |
|
|
|
id: joystickCombo |
|
|
|
width: parent.width - activeJoystickLabel.width - parent.spacing |
|
|
|
width: parent.width * 0.9 |
|
|
|
model: joystickManager.joystickNames |
|
|
|
model: joystickManager.joystickNames |
|
|
|
|
|
|
|
|
|
|
|
onActivated: joystickManager.activeJoystickName = textAt(index) |
|
|
|
onActivated: joystickManager.activeJoystickName = textAt(index) |
|
|
@ -448,7 +441,6 @@ SetupPage { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Column { |
|
|
|
Column { |
|
|
|
spacing: ScreenTools.defaultFontPixelHeight / 3 |
|
|
|
spacing: ScreenTools.defaultFontPixelHeight / 3 |
|
|
@ -494,7 +486,7 @@ SetupPage { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Column { |
|
|
|
Column { |
|
|
|
spacing: ScreenTools.defaultFontPixelHeight / 3 |
|
|
|
spacing: ScreenTools.defaultFontPixelHeight |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
id: expoSliderLabel |
|
|
|
id: expoSliderLabel |
|
|
@ -502,15 +494,15 @@ SetupPage { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Row { |
|
|
|
Row { |
|
|
|
|
|
|
|
spacing: ScreenTools.defaultFontPixelWidth |
|
|
|
QGCSlider { |
|
|
|
QGCSlider { |
|
|
|
id: expoSlider |
|
|
|
id: expoSlider |
|
|
|
|
|
|
|
width: ScreenTools.defaultFontPixelWidth * 14 |
|
|
|
minimumValue: 0 |
|
|
|
minimumValue: 0 |
|
|
|
maximumValue: 0.75 |
|
|
|
maximumValue: 0.75 |
|
|
|
|
|
|
|
Component.onCompleted: value = -_activeJoystick.exponential |
|
|
|
Component.onCompleted: value=-_activeJoystick.exponential |
|
|
|
onValueChanged: _activeJoystick.exponential = -value |
|
|
|
onValueChanged: _activeJoystick.exponential=-value |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
id: expoSliderIndicator |
|
|
|
id: expoSliderIndicator |
|
|
|
text: expoSlider.value.toFixed(2) |
|
|
|
text: expoSlider.value.toFixed(2) |
|
|
@ -761,53 +753,58 @@ SetupPage { |
|
|
|
anchors.top: parent.top |
|
|
|
anchors.top: parent.top |
|
|
|
anchors.right: parent.right |
|
|
|
anchors.right: parent.right |
|
|
|
width: Math.min(joystickPage.ScreenTools.defaultFontPixelWidth * 35, availableWidth * 0.4) |
|
|
|
width: Math.min(joystickPage.ScreenTools.defaultFontPixelWidth * 35, availableWidth * 0.4) |
|
|
|
spacing: ScreenTools.defaultFontPixelHeight / 2 |
|
|
|
spacing: ScreenTools.defaultFontPixelHeight |
|
|
|
|
|
|
|
|
|
|
|
Row { |
|
|
|
Row { |
|
|
|
spacing: ScreenTools.defaultFontPixelWidth |
|
|
|
spacing: ScreenTools.defaultFontPixelWidth |
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
text: "TX Mode:" |
|
|
|
text: "TX Mode:" |
|
|
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCRadioButton { |
|
|
|
QGCRadioButton { |
|
|
|
text: "1" |
|
|
|
text: "1" |
|
|
|
checked: controller.transmitterMode == 1 |
|
|
|
checked: controller.transmitterMode == 1 |
|
|
|
enabled: !controller.calibrating |
|
|
|
enabled: !controller.calibrating |
|
|
|
|
|
|
|
|
|
|
|
onClicked: controller.transmitterMode = 1 |
|
|
|
onClicked: controller.transmitterMode = 1 |
|
|
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCRadioButton { |
|
|
|
QGCRadioButton { |
|
|
|
text: "2" |
|
|
|
text: "2" |
|
|
|
checked: controller.transmitterMode == 2 |
|
|
|
checked: controller.transmitterMode == 2 |
|
|
|
enabled: !controller.calibrating |
|
|
|
enabled: !controller.calibrating |
|
|
|
|
|
|
|
|
|
|
|
onClicked: controller.transmitterMode = 2 |
|
|
|
onClicked: controller.transmitterMode = 2 |
|
|
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCRadioButton { |
|
|
|
QGCRadioButton { |
|
|
|
text: "3" |
|
|
|
text: "3" |
|
|
|
checked: controller.transmitterMode == 3 |
|
|
|
checked: controller.transmitterMode == 3 |
|
|
|
enabled: !controller.calibrating |
|
|
|
enabled: !controller.calibrating |
|
|
|
|
|
|
|
|
|
|
|
onClicked: controller.transmitterMode = 3 |
|
|
|
onClicked: controller.transmitterMode = 3 |
|
|
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCRadioButton { |
|
|
|
QGCRadioButton { |
|
|
|
text: "4" |
|
|
|
text: "4" |
|
|
|
checked: controller.transmitterMode == 4 |
|
|
|
checked: controller.transmitterMode == 4 |
|
|
|
enabled: !controller.calibrating |
|
|
|
enabled: !controller.calibrating |
|
|
|
|
|
|
|
|
|
|
|
onClicked: controller.transmitterMode = 4 |
|
|
|
onClicked: controller.transmitterMode = 4 |
|
|
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Image { |
|
|
|
QGCColoredImage { |
|
|
|
width: parent.width |
|
|
|
width: parent.width * 0.9 |
|
|
|
|
|
|
|
height: width * 0.5 |
|
|
|
|
|
|
|
sourceSize.height: height |
|
|
|
fillMode: Image.PreserveAspectFit |
|
|
|
fillMode: Image.PreserveAspectFit |
|
|
|
smooth: true |
|
|
|
smooth: true |
|
|
|
source: controller.imageHelp |
|
|
|
source: "/res/calibration/joystick.svg" |
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Axis monitor |
|
|
|
// Axis monitor |
|
|
@ -815,7 +812,10 @@ SetupPage { |
|
|
|
width: parent.width |
|
|
|
width: parent.width |
|
|
|
spacing: 5 |
|
|
|
spacing: 5 |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { text: qsTr("Axis Monitor") } |
|
|
|
QGCLabel { |
|
|
|
|
|
|
|
text: qsTr("Axis Monitor") |
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Connections { |
|
|
|
Connections { |
|
|
|
target: controller |
|
|
|
target: controller |
|
|
@ -840,6 +840,7 @@ SetupPage { |
|
|
|
|
|
|
|
|
|
|
|
Row { |
|
|
|
Row { |
|
|
|
spacing: 5 |
|
|
|
spacing: 5 |
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
|
|
|
|
|
|
|
|
// Need this to get to loader from Connections above |
|
|
|
// Need this to get to loader from Connections above |
|
|
|
property Item loader: theLoader |
|
|
|
property Item loader: theLoader |
|
|
@ -860,7 +861,6 @@ SetupPage { |
|
|
|
property bool mapped: true |
|
|
|
property bool mapped: true |
|
|
|
readonly property bool reversed: false |
|
|
|
readonly property bool reversed: false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MouseArea { |
|
|
|
MouseArea { |
|
|
|
id: deadbandMouseArea |
|
|
|
id: deadbandMouseArea |
|
|
|
anchors.fill: parent.item |
|
|
|
anchors.fill: parent.item |
|
|
@ -897,7 +897,10 @@ SetupPage { |
|
|
|
width: parent.width |
|
|
|
width: parent.width |
|
|
|
spacing: ScreenTools.defaultFontPixelHeight |
|
|
|
spacing: ScreenTools.defaultFontPixelHeight |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { text: qsTr("Button Monitor") } |
|
|
|
QGCLabel { |
|
|
|
|
|
|
|
text: qsTr("Button Monitor") |
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Connections { |
|
|
|
Connections { |
|
|
|
target: _activeJoystick |
|
|
|
target: _activeJoystick |
|
|
@ -910,19 +913,20 @@ SetupPage { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Flow { |
|
|
|
Flow { |
|
|
|
width: parent.width |
|
|
|
width: parent.width * 0.9 |
|
|
|
spacing: -1 |
|
|
|
spacing: -1 |
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
|
|
|
|
|
|
|
|
Repeater { |
|
|
|
Repeater { |
|
|
|
id: buttonMonitorRepeater |
|
|
|
id: buttonMonitorRepeater |
|
|
|
model: _activeJoystick ? _activeJoystick.totalButtonCount : 0 |
|
|
|
model: _activeJoystick ? _activeJoystick.totalButtonCount : 0 |
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
Rectangle { |
|
|
|
width: ScreenTools.defaultFontPixelHeight * 1.2 |
|
|
|
width: ScreenTools.defaultFontPixelHeight * 1.5 |
|
|
|
height: width |
|
|
|
height: width |
|
|
|
border.width: 1 |
|
|
|
border.width: 1 |
|
|
|
border.color: qgcPal.text |
|
|
|
border.color: qgcPal.text |
|
|
|
color: pressed ? qgcPal.buttonHighlight : qgcPal.button |
|
|
|
color: pressed ? qgcPal.buttonHighlight : qgcPal.windowShade |
|
|
|
|
|
|
|
|
|
|
|
property bool pressed |
|
|
|
property bool pressed |
|
|
|
|
|
|
|
|
|
|
|