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
424dbd37
Unverified
Commit
424dbd37
authored
Jul 30, 2019
by
Gus Grubba
Committed by
GitHub
Jul 30, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7644 from mavlink/customFixes
Custom fixes
parents
71ec9db4
54b3055b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
62 deletions
+86
-62
CustomMainToolBar.qml
custom-example/res/MainToolbar/CustomMainToolBar.qml
+0
-2
MAVLinkInspectorController.cc
src/AnalyzeView/MAVLinkInspectorController.cc
+1
-1
Joystick.cc
src/Joystick/Joystick.cc
+45
-35
Joystick.h
src/Joystick/Joystick.h
+4
-2
MainRootWindow.qml
src/ui/MainRootWindow.qml
+2
-1
MockLink.qml
src/ui/preferences/MockLink.qml
+34
-21
No files found.
custom-example/res/MainToolbar/CustomMainToolBar.qml
View file @
424dbd37
...
...
@@ -45,8 +45,6 @@ Item {
Component
.
onCompleted
:
{
flyButton
.
checked
=
true
sectionTitle
=
flyButton
.
text
//-- Show full screen
mainWindow
.
showFullScreen
()
}
//-------------------------------------------------------------------------
//-- Fly/Plan state toggle
...
...
src/AnalyzeView/MAVLinkInspectorController.cc
View file @
424dbd37
...
...
@@ -404,7 +404,7 @@ MAVLinkInspectorController::_vehicleAdded(Vehicle* vehicle)
{
QGCMAVLinkVehicle
*
v
=
_findVehicle
(
static_cast
<
uint8_t
>
(
vehicle
->
id
()));
if
(
v
)
{
v
->
messages
()
->
deleteListAnd
Contents
();
v
->
messages
()
->
clearAndDelete
Contents
();
emit
v
->
messagesChanged
();
}
else
{
v
=
new
QGCMAVLinkVehicle
(
this
,
static_cast
<
uint8_t
>
(
vehicle
->
id
()));
...
...
src/Joystick/Joystick.cc
View file @
424dbd37
...
...
@@ -108,40 +108,7 @@ Joystick::Joystick(const QString& name, int axisCount, int buttonCount, int hatC
_rgButtonValues
[
i
]
=
BUTTON_UP
;
_buttonActionArray
.
append
(
nullptr
);
}
//-- Available Actions
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionNone
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionArm
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionDisarm
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionToggleArm
));
if
(
_activeVehicle
)
{
QStringList
list
=
_activeVehicle
->
flightModes
();
foreach
(
auto
mode
,
list
)
{
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
mode
));
}
}
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionVTOLFixedWing
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionVTOLMultiRotor
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionContinuousZoomIn
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionContinuousZoomOut
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionStepZoomIn
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionStepZoomOut
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionNextStream
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionPreviousStream
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionNextCamera
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionPreviousCamera
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionTriggerCamera
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionStartVideoRecord
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionStopVideoRecord
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionToggleVideoRecord
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalDown
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalUp
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalLeft
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalRight
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalCenter
));
for
(
int
i
=
0
;
i
<
_assignableButtonActions
.
count
();
i
++
)
{
AssignableButtonAction
*
p
=
qobject_cast
<
AssignableButtonAction
*>
(
_assignableButtonActions
[
i
]);
_availableActionTitles
<<
p
->
action
();
}
_buildActionList
(
_multiVehicleManager
->
activeVehicle
());
_updateTXModeSettingsKey
(
_multiVehicleManager
->
activeVehicle
());
_loadSettings
();
connect
(
_multiVehicleManager
,
&
MultiVehicleManager
::
activeVehicleChanged
,
this
,
&
Joystick
::
_activeVehicleChanged
);
...
...
@@ -155,7 +122,7 @@ Joystick::~Joystick()
delete
[]
_rgAxisValues
;
delete
[]
_rgCalibration
;
delete
[]
_rgButtonValues
;
_assignableButtonActions
.
deleteListAnd
Contents
();
_assignableButtonActions
.
clearAndDelete
Contents
();
for
(
int
button
=
0
;
button
<
_totalButtonCount
;
button
++
)
{
if
(
_buttonActionArray
[
button
])
{
_buttonActionArray
[
button
]
->
deleteLater
();
...
...
@@ -690,6 +657,8 @@ void Joystick::startPolling(Vehicle* vehicle)
}
// Update qml in case of joystick transition
emit
calibratedChanged
(
_calibrated
);
// Build action list
_buildActionList
(
vehicle
);
// Only connect the new vehicle if it wants joystick data
if
(
vehicle
->
joystickEnabled
())
{
_pollingStartedForCalibration
=
false
;
...
...
@@ -1066,3 +1035,44 @@ int Joystick::_findAssignableButtonAction(const QString& action)
return
-
1
;
}
void
Joystick
::
_buildActionList
(
Vehicle
*
activeVehicle
)
{
if
(
_assignableButtonActions
.
count
())
_assignableButtonActions
.
clearAndDeleteContents
();
_availableActionTitles
.
clear
();
//-- Available Actions
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionNone
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionArm
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionDisarm
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionToggleArm
));
if
(
activeVehicle
)
{
QStringList
list
=
activeVehicle
->
flightModes
();
foreach
(
auto
mode
,
list
)
{
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
mode
));
}
}
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionVTOLFixedWing
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionVTOLMultiRotor
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionContinuousZoomIn
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionContinuousZoomOut
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionStepZoomIn
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionStepZoomOut
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionNextStream
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionPreviousStream
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionNextCamera
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionPreviousCamera
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionTriggerCamera
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionStartVideoRecord
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionStopVideoRecord
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionToggleVideoRecord
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalDown
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalUp
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalLeft
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalRight
,
true
));
_assignableButtonActions
.
append
(
new
AssignableButtonAction
(
this
,
_buttonActionGimbalCenter
));
for
(
int
i
=
0
;
i
<
_assignableButtonActions
.
count
();
i
++
)
{
AssignableButtonAction
*
p
=
qobject_cast
<
AssignableButtonAction
*>
(
_assignableButtonActions
[
i
]);
_availableActionTitles
<<
p
->
action
();
}
emit
assignableActionsChanged
();
}
src/Joystick/Joystick.h
View file @
424dbd37
...
...
@@ -93,8 +93,8 @@ public:
Q_PROPERTY
(
QStringList
buttonActions
READ
buttonActions
NOTIFY
buttonActionsChanged
)
//-- Actions that can be assigned to buttons
Q_PROPERTY
(
QmlObjectListModel
*
assignableActions
READ
assignableActions
CONSTANT
)
Q_PROPERTY
(
QStringList
assignableActionTitles
READ
assignableActionTitles
CONSTANT
)
Q_PROPERTY
(
QmlObjectListModel
*
assignableActions
READ
assignableActions
NOTIFY
assignableActionsChanged
)
Q_PROPERTY
(
QStringList
assignableActionTitles
READ
assignableActionTitles
NOTIFY
assignableActionsChanged
)
Q_PROPERTY
(
QString
disabledActionName
READ
disabledActionName
CONSTANT
)
Q_PROPERTY
(
bool
gimbalEnabled
READ
gimbalEnabled
WRITE
setGimbalEnabled
NOTIFY
gimbalEnabledChanged
)
...
...
@@ -180,6 +180,7 @@ signals:
void
rawButtonPressedChanged
(
int
index
,
int
pressed
);
void
calibratedChanged
(
bool
calibrated
);
void
buttonActionsChanged
();
void
assignableActionsChanged
();
void
throttleModeChanged
(
int
mode
);
void
negativeThrustChanged
(
bool
allowNegative
);
void
exponentialChanged
(
float
exponential
);
...
...
@@ -230,6 +231,7 @@ protected:
bool
_validButton
(
int
button
);
void
_handleAxis
();
void
_handleButtons
();
void
_buildActionList
(
Vehicle
*
activeVehicle
);
void
_pitchStep
(
int
direction
);
void
_yawStep
(
int
direction
);
...
...
src/ui/MainRootWindow.qml
View file @
424dbd37
...
...
@@ -29,7 +29,8 @@ ApplicationWindow {
visible
:
true
Component.onCompleted
:
{
if
(
ScreenTools
.
isMobile
)
{
//-- Full screen on mobile or tiny screens
if
(
ScreenTools
.
isMobile
||
Screen
.
height
/
ScreenTools
.
realPixelDensity
<
120
)
{
mainWindow
.
showFullScreen
()
}
else
{
width
=
ScreenTools
.
isMobile
?
Screen
.
width
:
Math
.
min
(
250
*
Screen
.
pixelDensity
,
Screen
.
width
)
...
...
src/ui/preferences/MockLink.qml
View file @
424dbd37
...
...
@@ -8,7 +8,9 @@
****************************************************************************/
import
QtQuick
2.3
import
QtQuick
2.11
import
QtQuick
.
Controls
2.4
import
QtQuick
.
Layouts
1.11
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
...
...
@@ -25,48 +27,59 @@ Rectangle {
QGCFlickable
{
anchors.fill
:
parent
contentWidth
:
column
.
width
+
(
_margins
*
2
)
contentWidth
:
column
.
width
+
(
_margins
*
2
)
contentHeight
:
column
.
height
+
(
_margins
*
2
)
clip
:
true
Column
{
Column
Layout
{
id
:
column
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
spacing
:
ScreenTools
.
defaultFontPixelHeight
QGC
Button
{
text
:
qsTr
(
"
PX4 Vehicle
"
)
onClicked
:
QGroundControl
.
startPX4MockLink
(
sendStatusText
.
checked
)
QGC
CheckBox
{
id
:
sendStatusText
text
:
qsTr
(
"
Send status text + voice
"
)
}
QGCButton
{
text
:
qsTr
(
"
APM ArduCopter Vehicle
"
)
onClicked
:
QGroundControl
.
startAPMArduCopterMockLink
(
sendStatusText
.
checked
)
text
:
qsTr
(
"
PX4 Vehicle
"
)
Layout.fillWidth
:
true
onClicked
:
QGroundControl
.
startPX4MockLink
(
sendStatusText
.
checked
)
}
QGCButton
{
text
:
qsTr
(
"
APM ArduPlane Vehicle
"
)
onClicked
:
QGroundControl
.
startAPMArduPlaneMockLink
(
sendStatusText
.
checked
)
text
:
qsTr
(
"
APM ArduCopter Vehicle
"
)
visible
:
QGroundControl
.
hasAPMSupport
Layout.fillWidth
:
true
onClicked
:
QGroundControl
.
startAPMArduCopterMockLink
(
sendStatusText
.
checked
)
}
QGCButton
{
text
:
qsTr
(
"
APM ArduSub Vehicle
"
)
onClicked
:
QGroundControl
.
startAPMArduSubMockLink
(
sendStatusText
.
checked
)
text
:
qsTr
(
"
APM ArduPlane Vehicle
"
)
visible
:
QGroundControl
.
hasAPMSupport
Layout.fillWidth
:
true
onClicked
:
QGroundControl
.
startAPMArduPlaneMockLink
(
sendStatusText
.
checked
)
}
QGCButton
{
text
:
qsTr
(
"
APM ArduRover Vehicle
"
)
onClicked
:
QGroundControl
.
startAPMArduRoverMockLink
(
sendStatusText
.
checked
)
text
:
qsTr
(
"
APM ArduSub Vehicle
"
)
visible
:
QGroundControl
.
hasAPMSupport
Layout.fillWidth
:
true
onClicked
:
QGroundControl
.
startAPMArduSubMockLink
(
sendStatusText
.
checked
)
}
QGCButton
{
text
:
qsTr
(
"
Generic Vehicle
"
)
onClicked
:
QGroundControl
.
startGenericMockLink
(
sendStatusText
.
checked
)
text
:
qsTr
(
"
APM ArduRover Vehicle
"
)
visible
:
QGroundControl
.
hasAPMSupport
Layout.fillWidth
:
true
onClicked
:
QGroundControl
.
startAPMArduRoverMockLink
(
sendStatusText
.
checked
)
}
QGCCheckBox
{
id
:
sendStatusText
text
:
qsTr
(
"
Send status text + voice
"
)
QGCButton
{
text
:
qsTr
(
"
Generic Vehicle
"
)
Layout.fillWidth
:
true
onClicked
:
QGroundControl
.
startGenericMockLink
(
sendStatusText
.
checked
)
}
QGCButton
{
text
:
qsTr
(
"
Stop One MockLink
"
)
onClicked
:
QGroundControl
.
stopOneMockLink
()
text
:
qsTr
(
"
Stop One MockLink
"
)
Layout.fillWidth
:
true
onClicked
:
QGroundControl
.
stopOneMockLink
()
}
}
}
...
...
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