Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
0775d444
Commit
0775d444
authored
Feb 25, 2017
by
nanthony21
Browse files
Moved deadband indicators to the right side column.
parent
d4dbe920
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/VehicleSetup/JoystickConfig.qml
View file @
0775d444
...
...
@@ -105,6 +105,7 @@ SetupPage {
width
:
_deadbandWidth
height
:
parent
.
height
/
2
color
:
"
#8c161a
"
visible
:
controller
.
deadbandToggle
property
real
_percentDeadband
:
((
2
*
deadbandValue
)
/
(
32768.0
*
2
))
property
real
_deadbandWidth
:
parent
.
width
*
_percentDeadband
...
...
@@ -743,6 +744,18 @@ SetupPage {
axisMonitorRepeater
.
itemAt
(
axis
).
loader
.
item
.
deadbandValue
=
value
}
}
onDeadbandToggled
:
{
if
(
value
)
{
for
(
var
i
=
0
;
i
<
_activeJoystick
.
axisCount
;
i
++
)
{
axisMonitorRepeater
.
itemAt
(
i
).
loader
.
item
.
deadbandBarVisible
=
true
}
}
else
{
for
(
var
i
=
0
;
i
<
_activeJoystick
.
axisCount
;
i
++
)
{
axisMonitorRepeater
.
itemAt
(
i
).
loader
.
item
.
deadbandBarVisible
=
false
}
}
}
}
Repeater
{
...
...
src/VehicleSetup/JoystickConfigController.cc
View file @
0775d444
...
...
@@ -257,7 +257,7 @@ void JoystickConfigController::_inputCenterWaitBegin(Joystick::AxisFunction_t fu
Q_UNUSED
(
function
);
//sensing deadband
if
(
abs
(
value
)
*
1.1
f
>
_rgAxisInfo
[
axis
].
deadband
)
{
//add 10% on top of existing deadband
if
(
(
abs
(
value
)
*
1.1
f
>
_rgAxisInfo
[
axis
].
deadband
)
&&
(
_activeJoystick
->
deadband
()))
{
//add 10% on top of existing deadband
_axisDeadbandChanged
(
axis
,
abs
(
value
)
*
1.1
f
);
}
...
...
@@ -451,6 +451,7 @@ void JoystickConfigController::_resetInternalCalibrationValues(void)
info
->
function
=
Joystick
::
maxFunction
;
info
->
reversed
=
false
;
info
->
deadband
=
0
;
emit
axisDeadbandChanged
(
i
,
info
->
deadband
);
info
->
axisMin
=
JoystickConfigController
::
_calCenterPoint
;
info
->
axisMax
=
JoystickConfigController
::
_calCenterPoint
;
info
->
axisTrim
=
JoystickConfigController
::
_calCenterPoint
;
...
...
@@ -489,6 +490,7 @@ void JoystickConfigController::_setInternalCalibrationValuesFromSettings(void)
info
->
axisMax
=
calibration
.
max
;
info
->
reversed
=
calibration
.
reversed
;
info
->
deadband
=
calibration
.
deadband
;
emit
axisDeadbandChanged
(
axis
,
info
->
deadband
);
qCDebug
(
JoystickConfigControllerLog
)
<<
"Read settings name:axis:min:max:trim:reversed"
<<
joystick
->
name
()
<<
axis
<<
info
->
axisMin
<<
info
->
axisMax
<<
info
->
axisTrim
<<
info
->
reversed
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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