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
41a99412
Commit
41a99412
authored
Jan 25, 2018
by
nanthony21
Committed by
Nick Anthony
Feb 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made deadband adjustable by click and drag.
parent
9dd91ffc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
JoystickConfig.qml
src/VehicleSetup/JoystickConfig.qml
+21
-0
JoystickConfigController.cc
src/VehicleSetup/JoystickConfigController.cc
+9
-0
JoystickConfigController.h
src/VehicleSetup/JoystickConfigController.h
+1
-0
No files found.
src/VehicleSetup/JoystickConfig.qml
View file @
41a99412
...
...
@@ -796,7 +796,28 @@ SetupPage {
property
real
defaultTextWidth
:
ScreenTools
.
defaultFontPixelWidth
property
bool
mapped
:
true
readonly
property
bool
reversed
:
false
MouseArea
{
id
:
deadbandMouseArea
anchors.fill
:
parent
.
item
property
real
startY
onPressed
:
{
startY
=
mouseY
}
onPositionChanged
:
{
var
newValue
=
parent
.
item
.
deadbandValue
+
(
startY
-
mouseY
)
*
15
if
((
newValue
>
0
)
&&
(
newValue
<
32768
)){
parent
.
item
.
deadbandValue
=
newValue
;}
startY
=
mouseY
}
onReleased
:
{
controller
.
setDeadbandValue
(
modelData
,
parent
.
item
.
deadbandValue
)
}
}
}
}
}
}
// Column - Axis Monitor
...
...
src/VehicleSetup/JoystickConfigController.cc
View file @
41a99412
...
...
@@ -71,6 +71,15 @@ void JoystickConfigController::start(void)
_stopCalibration
();
}
void
JoystickConfigController
::
setDeadbandValue
(
int
axis
,
int
value
)
{
_axisDeadbandChanged
(
axis
,
value
);
Joystick
*
joystick
=
_joystickManager
->
activeJoystick
();
Joystick
::
Calibration_t
calibration
=
joystick
->
getCalibration
(
axis
);
calibration
.
deadband
=
value
;
joystick
->
setCalibration
(
axis
,
calibration
);
}
JoystickConfigController
::~
JoystickConfigController
()
{
if
(
_activeJoystick
)
{
...
...
src/VehicleSetup/JoystickConfigController.h
View file @
41a99412
...
...
@@ -67,6 +67,7 @@ public:
Q_INVOKABLE
void
skipButtonClicked
(
void
);
Q_INVOKABLE
void
nextButtonClicked
(
void
);
Q_INVOKABLE
void
start
(
void
);
Q_INVOKABLE
void
setDeadbandValue
(
int
axis
,
int
value
);
bool
rollAxisMapped
(
void
);
bool
pitchAxisMapped
(
void
);
...
...
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