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
e3195f26
Commit
e3195f26
authored
Jul 31, 2016
by
Don Gagne
Committed by
GitHub
Jul 31, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3879 from bluerobotics/subJoystickSetup
Joystick button function selector for ArduSub
parents
5185cace
d96940f7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
4 deletions
+80
-4
FactComboBox.qml
src/FactSystem/FactControls/FactComboBox.qml
+1
-1
APMFirmwarePlugin.h
src/FirmwarePlugin/APM/APMFirmwarePlugin.h
+1
-1
ArduSubFirmwarePlugin.cc
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
+5
-0
ArduSubFirmwarePlugin.h
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
+1
-0
Joystick.cc
src/Joystick/Joystick.cc
+1
-1
JoystickConfig.qml
src/VehicleSetup/JoystickConfig.qml
+71
-1
No files found.
src/FactSystem/FactControls/FactComboBox.qml
View file @
e3195f26
...
...
@@ -10,7 +10,7 @@ QGCComboBox {
property
Fact
fact
:
Fact
{
}
property
bool
indexModel
:
true
///< true: model must be specifed, selected index is fact value, false: use enum meta data
model
:
fact
.
enumStrings
model
:
fact
?
fact
.
enumStrings
:
null
currentIndex
:
indexModel
?
fact
.
value
:
fact
.
enumIndex
...
...
src/FirmwarePlugin/APM/APMFirmwarePlugin.h
View file @
e3195f26
...
...
@@ -79,7 +79,7 @@ public:
bool
setFlightMode
(
const
QString
&
flightMode
,
uint8_t
*
base_mode
,
uint32_t
*
custom_mode
)
final
;
bool
isGuidedMode
(
const
Vehicle
*
vehicle
)
const
final
;
void
pauseVehicle
(
Vehicle
*
vehicle
);
int
manualControlReservedButtonCount
(
void
)
final
;
int
manualControlReservedButtonCount
(
void
);
bool
adjustIncomingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
final
;
void
adjustOutgoingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
final
;
void
initializeVehicle
(
Vehicle
*
vehicle
)
final
;
...
...
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
View file @
e3195f26
...
...
@@ -47,3 +47,8 @@ ArduSubFirmwarePlugin::ArduSubFirmwarePlugin(void)
supportedFlightModes
<<
APMSubMode
(
APMSubMode
::
ALT_HOLD
,
true
);
setSupportedModes
(
supportedFlightModes
);
}
int
ArduSubFirmwarePlugin
::
manualControlReservedButtonCount
(
void
)
{
return
0
;
}
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
View file @
e3195f26
...
...
@@ -67,6 +67,7 @@ public:
ArduSubFirmwarePlugin
(
void
);
// Overrides from FirmwarePlugin
int
manualControlReservedButtonCount
(
void
);
};
...
...
src/Joystick/Joystick.cc
View file @
e3195f26
...
...
@@ -284,7 +284,7 @@ void Joystick::run(void)
throttle
=
std
::
max
(
-
1.0
f
,
std
::
min
(
tanf
(
asinf
(
throttle_limited
)),
1.0
f
));
// Adjust throttle to 0:1 range
if
(
_throttleMode
==
ThrottleModeCenterZero
)
{
if
(
_throttleMode
==
ThrottleModeCenterZero
&&
!
_activeVehicle
->
sub
()
)
{
throttle
=
std
::
max
(
0.0
f
,
throttle
);
}
else
{
throttle
=
(
throttle
+
1.0
f
)
/
2.0
f
;
...
...
src/VehicleSetup/JoystickConfig.qml
View file @
e3195f26
...
...
@@ -18,6 +18,7 @@ import QGroundControl.Controls 1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Controllers
1.0
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactControls
1.0
/// Joystick Config
QGCView
{
...
...
@@ -380,6 +381,7 @@ QGCView {
Column
{
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
3
visible
:
!
_activeVehicle
.
sub
ExclusiveGroup
{
id
:
throttleModeExclusiveGroup
}
...
...
@@ -447,6 +449,9 @@ QGCView {
if
(
buttonActionRepeater
.
itemAt
(
index
))
{
buttonActionRepeater
.
itemAt
(
index
).
pressed
=
pressed
}
if
(
subButtonActionRepeater
.
itemAt
(
index
))
{
subButtonActionRepeater
.
itemAt
(
index
).
pressed
=
pressed
}
}
}
...
...
@@ -469,7 +474,7 @@ QGCView {
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_activeVehicle
.
manualControlReservedButtonCount
==
-
1
?
false
:
modelData
>=
_activeVehicle
.
manualControlReservedButtonCount
visible
:
(
_activeVehicle
.
manualControlReservedButtonCount
==
-
1
?
false
:
modelData
>=
_activeVehicle
.
manualControlReservedButtonCount
)
&&
!
_activeVehicle
.
sub
property
bool
pressed
...
...
@@ -508,6 +513,71 @@ QGCView {
}
}
}
// Repeater
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_activeVehicle
.
sub
QGCLabel
{
horizontalAlignment
:
Text
.
AlignHCenter
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
text
:
qsTr
(
"
#
"
)
}
QGCLabel
{
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
text
:
qsTr
(
"
Function:
"
)
}
QGCLabel
{
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
text
:
qsTr
(
"
Shift Function:
"
)
}
}
// Row
Repeater
{
id
:
subButtonActionRepeater
model
:
_activeJoystick
.
totalButtonCount
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_activeVehicle
.
sub
property
bool
pressed
Rectangle
{
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
border.width
:
1
border.color
:
qgcPal
.
text
color
:
pressed
?
qgcPal
.
buttonHighlight
:
qgcPal
.
button
QGCLabel
{
anchors.fill
:
parent
color
:
pressed
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
text
:
modelData
}
}
FactComboBox
{
id
:
mainSubButtonActionCombo
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
fact
:
controller
.
parameterExists
(
-
1
,
"
BTN
"
+
index
+
"
_FUNCTION
"
)
?
controller
.
getParameterFact
(
-
1
,
"
BTN
"
+
index
+
"
_FUNCTION
"
)
:
null
;
indexModel
:
false
}
FactComboBox
{
id
:
shiftSubButtonActionCombo
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
fact
:
controller
.
parameterExists
(
-
1
,
"
BTN
"
+
index
+
"
_SFUNCTION
"
)
?
controller
.
getParameterFact
(
-
1
,
"
BTN
"
+
index
+
"
_SFUNCTION
"
)
:
null
;
indexModel
:
false
}
}
// Row
}
// Repeater
}
// Column
}
// Column - right setting column
}
// Row - Settings
...
...
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