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
ddd6da04
Commit
ddd6da04
authored
Feb 07, 2017
by
Gus Grubba
Committed by
GitHub
Feb 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4525 from dogmaphobic/iconFromPlugin
Allow FirmwarePlugin to provide vehicle icons.
parents
ac839943
240b37fe
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
71 additions
and
13 deletions
+71
-13
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+18
-0
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+9
-0
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+0
-2
MultiVehicleList.qml
src/FlightDisplay/MultiVehicleList.qml
+1
-1
VehicleMapItem.qml
src/FlightMap/MapItems/VehicleMapItem.qml
+1
-1
QGCCompassWidget.qml
src/FlightMap/Widgets/QGCCompassWidget.qml
+8
-7
QGCInstrumentWidget.qml
src/FlightMap/Widgets/QGCInstrumentWidget.qml
+1
-1
QGCInstrumentWidgetAlternate.qml
src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml
+2
-1
Vehicle.cc
src/Vehicle/Vehicle.cc
+24
-0
Vehicle.h
src/Vehicle/Vehicle.h
+7
-0
No files found.
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
ddd6da04
...
...
@@ -302,3 +302,21 @@ QString FirmwarePlugin::takeControlFlightMode(void)
{
return
QString
();
}
QString
FirmwarePlugin
::
vehicleImageOpaque
(
const
Vehicle
*
vehicle
)
const
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"/qmlimages/vehicleArrowOpaque.svg"
);
}
QString
FirmwarePlugin
::
vehicleImageOutline
(
const
Vehicle
*
vehicle
)
const
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"/qmlimages/vehicleArrowOutline.svg"
);
}
QString
FirmwarePlugin
::
vehicleImageCompass
(
const
Vehicle
*
vehicle
)
const
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"/qmlimages/compassInstrumentArrow.svg"
);
}
src/FirmwarePlugin/FirmwarePlugin.h
View file @
ddd6da04
...
...
@@ -242,6 +242,15 @@ public:
/// Return the resource file which contains the brand image for the vehicle.
virtual
QString
brandImage
(
const
Vehicle
*
vehicle
)
const
{
Q_UNUSED
(
vehicle
)
return
QString
();
}
/// Return the resource file which contains the vehicle icon used in the flight view when the view is dark (Satellite for instance)
virtual
QString
vehicleImageOpaque
(
const
Vehicle
*
vehicle
)
const
;
/// Return the resource file which contains the vehicle icon used in the flight view when the view is light (Map for instance)
virtual
QString
vehicleImageOutline
(
const
Vehicle
*
vehicle
)
const
;
/// Return the resource file which contains the vehicle icon used in the compass
virtual
QString
vehicleImageCompass
(
const
Vehicle
*
vehicle
)
const
;
// FIXME: Hack workaround for non pluginize FollowMe support
static
const
char
*
px4FollowMeFlightMode
;
};
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
ddd6da04
...
...
@@ -81,7 +81,6 @@ Item {
anchors.verticalCenter
:
parent
.
verticalCenter
visible
:
!
_useAlternateInstruments
size
:
getGadgetWidth
()
active
:
_activeVehicle
!=
null
heading
:
_heading
rollAngle
:
_roll
pitchAngle
:
_pitch
...
...
@@ -100,7 +99,6 @@ Item {
anchors.right
:
altitudeSlider
.
visible
?
altitudeSlider
.
left
:
parent
.
right
visible
:
_useAlternateInstruments
width
:
ScreenTools
.
isTinyScreen
?
getGadgetWidth
()
*
1.5
:
getGadgetWidth
()
active
:
_activeVehicle
!=
null
heading
:
_heading
rollAngle
:
_roll
pitchAngle
:
_pitch
...
...
src/FlightDisplay/MultiVehicleList.qml
View file @
ddd6da04
...
...
@@ -52,8 +52,8 @@ QGCListView {
QGCCompassWidget
{
size
:
_widgetHeight
active
:
true
heading
:
_vehicle
.
heading
.
rawValue
vehicle
:
_vehicle
}
QGCAttitudeWidget
{
...
...
src/FlightMap/MapItems/VehicleMapItem.qml
View file @
ddd6da04
...
...
@@ -30,7 +30,7 @@ MapQuickItem {
sourceItem
:
Image
{
id
:
vehicleIcon
source
:
isSatellite
?
"
/qmlimages/vehicleArrowOpaque.svg
"
:
"
/qmlimages/vehicleArrowOutline.svg
"
source
:
isSatellite
?
vehicle
.
vehicleImageOpaque
:
vehicle
.
vehicleImageOutline
mipmap
:
true
width
:
size
sourceSize.width
:
size
...
...
src/FlightMap/Widgets/QGCCompassWidget.qml
View file @
ddd6da04
...
...
@@ -17,15 +17,16 @@
import
QtQuick
2.4
import
QtGraphicalEffects
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Vehicle
1.0
Item
{
id
:
root
property
bool
active
:
false
///< true: actively connected to data provider, false: show inactive control
property
real
heading
:
0
property
real
size
:
_defaultSize
property
real
heading
:
0
property
var
vehicle
:
null
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelHeight
*
(
10
)
property
real
_sizeRatio
:
ScreenTools
.
isTinyScreen
?
(
size
/
_defaultSize
)
*
0.5
:
size
/
_defaultSize
...
...
@@ -48,7 +49,7 @@ Item {
Image
{
id
:
pointer
source
:
"
/qmlimages/compassInstrumentArrow.svg
"
source
:
vehicle
?
vehicle
.
vehicleImageCompass
:
"
"
mipmap
:
true
width
:
size
*
0.75
sourceSize.width
:
width
...
...
@@ -78,8 +79,8 @@ Item {
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.65
)
QGCLabel
{
text
:
activ
e
?
heading
.
toFixed
(
0
)
:
qsTr
(
"
OFF
"
)
font.family
:
activ
e
?
ScreenTools
.
demiboldFontFamily
:
ScreenTools
.
normalFontFamily
text
:
vehicl
e
?
heading
.
toFixed
(
0
)
:
qsTr
(
"
OFF
"
)
font.family
:
vehicl
e
?
ScreenTools
.
demiboldFontFamily
:
ScreenTools
.
normalFontFamily
font.pointSize
:
_fontSize
<
8
?
8
:
_fontSize
;
color
:
"
white
"
anchors.centerIn
:
parent
...
...
src/FlightMap/Widgets/QGCInstrumentWidget.qml
View file @
ddd6da04
...
...
@@ -150,8 +150,8 @@ Item {
QGCCompassWidget
{
id
:
compass
size
:
parent
.
width
*
0.95
active
:
instrumentPanel
.
active
visible
:
_showCompass
vehicle
:
_activeVehicle
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
...
...
src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml
View file @
ddd6da04
...
...
@@ -10,6 +10,7 @@
import
QtQuick
2.4
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
FactSystem
1.0
...
...
@@ -68,7 +69,7 @@ Rectangle {
anchors.leftMargin
:
_spacing
anchors.left
:
attitude
.
right
size
:
_innerRadius
*
2
active
:
root
.
activ
e
vehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicl
e
anchors.verticalCenter
:
parent
.
verticalCenter
}
...
...
src/Vehicle/Vehicle.cc
View file @
ddd6da04
...
...
@@ -2203,6 +2203,30 @@ QString Vehicle::takeControlFlightMode(void) const
return
_firmwarePlugin
->
takeControlFlightMode
();
}
QString
Vehicle
::
vehicleImageOpaque
()
const
{
if
(
_firmwarePlugin
)
return
_firmwarePlugin
->
vehicleImageOpaque
(
this
);
else
return
QString
();
}
QString
Vehicle
::
vehicleImageOutline
()
const
{
if
(
_firmwarePlugin
)
return
_firmwarePlugin
->
vehicleImageOutline
(
this
);
else
return
QString
();
}
QString
Vehicle
::
vehicleImageCompass
()
const
{
if
(
_firmwarePlugin
)
return
_firmwarePlugin
->
vehicleImageCompass
(
this
);
else
return
QString
();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
...
src/Vehicle/Vehicle.h
View file @
ddd6da04
...
...
@@ -264,6 +264,9 @@ public:
Q_PROPERTY
(
QString
takeControlFlightMode
READ
takeControlFlightMode
CONSTANT
)
Q_PROPERTY
(
QString
firmwareTypeString
READ
firmwareTypeString
NOTIFY
firmwareTypeChanged
)
Q_PROPERTY
(
QString
vehicleTypeString
READ
vehicleTypeString
NOTIFY
vehicleTypeChanged
)
Q_PROPERTY
(
QString
vehicleImageOpaque
READ
vehicleImageOpaque
CONSTANT
)
Q_PROPERTY
(
QString
vehicleImageOutline
READ
vehicleImageOutline
CONSTANT
)
Q_PROPERTY
(
QString
vehicleImageCompass
READ
vehicleImageCompass
CONSTANT
)
/// true: Vehicle is flying, false: Vehicle is on ground
Q_PROPERTY
(
bool
flying
READ
flying
WRITE
setFlying
NOTIFY
flyingChanged
)
...
...
@@ -582,6 +585,10 @@ public:
/// and destroyed when the vehicle goes away.
void
setFirmwarePluginInstanceData
(
QObject
*
firmwarePluginInstanceData
);
QString
vehicleImageOpaque
()
const
;
QString
vehicleImageOutline
()
const
;
QString
vehicleImageCompass
()
const
;
public
slots
:
void
setLatitude
(
double
latitude
);
void
setLongitude
(
double
longitude
);
...
...
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