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
328ad9ee
Commit
328ad9ee
authored
Mar 30, 2018
by
nanthony21
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
joystick.outputMode is redundant since the vehicle class has its own "joystickEnabled"
parent
858af395
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
24 deletions
+3
-24
Joystick.cc
src/Joystick/Joystick.cc
+1
-11
Joystick.h
src/Joystick/Joystick.h
+0
-4
JoystickConfig.qml
src/VehicleSetup/JoystickConfig.qml
+2
-9
No files found.
src/Joystick/Joystick.cc
View file @
328ad9ee
...
...
@@ -445,7 +445,7 @@ void Joystick::run(void)
}
}
if
(
_
outputEnabled
&&
_calibrated
)
{
if
(
_
activeVehicle
->
joystickEnabled
()
&&
_calibrated
)
{
int
axis
=
_rgFunctionAxis
[
rollFunction
];
float
roll
=
_adjustRange
(
_rgAxisValues
[
axis
],
_rgCalibration
[
axis
],
_deadband
);
...
...
@@ -798,18 +798,8 @@ void Joystick::setCalibrationMode(bool calibrating)
else
if
(
_pollingStartedForCalibration
)
{
stopPolling
();
}
if
(
calibrating
){
setOutputEnabled
(
false
);
//Disable the joystick output before calibrating
}
else
if
(
!
calibrating
&&
_calibrated
){
setOutputEnabled
(
true
);
//Enable joystick output after calibration
}
}
void
Joystick
::
setOutputEnabled
(
bool
enabled
){
_outputEnabled
=
enabled
;
emit
outputEnabledChanged
(
_outputEnabled
);
}
void
Joystick
::
_buttonAction
(
const
QString
&
action
)
{
...
...
src/Joystick/Joystick.h
View file @
328ad9ee
...
...
@@ -61,7 +61,6 @@ public:
Q_PROPERTY
(
QString
name
READ
name
CONSTANT
)
Q_PROPERTY
(
bool
calibrated
MEMBER
_calibrated
NOTIFY
calibratedChanged
)
Q_PROPERTY
(
bool
outputEnabled
MEMBER
_outputEnabled
WRITE
setOutputEnabled
NOTIFY
outputEnabledChanged
)
Q_PROPERTY
(
int
totalButtonCount
READ
totalButtonCount
CONSTANT
)
Q_PROPERTY
(
int
axisCount
READ
axisCount
CONSTANT
)
...
...
@@ -129,11 +128,9 @@ public:
/// Set the current calibration mode
void
setCalibrationMode
(
bool
calibrating
);
void
setOutputEnabled
(
bool
enabled
);
signals:
void
calibratedChanged
(
bool
calibrated
);
void
outputEnabledChanged
(
bool
enabled
);
// The raw signals are only meant for use by calibration
void
rawAxisValueChanged
(
int
index
,
int
value
);
...
...
@@ -202,7 +199,6 @@ protected:
static
int
_transmitterMode
;
bool
_calibrationMode
;
bool
_outputEnabled
;
int
*
_rgAxisValues
;
Calibration_t
*
_rgCalibration
;
...
...
src/VehicleSetup/JoystickConfig.qml
View file @
328ad9ee
...
...
@@ -366,15 +366,8 @@ SetupPage {
id
:
enabledCheckBox
enabled
:
_activeJoystick
?
_activeJoystick
.
calibrated
:
false
text
:
_activeJoystick
?
_activeJoystick
.
calibrated
?
qsTr
(
"
Enable joystick input
"
)
:
qsTr
(
"
Enable not allowed (Calibrate First)
"
)
:
""
onClicked
:
_activeJoystick
.
outputEnabled
=
checked
Connections
{
target
:
_activeJoystick
onOutputEnabledChanged
:
{
enabledCheckBox
.
checked
=
enabled
}
}
checked
:
_activeVehicle
.
joystickEnabled
onClicked
:
_activeVehicle
.
joystickEnabled
=
checked
Connections
{
target
:
joystickManager
...
...
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