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
a1e086e5
Commit
a1e086e5
authored
May 03, 2017
by
Don Gagne
Committed by
GitHub
May 03, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5087 from bluerobotics/joystick-icon
Joystick icon
parents
b62261e8
fb35b7d1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
2 deletions
+107
-2
qgcresources.qrc
qgcresources.qrc
+1
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
ArduSubFirmwarePlugin.cc
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
+1
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+1
-1
Joystick.png
src/ui/toolbar/Images/Joystick.png
+0
-0
JoystickIndicator.qml
src/ui/toolbar/JoystickIndicator.qml
+102
-0
RCRSSIIndicator.qml
src/ui/toolbar/RCRSSIIndicator.qml
+1
-1
No files found.
qgcresources.qrc
View file @
a1e086e5
...
...
@@ -154,6 +154,7 @@
<file alias="TelemRSSI.svg">src/ui/toolbar/Images/TelemRSSI.svg</file>
<file alias="Yield.svg">src/ui/toolbar/Images/Yield.svg</file>
<file alias="CameraIcon.svg">src/ui/toolbar/Images/CameraIcon.svg</file>
<file alias="Joystick.png">src/ui/toolbar/Images/Joystick.png</file>
<file alias="CogWheel.svg">src/MissionManager/CogWheel.svg</file>
<file alias="StationMode.svg">src/AutoPilotPlugins/Common/Images/StationMode.svg</file>
<file alias="APMode.svg">src/AutoPilotPlugins/Common/Images/APMode.svg</file>
...
...
qgroundcontrol.qrc
View file @
a1e086e5
...
...
@@ -10,6 +10,7 @@
<file alias="ModeIndicator.qml">src/ui/toolbar/ModeIndicator.qml</file>
<file alias="RCRSSIIndicator.qml">src/ui/toolbar/RCRSSIIndicator.qml</file>
<file alias="TelemetryRSSIIndicator.qml">src/ui/toolbar/TelemetryRSSIIndicator.qml</file>
<file alias="JoystickIndicator.qml">src/ui/toolbar/JoystickIndicator.qml</file>
</qresource>
<qresource prefix="/qml">
<file alias="AirframeComponent.qml">src/AutoPilotPlugins/PX4/AirframeComponent.qml</file>
...
...
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
View file @
a1e086e5
...
...
@@ -117,6 +117,7 @@ const QVariantList& ArduSubFirmwarePlugin::toolBarIndicators(const Vehicle* vehi
_toolBarIndicators
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MessageIndicator.qml"
)));
_toolBarIndicators
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/BatteryIndicator.qml"
)));
_toolBarIndicators
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ModeIndicator.qml"
)));
_toolBarIndicators
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/JoystickIndicator.qml"
)));
}
return
_toolBarIndicators
;
}
src/Vehicle/Vehicle.cc
View file @
a1e086e5
...
...
@@ -1409,7 +1409,7 @@ void Vehicle::_loadSettings(void)
// Joystick enabled is a global setting so first make sure there are any joysticks connected
if
(
qgcApp
()
->
toolbox
()
->
joystickManager
()
->
joysticks
().
count
())
{
_joystickEnabled
=
settings
.
value
(
_joystickEnabledSettingsKey
,
false
).
toBool
(
);
setJoystickEnabled
(
settings
.
value
(
_joystickEnabledSettingsKey
,
false
).
toBool
()
);
}
}
...
...
src/ui/toolbar/Images/Joystick.png
0 → 100644
View file @
a1e086e5
38.3 KB
src/ui/toolbar/JoystickIndicator.qml
0 → 100644
View file @
a1e086e5
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.5
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Layouts
1.2
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
MultiVehicleManager
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
// Joystick Indicator
Item
{
width
:
joystickRow
.
width
*
1.1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
visible
:
activeVehicle
?
activeVehicle
.
sub
:
false
Component
{
id
:
joystickInfo
Rectangle
{
width
:
joystickCol
.
width
+
ScreenTools
.
defaultFontPixelWidth
*
3
height
:
joystickCol
.
height
+
ScreenTools
.
defaultFontPixelHeight
*
2
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
color
:
qgcPal
.
window
border.color
:
qgcPal
.
text
Column
{
id
:
joystickCol
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
width
:
Math
.
max
(
joystickGrid
.
width
,
joystickLabel
.
width
)
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.centerIn
:
parent
QGCLabel
{
id
:
joystickLabel
text
:
qsTr
(
"
Joystick Status
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
GridLayout
{
id
:
joystickGrid
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
columns
:
2
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCLabel
{
text
:
qsTr
(
"
Connected:
"
)
}
QGCLabel
{
text
:
joystickManager
.
activeJoystick
?
"
Yes
"
:
"
No
"
color
:
joystickManager
.
activeJoystick
?
qgcPal
.
buttonText
:
"
red
"
}
QGCLabel
{
text
:
qsTr
(
"
Enabled:
"
)
}
QGCLabel
{
text
:
activeVehicle
&&
activeVehicle
.
joystickEnabled
?
"
Yes
"
:
"
No
"
color
:
activeVehicle
&&
activeVehicle
.
joystickEnabled
?
qgcPal
.
buttonText
:
"
red
"
}
}
}
Component.onCompleted
:
{
var
pos
=
mapFromItem
(
toolBar
,
centerX
-
(
width
/
2
),
toolBar
.
height
)
x
=
pos
.
x
y
=
pos
.
y
+
ScreenTools
.
defaultFontPixelHeight
}
}
}
Row
{
id
:
joystickRow
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCColoredImage
{
width
:
height
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
sourceSize.height
:
height
source
:
"
/qmlimages/Joystick.png
"
fillMode
:
Image
.
PreserveAspectFit
color
:
activeVehicle
&&
activeVehicle
.
joystickEnabled
&&
joystickManager
.
activeJoystick
?
qgcPal
.
buttonText
:
"
red
"
}
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
mainWindow
.
showPopUp
(
joystickInfo
,
mapToItem
(
toolBar
,
x
,
y
).
x
+
(
width
/
2
))
}
}
src/ui/toolbar/RCRSSIIndicator.qml
View file @
a1e086e5
...
...
@@ -19,7 +19,7 @@ import QGroundControl.ScreenTools 1.0
import
QGroundControl
.
Palette
1.0
//-------------------------------------------------------------------------
//--
GPS
Indicator
//--
RC RSSI
Indicator
Item
{
width
:
rssiRow
.
width
*
1.1
anchors.top
:
parent
.
top
...
...
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