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
2664e9a5
Commit
2664e9a5
authored
Aug 01, 2016
by
Rustom Jehangir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make supportsJSButton a plugin option
parent
a78ee55b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
9 deletions
+32
-9
ArduSubFirmwarePlugin.cc
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
+5
-0
ArduSubFirmwarePlugin.h
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
+2
-0
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+5
-0
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+4
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+5
-0
Vehicle.h
src/Vehicle/Vehicle.h
+2
-0
JoystickConfig.qml
src/VehicleSetup/JoystickConfig.qml
+9
-9
No files found.
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
View file @
2664e9a5
...
...
@@ -67,3 +67,8 @@ bool ArduSubFirmwarePlugin::supportsRadio(void)
{
return
false
;
}
bool
ArduSubFirmwarePlugin
::
supportsJSButton
(
void
)
{
return
true
;
}
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
View file @
2664e9a5
...
...
@@ -74,6 +74,8 @@ public:
bool
supportsManualControl
(
void
);
bool
supportsRadio
(
void
);
bool
supportsJSButton
(
void
);
};
#endif
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
2664e9a5
...
...
@@ -99,6 +99,11 @@ bool FirmwarePlugin::supportsRadio(void)
return
true
;
}
bool
FirmwarePlugin
::
supportsJSButton
(
void
)
{
return
false
;
}
bool
FirmwarePlugin
::
adjustIncomingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
{
Q_UNUSED
(
vehicle
);
...
...
src/FirmwarePlugin/FirmwarePlugin.h
View file @
2664e9a5
...
...
@@ -141,6 +141,10 @@ public:
/// setup page. Returns true by default.
virtual
bool
supportsRadio
(
void
);
/// Returns true if the firmware supports the AP_JSButton library, which allows joystick buttons
/// to be assigned via parameters in firmware. Default is false.
virtual
bool
supportsJSButton
(
void
);
/// Called before any mavlink message is processed by Vehicle such that the firmwre plugin
/// can adjust any message characteristics. This is handy to adjust or differences in mavlink
/// spec implementations such that the base code can remain mavlink generic.
...
...
src/Vehicle/Vehicle.cc
View file @
2664e9a5
...
...
@@ -1530,6 +1530,11 @@ bool Vehicle::supportsRadio(void) const
return
_firmwarePlugin
->
supportsRadio
();
}
bool
Vehicle
::
supportsJSButton
(
void
)
const
{
return
_firmwarePlugin
->
supportsJSButton
();
}
void
Vehicle
::
_setCoordinateValid
(
bool
coordinateValid
)
{
if
(
coordinateValid
!=
_coordinateValid
)
{
...
...
src/Vehicle/Vehicle.h
View file @
2664e9a5
...
...
@@ -277,6 +277,7 @@ public:
Q_PROPERTY
(
bool
rover
READ
rover
CONSTANT
)
Q_PROPERTY
(
bool
supportsManualControl
READ
supportsManualControl
CONSTANT
)
Q_PROPERTY
(
bool
supportsThrottleModeCenterZero
READ
supportsThrottleModeCenterZero
CONSTANT
)
Q_PROPERTY
(
bool
supportsJSButton
READ
supportsJSButton
CONSTANT
)
Q_PROPERTY
(
bool
sub
READ
sub
CONSTANT
)
Q_PROPERTY
(
bool
autoDisconnect
MEMBER
_autoDisconnect
NOTIFY
autoDisconnectChanged
)
Q_PROPERTY
(
QString
prearmError
READ
prearmError
WRITE
setPrearmError
NOTIFY
prearmErrorChanged
)
...
...
@@ -476,6 +477,7 @@ public:
bool
supportsManualControl
(
void
)
const
;
bool
supportsThrottleModeCenterZero
(
void
)
const
;
bool
supportsRadio
(
void
)
const
;
bool
supportsJSButton
(
void
)
const
;
void
setFlying
(
bool
flying
);
void
setGuidedMode
(
bool
guidedMode
);
...
...
src/VehicleSetup/JoystickConfig.qml
View file @
2664e9a5
...
...
@@ -381,7 +381,7 @@ QGCView {
Column
{
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
3
visible
:
!
_activeVehicle
.
sub
visible
:
_activeVehicle
.
supportsThrottleModeCenterZero
ExclusiveGroup
{
id
:
throttleModeExclusiveGroup
}
...
...
@@ -449,8 +449,8 @@ QGCView {
if
(
buttonActionRepeater
.
itemAt
(
index
))
{
buttonActionRepeater
.
itemAt
(
index
).
pressed
=
pressed
}
if
(
sub
ButtonActionRepeater
.
itemAt
(
index
))
{
sub
ButtonActionRepeater
.
itemAt
(
index
).
pressed
=
pressed
if
(
js
ButtonActionRepeater
.
itemAt
(
index
))
{
js
ButtonActionRepeater
.
itemAt
(
index
).
pressed
=
pressed
}
}
}
...
...
@@ -474,7 +474,7 @@ QGCView {
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
(
_activeVehicle
.
manualControlReservedButtonCount
==
-
1
?
false
:
modelData
>=
_activeVehicle
.
manualControlReservedButtonCount
)
&&
!
_activeVehicle
.
su
b
visible
:
(
_activeVehicle
.
manualControlReservedButtonCount
==
-
1
?
false
:
modelData
>=
_activeVehicle
.
manualControlReservedButtonCount
)
&&
!
_activeVehicle
.
su
pportsJSButton
property
bool
pressed
...
...
@@ -516,7 +516,7 @@ QGCView {
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_activeVehicle
.
su
b
visible
:
_activeVehicle
.
su
pportsJSButton
QGCLabel
{
horizontalAlignment
:
Text
.
AlignHCenter
...
...
@@ -536,12 +536,12 @@ QGCView {
}
// Row
Repeater
{
id
:
sub
ButtonActionRepeater
id
:
js
ButtonActionRepeater
model
:
_activeJoystick
.
totalButtonCount
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_activeVehicle
.
su
b
visible
:
_activeVehicle
.
su
pportsJSButton
property
bool
pressed
...
...
@@ -564,14 +564,14 @@ QGCView {
}
FactComboBox
{
id
:
main
Sub
ButtonActionCombo
id
:
main
JS
ButtonActionCombo
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
fact
:
controller
.
parameterExists
(
-
1
,
"
BTN
"
+
index
+
"
_FUNCTION
"
)
?
controller
.
getParameterFact
(
-
1
,
"
BTN
"
+
index
+
"
_FUNCTION
"
)
:
null
;
indexModel
:
false
}
FactComboBox
{
id
:
shift
Sub
ButtonActionCombo
id
:
shift
JS
ButtonActionCombo
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
fact
:
controller
.
parameterExists
(
-
1
,
"
BTN
"
+
index
+
"
_SFUNCTION
"
)
?
controller
.
getParameterFact
(
-
1
,
"
BTN
"
+
index
+
"
_SFUNCTION
"
)
:
null
;
indexModel
:
false
...
...
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