You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
2.9 KiB
91 lines
2.9 KiB
/**************************************************************************** |
|
* |
|
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> |
|
* |
|
* QGroundControl is licensed according to the terms in the file |
|
* COPYING.md in the root of the source code directory. |
|
* |
|
****************************************************************************/ |
|
|
|
|
|
import QtQuick 2.11 |
|
import QtQuick.Controls 2.4 |
|
import QtQuick.Dialogs 1.3 |
|
import QtQuick.Layouts 1.11 |
|
|
|
import QGroundControl 1.0 |
|
import QGroundControl.Palette 1.0 |
|
import QGroundControl.Controls 1.0 |
|
import QGroundControl.ScreenTools 1.0 |
|
import QGroundControl.Controllers 1.0 |
|
import QGroundControl.FactSystem 1.0 |
|
import QGroundControl.FactControls 1.0 |
|
|
|
/// Joystick Config |
|
SetupPage { |
|
id: joystickPage |
|
pageComponent: pageComponent |
|
pageName: qsTr("Joystick") |
|
pageDescription: "" // qsTr("Joystick Setup is used to configure and calibrate joysticks.") |
|
|
|
readonly property real _maxButtons: 64 |
|
readonly property real _attitudeLabelWidth: ScreenTools.defaultFontPixelWidth * 12 |
|
|
|
Connections { |
|
target: joystickManager |
|
onAvailableJoysticksChanged: { |
|
if(joystickManager.joysticks.length === 0) { |
|
summaryButton.checked = true |
|
setupView.showSummaryPanel() |
|
} |
|
} |
|
} |
|
|
|
Component { |
|
id: pageComponent |
|
Item { |
|
width: availableWidth |
|
height: bar.height + joyLoader.height |
|
|
|
readonly property real labelToMonitorMargin: ScreenTools.defaultFontPixelWidth * 3 |
|
property var _activeJoystick: joystickManager.activeJoystick |
|
|
|
function setupPageCompleted() { |
|
controller.start() |
|
} |
|
|
|
JoystickConfigController { |
|
id: controller |
|
} |
|
|
|
TabBar { |
|
id: bar |
|
width: parent.width |
|
anchors.top: parent.top |
|
TabButton { |
|
text: qsTr("General") |
|
} |
|
TabButton { |
|
text: qsTr("Button Assigment") |
|
} |
|
TabButton { |
|
text: qsTr("Calibration") |
|
} |
|
TabButton { |
|
text: qsTr("Advanced") |
|
} |
|
} |
|
|
|
property var pages: ["JoystickConfigGeneral.qml", "JoystickConfigButtons.qml", "JoystickConfigCalibration.qml", "JoystickConfigAdvanced.qml"] |
|
|
|
Loader { |
|
id: joyLoader |
|
source: pages[bar.currentIndex] |
|
width: parent.width |
|
anchors.top: bar.bottom |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
|