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
8c0e81d9
Commit
8c0e81d9
authored
Apr 22, 2016
by
Gregory Dymarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
e44fed2f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
Joystick.cc
src/Joystick/Joystick.cc
+3
-3
JoystickAndroid.cc
src/Joystick/JoystickAndroid.cc
+8
-8
SetupView.qml
src/VehicleSetup/SetupView.qml
+1
-0
No files found.
src/Joystick/Joystick.cc
View file @
8c0e81d9
...
...
@@ -89,7 +89,7 @@ void Joystick::run(void)
open
();
while
(
!
_exitThread
)
{
update
();
update
();
// Update axes
for
(
int
axisIndex
=
0
;
axisIndex
<
_axisCount
;
axisIndex
++
)
{
...
...
@@ -143,9 +143,9 @@ void Joystick::run(void)
// We only send the buttons the firmwware has reserved
int
reservedButtonCount
=
_activeVehicle
->
manualControlReservedButtonCount
();
if
(
reservedButtonCount
==
-
1
)
{
if
(
reservedButtonCount
==
-
1
)
reservedButtonCount
=
_buttonCount
;
}
quint16
newButtonBits
=
0
;
// New set of button which are down
quint16
buttonPressedBits
=
0
;
// Buttons pressed for manualControl signal
...
...
src/Joystick/JoystickAndroid.cc
View file @
8c0e81d9
...
...
@@ -49,20 +49,20 @@ JoystickAndroid::JoystickAndroid(const QString& name, int id, MultiVehicleManage
axisValue
=
new
int
[
_axisCount
];
axisCode
=
new
int
[
_axisCount
];
for
(
i
=
0
;
i
<
_axisCount
;
i
++
)
{
QAndroidJniObject
range
=
rangeListNative
.
callObjectMethod
(
"get"
,
"()Landroid/view/InputDevice/MotionRange;"
);
if
(
range
.
isValid
())
axisCode
[
i
]
=
range
.
callMethod
<
jint
>
(
"getAxis"
);
axisValue
[
i
]
=
0
;
QAndroidJniObject
range
=
rangeListNative
.
callObjectMethod
(
"get"
,
"()Landroid/view/InputDevice/MotionRange;"
);
if
(
range
.
isValid
())
axisCode
[
i
]
=
range
.
callMethod
<
jint
>
(
"getAxis"
);
axisValue
[
i
]
=
0
;
}
qDebug
()
<<
"joystick constructor:"
<<
_name
;
_axisCount
=
4
;
qDebug
()
<<
"axis:"
<<
_axisCount
<<
"buttons:"
<<
_buttonCount
;
QtAndroidPrivate
::
registerGenericMotionEventListener
(
this
);
QtAndroidPrivate
::
registerKeyEventListener
(
this
);
}
JoystickAndroid
::~
JoystickAndroid
()
{
qDebug
()
<<
"joystick destructor"
<<
_name
;
delete
btnCode
;
delete
axisCode
;
...
...
@@ -150,11 +150,11 @@ bool JoystickAndroid::update(void)
}
bool
JoystickAndroid
::
getButton
(
int
i
)
{
return
btnValue
[
btnCode
[
i
]
];
return
btnValue
[
i
];
}
int
JoystickAndroid
::
getAxis
(
int
i
)
{
return
axisValue
[
axisCode
[
i
]
];
return
axisValue
[
i
];
}
...
...
src/VehicleSetup/SetupView.qml
View file @
8c0e81d9
...
...
@@ -287,6 +287,7 @@ Rectangle {
setupComplete
:
joystickManager
.
activeJoystick
?
joystickManager
.
activeJoystick
.
calibrated
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
_fullParameterVehicleAvailable
&&
joystickManager
.
joysticks
.
length
!=
0
//visible: true
text
:
"
Joystick
"
onClicked
:
showJoystickPanel
()
...
...
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