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
bce432ef
Commit
bce432ef
authored
8 years ago
by
Gregory Dymarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
7af1f46c
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 @
bce432ef
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/Joystick/JoystickAndroid.cc
View file @
bce432ef
...
...
@@ -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
];
}
...
...
This diff is collapsed.
Click to expand it.
src/VehicleSetup/SetupView.qml
View file @
bce432ef
...
...
@@ -279,6 +279,7 @@ Rectangle {
setupComplete
:
joystickManager
.
activeJoystick
?
joystickManager
.
activeJoystick
.
calibrated
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
_fullParameterVehicleAvailable
&&
joystickManager
.
joysticks
.
length
!=
0
//visible: true
text
:
"
Joystick
"
onClicked
:
showJoystickPanel
()
...
...
This diff is collapsed.
Click to expand it.
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