Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
17370aa4
Commit
17370aa4
authored
Jul 25, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue WIP
parent
41b2fd7e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
260 additions
and
169 deletions
+260
-169
Joystick.cc
src/Joystick/Joystick.cc
+137
-82
Joystick.h
src/Joystick/Joystick.h
+90
-78
JoystickConfigButtons.qml
src/VehicleSetup/JoystickConfigButtons.qml
+33
-9
No files found.
src/Joystick/Joystick.cc
View file @
17370aa4
This diff is collapsed.
Click to expand it.
src/Joystick/Joystick.h
View file @
17370aa4
This diff is collapsed.
Click to expand it.
src/VehicleSetup/JoystickConfigButtons.qml
View file @
17370aa4
...
...
@@ -46,11 +46,7 @@ Item {
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
bool
pressed
QGCCheckBox
{
anchors.verticalCenter
:
parent
.
verticalCenter
checked
:
_activeJoystick
?
_activeJoystick
.
actionTitles
[
modelData
]
!==
""
:
false
onClicked
:
_activeJoystick
.
setButtonAction
(
modelData
,
checked
?
buttonActionCombo
.
textAt
(
buttonActionCombo
.
currentIndex
)
:
""
)
}
property
var
currentAction
:
_activeJoystick
?
_activeJoystick
.
assignableActions
.
get
(
buttonActionCombo
.
currentIndex
)
:
null
Rectangle
{
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
...
...
@@ -69,19 +65,47 @@ Item {
QGCComboBox
{
id
:
buttonActionCombo
width
:
ScreenTools
.
defaultFontPixelWidth
*
26
model
:
_activeJoystick
?
_activeJoystick
.
actions
:
[]
onActivated
:
_activeJoystick
.
setButtonAction
(
modelData
,
textAt
(
index
))
Component.onCompleted
:
currentIndex
=
find
(
_activeJoystick
.
actionTitles
[
modelData
])
model
:
_activeJoystick
?
_activeJoystick
.
assignableActionTitles
:
[]
onActivated
:
{
_activeJoystick
.
setButtonAction
(
modelData
,
textAt
(
index
))
}
Component.onCompleted
:
{
if
(
_activeJoystick
)
{
var
i
=
find
(
_activeJoystick
.
buttonActions
[
modelData
])
if
(
i
<
0
)
i
=
0
currentIndex
=
0
}
}
}
QGCCheckBox
{
id
:
repeatCheck
text
:
qsTr
(
"
Repeat
"
)
enabled
:
currentAction
&&
_activeJoystick
.
calibrated
&&
currentAction
.
canRepeat
onClicked
:
{
_activeJoystick
.
setButtonRepeat
(
modelData
,
checked
)
}
anchors.verticalCenter
:
parent
.
verticalCenter
}
QGCComboBox
{
width
:
ScreenTools
.
defaultFontPixelWidth
*
10
model
:
[
"
1Hz
"
,
"
2Hz
"
,
"
5Hz
"
,
"
10Hz
"
]
model
:
[
"
1Hz
"
,
"
2Hz
"
,
"
5Hz
"
,
"
10Hz
"
,
"
25Hz
"
]
enabled
:
repeatCheck
.
checked
onActivated
:
{
var
freq
=
1
;
switch
(
index
)
{
case
0
:
freq
=
1
;
break
;
case
1
:
freq
=
2
;
break
;
case
2
:
freq
=
5
;
break
;
case
3
:
freq
=
10
;
break
;
case
4
:
freq
=
25
;
break
;
}
_activeJoystick
.
setButtonFrequency
(
modelData
,
freq
)
}
Component
.
onCompleted
:
{
}
}
Item
{
width
:
ScreenTools
.
defaultFontPixelWidth
*
2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment